[Intel-gfx] [PATCH] drm: Disable all the possibles output/crtcs before entering KMS mode

ykzhao yakui.zhao at intel.com
Sat Dec 5 13:42:01 CET 2009


On Sat, 2009-12-05 at 04:40 +0800, Dave Airlie wrote:
> On Fri, 2009-12-04 at 20:05 +0800, yakui.zhao at intel.com wrote:
> > From: Zhao Yakui <yakui.zhao at intel.com>
> > 
> > Disable all the possible outputs/crtcs before entering KMS mode.
> 
> We need a bit more info than this for such a large change?

The BIOS will select a crtc for LVDS, which is different . different
with what we have done in modesetting. Sometimes we will
assign the pipe configured for LVDS by BIOS to other output device.
In such case it seems that it is not safe to configure the
crtc/output.  

In fact I check the xserver source code and find that we will try to
disable all the possible outputs/crtcs when we set the desired mode for
every crtc at the first time. In such case we can make sure the all the
outputs/crtcs are put into the known state.

> At one point we wanted to do smooth startup for LVDS panels,
> so that we read back the mode and avoided reconfiguring them
> this sort of change would totally go against it.

We will use the different framebuffer for LVDS in KMS mode and BIOS. Can
we avoid the modesetting for LVDS in the boot phase?


Thanks.
	Yakui

> 
> Also I thought Arjan wanted to avoid slowdowns on startup,
> which I would expect this to add to.
> 
> Dave.
> 
> > 
> > Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
> > ---
> >  drivers/gpu/drm/drm_crtc_helper.c |   32 ++++++++++++++++++++++++++++++++
> >  include/drm/drm_crtc_helper.h     |    2 ++
> >  2 files changed, 34 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
> > index 3963b3c..b49028f 100644
> > --- a/drivers/gpu/drm/drm_crtc_helper.c
> > +++ b/drivers/gpu/drm/drm_crtc_helper.c
> > @@ -1020,6 +1020,9 @@ bool drm_helper_initial_config(struct drm_device *dev)
> >  {
> >  	int count = 0;
> >  
> > +	/* Disable all the possible outputs/crtc before entering KMS mode */
> > +	drm_helper_disable_connector_crtc(dev);
> > +
> >  	drm_fb_helper_parse_command_line(dev);
> >  
> >  	count = drm_helper_probe_connector_modes(dev,
> > @@ -1067,6 +1070,35 @@ static int drm_helper_choose_crtc_dpms(struct drm_crtc *crtc)
> >  }
> >  
> >  /**
> > + * drm_helper_disable_connector_crtc
> > + * @dev: drm_device
> > + *
> > + * Disable all the possible outputs & Crtcs
> > + */
> > +void drm_helper_disable_connector_crtc(struct drm_device *dev)
> > +{
> > +	struct drm_encoder *encoder;
> > +	struct drm_crtc *crtc;
> > +
> > +	list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
> > +		struct drm_encoder_helper_funcs *encoder_funcs =
> > +						encoder->helper_private;
> > +		if (encoder_funcs && encoder_funcs->dpms)
> > +			(*encoder_funcs->dpms)(encoder, DRM_MODE_DPMS_OFF);
> > +	}
> > +
> > +	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
> > +		struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
> > +		if (crtc_funcs && crtc_funcs->dpms)
> > +			(*crtc_funcs->dpms)(crtc, DRM_MODE_DPMS_OFF);
> > +	}
> > +
> > +	return;
> > +}
> > +
> > +EXPORT_SYMBOL(drm_helper_disable_connector_crtc);
> > +
> > +/**
> >   * drm_helper_connector_dpms
> >   * @connector affected connector
> >   * @mode DPMS mode
> > diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
> > index b29e201..007bbba 100644
> > --- a/include/drm/drm_crtc_helper.h
> > +++ b/include/drm/drm_crtc_helper.h
> > @@ -131,4 +131,6 @@ static inline int drm_connector_helper_add(struct drm_connector *connector,
> >  }
> >  
> >  extern int drm_helper_resume_force_mode(struct drm_device *dev);
> > +/* disable all the possible outputs & crtcs for one drm_device */
> > +extern void drm_helper_disable_connector_crtc(struct drm_device *dev);
> >  #endif
> 
> 




More information about the Intel-gfx mailing list