Added a new cmdline switch to disable XF86 DGA Extensions, -nodga.

This commit is contained in:
Stephen Crowley 1998-11-27 15:12:33 +00:00 committed by Alexandre Julliard
parent 4ae195a2f5
commit 8e06d90e4d
3 changed files with 12 additions and 2 deletions

View File

@ -37,6 +37,7 @@
#include "spy.h" #include "spy.h"
#include "message.h" #include "message.h"
#include "x11drv.h" #include "x11drv.h"
#include "options.h"
#ifdef HAVE_LIBXXF86DGA #ifdef HAVE_LIBXXF86DGA
#include "ts_xf86dga.h" #include "ts_xf86dga.h"
@ -89,13 +90,16 @@ DDRAW_DGA_Available()
#ifdef HAVE_LIBXXF86DGA #ifdef HAVE_LIBXXF86DGA
int evbase, evret, fd; int evbase, evret, fd;
if (Options.noDGA)
return 0;
/* You don't have to be root to use DGA extensions. Simply having access to /dev/mem will do the trick */ /* You don't have to be root to use DGA extensions. Simply having access to /dev/mem will do the trick */
/* This can be achieved by adding the user to the "kmem" group on Debian 2.x systems, don't know about */ /* This can be achieved by adding the user to the "kmem" group on Debian 2.x systems, don't know about */
/* others. --stephenc */ /* others. --stephenc */
if ((fd = open("/dev/mem", O_RDWR)) != -1) if ((fd = open("/dev/mem", O_RDWR)) != -1)
close(fd); close(fd);
return (fd != -1)&&TSXF86DGAQueryExtension(display,&evbase,&evret); return (fd != -1) && TSXF86DGAQueryExtension(display,&evbase,&evret);
#else /* defined(HAVE_LIBXXF86DGA) */ #else /* defined(HAVE_LIBXXF86DGA) */
return 0; return 0;
#endif /* defined(HAVE_LIBXXF86DGA) */ #endif /* defined(HAVE_LIBXXF86DGA) */

View File

@ -68,6 +68,7 @@ struct options
WINE_LANGUAGE language; /* Current language */ WINE_LANGUAGE language; /* Current language */
int managed; /* Managed windows */ int managed; /* Managed windows */
int perfectGraphics; /* Favor correctness over speed for graphics */ int perfectGraphics; /* Favor correctness over speed for graphics */
int noDGA; /* Disable XFree86 DGA extensions */
char * configFileName; /* Command line config file */ char * configFileName; /* Command line config file */
}; };

View File

@ -98,6 +98,7 @@ struct options Options =
#endif #endif
FALSE, /* Managed windows */ FALSE, /* Managed windows */
FALSE, /* Perfect graphics */ FALSE, /* Perfect graphics */
FALSE, /* No DGA */
NULL /* Alternate config file name */ NULL /* Alternate config file name */
}; };
@ -122,7 +123,8 @@ static XrmOptionDescRec optionsTable[] =
{ "-mode", ".mode", XrmoptionSepArg, (caddr_t)NULL }, { "-mode", ".mode", XrmoptionSepArg, (caddr_t)NULL },
{ "-managed", ".managed", XrmoptionNoArg, (caddr_t)"off"}, { "-managed", ".managed", XrmoptionNoArg, (caddr_t)"off"},
{ "-winver", ".winver", XrmoptionSepArg, (caddr_t)NULL }, { "-winver", ".winver", XrmoptionSepArg, (caddr_t)NULL },
{ "-config", ".config", XrmoptionSepArg, (caddr_t)NULL } { "-config", ".config", XrmoptionSepArg, (caddr_t)NULL },
{ "-nodga", ".nodga", XrmoptionNoArg, (caddr_t)"off"}
}; };
#define NB_OPTIONS (sizeof(optionsTable) / sizeof(optionsTable[0])) #define NB_OPTIONS (sizeof(optionsTable) / sizeof(optionsTable[0]))
@ -148,6 +150,7 @@ static XrmOptionDescRec optionsTable[] =
" -managed Allow the window manager to manage created windows\n" \ " -managed Allow the window manager to manage created windows\n" \
" -mode mode Start Wine in a particular mode (standard or enhanced)\n" \ " -mode mode Start Wine in a particular mode (standard or enhanced)\n" \
" -name name Set the application name\n" \ " -name name Set the application name\n" \
" -nodga Disable XFree86 DGA extensions\n" \
" -perfect Favor correctness over speed for graphical operations\n" \ " -perfect Favor correctness over speed for graphical operations\n" \
" -privatemap Use a private color map\n" \ " -privatemap Use a private color map\n" \
" -synchronous Turn on synchronous display mode\n" \ " -synchronous Turn on synchronous display mode\n" \
@ -871,6 +874,8 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
VERSION_ParseVersion( (char*)value.addr ); VERSION_ParseVersion( (char*)value.addr );
if (MAIN_GetResource( db, ".config", &value)) if (MAIN_GetResource( db, ".config", &value))
Options.configFileName = xstrdup((char *)value.addr); Options.configFileName = xstrdup((char *)value.addr);
if (MAIN_GetResource( db, ".nodga", &value))
Options.noDGA = TRUE;
} }