[Intel-gfx] [PATCH] drm/i915: Reuse probed LVDS modes

Li Peng peng.li at linux.intel.com
Fri May 22 08:57:14 CEST 2009


On Thu, 2009-05-21 at 13:18 +0800, yakui_zhao wrote:
> On Tue, 2009-05-19 at 14:54 +0800, Li Peng wrote:
> > >From 8f45e42005abeb26e877fbeecaeb517e94027155 Mon Sep 17 00:00:00 2001
> > From: Li Peng <peng.li at intel.com>
> > Date: Tue, 19 May 2009 08:07:15 +0800
> > Subject: Reuse probed LVDS modes
> > 
> > This is an optimization that reuse probed LVDS modes
> > in fill_modes(), since LVDS modes have been setup at
> > drm_helper_initial_config(). This could help to reduce
> > driver boot time.
> 
> The fill_modes callback won't be called in the boot phase.
> It is called when the out_resp->counts_mode is zero. And it will
> re-enumerate the modelines for the given connector.
> 
> In such case it can't be optimized.
> 
Thanks for your review, Yakui. 
You are right that .fill_modes is called only if out_resp->counts_mode
is zero.
In the libdrm, drmModeGetConnector will call ioctl
DRM_IOCTL_MODE_GETCONNECTOR twice,
In the first ioctl count_modes is always zero, which means .fill_modes
will be called. right ?

Arjan post a patch before to cache LVDS EDID for saving mode probe time.
this patch is for the same purpose.

Peng
> Thanks.
> > 
> > Signed-off-by: Li Peng <peng.li at intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_lvds.c |   13 ++++++++++++-
> >  1 files changed, 12 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
> > index 439a865..991cea2 100644
> > --- a/drivers/gpu/drm/i915/intel_lvds.c
> > +++ b/drivers/gpu/drm/i915/intel_lvds.c
> > @@ -351,6 +351,17 @@ static int intel_lvds_set_property(struct drm_connector *connector,
> >  	return 0;
> >  }
> >  
> > +static int intel_lvds_fill_modes(struct drm_connector *connector, uint32_t maxX, uint32_t maxY)
> > +{
> > +	struct list_head *node, *next;
> > +	int ret = 0;
> > +
> > +	list_for_each_safe(node, next, &connector->modes) 
> > +		ret++;
> > +
> > +	return ret;
> > +}
> > +
> >  static const struct drm_encoder_helper_funcs intel_lvds_helper_funcs = {
> >  	.dpms = intel_lvds_dpms,
> >  	.mode_fixup = intel_lvds_mode_fixup,
> > @@ -369,7 +380,7 @@ static const struct drm_connector_funcs intel_lvds_connector_funcs = {
> >  	.save = intel_lvds_save,
> >  	.restore = intel_lvds_restore,
> >  	.detect = intel_lvds_detect,
> > -	.fill_modes = drm_helper_probe_single_connector_modes,
> > +	.fill_modes = intel_lvds_fill_modes,
> >  	.set_property = intel_lvds_set_property,
> >  	.destroy = intel_lvds_destroy,
> >  };
> 




More information about the Intel-gfx mailing list