Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[xsrc/trunk]: xsrc/external/mit/xf86-video-nv/dist/src try WSDISPLAYIO_GET_ED...



details:   https://anonhg.NetBSD.org/xsrc/rev/1d89a5eb659c
branches:  trunk
changeset: 10661:1d89a5eb659c
user:      macallan <macallan%NetBSD.org@localhost>
date:      Thu Mar 25 17:22:02 2021 +0000

description:
try WSDISPLAYIO_GET_EDID if DDC2 fails
now my iMac G5 correctly identifies its display

diffstat:

 external/mit/xf86-video-nv/dist/src/nv_setup.c |  28 ++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diffs (47 lines):

diff -r 965f52677c7a -r 1d89a5eb659c external/mit/xf86-video-nv/dist/src/nv_setup.c
--- a/external/mit/xf86-video-nv/dist/src/nv_setup.c    Mon Mar 22 14:10:06 2021 +0000
+++ b/external/mit/xf86-video-nv/dist/src/nv_setup.c    Thu Mar 25 17:22:02 2021 +0000
@@ -25,8 +25,16 @@
 #include "config.h"
 #endif
 
+#include "xf86Priv.h"
+#include "xf86Privstr.h"
 #include "nv_include.h"
 
+#ifdef __NetBSD__
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <dev/wscons/wsconsio.h>
+#endif
+
 /*
  * Override VGA I/O routines.
  */
@@ -234,6 +242,26 @@
 #else
     MonInfo = xf86DoEDID_DDC2(XF86_SCRN_ARG(pScrn), pNv->I2C);
 #endif
+#ifdef __NetBSD__
+    if (!MonInfo) {
+       /* ask wsdisplay */
+       struct wsdisplayio_edid_info ei;
+       char *buffer;
+       xf86MonPtr tmp;
+
+       buffer = malloc(1024);
+       ei.edid_data = buffer;
+       ei.buffer_size = 1024;
+       if (ioctl(xf86Info.consoleFd, WSDISPLAYIO_GET_EDID, &ei) != -1) {
+           xf86Msg(X_INFO, "got %d bytes worth of EDID from wsdisplay\n",
+               ei.data_size);
+           tmp = xf86InterpretEEDID(pScrn->scrnIndex, buffer);
+           tmp->flags |= MONITOR_EDID_COMPLETE_RAWDATA;
+           MonInfo = tmp;
+       }
+       free(buffer);
+    }
+#endif
     if (MonInfo) {
        xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
                   "DDC detected a %s:\n", MonInfo->features.input_type ?



Home | Main Index | Thread Index | Old Index