summaryrefslogtreecommitdiff
path: root/src/nv_setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nv_setup.c')
-rw-r--r--src/nv_setup.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/nv_setup.c b/src/nv_setup.c
index 6a7c048..77f6c4a 100644
--- a/src/nv_setup.c
+++ b/src/nv_setup.c
@@ -25,8 +25,16 @@
#include "config.h"
#endif
+#include "xf86Priv.h"
+#include "xf86Privstr.h"
#include "nv_include.h"
+#ifdef HAVE_DEV_WSCONS_WSCONSIO_H
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <dev/wscons/wsconsio.h>
+#endif
+
/*
* Override VGA I/O routines.
*/
@@ -234,6 +242,26 @@ NVProbeDDC (ScrnInfoPtr pScrn, int bus)
#else
MonInfo = xf86DoEDID_DDC2(XF86_SCRN_ARG(pScrn), pNv->I2C);
#endif
+#ifdef WSDISPLAYIO_GET_EDID
+ 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 ?