xf86-video-intel: src/intel_display.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Aug 5 02:02:10 PDT 2010


 src/intel_display.c |   54 ++++++++++++++++++++++++----------------------------
 1 file changed, 25 insertions(+), 29 deletions(-)

New commits:
commit a8919ab2967a8425e1cdc04b73702ce534f6abf0
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Aug 5 09:59:22 2010 +0100

    Revert "display: Cache whether we have probed for an EDID"
    
    Dave Airlie advised that hotplug detection can be unreliable and that
    mode caching, in general, should be done in the kernel in any case.
    
    This reverts commit 622e600069ab0efd22586c7a71eecbd4baf21c40.

diff --git a/src/intel_display.c b/src/intel_display.c
index 061d222..1539976 100644
--- a/src/intel_display.c
+++ b/src/intel_display.c
@@ -82,7 +82,6 @@ struct intel_output {
 	int output_id;
 	drmModeConnectorPtr mode_output;
 	drmModeEncoderPtr mode_encoder;
-	Bool have_edid;
 	drmModePropertyBlobPtr edid_blob;
 	int num_props;
 	struct intel_property *props;
@@ -677,8 +676,6 @@ intel_output_detect(xf86OutputPtr output)
 	struct intel_mode *mode = intel_output->mode;
 	xf86OutputStatus status;
 
-	intel_output->have_edid = FALSE;
-
 	drmModeFreeConnector(intel_output->mode_output);
 	intel_output->mode_output =
 		drmModeGetConnector(mode->fd, intel_output->output_id);
@@ -770,41 +767,40 @@ intel_output_get_modes(xf86OutputPtr output)
 	struct intel_output *intel_output = output->driver_private;
 	drmModeConnectorPtr koutput = intel_output->mode_output;
 	struct intel_mode *mode = intel_output->mode;
+	int i;
 	DisplayModePtr Modes = NULL, Mode;
+	drmModePropertyPtr props;
 	drmModeModeInfo *mode_ptr;
-	int i;
 
-	if (!intel_output->have_edid) {
-		/* look for an EDID property */
-		for (i = 0; i < koutput->count_props; i++) {
-			drmModePropertyPtr props;
-
-			props = drmModeGetProperty(mode->fd, koutput->props[i]);
-			if (!props)
-				continue;
-
-			if ((props->flags & DRM_MODE_PROP_BLOB) &&
-			    strcmp(props->name, "EDID") == 0) {
-				drmModeFreePropertyBlob(intel_output->edid_blob);
-				intel_output->edid_blob =
-					drmModeGetPropertyBlob(mode->fd,
-							       koutput->prop_values[i]);
-			}
+	/* look for an EDID property */
+	for (i = 0; i < koutput->count_props; i++) {
+		props = drmModeGetProperty(mode->fd, koutput->props[i]);
+		if (!props)
+			continue;
 
+		if (!(props->flags & DRM_MODE_PROP_BLOB)) {
 			drmModeFreeProperty(props);
+			continue;
 		}
 
-		if (intel_output->edid_blob)
-			xf86OutputSetEDID(output,
-					  xf86InterpretEDID(output->scrn->scrnIndex,
-							    intel_output->edid_blob->data));
-		else
-			xf86OutputSetEDID(output,
-					  xf86InterpretEDID(output->scrn->scrnIndex,
-							    NULL));
-		intel_output->have_edid = TRUE;
+		if (!strcmp(props->name, "EDID")) {
+			drmModeFreePropertyBlob(intel_output->edid_blob);
+			intel_output->edid_blob =
+				drmModeGetPropertyBlob(mode->fd,
+						       koutput->prop_values[i]);
+		}
+		drmModeFreeProperty(props);
 	}
 
+	if (intel_output->edid_blob)
+		xf86OutputSetEDID(output,
+				  xf86InterpretEDID(output->scrn->scrnIndex,
+						    intel_output->edid_blob->data));
+	else
+		xf86OutputSetEDID(output,
+				  xf86InterpretEDID(output->scrn->scrnIndex,
+						    NULL));
+
 	/* modes should already be available */
 	for (i = 0; i < koutput->count_modes; i++) {
 		Mode = xnfalloc(sizeof(DisplayModeRec));


More information about the xorg-commit mailing list