From patchwork Tue Jun 16 11:31:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kahola X-Patchwork-Id: 6617441 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0C0A69F1C1 for ; Tue, 16 Jun 2015 11:30:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 36FD42078E for ; Tue, 16 Jun 2015 11:30:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id AA719207A1 for ; Tue, 16 Jun 2015 11:30:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 234516E93E; Tue, 16 Jun 2015 04:30:22 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id C28F96E156 for ; Tue, 16 Jun 2015 04:30:20 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 16 Jun 2015 04:30:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,626,1427785200"; d="scan'208";a="728342692" Received: from sorvi.fi.intel.com ([10.237.72.63]) by fmsmga001.fm.intel.com with ESMTP; 16 Jun 2015 04:30:19 -0700 From: Mika Kahola To: intel-gfx@lists.freedesktop.org Date: Tue, 16 Jun 2015 14:31:33 +0300 Message-Id: <1434454295-7647-2-git-send-email-mika.kahola@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434454295-7647-1-git-send-email-mika.kahola@intel.com> References: <1434454295-7647-1-git-send-email-mika.kahola@intel.com> Subject: [Intel-gfx] [PATCH 1/3] drm/i915: Broadwell modeset global pipes to atomic X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 Convert 'broadwell_modeset_global_pipes()' into atomic mode setting. Signed-off-by: Mika Kahola --- drivers/gpu/drm/i915/intel_display.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 3f48917..953eda7 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -9683,6 +9683,10 @@ static int broadwell_modeset_global_pipes(struct drm_atomic_state *state) struct drm_crtc_state *crtc_state; int max_pixclk = ilk_max_pixel_rate(dev_priv); int cdclk, i; + int ret = 0; + + if (max_pixclk < 0) + return max_pixclk; cdclk = broadwell_calc_cdclk(dev_priv, max_pixclk); @@ -9697,14 +9701,22 @@ static int broadwell_modeset_global_pipes(struct drm_atomic_state *state) crtc_state = drm_atomic_get_crtc_state(state, crtc); if (IS_ERR(crtc_state)) return PTR_ERR(crtc_state); - } - /* disable/enable all currently active pipes while we change cdclk */ - for_each_crtc_in_state(state, crtc, crtc_state, i) - if (crtc_state->enable) - crtc_state->mode_changed = true; + if (!crtc_state->active || needs_modeset(crtc_state)) + continue; - return 0; + crtc_state->mode_changed = true; + + ret = drm_atomic_add_affected_connectors(state, crtc); + if (ret) + break; + + ret = drm_atomic_add_affected_planes(state, crtc); + if (ret) + break; + } + + return ret; } static void broadwell_modeset_global_resources(struct drm_atomic_state *state)