>From 8ad1bd63c097f9f6948439c1ce7c0b17b8caa64a Mon Sep 17 00:00:00 2001 From: Arjan van de Ven <[email protected]> Date: Mon, 16 Mar 2009 19:31:39 -0700 Subject: [PATCH] drm: Cache the EDID value for a short time in i915
during the boot process we have several places that want to make sure we have EDID information in a short time. An EDID probe for me takes 0.23 seconds, so doing multiple of them is not very nice. This patch caches the EDID result for upto 1 second to avoid repeated delays. Signed-off-by: Arjan van de Ven <[email protected]> --- drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_modes.c | 4 ++++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 957daef..72e6b9a 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -81,6 +81,7 @@ struct intel_output { int type; struct intel_i2c_chan *i2c_bus; /* for control functions */ struct intel_i2c_chan *ddc_bus; /* for DDC only stuff */ + unsigned long last_edid; bool load_detect_temp; bool needs_tv_clock; void *dev_priv; diff --git a/drivers/gpu/drm/i915/intel_modes.c b/drivers/gpu/drm/i915/intel_modes.c index e42019e..7c21b53 100644 --- a/drivers/gpu/drm/i915/intel_modes.c +++ b/drivers/gpu/drm/i915/intel_modes.c @@ -70,6 +70,9 @@ int intel_ddc_get_modes(struct intel_output *intel_output) struct edid *edid; int ret = 0; + if (intel_output->last_edid && time_after(intel_output->last_edid+HZ, jiffies)) + return 0; + edid = drm_get_edid(&intel_output->base, &intel_output->ddc_bus->adapter); if (edid) { @@ -77,6 +80,7 @@ int intel_ddc_get_modes(struct intel_output *intel_output) edid); ret = drm_add_edid_modes(&intel_output->base, edid); kfree(edid); + intel_output->last_edid = jiffies; } return ret; -- 1.6.0.6 -- Arjan van de Ven Intel Open Source Technology Centre For development, discussion and tips for power savings, visit http://www.lesswatts.org ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
