Module Name:    xsrc
Committed By:   macallan
Date:           Thu Aug  4 01:17:34 UTC 2011

Modified Files:
        xsrc/external/mit/xf86-video-mach64/dist/src: atipreinit.c

Log Message:
support ioctl(WSDISPLAYIO_GET_EDID)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 \
    xsrc/external/mit/xf86-video-mach64/dist/src/atipreinit.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xf86-video-mach64/dist/src/atipreinit.c
diff -u xsrc/external/mit/xf86-video-mach64/dist/src/atipreinit.c:1.1.1.4 xsrc/external/mit/xf86-video-mach64/dist/src/atipreinit.c:1.2
--- xsrc/external/mit/xf86-video-mach64/dist/src/atipreinit.c:1.1.1.4	Sat Jul 23 08:11:59 2011
+++ xsrc/external/mit/xf86-video-mach64/dist/src/atipreinit.c	Thu Aug  4 01:17:34 2011
@@ -27,6 +27,13 @@
 #include <string.h>
 #include <stdio.h>
 
+#ifdef __NetBSD__
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <dev/wscons/wsconsio.h>
+#endif
+
 #include "ati.h"
 #include "atiadjust.h"
 #include "atiaudio.h"
@@ -56,6 +63,8 @@
 #include "xf86RAC.h"
 #endif
 
+#include "xf86Priv.h"
+
 /*
  * FreeScreen handles the clean-up.
  */
@@ -529,7 +538,7 @@
 
 #   define           pATIHW     (&pATI->OldHW)
 
-#ifndef AVOID_CPIO
+#ifndef AVOID_CPIO_
 
     xf86Int10InfoPtr pInt10Info = NULL;
     vbeInfoPtr       pVBE = NULL;
@@ -648,7 +657,6 @@
     ATIClaimBusSlot(pGDev->active, pATI);
 
 #ifndef AVOID_CPIO
-
 #ifdef TV_OUT
 
     pATI->pVBE = NULL;
@@ -725,6 +733,23 @@
     pVBE = NULL;
     pInt10Info = NULL;
 #endif /* TV_OUT */
+#endif /* AVOID_CPIO */
+#ifdef __NetBSD__
+    if (ConfiguredMonitor == NULL) {
+    	struct wsdisplayio_edid_info ei;
+    	char buffer[1024];
+    	int i, j;
+
+	ei.edid_data = buffer;
+	ei.buffer_size = 1024;
+	if (ioctl(xf86Info.screenFd, WSDISPLAYIO_GET_EDID, &ei) != -1) {
+	    xf86Msg(X_INFO, "got %d bytes worth of EDID from wsdisplay\n", ei.data_size);
+	    ConfiguredMonitor = xf86InterpretEDID(pScreenInfo->scrnIndex, buffer);
+	} else
+	    xf86Msg(X_INFO, "ioctl failed %d\n", errno);
+    }
+#endif
+
 
     if (ConfiguredMonitor && !(flags & PROBE_DETECT))
     {
@@ -732,10 +757,10 @@
         xf86SetDDCproperties(pScreenInfo, ConfiguredMonitor);
     }
 
+#ifndef AVOID_CPIO
     /* DDC module is no longer needed at this point */
     xf86UnloadSubModule(pDDCModule);
-
-#endif /* AVOID_CPIO */
+#endif
 
     if (flags & PROBE_DETECT)
     {

Reply via email to