diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/nv_setup.c | 28 |
2 files changed, 30 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index a282013..a6df24c 100644 --- a/configure.ac +++ b/configure.ac @@ -72,6 +72,8 @@ AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ]) save_CFLAGS="$CFLAGS" CFLAGS="$XORG_CFLAGS" +AC_CHECK_HEADERS(dev/wscons/wsconsio.h) + # PCI rework AC_CHECK_DECL(XSERVER_LIBPCIACCESS, [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no], 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 ? |