From patchwork Fri Jul 3 03:31:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kausal Malladi X-Patchwork-Id: 6712521 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 90BF0C05AC for ; Fri, 3 Jul 2015 03:31:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD70B206FE for ; Fri, 3 Jul 2015 03:31:26 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D7D78206E7 for ; Fri, 3 Jul 2015 03:31:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 02CF76E5D4; Thu, 2 Jul 2015 20:31:25 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id F17B26E5D4; Thu, 2 Jul 2015 20:31:23 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 02 Jul 2015 20:31:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,397,1432623600"; d="scan'208";a="518171296" Received: from kmalladi-desktop.iind.intel.com ([10.223.25.13]) by FMSMGA003.fm.intel.com with ESMTP; 02 Jul 2015 20:31:18 -0700 From: Kausal Malladi To: matthew.d.roper@intel.com, jesse.barnes@intel.com, damien.lespiau@intel.com, sonika.jindal@intel.com, durgadoss.r@intel.com, vijay.a.purushothaman@intel.com, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, hverkuil@xs4all.nl, daniel@fooishbar.org Subject: [PATCH 01/12] drm/i915: Atomic commit path fix for CRTC properties Date: Fri, 3 Jul 2015 09:01:36 +0530 Message-Id: <1435894307-5722-2-git-send-email-Kausal.Malladi@intel.com> X-Mailer: git-send-email 2.4.5 In-Reply-To: <1435894307-5722-1-git-send-email-Kausal.Malladi@intel.com> References: <1435894307-5722-1-git-send-email-Kausal.Malladi@intel.com> Cc: annie.j.matheson@intel.com, jyoti.r.yadav@intel.com, avinash.reddy.palleti@intel.com, indranil.mukherjee@intel.com, dhanya.p.r@intel.com, sunil.kamath@intel.com, daniel.vetter@intel.com, shashank.sharma@intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Matt Roper The intel_atomic_check() function had some simple testing to make sure that an atomic update isn't updating more than one CRTC at a time. The logic assumed that a plane was always being updated, so it figured out the "nuclear pipe" from the first plane it encountered and just made sure that all CRTC's matched that nuclear pipe. But when someone is adding CRTC properties, it's valid to update just a CRTC property and not have any plane updates in the transaction, which means the initial 'nuclear_pipe' value was never set. This patch adds a fix for it and makes sure CRTC properties also get through atomic commit path. Signed-off-by: Matt Roper Signed-off-by: Kausal Malladi --- drivers/gpu/drm/i915/intel_atomic.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c index 0aeced8..126e092 100644 --- a/drivers/gpu/drm/i915/intel_atomic.c +++ b/drivers/gpu/drm/i915/intel_atomic.c @@ -80,6 +80,15 @@ int intel_atomic_check(struct drm_device *dev, state->allow_modeset = false; for (i = 0; i < ncrtcs; i++) { struct intel_crtc *crtc = to_intel_crtc(state->crtcs[i]); + + /* + * If we're only updating CRTC properties, we may not have + * established a 'nuclear pipe' yet. In that case, the first + * CRTC we encounter here should be taken as the 'nuclear + * pipe.' + */ + if (nuclear_pipe == INVALID_PIPE && crtc) + nuclear_pipe = crtc->pipe; if (crtc) memset(&crtc->atomic, 0, sizeof(crtc->atomic)); if (crtc && crtc->pipe != nuclear_pipe)