[Intel-gfx] [PATCH 06/13] drm/i915: Retrieve the current mode upon KMS takeover

Daniel Vetter daniel at ffwll.ch
Wed Mar 27 00:52:47 CET 2013


On Tue, Mar 26, 2013 at 04:24:48PM -0700, Jesse Barnes wrote:
> On Wed, 20 Mar 2013 14:36:25 +0200
> Imre Deak <imre.deak at intel.com> wrote:
> 
> > > +		pipe = -1;
> > >  
> > >  		if (encoder->get_hw_state(encoder, &pipe)) {
> > > -			encoder->base.crtc =
> > > -				dev_priv->pipe_to_crtc_mapping[pipe];
> > > -		} else {
> > > +			crtc = to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]);  
> > 
> > get_hw_state() can return true and still leave pipe at -1, causing an
> > invalid access here.
> 
> Fixed, thanks.

That shouldn't actually be possible - if encoder->get_hw_state returns
true but doesn't set the pipe, that's a bug in the callback. So maybe yell
with a WARN?
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list