aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_connector.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index 5a10deb8bdbd..54c85305a0fb 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -83,14 +83,16 @@ nouveau_encoder_connector_get(struct nouveau_encoder *encoder)
83static void 83static void
84nouveau_connector_destroy(struct drm_connector *drm_connector) 84nouveau_connector_destroy(struct drm_connector *drm_connector)
85{ 85{
86 struct nouveau_connector *connector = nouveau_connector(drm_connector); 86 struct nouveau_connector *nv_connector =
87 struct drm_device *dev = connector->base.dev; 87 nouveau_connector(drm_connector);
88 struct drm_device *dev = nv_connector->base.dev;
88 89
89 NV_DEBUG_KMS(dev, "\n"); 90 NV_DEBUG_KMS(dev, "\n");
90 91
91 if (!connector) 92 if (!nv_connector)
92 return; 93 return;
93 94
95 kfree(nv_connector->edid);
94 drm_sysfs_connector_remove(drm_connector); 96 drm_sysfs_connector_remove(drm_connector);
95 drm_connector_cleanup(drm_connector); 97 drm_connector_cleanup(drm_connector);
96 kfree(drm_connector); 98 kfree(drm_connector);
@@ -237,6 +239,9 @@ nouveau_connector_detect(struct drm_connector *connector)
237 return connector_status_connected; 239 return connector_status_connected;
238 } 240 }
239 241
242 kfree(nv_connector->edid);
243 nv_connector->edid = NULL;
244
240 i2c = nouveau_connector_ddc_detect(connector, &nv_encoder); 245 i2c = nouveau_connector_ddc_detect(connector, &nv_encoder);
241 if (i2c) { 246 if (i2c) {
242 nouveau_connector_ddc_prepare(connector, &flags); 247 nouveau_connector_ddc_prepare(connector, &flags);
@@ -687,8 +692,12 @@ nouveau_connector_create_lvds(struct drm_device *dev,
687 */ 692 */
688 if (!nv_connector->edid && !nv_connector->native_mode && 693 if (!nv_connector->edid && !nv_connector->native_mode &&
689 !dev_priv->VBIOS.pub.fp_no_ddc) { 694 !dev_priv->VBIOS.pub.fp_no_ddc) {
690 nv_connector->edid = 695 struct edid *edid =
691 (struct edid *)nouveau_bios_embedded_edid(dev); 696 (struct edid *)nouveau_bios_embedded_edid(dev);
697 if (edid) {
698 nv_connector->edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
699 *(nv_connector->edid) = *edid;
700 }
692 } 701 }
693 702
694 if (!nv_connector->edid) 703 if (!nv_connector->edid)