Commit 399931a2 authored by Stephen Crowley's avatar Stephen Crowley Committed by Alexandre Julliard

Added fullscreen DGA support.

parent 0e40582d
...@@ -44,7 +44,7 @@ AC_ARG_ENABLE(trace, ...@@ -44,7 +44,7 @@ AC_ARG_ENABLE(trace,
[if test "$enableval" = "no"; then TRACE_MSGS="no"; fi]) [if test "$enableval" = "no"; then TRACE_MSGS="no"; fi])
AC_ARG_WITH(ncurses, 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]) [if test "$withval" = "yes"; then LIBS="$LIBS -lncurses"; AC_DEFINE(WINE_NCURSES) fi])
AC_ARG_WITH(reentrant-x, AC_ARG_WITH(reentrant-x,
...@@ -106,6 +106,8 @@ then ...@@ -106,6 +106,8 @@ then
AC_CHECK_LIB(Xext,XShmQueryExtension,AC_DEFINE(HAVE_LIBXXSHM),,$X_LIBS -lXext -lX11) AC_CHECK_LIB(Xext,XShmQueryExtension,AC_DEFINE(HAVE_LIBXXSHM),,$X_LIBS -lXext -lX11)
dnl Check for XFree86 DGA extension 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) 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 else
XLIB="" XLIB=""
X_CFLAGS="" X_CFLAGS=""
......
...@@ -20,6 +20,15 @@ ...@@ -20,6 +20,15 @@
#include <sys/signal.h> #include <sys/signal.h>
#include <fcntl.h> #include <fcntl.h>
#include <string.h> #include <string.h>
#include <stdlib.h>
#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 "windows.h"
#include "winerror.h" #include "winerror.h"
...@@ -1958,7 +1967,7 @@ static HRESULT WINAPI DGA_IDirectDraw_SetDisplayMode( ...@@ -1958,7 +1967,7 @@ static HRESULT WINAPI DGA_IDirectDraw_SetDisplayMode(
LPDIRECTDRAW this,DWORD width,DWORD height,DWORD depth LPDIRECTDRAW this,DWORD width,DWORD height,DWORD depth
) { ) {
#ifdef HAVE_LIBXXF86DGA #ifdef HAVE_LIBXXF86DGA
int i,*depths,depcount; int i,*depths,depcount,mode_count;
TRACE(ddraw, "(%p)->(%ld,%ld,%ld)\n", this, width, height, depth); TRACE(ddraw, "(%p)->(%ld,%ld,%ld)\n", this, width, height, depth);
...@@ -1984,6 +1993,33 @@ static HRESULT WINAPI DGA_IDirectDraw_SetDisplayMode( ...@@ -1984,6 +1993,33 @@ static HRESULT WINAPI DGA_IDirectDraw_SetDisplayMode(
this->e.dga.fb_height = height; this->e.dga.fb_height = height;
_common_IDirectDraw_SetDisplayMode(this); _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;i<mode_count;i++)
{
if (all_modes[i]->hdisplay == 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. /* FIXME: this function OVERWRITES several signal handlers.
* can we save them? and restore them later? In a way that * can we save them? and restore them later? In a way that
* it works for the library too? * it works for the library too?
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
/* Define if you have the X Shm extension */ /* Define if you have the X Shm extension */
#undef HAVE_LIBXXSHM #undef HAVE_LIBXXSHM
/* Define if you have the Xxf86vm library */
#undef HAVE_LIBXXF86VM
/* Define if you have the Open Sound system. */ /* Define if you have the Open Sound system. */
#undef HAVE_OSS #undef HAVE_OSS
......
...@@ -33,6 +33,9 @@ ...@@ -33,6 +33,9 @@
/* Define if you have the X Shm extension */ /* Define if you have the X Shm extension */
#undef HAVE_LIBXXSHM #undef HAVE_LIBXXSHM
/* Define if you have the Xxf86vm library */
#undef HAVE_LIBXXF86VM
/* Define if you have the Open Sound system. */ /* Define if you have the Open Sound system. */
#undef HAVE_OSS #undef HAVE_OSS
......
/*
* Thread safe wrappers around xf86vmode calls.
* Always include this file instead of <X11/xf86vmode.h>.
* This file was generated automatically by tools/make_X11wrappers
*
* Copyright 1998 Kristian Nielsen
*/
#ifndef __WINE_TSXF86VMODE_H
#define __WINE_TSXF86VMODE_H
#include <X11/Xlib.h>
#include <X11/extensions/xf86vmode.h>
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 */
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
$X11_include_dir = "/usr/X11R6/include"; $X11_include_dir = "/usr/X11R6/include";
$outdir = "tsx11"; $outdir = "tsx11";
$wantfile = "$outdir/X11_calls"; $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. # First read list of wanted function names.
...@@ -60,6 +60,12 @@ foreach $name (@dolist) { ...@@ -60,6 +60,12 @@ foreach $name (@dolist) {
if($name eq "XShm") { if($name eq "XShm") {
$extensions_dir = "extensions/"; $extensions_dir = "extensions/";
} }
if($name eq "xf86vmode") {
$x11_incl = "#include <X11/Xlib.h>\n";
$extensions_dir = "extensions/";
$pre_file = "#include \"config.h\"\n#ifdef HAVE_LIBXXF86VM\n";
$post_file = "#endif";
}
print OUTH <<END; print OUTH <<END;
/* /*
...@@ -170,6 +176,77 @@ END ...@@ -170,6 +176,77 @@ END
"Display*a0,int a1,int a2", "Display*a0,int a1,int a2",
"a0,a1,a2" "a0,a1,a2"
); );
} elsif($name eq "xf86vmode") {
output_fn("XF86VidModeQueryVersion",Bool,
"Display*,int*,int*",
"Display*a0,int*a1,int*a2",
"a0,a1,a2"
);
output_fn("XF86VidModeQueryExtension",Bool,
"Display*,int*,int*",
"Display*a0,int*a1,int*a2",
"a0,a2,a2"
);
output_fn("XF86VidModeGetModeLine",Bool,
"Display*,int,int*,XF86VidModeModeLine*",
"Display*a0,int a1,int*a2,XF86VidModeModeLine*a3",
"a0,a1,a2,a3"
);
output_fn("XF86VidModeGetAllModeLines",Bool,
"Display*,int,int*,XF86VidModeModeInfo***",
"Display*a0,int a1,int*a2,XF86VidModeModeInfo***a3",
"a0,a1,a2,a3"
);
output_fn("XF86VidModeAddModeLine",Bool,
"Display*,int,XF86VidModeModeInfo*,XF86VidModeModeInfo*",
"Display*a0,int a1,XF86VidModeModeInfo*a2,XF86VidModeModeInfo*a3",
"a0,a1,a2,a3"
);
output_fn("XF86VidModeDeleteModeLine",Bool,
"Display*,int,XF86VidModeModeInfo*",
"Display*a0,int a1,XF86VidModeModeInfo*a2",
"a0,a1,a2"
);
output_fn("XF86VidModeModModeLine",Bool,
"Display*,int,XF86VidModeModeLine*",
"Display*a0,int a1,XF86VidModeModeLine*a2",
"a0,a1,a2"
);
output_fn("XF86VidModeValidateModeLine",Status,
"Display*,int,XF86VidModeModeInfo*",
"Display*a0,int a1,XF86VidModeModeInfo*a2",
"a0,a1,a2"
);
output_fn("XF86VidModeSwitchMode",Bool,
"Display*,int,int",
"Display*a0,int a1,int a2",
"a0,a1,a2"
);
output_fn("XF86VidModeSwitchToMode",Bool,
"Display*,int,XF86VidModeModeInfo*",
"Display*a0,int a1,XF86VidModeModeInfo*a2",
"a0,a1,a2"
);
output_fn("XF86VidModeLockModeSwitch",Bool,
"Display*,int,int",
"Display*a0,int a1,int a2",
"a0,a1,a2"
);
output_fn("XF86VidModeGetMonitor",Bool,
"Display*,int,XF86VidModeMonitor*",
"Display*a0,int a1,XF86VidModeMonitor*a2",
"a0,a1,a2"
);
output_fn("XF86VidModeGetViewPort",Bool,
"Display*,int,int*,int*",
"Display*a0,int a1,int*a2,int*a3",
"a0,a1,a2,a3"
);
output_fn("XF86VidModeSetViewPort",Bool,
"Display*,int,int,int",
"Display*a0,int a1,int a2,int a3",
"a0,a1,a2,a3"
);
} else { } else {
open(IN, "echo \"$x11_incl#include <X11/$extensions_dir$name.h>\" | gcc -L$X11_include_dir -E - | grep -v '^[ \t]*\$'|") || die "open"; open(IN, "echo \"$x11_incl#include <X11/$extensions_dir$name.h>\" | gcc -L$X11_include_dir -E - | grep -v '^[ \t]*\$'|") || die "open";
......
...@@ -7,6 +7,7 @@ MODULE = tsx11 ...@@ -7,6 +7,7 @@ MODULE = tsx11
C_SRCS = \ C_SRCS = \
ts_xf86dga.c \ ts_xf86dga.c \
ts_xf86vmode.c \
ts_xshm.c \ ts_xshm.c \
ts_xlib.c \ ts_xlib.c \
ts_xresource.c \ ts_xresource.c \
......
...@@ -179,3 +179,17 @@ XF86DGAQueryVersion ...@@ -179,3 +179,17 @@ XF86DGAQueryVersion
XF86DGAQueryDirectVideo XF86DGAQueryDirectVideo
XF86DGAGetVideo XF86DGAGetVideo
XF86DGAGetViewPortSize XF86DGAGetViewPortSize
XF86VidModeQueryVersion
XF86VidModeQueryExtension
XF86VidModeGetModeLine
XF86VidModeGetAllModeLines
XF86VidModeAddModeLine
XF86VidModeDeleteModeLine
XF86VidModeModModeLine
XF86VidModeValidateModeLine
XF86VidModeSwitchMode
XF86VidModeSwitchToMode
XF86VidModeLockModeSwitch
XF86VidModeGetMonitor
XF86VidModeGetViewPort
XF86VidModeSetViewPort
/*
* 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 <X11/Xlib.h>
#include <X11/extensions/xf86vmode.h>
#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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment