From c0434d237f30ba1ca17fcb46d257b0be9033535d Mon Sep 17 00:00:00 2001 From: Arjan van de Van Date: Fri, 29 Jan 2010 18:49:57 +0000 Subject: [PATCH] drm/i915: Cache EDID probes Signed-off-by: Arjan van de Van Tested-by: Chris Wilson --- drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_lvds.c | 2 ++ drivers/gpu/drm/i915/intel_modes.c | 9 ++++++++- 3 files changed, 11 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 3a467ca..d05586b 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -102,6 +102,7 @@ struct intel_output { int type; struct i2c_adapter *i2c_bus; struct i2c_adapter *ddc_bus; + struct edid *edid; bool load_detect_temp; bool needs_tv_clock; void *dev_priv; diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 68b0185..ac35659 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c @@ -744,6 +744,7 @@ static void intel_lvds_destroy(struct drm_connector *connector) acpi_lid_notifier_unregister(&dev_priv->lid_notifier); drm_sysfs_connector_remove(connector); drm_connector_cleanup(connector); + kfree(intel_output->edid); kfree(connector); } @@ -1157,5 +1158,6 @@ failed: intel_i2c_destroy(intel_output->ddc_bus); drm_connector_cleanup(connector); drm_encoder_cleanup(encoder); + kfree(intel_output->edid); kfree(intel_output); } diff --git a/drivers/gpu/drm/i915/intel_modes.c b/drivers/gpu/drm/i915/intel_modes.c index 67e2f46..0ef5559 100644 --- a/drivers/gpu/drm/i915/intel_modes.c +++ b/drivers/gpu/drm/i915/intel_modes.c @@ -74,6 +74,10 @@ int intel_ddc_get_modes(struct intel_output *intel_output) int ret = 0; intel_i2c_quirk_set(intel_output->base.dev, true); + if (intel_output->edid && intel_output->type == INTEL_OUTPUT_LVDS) { + DRM_DEBUG_DRIVER("Skipping EDID probe due to cached edid\n"); + return ret; + } edid = drm_get_edid(&intel_output->base, intel_output->ddc_bus); intel_i2c_quirk_set(intel_output->base.dev, false); if (edid) { @@ -81,7 +85,10 @@ int intel_ddc_get_modes(struct intel_output *intel_output) edid); ret = drm_add_edid_modes(&intel_output->base, edid); intel_output->base.display_info.raw_edid = NULL; - kfree(edid); + if (intel_output->type == INTEL_OUTPUT_LVDS) + intel_output->edid = edid; + else + kfree(edid); } return ret; -- 1.7.0