All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915: Reuse normal state readout for LVDS/DVO fixed mode
Date: Tue, 10 Oct 2017 17:55:42 +0300	[thread overview]
Message-ID: <20171010145542.GQ10981@intel.com> (raw)
In-Reply-To: <150764601326.797.165660555365983150@mail.alporthouse.com>

On Tue, Oct 10, 2017 at 03:33:33PM +0100, Chris Wilson wrote:
> Quoting Ville Syrjala (2017-10-09 17:19:50)
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Reuse the normal state readout code to get the fixed mode for LVDS/DVO
> > encoders. This removes some partially duplicated state readout code
> > from LVDS/DVO encoders. The duplicated code wasn't actually even
> > populating the negative h/vsync flags, leading to possible state checker
> > complaints. The normal readout code populates that stuff fully.
> > 
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 50 +++++++++++++++++-------------------
> >  drivers/gpu/drm/i915/intel_drv.h     |  5 ++--
> >  drivers/gpu/drm/i915/intel_dvo.c     | 33 ++++++------------------
> >  drivers/gpu/drm/i915/intel_lvds.c    | 18 ++++---------
> >  4 files changed, 39 insertions(+), 67 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 15844bf92434..f8693374955c 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -10247,48 +10247,44 @@ static void ironlake_pch_clock_get(struct intel_crtc *crtc,
> >                                          &pipe_config->fdi_m_n);
> >  }
> >  
> > -/** Returns the currently programmed mode of the given pipe. */
> > -struct drm_display_mode *intel_crtc_mode_get(struct drm_device *dev,
> > -                                            struct drm_crtc *crtc)
> > +/* Returns the currently programmed mode of the given encoder. */
> > +struct drm_display_mode *
> > +intel_encoder_current_mode(struct intel_encoder *encoder)
> >  {
> > -       struct drm_i915_private *dev_priv = to_i915(dev);
> > -       struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> > +       struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> > +       struct intel_crtc_state *crtc_state;
> >         struct drm_display_mode *mode;
> > -       struct intel_crtc_state *pipe_config;
> > -       enum pipe pipe = intel_crtc->pipe;
> > +       struct intel_crtc *crtc;
> > +       enum pipe pipe;
> > +
> > +       if (!encoder->get_hw_state(encoder, &pipe))
> > +               return NULL;
> 
> There's no chance that get_hw_state can return a pipe beyond our
> knowledge?

It shouldn't, unless the hardware registers are plain lying to us.
It just checks the port register whether the port is enabled, and
which pipe is connected to it.

> I'm presuming we are part of the early hw setup here, so may
> not have sanitized everything?

I think we should have done enough setup by this time. And we do the
normal state readout very shortly afterwards, so things had better be
ready by then.

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-10-10 14:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09 16:19 [PATCH 1/2] drm/i915: Reuse normal state readout for LVDS/DVO fixed mode Ville Syrjala
2017-10-09 16:19 ` [PATCH 2/2] drm/i915: Allow PCH platforms fall back to BIOS LVDS mode Ville Syrjala
2017-10-11 18:06   ` Chris Wilson
2017-10-11 18:47     ` Ville Syrjälä
2017-10-09 17:00 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Reuse normal state readout for LVDS/DVO fixed mode Patchwork
2017-10-09 21:39 ` ✓ Fi.CI.IGT: " Patchwork
2017-10-10 14:33 ` [PATCH 1/2] " Chris Wilson
2017-10-10 14:55   ` Ville Syrjälä [this message]
2017-10-11 16:21   ` Chris Wilson
2017-10-11 17:18     ` Ville Syrjälä

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=20171010145542.GQ10981@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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.