public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/i915: get basic encoder state before reading CRTC state
Date: Mon, 20 Jan 2014 08:21:49 -0800	[thread overview]
Message-ID: <20140120082149.4a48d05a@jbarnes-desktop> (raw)
In-Reply-To: <20140118140106.GT9454@intel.com>

On Sat, 18 Jan 2014 16:01:06 +0200
Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:

> On Fri, Jan 17, 2014 at 01:16:56PM -0800, Jesse Barnes wrote:
> > In DDI configs, we need to get the encoder to CRTC mapping early on so
> > we can read out and calculate the clock state correctly, as it depends
> > on the port.
> > 
> > Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 59 +++++++++++++++++++++++++++---------
> >  1 file changed, 44 insertions(+), 15 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 74137d5..92f46ad 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -9476,6 +9476,22 @@ check_crtc_state(struct drm_device *dev)
> >  		     "crtc's computed enabled state doesn't match tracked enabled state "
> >  		     "(expected %i, found %i)\n", enabled, crtc->base.enabled);
> >  
> > +
> > +		list_for_each_entry(encoder, &dev->mode_config.encoder_list,
> > +				    base.head) {
> > +			/* Get encoder->crtc mapping */
> > +			struct intel_crtc *tmp_crtc;
> > +			enum pipe pipe;
> > +			if (encoder->get_hw_state(encoder, &pipe)) {
> > +				tmp_crtc = to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]);
> > +				if (tmp_crtc == crtc) {
> > +					encoder->base.crtc = &tmp_crtc->base;
> > +					encoder->get_config(encoder,
> > +							    &pipe_config);
> > +				}
> > +			}
> > +		}
> > +
> >  		active = dev_priv->display.get_pipe_config(crtc,
> >  							   &pipe_config);
> >  
> 
> NAK. This will break clock readout for every other platform. For most 
> things we read out the .port_clock from the DPLL in .get_pipe_config()
> (eDP port A being the excption where intel_dp_get_config() also fills
> out .port_clock), and then the encoder .get_config() massages .port_clock
> appropriately to figure out what .crtc_clock was supposed to be.
> 
> Maybe I'm missing something, but can't you just follow the eDP port A
> route and simply stick your intel_ddi_clock_get() into
> intel_ddi_get_config(), so that intel_ddi_get_config() is always
> responsible for filling out both .port_clock and .crtc_clock?
> 

Yeah I knew this would cause trouble.  I might be able to get the clock
later, but I just need to make sure the CRTC to encoder mapping is set
up when I need it.

-- 
Jesse Barnes, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2014-01-20 16:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-17 21:16 [PATCH 1/3] drm/i915: get basic encoder state before reading CRTC state Jesse Barnes
2014-01-17 21:16 ` [PATCH 2/3] drm/i915: clock readout support for DDI Jesse Barnes
2014-01-17 21:16 ` [PATCH 3/3] drm/i915: always check clocks when comparing pipe configs Jesse Barnes
2014-01-18 14:01 ` [PATCH 1/3] drm/i915: get basic encoder state before reading CRTC state Ville Syrjälä
2014-01-20 16:21   ` Jesse Barnes [this message]

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=20140120082149.4a48d05a@jbarnes-desktop \
    --to=jbarnes@virtuousgeek.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox