From patchwork Thu Dec 11 12:38:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ander Conselvan de Oliveira X-Patchwork-Id: 5475761 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 626D8BEEA8 for ; Thu, 11 Dec 2014 12:38:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 654CC20121 for ; Thu, 11 Dec 2014 12:38:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 57029201B4 for ; Thu, 11 Dec 2014 12:38:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D9F566E7DA; Thu, 11 Dec 2014 04:38:25 -0800 (PST) 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 703EF6E7DA for ; Thu, 11 Dec 2014 04:38:24 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 11 Dec 2014 04:38:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,557,1413270000"; d="scan'208";a="646023657" Received: from linux.jf.intel.com (HELO linux.intel.com) ([10.23.219.25]) by fmsmga002.fm.intel.com with ESMTP; 11 Dec 2014 04:38:23 -0800 Received: from localhost (ander-mobl1.fi.intel.com [10.237.72.54]) by linux.intel.com (Postfix) with ESMTP id D991E6A408D; Thu, 11 Dec 2014 04:37:23 -0800 (PST) From: Ander Conselvan de Oliveira To: intel-gfx@lists.freedesktop.org Date: Thu, 11 Dec 2014 14:38:09 +0200 Message-Id: <1418301491-23020-7-git-send-email-ander.conselvan.de.oliveira@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1418301491-23020-1-git-send-email-ander.conselvan.de.oliveira@intel.com> References: <1418301491-23020-1-git-send-email-ander.conselvan.de.oliveira@intel.com> Cc: Ander Conselvan de Oliveira , shuang.he@linux.intel.com Subject: [Intel-gfx] [PATCH 6/8] drm/i915: Remove intel_crtc->new_config pointer 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 There are no more users of that pointer since the new config is now passed down the call chain during mode set. Also, when the switch to atomic happens, the right config (state) should be derived from an atomic state structure. Signed-off-by: Ander Conselvan de Oliveira --- drivers/gpu/drm/i915/intel_display.c | 46 ++++++++---------------------------- drivers/gpu/drm/i915/intel_drv.h | 1 - 2 files changed, 10 insertions(+), 37 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index a9f3034..a032a1d 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -8583,7 +8583,6 @@ retry: intel_crtc = to_intel_crtc(crtc); intel_crtc->new_enabled = true; - intel_crtc->new_config = &intel_crtc->config; old->dpms_mode = connector->dpms; old->load_detect_temp = true; old->release_fb = NULL; @@ -8623,10 +8622,6 @@ retry: fail: intel_crtc->new_enabled = crtc->enabled; - if (intel_crtc->new_enabled) - intel_crtc->new_config = &intel_crtc->config; - else - intel_crtc->new_config = NULL; fail_unlock: if (ret == -EDEADLK) { drm_modeset_backoff(ctx); @@ -8653,7 +8648,6 @@ void intel_release_load_detect_pipe(struct drm_connector *connector, to_intel_connector(connector)->new_encoder = NULL; intel_encoder->new_crtc = NULL; intel_crtc->new_enabled = false; - intel_crtc->new_config = NULL; intel_set_mode(crtc, NULL, 0, 0, NULL); if (old->release_fb) { @@ -9839,14 +9833,8 @@ static void intel_modeset_update_staged_output_state(struct drm_device *dev) to_intel_crtc(encoder->base.crtc); } - for_each_intel_crtc(dev, crtc) { + for_each_intel_crtc(dev, crtc) crtc->new_enabled = crtc->base.enabled; - - if (crtc->new_enabled) - crtc->new_config = &crtc->config; - else - crtc->new_config = NULL; - } } /** @@ -10355,12 +10343,8 @@ intel_modeset_update_state(struct drm_device *dev, unsigned prepare_pipes) intel_modeset_commit_output_state(dev); /* Double check state. */ - for_each_intel_crtc(dev, intel_crtc) { + for_each_intel_crtc(dev, intel_crtc) WARN_ON(intel_crtc->base.enabled != intel_crtc_in_use(&intel_crtc->base)); - WARN_ON(intel_crtc->new_config && - intel_crtc->new_config != &intel_crtc->config); - WARN_ON(intel_crtc->base.enabled != !!intel_crtc->new_config); - } list_for_each_entry(connector, &dev->mode_config.connector_list, head) { if (!connector->encoder || !connector->encoder->crtc) @@ -10957,9 +10941,6 @@ static int __intel_set_mode(struct drm_crtc *crtc, *saved_mode = crtc->mode; - if (modeset_pipes) - to_intel_crtc(crtc)->new_config = pipe_config; - /* * See if the config requires any additional preparation, e.g. * to adjust global state with pipes off. We need to do this @@ -10984,7 +10965,13 @@ static int __intel_set_mode(struct drm_crtc *crtc, goto done; for_each_intel_crtc_masked(dev, modeset_pipes, intel_crtc) { - struct intel_crtc_state *state = intel_crtc->new_config; + struct intel_crtc_state *state; + + if (&intel_crtc->base == crtc) + state = pipe_config; + else + state = intel_crtc->config; + ret = dev_priv->display.crtc_compute_clock(intel_crtc, state); if (ret) { @@ -11014,7 +11001,6 @@ static int __intel_set_mode(struct drm_crtc *crtc, /* mode_set/enable/disable functions rely on a correct pipe * config. */ to_intel_crtc(crtc)->config = *pipe_config; - to_intel_crtc(crtc)->new_config = &to_intel_crtc(crtc)->config; /* * Calculate and store various constants which @@ -11177,15 +11163,9 @@ static void intel_set_config_restore_state(struct drm_device *dev, int count; count = 0; - for_each_intel_crtc(dev, crtc) { + for_each_intel_crtc(dev, crtc) crtc->new_enabled = config->save_crtc_enabled[count++]; - if (crtc->new_enabled) - crtc->new_config = &crtc->config; - else - crtc->new_config = NULL; - } - count = 0; for_each_intel_encoder(dev, encoder) { encoder->new_crtc = @@ -11391,11 +11371,6 @@ intel_modeset_stage_output_state(struct drm_device *dev, crtc->new_enabled ? "en" : "dis"); config->mode_changed = true; } - - if (crtc->new_enabled) - crtc->new_config = &crtc->config; - else - crtc->new_config = NULL; } return 0; @@ -11422,7 +11397,6 @@ static void disable_crtc_nofb(struct intel_crtc *crtc) } crtc->new_enabled = false; - crtc->new_config = NULL; } static int intel_crtc_set_config(struct drm_mode_set *set) diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 0a84667..175b853 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -440,7 +440,6 @@ struct intel_crtc { struct intel_plane_config plane_config; struct intel_crtc_state config; - struct intel_crtc_state *new_config; bool new_enabled; /* reset counter value when the last flip was submitted */