[Intel-gfx] [PATCH] drm/i915: Don't initialize pipe config after choosing DPLLs.

Bob Paauwe bob.j.paauwe at intel.com
Mon Nov 10 23:50:28 CET 2014


On Mon, 10 Nov 2014 12:40:47 +0200
Ville Syrjälä <ville.syrjala at linux.intel.com> wrote:

> On Fri, Nov 07, 2014 at 04:07:50PM -0800, Bob Paauwe wrote:
> > The pipe config needs to be initialized before calling crtc_compute_clock
> > since this will update the new_config structure DPLL values. Initializing
> > the new_config structure after calling crtc_compute_clock can result in
> > incorrect timing values.
> > 
> > This regression was introduced in
> > 
> > commit 0dbdf89f27b17ae1eceed6782c2917f74cbb5d59
> > Author: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>
> > Date:   Wed Oct 29 11:32:33 2014 +0200
> > 
> >     drm/i915: Add infrastructure for choosing DPLLs before disabling crtcs
> > 
> > 	and
> > 
> > 	commit 00d958817dd3daaa452c221387ddaf23d1e4c06f
> > 	Author: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>
> > 	Date:   Wed Oct 29 11:32:36 2014 +0200
> > 
> > 	    drm/i915: Covert remaining platforms to choose DPLLS before disabling CRTCs
> > 
> > Signed-off-by: Bob Paauwe <bob.j.paauwe at intel.com>
> > CC: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index ff071a7..53f3d3a 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -10774,7 +10774,11 @@ static int __intel_set_mode(struct drm_crtc *crtc,
> >  		}
> >  		intel_dump_pipe_config(to_intel_crtc(crtc), pipe_config,
> >  				       "[modeset]");
> > -		to_intel_crtc(crtc)->new_config = pipe_config;
> 
> new_config _is_ initialized here.
> 
> > +
> > +		/* 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;
> 
> And this will clobber the old config before we even know if the modeset
> will succeed. That's not what we want.

Ahh, I was looking at this wrong before. For some reason I was thinking
that when this was done below, it was overwriting something that was
set in new_config/pipe_config.
> 
> You didn't really describe the problem you're seeing, so coming up with
> theories is a bit hard. I guess one problem could be that some piece of
> code is still looking at crtc->config when it should be looking at
> crtc->new_config. In any case, I suggest you tell us a bit more before
> anyone spends too much time guessing.

With the series that changes this to choose DPLLs before disabling
CRTCs, my 945 system fails to set the initial mode (no display) and I
get this error:


Nov 11 03:47:07 localhost kernel: [    2.086190] [drm:intel_pipe_config_compare [i915]] *ERROR* mismatch in adjusted_mode.crtc_clock (expected 148500, found 57600)
Nov 11 03:47:07 localhost kernel: [    2.086191] ------------[ cut here ]------------
Nov 11 03:47:07 localhost kernel: [    2.086238] WARNING: CPU: 1 PID: 56 at /home/bpaauwe/git/otc/drm-intel/drivers/gpu/drm/i915/intel_display.c:10650 check_crtc_state+0x244/0x2ac [i915]()
Nov 11 03:47:07 localhost kernel: [    2.086239] pipe state doesn't match!

I bisected it back to the commit referenced above.

I had been thinking that something was not getting set property, but your
insight that maybe something was using the old values is right.  I found 
where it's doing that.  I'll send out a new patch shortly.

> 
> >  	}
> >  
> >  	/*
> > @@ -10820,10 +10824,6 @@ static int __intel_set_mode(struct drm_crtc *crtc,
> >  	 */
> >  	if (modeset_pipes) {
> >  		crtc->mode = *mode;
> > -		/* 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
> > -- 
> > 1.8.3.1
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 




More information about the Intel-gfx mailing list