summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac3
-rw-r--r--src/Makefile.am5
-rw-r--r--src/smi_driver.c10
3 files changed, 17 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 74667a3..825aa9c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,6 +63,8 @@ CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
[XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
[#include "xorg-server.h"])
+AC_CHECK_HEADER(xf86Modes.h,
+ [XMODES=yes], [XMODES=no], [#include "xorg-server.h"])
CPPFLAGS="$SAVE_CPPFLAGS"
# Checks for header files.
@@ -73,6 +75,7 @@ if test "x$XSERVER_LIBPCIACCESS" = xyes; then
XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
fi
AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
+AM_CONDITIONAL(XMODES, test "x$XMODES" = xno)
AC_SUBST([XORG_CFLAGS])
AC_SUBST([moduledir])
diff --git a/src/Makefile.am b/src/Makefile.am
index 63510f5..2219ee2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -44,4 +44,7 @@ siliconmotion_drv_la_SOURCES = \
smi_pcirename.h \
smi_shadow.c \
smi_video.c \
- smi_video.h
+ smi_video.h \
+if XMODES
+ xf86cvt.c
+endif
diff --git a/src/smi_driver.c b/src/smi_driver.c
index 5730550..64db50f 100644
--- a/src/smi_driver.c
+++ b/src/smi_driver.c
@@ -1047,6 +1047,16 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
clockRanges->interlaceAllowed = FALSE;
clockRanges->doubleScanAllowed = FALSE;
+ /* FIXME Maybe this should be done only for the 501/502?
+ * as it doesn't have any method of detecting monitors, other then
+ * reading what is in the hardware, and hoping the kernel received
+ * the proper parameters, and correctly programmed the hardware. */
+ if (pSmi->lcdWidth && pSmi->lcdHeight)
+ pScrn->monitor->Modes =
+ xf86ModesAdd(pScrn->monitor->Modes,
+ xf86CVTMode(pSmi->lcdWidth, pSmi->lcdHeight, 60.0f,
+ FALSE, FALSE));
+
i = xf86ValidateModes(
pScrn, /* Screen pointer */
pScrn->monitor->Modes, /* Available monitor modes */