From 8e06d90e4d38f1a9eac24ef605f446f076a020be Mon Sep 17 00:00:00 2001 From: Stephen Crowley Date: Fri, 27 Nov 1998 15:12:33 +0000 Subject: [PATCH] Added a new cmdline switch to disable XF86 DGA Extensions, -nodga. --- graphics/ddraw.c | 6 +++++- include/options.h | 1 + misc/main.c | 7 ++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/graphics/ddraw.c b/graphics/ddraw.c index bd5ecf2e2d7..3a9d787184f 100644 --- a/graphics/ddraw.c +++ b/graphics/ddraw.c @@ -37,6 +37,7 @@ #include "spy.h" #include "message.h" #include "x11drv.h" +#include "options.h" #ifdef HAVE_LIBXXF86DGA #include "ts_xf86dga.h" @@ -89,13 +90,16 @@ DDRAW_DGA_Available() #ifdef HAVE_LIBXXF86DGA 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 */ /* This can be achieved by adding the user to the "kmem" group on Debian 2.x systems, don't know about */ /* others. --stephenc */ if ((fd = open("/dev/mem", O_RDWR)) != -1) close(fd); - return (fd != -1)&&TSXF86DGAQueryExtension(display,&evbase,&evret); + return (fd != -1) && TSXF86DGAQueryExtension(display,&evbase,&evret); #else /* defined(HAVE_LIBXXF86DGA) */ return 0; #endif /* defined(HAVE_LIBXXF86DGA) */ diff --git a/include/options.h b/include/options.h index ec09f0262fa..2d2f718e436 100644 --- a/include/options.h +++ b/include/options.h @@ -68,6 +68,7 @@ struct options WINE_LANGUAGE language; /* Current language */ int managed; /* Managed windows */ int perfectGraphics; /* Favor correctness over speed for graphics */ + int noDGA; /* Disable XFree86 DGA extensions */ char * configFileName; /* Command line config file */ }; diff --git a/misc/main.c b/misc/main.c index 3905e9dbb16..6b534cb771c 100644 --- a/misc/main.c +++ b/misc/main.c @@ -98,6 +98,7 @@ struct options Options = #endif FALSE, /* Managed windows */ FALSE, /* Perfect graphics */ + FALSE, /* No DGA */ NULL /* Alternate config file name */ }; @@ -122,7 +123,8 @@ static XrmOptionDescRec optionsTable[] = { "-mode", ".mode", XrmoptionSepArg, (caddr_t)NULL }, { "-managed", ".managed", XrmoptionNoArg, (caddr_t)"off"}, { "-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])) @@ -148,6 +150,7 @@ static XrmOptionDescRec optionsTable[] = " -managed Allow the window manager to manage created windows\n" \ " -mode mode Start Wine in a particular mode (standard or enhanced)\n" \ " -name name Set the application name\n" \ + " -nodga Disable XFree86 DGA extensions\n" \ " -perfect Favor correctness over speed for graphical operations\n" \ " -privatemap Use a private color map\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 ); if (MAIN_GetResource( db, ".config", &value)) Options.configFileName = xstrdup((char *)value.addr); + if (MAIN_GetResource( db, ".nodga", &value)) + Options.noDGA = TRUE; }