summaryrefslogtreecommitdiff
path: root/meta-moblin/packages/linux/linux-moblin-2.6.31.5/linux-2.6.29-kms-edid-cache.patch
blob: 47e5b16a2a36117f62d62e7e5e794b695ab0aac1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 004541c..b218780 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 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 9ab38ef..9fba800 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -657,6 +657,7 @@ static void intel_lvds_destroy(struct drm_connector *connector)
 		intel_i2c_destroy(intel_output->ddc_bus);
 	drm_sysfs_connector_remove(connector);
 	drm_connector_cleanup(connector);
+	kfree(intel_output->edid);
 	kfree(connector);
 }
 
@@ -1017,5 +1018,6 @@ failed:
 	if (intel_output->ddc_bus)
 		intel_i2c_destroy(intel_output->ddc_bus);
 	drm_connector_cleanup(connector);
+	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..5ac537f 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) {
+		printk(KERN_INFO "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;