-I$(TIGERVNC_BUILDDIR) \
-I$(TIGERVNC_SRCDIR)/common \
-I$(TIGERVNC_SRCDIR)/unix/common \
- $(DIX_CFLAGS)
+ $(DIX_CFLAGS) $(LIBXCVT_CFLAGS)
AM_CXXFLAGS = -std=gnu++11
$(COMMON_LIBS)
Xvnc_DEPENDENCIES = $(LOCAL_LIBS)
-Xvnc_LDADD = $(LOCAL_LIBS) $(XSERVER_SYS_LIBS) $(XVNC_SYS_LIBS)
+Xvnc_LDADD = \
+ $(LOCAL_LIBS) \
+ $(XSERVER_SYS_LIBS) \
+ $(XVNC_SYS_LIBS) \
+ $(LIBXCVT_LIBS)
Xvnc_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
#include "xorg-version.h"
#include <stdio.h>
+#ifdef HAVE_LIBXCVT
+#include <libxcvt/libxcvt.h>
+#endif
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/Xos.h>
RRModePtr mode;
memset(&modeInfo, 0, sizeof(modeInfo));
- sprintf(name, "%dx%d", width, height);
+#ifdef HAVE_LIBXCVT
+ struct libxcvt_mode_info *cvtMode;
+
+ cvtMode = libxcvt_gen_mode_info(width, height, 60.0, false, false);
+
+ modeInfo.width = cvtMode->hdisplay;
+ modeInfo.height = cvtMode->vdisplay;
+ modeInfo.dotClock = cvtMode->dot_clock * 1000.0;
+ modeInfo.hSyncStart = cvtMode->hsync_start;
+ modeInfo.hSyncEnd = cvtMode->hsync_end;
+ modeInfo.hTotal = cvtMode->htotal;
+ modeInfo.vSyncStart = cvtMode->vsync_start;
+ modeInfo.vSyncEnd = cvtMode->vsync_end;
+ modeInfo.vTotal = cvtMode->vtotal;
+ modeInfo.modeFlags = cvtMode->mode_flags;
+
+ free(cvtMode);
+
+ /* libxcvt rounds up to multiples of 8, so override them here */
+ modeInfo.width = width;
+ modeInfo.height = height;
+#else
modeInfo.width = width;
modeInfo.height = height;
modeInfo.hTotal = width;
modeInfo.vTotal = height;
modeInfo.dotClock = ((CARD32) width * (CARD32) height * 60);
+#endif
+
+ sprintf(name, "%dx%d", width, height);
modeInfo.nameLength = strlen(name);
mode = RRModeGet(&modeInfo, name);
if (mode == NULL)
AC_PROG_LN_S
LT_PREREQ([2.2])
LT_INIT([disable-static win32-dll])
-@@ -1735,6 +1736,14 @@ if test "x$XVFB" = xyes; then
+@@ -1735,6 +1736,19 @@ if test "x$XVFB" = xyes; then
AC_SUBST([XVFB_SYS_LIBS])
fi
+PKG_CHECK_MODULES(GBM, "$LIBGBM", [GBM=yes], [GBM=no])
+if test "x$GBM" = xyes; then
+ AC_DEFINE(HAVE_GBM, 1, [Have GBM support])
++fi
++
++PKG_CHECK_MODULES(LIBXCVT, "libxcvt", [XCVT=yes], [XCVT=no])
++if test "x$XCVT" = xyes; then
++ AC_DEFINE(HAVE_LIBXCVT, 1, [Have libxcvt support])
+fi
dnl Xnest DDX
index f8fc67067..d53c4e72f 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
+@@ -63,6 +63,9 @@
+ /* Has libunwind support */
+ #undef HAVE_LIBUNWIND
+
++/* Have libxcvt support */
++#undef HAVE_LIBXCVT
++
+ /* Define to 1 if you have the `cbrt' function. */
+ #undef HAVE_CBRT
+
@@ -83,6 +83,9 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
AC_PROG_LN_S
LT_PREREQ([2.2])
LT_INIT([disable-static win32-dll])
-@@ -1720,6 +1721,14 @@ if test "x$XVFB" = xyes; then
+@@ -1720,6 +1721,19 @@ if test "x$XVFB" = xyes; then
AC_SUBST([XVFB_SYS_LIBS])
fi
+PKG_CHECK_MODULES(GBM, "$LIBGBM", [GBM=yes], [GBM=no])
+if test "x$GBM" = xyes; then
+ AC_DEFINE(HAVE_GBM, 1, [Have GBM support])
++fi
++
++PKG_CHECK_MODULES(LIBXCVT, "$LIBXCVT", [XCVT=yes], [XCVT=no])
++if test "x$XCVT" = xyes; then
++ AC_DEFINE(HAVE_LIBXCVT, 1, [Have libxcvt support])
+fi
dnl Xnest DDX
index 382d70609..04a4fd263 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
+@@ -63,6 +63,9 @@
+ /* Has libunwind support */
+ #undef HAVE_LIBUNWIND
+
++/* Have libxcvt support */
++#undef HAVE_LIBXCVT
++
+ /* Define to 1 if you have the `cbrt' function. */
+ #undef HAVE_CBRT
+
@@ -77,6 +77,9 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H