From 399931a293dca4276c1d99d0e58cf14c50d53259 Mon Sep 17 00:00:00 2001 From: Stephen Crowley Date: Tue, 8 Dec 1998 13:10:56 +0000 Subject: [PATCH] Added fullscreen DGA support. --- configure | 189 ++++++++++++++++++++++++++++++------------------- configure.in | 4 +- graphics/ddraw.c | 40 ++++++++++- include/acconfig.h | 3 + include/config.h.in | 3 + include/ts_xf86vmode.h | 30 ++++++++ tools/make_X11wrappers | 79 ++++++++++++++++++++- tsx11/Makefile.in | 1 + tsx11/X11_calls | 14 ++++ tsx11/ts_xf86vmode.c | 167 +++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 453 insertions(+), 77 deletions(-) create mode 100644 include/ts_xf86vmode.h create mode 100644 tsx11/ts_xf86vmode.c diff --git a/configure b/configure index 5f0e2bdd6ea..c9b7e0b207e 100755 --- a/configure +++ b/configure @@ -23,7 +23,7 @@ ac_help="$ac_help ac_help="$ac_help --disable-trace compile out TRACE messages" ac_help="$ac_help - --with-ncurses compile in the ncurses terminal" + --with-ncurses compile in the ncurses terminal (EXPERIMENTAL)" ac_help="$ac_help --without-reentrant-x compile for use with non-reentrant X libraries" ac_help="$ac_help @@ -2373,6 +2373,49 @@ else echo "$ac_t""no" 1>&6 fi + echo $ac_n "checking for XF86VidModeQueryExtension in -lXxf86vm""... $ac_c" 1>&6 +echo "configure:2378: checking for XF86VidModeQueryExtension in -lXxf86vm" >&5 +ac_lib_var=`echo Xxf86vm'_'XF86VidModeQueryExtension | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lXxf86vm $X_LIBS -lXext -lX11 $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_LIBXXF86VM 1 +EOF + X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm" +else + echo "$ac_t""no" 1>&6 +fi + else XLIB="" X_CFLAGS="" @@ -2383,17 +2426,17 @@ for ac_hdr in sys/soundcard.h machine/soundcard.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2387: checking for $ac_hdr" >&5 +echo "configure:2430: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2397: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2440: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2421,12 +2464,12 @@ done echo $ac_n "checking "for Open Sound System"""... $ac_c" 1>&6 -echo "configure:2425: checking "for Open Sound System"" >&5 +echo "configure:2468: checking "for Open Sound System"" >&5 if eval "test \"`echo '$''{'ac_cv_c_opensoundsystem'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2493: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_opensoundsystem="yes" else @@ -2470,12 +2513,12 @@ fi echo $ac_n "checking "for union semun"""... $ac_c" 1>&6 -echo "configure:2474: checking "for union semun"" >&5 +echo "configure:2517: checking "for union semun"" >&5 if eval "test \"`echo '$''{'ac_cv_c_union_semun'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2483,7 +2526,7 @@ int main() { union semun foo ; return 0; } EOF -if { (eval echo configure:2487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2530: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_union_semun="yes" else @@ -2511,7 +2554,7 @@ if test "x${GCC}" = "xyes" then CFLAGS="$CFLAGS -Wall" echo $ac_n "checking "for gcc strength-reduce bug"""... $ac_c" 1>&6 -echo "configure:2515: checking "for gcc strength-reduce bug"" >&5 +echo "configure:2558: checking "for gcc strength-reduce bug"" >&5 if eval "test \"`echo '$''{'ac_cv_c_gcc_strength_bug'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2519,7 +2562,7 @@ else ac_cv_c_gcc_strength_bug="yes" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_gcc_strength_bug="no" else @@ -2553,7 +2596,7 @@ fi echo $ac_n "checking "whether external symbols need an underscore prefix"""... $ac_c" 1>&6 -echo "configure:2557: checking "whether external symbols need an underscore prefix"" >&5 +echo "configure:2600: checking "whether external symbols need an underscore prefix"" >&5 if eval "test \"`echo '$''{'ac_cv_c_extern_prefix'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2565,14 +2608,14 @@ _ac_test: .long 0 EOF cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_c_extern_prefix="yes" else @@ -2596,7 +2639,7 @@ fi echo $ac_n "checking "whether assembler accepts .string"""... $ac_c" 1>&6 -echo "configure:2600: checking "whether assembler accepts .string"" >&5 +echo "configure:2643: checking "whether assembler accepts .string"" >&5 if eval "test \"`echo '$''{'ac_cv_c_asm_string'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2606,14 +2649,14 @@ cat > conftest_asm.s < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_c_asm_string="yes" else @@ -2640,21 +2683,21 @@ DLLFLAGS="" if test "$LIB_TARGET" = "libwine.so.1.0" then echo $ac_n "checking "whether we can build a dll"""... $ac_c" 1>&6 -echo "configure:2644: checking "whether we can build a dll"" >&5 +echo "configure:2687: checking "whether we can build a dll"" >&5 if eval "test \"`echo '$''{'ac_cv_c_dll'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else saved_cflags=$CFLAGS CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_c_dll="yes" else @@ -2680,7 +2723,7 @@ fi echo $ac_n "checking "for reentrant libc"""... $ac_c" 1>&6 -echo "configure:2684: checking "for reentrant libc"" >&5 +echo "configure:2727: checking "for reentrant libc"" >&5 if eval "test \"`echo '$''{'wine_cv_libc_reentrant'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2688,14 +2731,14 @@ else wine_cv_libc_reentrant=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then wine_cv_libc_reentrant=yes else @@ -2720,7 +2763,7 @@ fi echo $ac_n "checking "for reentrant X libraries"""... $ac_c" 1>&6 -echo "configure:2724: checking "for reentrant X libraries"" >&5 +echo "configure:2767: checking "for reentrant X libraries"" >&5 if eval "test \"`echo '$''{'wine_cv_x_reentrant'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2765,12 +2808,12 @@ fi for ac_func in clone getpagesize memmove sendmsg sigaltstack strerror stricmp tcgetattr timegm usleep wait4 waitpid vfscanf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2769: checking for $ac_func" >&5 +echo "configure:2812: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2821,17 +2864,17 @@ for ac_hdr in wctype.h sys/syscall.h syscall.h sys/param.h sys/vfs.h sys/mount.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2825: checking for $ac_hdr" >&5 +echo "configure:2868: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2835: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2878: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2858,12 +2901,12 @@ fi done echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:2862: checking whether stat file-mode macros are broken" >&5 +echo "configure:2905: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2914,12 +2957,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2918: checking for working const" >&5 +echo "configure:2961: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3015: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2989,12 +3032,12 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2993: checking for ANSI C header files" >&5 +echo "configure:3036: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3002,7 +3045,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3019,7 +3062,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3037,7 +3080,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3058,7 +3101,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3069,7 +3112,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:3073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -3093,12 +3136,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3097: checking for size_t" >&5 +echo "configure:3140: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3126,7 +3169,7 @@ EOF fi echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:3130: checking size of long long" >&5 +echo "configure:3173: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3134,7 +3177,7 @@ else ac_cv_sizeof_long_long=0 else cat > conftest.$ac_ext < main() @@ -3145,7 +3188,7 @@ main() exit(0); } EOF -if { (eval echo configure:3149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -3168,7 +3211,7 @@ EOF if test $ac_cv_func_sendmsg = no; then echo $ac_n "checking for sendmsg in -lsocket""... $ac_c" 1>&6 -echo "configure:3172: checking for sendmsg in -lsocket" >&5 +echo "configure:3215: checking for sendmsg in -lsocket" >&5 ac_lib_var=`echo socket'_'sendmsg | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3176,7 +3219,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3220,12 +3263,12 @@ fi if test "$ac_cv_header_sys_vfs_h" = "yes" then echo $ac_n "checking "whether sys/vfs.h defines statfs"""... $ac_c" 1>&6 -echo "configure:3224: checking "whether sys/vfs.h defines statfs"" >&5 +echo "configure:3267: checking "whether sys/vfs.h defines statfs"" >&5 if eval "test \"`echo '$''{'wine_cv_sys_vfs_has_statfs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3242,7 +3285,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_sys_vfs_has_statfs=yes else @@ -3269,12 +3312,12 @@ fi if test "$ac_cv_header_sys_statfs_h" = "yes" then echo $ac_n "checking "whether sys/statfs.h defines statfs"""... $ac_c" 1>&6 -echo "configure:3273: checking "whether sys/statfs.h defines statfs"" >&5 +echo "configure:3316: checking "whether sys/statfs.h defines statfs"" >&5 if eval "test \"`echo '$''{'wine_cv_sys_statfs_has_statfs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3289,7 +3332,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3293: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3336: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_sys_statfs_has_statfs=yes else @@ -3316,12 +3359,12 @@ fi if test "$ac_cv_header_sys_mount_h" = "yes" then echo $ac_n "checking "whether sys/mount.h defines statfs"""... $ac_c" 1>&6 -echo "configure:3320: checking "whether sys/mount.h defines statfs"" >&5 +echo "configure:3363: checking "whether sys/mount.h defines statfs"" >&5 if eval "test \"`echo '$''{'wine_cv_sys_mount_has_statfs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3336,7 +3379,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_sys_mount_has_statfs=yes else @@ -3362,7 +3405,7 @@ fi echo $ac_n "checking "for statfs.f_bfree"""... $ac_c" 1>&6 -echo "configure:3366: checking "for statfs.f_bfree"" >&5 +echo "configure:3409: checking "for statfs.f_bfree"" >&5 if eval "test \"`echo '$''{'wine_cv_statfs_bfree'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3371,7 +3414,7 @@ else wine_cv_statfs_bfree=no else cat > conftest.$ac_ext < @@ -3398,7 +3441,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_statfs_bfree=yes else @@ -3422,7 +3465,7 @@ EOF fi echo $ac_n "checking "for statfs.f_bavail"""... $ac_c" 1>&6 -echo "configure:3426: checking "for statfs.f_bavail"" >&5 +echo "configure:3469: checking "for statfs.f_bavail"" >&5 if eval "test \"`echo '$''{'wine_cv_statfs_bavail'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3431,7 +3474,7 @@ else wine_cv_statfs_bavail=no else cat > conftest.$ac_ext < @@ -3458,7 +3501,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3462: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wine_cv_statfs_bavail=yes else @@ -3483,7 +3526,7 @@ fi echo $ac_n "checking "for working sigaltstack"""... $ac_c" 1>&6 -echo "configure:3487: checking "for working sigaltstack"" >&5 +echo "configure:3530: checking "for working sigaltstack"" >&5 if eval "test \"`echo '$''{'ac_cv_c_working_sigaltstack'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3492,7 +3535,7 @@ else else cat > conftest.$ac_ext < @@ -3530,7 +3573,7 @@ else } EOF -if { (eval echo configure:3534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_working_sigaltstack="yes" else @@ -3557,12 +3600,12 @@ fi echo $ac_n "checking "for msg_accrights in struct msghdr"""... $ac_c" 1>&6 -echo "configure:3561: checking "for msg_accrights in struct msghdr"" >&5 +echo "configure:3604: checking "for msg_accrights in struct msghdr"" >&5 if eval "test \"`echo '$''{'ac_cv_c_msg_accrights'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3570,7 +3613,7 @@ int main() { struct msghdr hdr; hdr.msg_accrights=0 ; return 0; } EOF -if { (eval echo configure:3574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3617: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_msg_accrights="yes" else diff --git a/configure.in b/configure.in index 4594de32d4b..7d1120c4f0e 100644 --- a/configure.in +++ b/configure.in @@ -44,7 +44,7 @@ AC_ARG_ENABLE(trace, [if test "$enableval" = "no"; then TRACE_MSGS="no"; fi]) AC_ARG_WITH(ncurses, -[ --with-ncurses compile in the ncurses terminal], +[ --with-ncurses compile in the ncurses terminal (EXPERIMENTAL)], [if test "$withval" = "yes"; then LIBS="$LIBS -lncurses"; AC_DEFINE(WINE_NCURSES) fi]) AC_ARG_WITH(reentrant-x, @@ -106,6 +106,8 @@ then AC_CHECK_LIB(Xext,XShmQueryExtension,AC_DEFINE(HAVE_LIBXXSHM),,$X_LIBS -lXext -lX11) dnl Check for XFree86 DGA extension AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,AC_DEFINE(HAVE_LIBXXF86DGA) X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga",,$X_LIBS -lXext -lX11) + dnl Check for XFree86 VMODE extension + AC_CHECK_LIB(Xxf86vm,XF86VidModeQueryExtension,AC_DEFINE(HAVE_LIBXXF86VM) X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm",,$X_LIBS -lXext -lX11) else XLIB="" X_CFLAGS="" diff --git a/graphics/ddraw.c b/graphics/ddraw.c index 8b2258e8a28..fe1d2d43dd3 100644 --- a/graphics/ddraw.c +++ b/graphics/ddraw.c @@ -20,6 +20,15 @@ #include #include #include +#include + +#ifdef HAVE_LIBXXF86VM +/* X is retarted and insists on declaring INT32, INT16 etc in Xmd.h, this is a crude hack to get around it */ +/* Anywhere ts_xf86vmode.h is included you must define LONG64 also, see include/wintypes.h */ +#define LONG64 +#include "ts_xf86vmode.h" +#undef LONG64 +#endif #include "windows.h" #include "winerror.h" @@ -1958,7 +1967,7 @@ static HRESULT WINAPI DGA_IDirectDraw_SetDisplayMode( LPDIRECTDRAW this,DWORD width,DWORD height,DWORD depth ) { #ifdef HAVE_LIBXXF86DGA - int i,*depths,depcount; + int i,*depths,depcount,mode_count; TRACE(ddraw, "(%p)->(%ld,%ld,%ld)\n", this, width, height, depth); @@ -1984,6 +1993,33 @@ static HRESULT WINAPI DGA_IDirectDraw_SetDisplayMode( this->e.dga.fb_height = height; _common_IDirectDraw_SetDisplayMode(this); +#ifdef HAVE_LIBXXF86VM + { + XF86VidModeModeInfo **all_modes, *vidmode; + /* set fullscreen mode */ + /* do we need to save the old video mode and restore it when we exit? */ + + TSXF86VidModeGetAllModeLines(display,DefaultScreen(display),&mode_count,&all_modes); + for (i=0;ihdisplay == width && all_modes[i]->vdisplay == height) + { + vidmode = (XF86VidModeModeInfo *)malloc(sizeof(XF86VidModeModeInfo)); + *vidmode = *(all_modes[i]); + break; + } else + TSXFree(all_modes[i]->private); + } + TSXFree(all_modes); + + if (!vidmode) + WARN(ddraw, "Fullscreen mode not available!\n"); + + if (vidmode) + TSXF86VidModeSwitchToMode(display, DefaultScreen(display), vidmode); + } +#endif + /* FIXME: this function OVERWRITES several signal handlers. * can we save them? and restore them later? In a way that * it works for the library too? @@ -2675,7 +2711,7 @@ HRESULT WINAPI DGA_DirectDrawCreate( LPDIRECTDRAW *lplpDD, LPUNKNOWN pUnkOuter) #ifdef HAVE_LIBXXF86DGA int memsize,banksize,width,major,minor,flags,height; char *addr; - int fd; + int fd; /* Must be able to access /dev/mem for DGA extensions to work, root is not neccessary. --stephenc */ if ((fd = open("/dev/mem", O_RDWR)) != -1) diff --git a/include/acconfig.h b/include/acconfig.h index 17861fb9216..3138af1021c 100644 --- a/include/acconfig.h +++ b/include/acconfig.h @@ -21,6 +21,9 @@ /* Define if you have the X Shm extension */ #undef HAVE_LIBXXSHM +/* Define if you have the Xxf86vm library */ +#undef HAVE_LIBXXF86VM + /* Define if you have the Open Sound system. */ #undef HAVE_OSS diff --git a/include/config.h.in b/include/config.h.in index a6538fcab6b..9d045be1558 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -33,6 +33,9 @@ /* Define if you have the X Shm extension */ #undef HAVE_LIBXXSHM +/* Define if you have the Xxf86vm library */ +#undef HAVE_LIBXXF86VM + /* Define if you have the Open Sound system. */ #undef HAVE_OSS diff --git a/include/ts_xf86vmode.h b/include/ts_xf86vmode.h new file mode 100644 index 00000000000..556a9acba96 --- /dev/null +++ b/include/ts_xf86vmode.h @@ -0,0 +1,30 @@ +/* + * Thread safe wrappers around xf86vmode calls. + * Always include this file instead of . + * This file was generated automatically by tools/make_X11wrappers + * + * Copyright 1998 Kristian Nielsen + */ + +#ifndef __WINE_TSXF86VMODE_H +#define __WINE_TSXF86VMODE_H + +#include +#include + +extern Bool TSXF86VidModeQueryVersion(Display*,int*,int*); +extern Bool TSXF86VidModeQueryExtension(Display*,int*,int*); +extern Bool TSXF86VidModeGetModeLine(Display*,int,int*,XF86VidModeModeLine*); +extern Bool TSXF86VidModeGetAllModeLines(Display*,int,int*,XF86VidModeModeInfo***); +extern Bool TSXF86VidModeAddModeLine(Display*,int,XF86VidModeModeInfo*,XF86VidModeModeInfo*); +extern Bool TSXF86VidModeDeleteModeLine(Display*,int,XF86VidModeModeInfo*); +extern Bool TSXF86VidModeModModeLine(Display*,int,XF86VidModeModeLine*); +extern Status TSXF86VidModeValidateModeLine(Display*,int,XF86VidModeModeInfo*); +extern Bool TSXF86VidModeSwitchMode(Display*,int,int); +extern Bool TSXF86VidModeSwitchToMode(Display*,int,XF86VidModeModeInfo*); +extern Bool TSXF86VidModeLockModeSwitch(Display*,int,int); +extern Bool TSXF86VidModeGetMonitor(Display*,int,XF86VidModeMonitor*); +extern Bool TSXF86VidModeGetViewPort(Display*,int,int*,int*); +extern Bool TSXF86VidModeSetViewPort(Display*,int,int,int); + +#endif /* __WINE_TSXF86VMODE_H */ diff --git a/tools/make_X11wrappers b/tools/make_X11wrappers index b074e3caee0..4d01c2d2214 100755 --- a/tools/make_X11wrappers +++ b/tools/make_X11wrappers @@ -17,7 +17,7 @@ $X11_include_dir = "/usr/X11R6/include"; $outdir = "tsx11"; $wantfile = "$outdir/X11_calls"; -@dolist = ("Xlib", "Xresource", "Xutil", "xpm", "XShm", "xf86dga"); +@dolist = ("Xlib", "Xresource", "Xutil", "xpm", "XShm", "xf86dga", "xf86vmode"); # First read list of wanted function names. @@ -60,6 +60,12 @@ foreach $name (@dolist) { if($name eq "XShm") { $extensions_dir = "extensions/"; } + if($name eq "xf86vmode") { + $x11_incl = "#include \n"; + $extensions_dir = "extensions/"; + $pre_file = "#include \"config.h\"\n#ifdef HAVE_LIBXXF86VM\n"; + $post_file = "#endif"; + } print OUTH <\" | gcc -L$X11_include_dir -E - | grep -v '^[ \t]*\$'|") || die "open"; diff --git a/tsx11/Makefile.in b/tsx11/Makefile.in index d4e6aa6e6e8..9db8628b08d 100644 --- a/tsx11/Makefile.in +++ b/tsx11/Makefile.in @@ -7,6 +7,7 @@ MODULE = tsx11 C_SRCS = \ ts_xf86dga.c \ + ts_xf86vmode.c \ ts_xshm.c \ ts_xlib.c \ ts_xresource.c \ diff --git a/tsx11/X11_calls b/tsx11/X11_calls index 3e75d3466f7..78fd27bbdab 100644 --- a/tsx11/X11_calls +++ b/tsx11/X11_calls @@ -179,3 +179,17 @@ XF86DGAQueryVersion XF86DGAQueryDirectVideo XF86DGAGetVideo XF86DGAGetViewPortSize +XF86VidModeQueryVersion +XF86VidModeQueryExtension +XF86VidModeGetModeLine +XF86VidModeGetAllModeLines +XF86VidModeAddModeLine +XF86VidModeDeleteModeLine +XF86VidModeModModeLine +XF86VidModeValidateModeLine +XF86VidModeSwitchMode +XF86VidModeSwitchToMode +XF86VidModeLockModeSwitch +XF86VidModeGetMonitor +XF86VidModeGetViewPort +XF86VidModeSetViewPort diff --git a/tsx11/ts_xf86vmode.c b/tsx11/ts_xf86vmode.c new file mode 100644 index 00000000000..edc1697a3fb --- /dev/null +++ b/tsx11/ts_xf86vmode.c @@ -0,0 +1,167 @@ +/* + * Thread safe wrappers around xf86vmode calls. + * This file was generated automatically by tools/make_X11wrappers + * DO NOT EDIT! + */ +#include "config.h" +#ifdef HAVE_LIBXXF86VM + +#include +#include +#include "x11drv.h" +#include "debug.h" + +Bool TSXF86VidModeQueryVersion(Display*a0,int*a1,int*a2) +{ + Bool r; + TRACE(x11, "Call XF86VidModeQueryVersion\n"); + EnterCriticalSection( &X11DRV_CritSection ); + r = XF86VidModeQueryVersion(a0,a1,a2); + LeaveCriticalSection( &X11DRV_CritSection ); + TRACE(x11, "Ret XF86VidModeQueryVersion\n"); + return r; +} + +Bool TSXF86VidModeQueryExtension(Display*a0,int*a1,int*a2) +{ + Bool r; + TRACE(x11, "Call XF86VidModeQueryExtension\n"); + EnterCriticalSection( &X11DRV_CritSection ); + r = XF86VidModeQueryExtension(a0,a2,a2); + LeaveCriticalSection( &X11DRV_CritSection ); + TRACE(x11, "Ret XF86VidModeQueryExtension\n"); + return r; +} + +Bool TSXF86VidModeGetModeLine(Display*a0,int a1,int*a2,XF86VidModeModeLine*a3) +{ + Bool r; + TRACE(x11, "Call XF86VidModeGetModeLine\n"); + EnterCriticalSection( &X11DRV_CritSection ); + r = XF86VidModeGetModeLine(a0,a1,a2,a3); + LeaveCriticalSection( &X11DRV_CritSection ); + TRACE(x11, "Ret XF86VidModeGetModeLine\n"); + return r; +} + +Bool TSXF86VidModeGetAllModeLines(Display*a0,int a1,int*a2,XF86VidModeModeInfo***a3) +{ + Bool r; + TRACE(x11, "Call XF86VidModeGetAllModeLines\n"); + EnterCriticalSection( &X11DRV_CritSection ); + r = XF86VidModeGetAllModeLines(a0,a1,a2,a3); + LeaveCriticalSection( &X11DRV_CritSection ); + TRACE(x11, "Ret XF86VidModeGetAllModeLines\n"); + return r; +} + +Bool TSXF86VidModeAddModeLine(Display*a0,int a1,XF86VidModeModeInfo*a2,XF86VidModeModeInfo*a3) +{ + Bool r; + TRACE(x11, "Call XF86VidModeAddModeLine\n"); + EnterCriticalSection( &X11DRV_CritSection ); + r = XF86VidModeAddModeLine(a0,a1,a2,a3); + LeaveCriticalSection( &X11DRV_CritSection ); + TRACE(x11, "Ret XF86VidModeAddModeLine\n"); + return r; +} + +Bool TSXF86VidModeDeleteModeLine(Display*a0,int a1,XF86VidModeModeInfo*a2) +{ + Bool r; + TRACE(x11, "Call XF86VidModeDeleteModeLine\n"); + EnterCriticalSection( &X11DRV_CritSection ); + r = XF86VidModeDeleteModeLine(a0,a1,a2); + LeaveCriticalSection( &X11DRV_CritSection ); + TRACE(x11, "Ret XF86VidModeDeleteModeLine\n"); + return r; +} + +Bool TSXF86VidModeModModeLine(Display*a0,int a1,XF86VidModeModeLine*a2) +{ + Bool r; + TRACE(x11, "Call XF86VidModeModModeLine\n"); + EnterCriticalSection( &X11DRV_CritSection ); + r = XF86VidModeModModeLine(a0,a1,a2); + LeaveCriticalSection( &X11DRV_CritSection ); + TRACE(x11, "Ret XF86VidModeModModeLine\n"); + return r; +} + +Status TSXF86VidModeValidateModeLine(Display*a0,int a1,XF86VidModeModeInfo*a2) +{ + Status r; + TRACE(x11, "Call XF86VidModeValidateModeLine\n"); + EnterCriticalSection( &X11DRV_CritSection ); + r = XF86VidModeValidateModeLine(a0,a1,a2); + LeaveCriticalSection( &X11DRV_CritSection ); + TRACE(x11, "Ret XF86VidModeValidateModeLine\n"); + return r; +} + +Bool TSXF86VidModeSwitchMode(Display*a0,int a1,int a2) +{ + Bool r; + TRACE(x11, "Call XF86VidModeSwitchMode\n"); + EnterCriticalSection( &X11DRV_CritSection ); + r = XF86VidModeSwitchMode(a0,a1,a2); + LeaveCriticalSection( &X11DRV_CritSection ); + TRACE(x11, "Ret XF86VidModeSwitchMode\n"); + return r; +} + +Bool TSXF86VidModeSwitchToMode(Display*a0,int a1,XF86VidModeModeInfo*a2) +{ + Bool r; + TRACE(x11, "Call XF86VidModeSwitchToMode\n"); + EnterCriticalSection( &X11DRV_CritSection ); + r = XF86VidModeSwitchToMode(a0,a1,a2); + LeaveCriticalSection( &X11DRV_CritSection ); + TRACE(x11, "Ret XF86VidModeSwitchToMode\n"); + return r; +} + +Bool TSXF86VidModeLockModeSwitch(Display*a0,int a1,int a2) +{ + Bool r; + TRACE(x11, "Call XF86VidModeLockModeSwitch\n"); + EnterCriticalSection( &X11DRV_CritSection ); + r = XF86VidModeLockModeSwitch(a0,a1,a2); + LeaveCriticalSection( &X11DRV_CritSection ); + TRACE(x11, "Ret XF86VidModeLockModeSwitch\n"); + return r; +} + +Bool TSXF86VidModeGetMonitor(Display*a0,int a1,XF86VidModeMonitor*a2) +{ + Bool r; + TRACE(x11, "Call XF86VidModeGetMonitor\n"); + EnterCriticalSection( &X11DRV_CritSection ); + r = XF86VidModeGetMonitor(a0,a1,a2); + LeaveCriticalSection( &X11DRV_CritSection ); + TRACE(x11, "Ret XF86VidModeGetMonitor\n"); + return r; +} + +Bool TSXF86VidModeGetViewPort(Display*a0,int a1,int*a2,int*a3) +{ + Bool r; + TRACE(x11, "Call XF86VidModeGetViewPort\n"); + EnterCriticalSection( &X11DRV_CritSection ); + r = XF86VidModeGetViewPort(a0,a1,a2,a3); + LeaveCriticalSection( &X11DRV_CritSection ); + TRACE(x11, "Ret XF86VidModeGetViewPort\n"); + return r; +} + +Bool TSXF86VidModeSetViewPort(Display*a0,int a1,int a2,int a3) +{ + Bool r; + TRACE(x11, "Call XF86VidModeSetViewPort\n"); + EnterCriticalSection( &X11DRV_CritSection ); + r = XF86VidModeSetViewPort(a0,a1,a2,a3); + LeaveCriticalSection( &X11DRV_CritSection ); + TRACE(x11, "Ret XF86VidModeSetViewPort\n"); + return r; +} +#endif -- 2.11.4.GIT