xf86-video-intel: src/uxa/intel_display.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Jul 31 10:57:49 PDT 2013


 src/uxa/intel_display.c |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

New commits:
commit c5e3b66c27e8960a39ba0fc9108e04a67e1c2d98
Author: Damien Lespiau <damien.lespiau at intel.com>
Date:   Wed Jul 31 18:50:51 2013 +0100

    uxa/display: Keep the EDID blob around for the lifetime of an output
    
    xf86InterpretEDID() doesn't copy the EDID raw data in xf86MonPtr but
    just stores the given pointer. The DDX driver needs to make sure that
    data stays valid.
    
    Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>

diff --git a/src/uxa/intel_display.c b/src/uxa/intel_display.c
index 02f2dcb..b4f7e87 100644
--- a/src/uxa/intel_display.c
+++ b/src/uxa/intel_display.c
@@ -105,6 +105,7 @@ struct intel_output {
 	int output_id;
 	drmModeConnectorPtr mode_output;
 	drmModeEncoderPtr mode_encoder;
+	drmModePropertyBlobPtr edid_blob;
 	int num_props;
 	struct intel_property *props;
 	void *private_data;
@@ -920,7 +921,6 @@ intel_output_attach_edid(xf86OutputPtr output)
 	struct intel_output *intel_output = output->driver_private;
 	drmModeConnectorPtr koutput = intel_output->mode_output;
 	struct intel_mode *mode = intel_output->mode;
-	drmModePropertyBlobPtr edid_blob = NULL;
 	xf86MonPtr mon = NULL;
 	int i;
 
@@ -938,26 +938,23 @@ intel_output_attach_edid(xf86OutputPtr output)
 		}
 
 		if (!strcmp(props->name, "EDID")) {
-			drmModeFreePropertyBlob(edid_blob);
-			edid_blob =
+			drmModeFreePropertyBlob(intel_output->edid_blob);
+			intel_output->edid_blob =
 				drmModeGetPropertyBlob(mode->fd,
 						       koutput->prop_values[i]);
 		}
 		drmModeFreeProperty(props);
 	}
 
-	if (edid_blob) {
+	if (intel_output->edid_blob) {
 		mon = xf86InterpretEDID(output->scrn->scrnIndex,
-					edid_blob->data);
+					intel_output->edid_blob->data);
 
-		if (mon && edid_blob->length > 128)
+		if (mon && intel_output->edid_blob->length > 128)
 			mon->flags |= MONITOR_EDID_COMPLETE_RAWDATA;
 	}
 
 	xf86OutputSetEDID(output, mon);
-
-	if (edid_blob)
-		drmModeFreePropertyBlob(edid_blob);
 }
 
 static DisplayModePtr
@@ -1061,6 +1058,8 @@ intel_output_destroy(xf86OutputPtr output)
 	struct intel_output *intel_output = output->driver_private;
 	int i;
 
+	drmModeFreePropertyBlob(intel_output->edid_blob);
+
 	for (i = 0; i < intel_output->num_props; i++) {
 		drmModeFreeProperty(intel_output->props[i].mode_prop);
 		free(intel_output->props[i].atoms);


More information about the xorg-commit mailing list