xf86-video-intel: Branch 'modesetting' - src/i830_modes.c

Eric Anholt anholt at kemper.freedesktop.org
Fri Nov 10 06:29:07 EET 2006


 src/i830_modes.c |   40 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 39 insertions(+), 1 deletion(-)

New commits:
diff-tree 3955f044cfe1d592bcb36c43c539fb4a75840b8d (from 0f5886689d7ef7dbbef6425d5c855ac6b67d3350)
Author: Eric Anholt <eric at anholt.net>
Date:   Thu Nov 9 20:28:46 2006 -0800

    Expose the DDC-probed EDID data as the EDID_DATA output property.

diff --git a/src/i830_modes.c b/src/i830_modes.c
index b6867c3..77db66c 100644
--- a/src/i830_modes.c
+++ b/src/i830_modes.c
@@ -48,6 +48,7 @@
 #include <math.h>
 
 #include "xf86.h"
+#include "X11/Xatom.h"
 #include "i830.h"
 #include "i830_display.h"
 #include "i830_xf86Modes.h"
@@ -612,6 +613,29 @@ I830ValidateXF86ModeList(ScrnInfoPtr pSc
     return 1; /* XXX */
 }
 
+#ifdef RANDR_12_INTERFACE
+
+#define EDID_ATOM_NAME		"EDID_DATA"
+
+static void
+i830_ddc_set_edid_property(ScrnInfoPtr pScrn, I830OutputPtr output,
+			   void *data, int data_len)
+{
+    Atom edid_atom = MakeAtom(EDID_ATOM_NAME, sizeof(EDID_ATOM_NAME), TRUE);
+
+    /* This may get called before the RandR resources have been created */
+    if (output->randr_output == NULL)
+	return;
+
+    if (data_len != 0) {
+	RRChangeOutputProperty(output->randr_output, edid_atom, XA_INTEGER, 8,
+			       PropModeReplace, data_len, data, FALSE);
+    } else {
+	RRDeleteOutputProperty(output->randr_output, edid_atom);
+    }
+}
+#endif
+
 /**
  * Generic get_modes function using DDC, used by many outputs.
  */
@@ -623,13 +647,27 @@ i830_ddc_get_modes(ScrnInfoPtr pScrn, I8
     int i;
 
     ddc_mon = xf86DoEDID_DDC2(pScrn->scrnIndex, output->pDDCBus);
-    if (ddc_mon == NULL)
+    if (ddc_mon == NULL) {
+#ifdef RANDR_12_INTERFACE
+	i830_ddc_set_edid_property(pScrn, output, NULL, 0);
+#endif
 	return NULL;
+    }
 
     if (output->MonInfo != NULL)
 	xfree(output->MonInfo);
     output->MonInfo = ddc_mon;
 
+#ifdef RANDR_12_INTERFACE
+    if (output->MonInfo->ver.version == 1) {
+	i830_ddc_set_edid_property(pScrn, output, ddc_mon->rawData, 128);
+    } else if (output->MonInfo->ver.version == 2) {
+	i830_ddc_set_edid_property(pScrn, output, ddc_mon->rawData, 256);
+    } else {
+	i830_ddc_set_edid_property(pScrn, output, NULL, 0);
+    }
+#endif
+
     /* Debug info for now, at least */
     xf86DrvMsg(pScrn->scrnIndex, X_INFO, "EDID for output %s\n",
 	       i830_output_type_names[output->type]);



More information about the xorg-commit mailing list