From mboxrd@z Thu Jan 1 00:00:00 1970 From: Imre Deak Subject: Re: [PATCH 1/4] drm/i915: stop using is_cpu_edp() in intel_disable/post_disable_dp Date: Tue, 21 May 2013 13:29:52 +0300 Message-ID: <1369132192.15652.30.camel@intelbox> References: <1368704437-17034-1-git-send-email-imre.deak@intel.com> <1368704437-17034-2-git-send-email-imre.deak@intel.com> <20130521091517.GH12292@phenom.ffwll.local> Reply-To: imre.deak@intel.com Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id ECA4EE5C54 for ; Tue, 21 May 2013 03:29:54 -0700 (PDT) In-Reply-To: <20130521091517.GH12292@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Daniel Vetter Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, 2013-05-21 at 11:15 +0200, Daniel Vetter wrote: > On Thu, May 16, 2013 at 02:40:34PM +0300, Imre Deak wrote: > > On port A and for Valleyview on port C we can have only eDP and in both > > cases it's a CPU port. So we can replace is_cpu_edp() with a port check > > for these two cases. This allows us to remove is_cpu_edp() completely in > > a later patch. > > > > Signed-off-by: Imre Deak > > --- > > drivers/gpu/drm/i915/intel_dp.c | 7 +++++-- > > 1 file changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c > > index 4dae01a..90ae58a 100644 > > --- a/drivers/gpu/drm/i915/intel_dp.c > > +++ b/drivers/gpu/drm/i915/intel_dp.c > > @@ -1350,6 +1350,8 @@ static bool intel_dp_get_hw_state(struct intel_encoder *encoder, > > static void intel_disable_dp(struct intel_encoder *encoder) > > { > > struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base); > > + enum port port = dp_to_dig_port(intel_dp)->port; > > + struct drm_device *dev = encoder->base.dev; > > > > /* Make sure the panel is off before trying to change the mode. But also > > * ensure that we have vdd while we switch off the panel. */ > > @@ -1359,16 +1361,17 @@ static void intel_disable_dp(struct intel_encoder *encoder) > > ironlake_edp_panel_off(intel_dp); > > > > /* cpu edp my only be disable _after_ the cpu pipe/plane is disabled. */ > > - if (!is_cpu_edp(intel_dp)) > > + if (port != PORT_A && (port != PORT_C || !IS_VALLEYVIEW(dev))) > > I think this would read easier as port !(port == A || IS_VLV). I think > that should also be more correct since there's no reason (besides > hard-coding) that DP on port B (or external DP fwiw) should work different > on vlv. I don't have the VLV spec to verify this, so this is just keeping the current behavior. I'll try to get the spec and follow up on this. --Imre > -Daniel > > > intel_dp_link_down(intel_dp); > > } > > > > static void intel_post_disable_dp(struct intel_encoder *encoder) > > { > > struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base); > > + enum port port = dp_to_dig_port(intel_dp)->port; > > struct drm_device *dev = encoder->base.dev; > > > > - if (is_cpu_edp(intel_dp)) { > > + if (port == PORT_A || (port == PORT_C && IS_VALLEYVIEW(dev))) { > > intel_dp_link_down(intel_dp); > > if (!IS_VALLEYVIEW(dev)) > > ironlake_edp_pll_off(intel_dp); > > -- > > 1.7.10.4 > > > > _______________________________________________ > > Intel-gfx mailing list > > Intel-gfx@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/intel-gfx >