All of lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/4] drm/i915: stop using is_cpu_edp() in intel_disable/post_disable_dp
Date: Thu, 23 May 2013 17:53:00 +0300	[thread overview]
Message-ID: <1369320780.11230.19.camel@intelbox> (raw)
In-Reply-To: <1369132192.15652.30.camel@intelbox>

On Tue, 2013-05-21 at 13:29 +0300, Imre Deak wrote:
> 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 <imre.deak@intel.com>
> > > ---
> > >  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.

Ok, I dig around in git history and IVB,VLV bspec to understand this
better. Commit "drm/i915: disable the cpu edp port after the cpu pipe"
you add the above distinction in the disable sequence. From that and the
cited bspec modeset sequence, it seems we have to distinguish between
the CPU and PCH cases and whether it's eDP or DP doesn't seem to play a
role.

Since on VLV we don't have a PCH we should always follow there the
sequence we do on other platforms for the CPU case. Based on this I
agree with the simplification you give above and I will follow up with a
new version with that.

Contradictory to the above though, from the VLV display spec 37.2 Power
down sequence, it seems the sequence has to be always disable port,
disable planes, disable pipe. So that would mean port != A || IS_VLV
above. But I suggest handling this in a follow up patch.

--Imre

  reply	other threads:[~2013-05-23 14:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16 11:40 [PATCH 0/4] drm/i915: remove is_cpu_edp() Imre Deak
2013-05-16 11:40 ` [PATCH 1/4] drm/i915: stop using is_cpu_edp() in intel_disable/post_disable_dp Imre Deak
2013-05-21  9:15   ` Daniel Vetter
2013-05-21 10:29     ` Imre Deak
2013-05-23 14:53       ` Imre Deak [this message]
2013-05-23 16:39   ` [PATCH v2 " Imre Deak
2013-05-16 11:40 ` [PATCH 2/4] drm/i915: merge VLV eDP and DP AUX clock divider calculation Imre Deak
2013-05-21  9:12   ` Daniel Vetter
2013-05-21 10:36     ` Imre Deak
2013-05-21 10:42       ` Daniel Vetter
2013-05-21 10:59         ` Imre Deak
2013-05-23 14:56           ` Imre Deak
2013-05-16 11:40 ` [PATCH 3/4] drm/i915: replace is_cpu_edp() with a check for port A Imre Deak
2013-05-16 11:40 ` [PATCH 4/4] drm/i915: remove unused is_cpu_edp() Imre Deak
2013-05-27 17:16 ` [PATCH 0/4] drm/i915: remove is_cpu_edp() Rodrigo Vivi
2013-05-27 17:28   ` Daniel Vetter
2013-05-27 17:54     ` Rodrigo Vivi
2013-05-28  9:37       ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1369320780.11230.19.camel@intelbox \
    --to=imre.deak@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.