.gitignore | 3 configure.ac | 2 src/glide_driver.c | 1475 ++++++++++++++++++++++++++--------------------------- 3 files changed, 728 insertions(+), 752 deletions(-)
New commits: commit 44047d72706c1a9ac80cff7714241c1934437c6f Author: Guillem Jover <guil...@hadrons.org> Date: Thu Sep 19 06:46:23 2013 +0200 Bump to 1.2.2 Signed-off-by: Guillem Jover <guil...@hadrons.org> diff --git a/configure.ac b/configure.ac index cf5f896..a1b35ae 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ AC_PREREQ([2.60]) AC_INIT([xf86-video-glide], - [1.2.1], + [1.2.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xf86-video-glide]) commit 6af93046dabc8ef63bbabd266841cb34d5eb174a Author: Guillem Jover <guil...@hadrons.org> Date: Wed Sep 18 19:50:54 2013 +0200 Add compile, *.tar.bz2 and *.tar.gz to .gitignore Signed-off-by: Guillem Jover <guil...@hadrons.org> diff --git a/.gitignore b/.gitignore index d90176e..5ffeddb 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ Makefile.in *.lo aclocal.m4 autom4te.cache +compile config.guess config.h config.h.in @@ -19,3 +20,5 @@ ltmain.sh missing stamp-h1 *~ +*.tar.bz2 +*.tar.gz commit 00bd4faaf963806f7b322e90fd33b57834a6dbe1 Author: Guillem Jover <guil...@hadrons.org> Date: Wed Sep 18 19:43:19 2013 +0200 Move miSetVisualTypes() call outside an if conditional The function call is a bit long, take it out of the conditional and use a ret variable instead. Signed-off-by: Guillem Jover <guil...@hadrons.org> diff --git a/src/glide_driver.c b/src/glide_driver.c index 897bebf..a37589f 100644 --- a/src/glide_driver.c +++ b/src/glide_driver.c @@ -606,9 +606,10 @@ GLIDEScreenInit(SCREEN_INIT_ARGS_DECL) miClearVisualTypes(); /* Setup the visuals we support. Only TrueColor. */ - if (!miSetVisualTypes(pScrn->depth, - miGetDefaultVisualMask(pScrn->depth), - pScrn->rgbBits, pScrn->defaultVisual)) + ret = miSetVisualTypes(pScrn->depth, + miGetDefaultVisualMask(pScrn->depth), + pScrn->rgbBits, pScrn->defaultVisual); + if (!ret) return FALSE; miSetPixmapDepths(); commit 9ff6c53d427c785898ccf34f7e322be0c8d0c2c3 Author: Guillem Jover <guil...@hadrons.org> Date: Wed Sep 18 19:36:00 2013 +0200 Do not assign to variables inside if conditionals Signed-off-by: Guillem Jover <guil...@hadrons.org> diff --git a/src/glide_driver.c b/src/glide_driver.c index be1f079..897bebf 100644 --- a/src/glide_driver.c +++ b/src/glide_driver.c @@ -297,7 +297,8 @@ GLIDEProbe(DriverPtr drv, int flags) ScrnInfoPtr pScrn; int GlideDevice; - if ((numdevList = xf86MatchDevice(GLIDE_DRIVER_NAME, &devList)) <= 0) + numdevList = xf86MatchDevice(GLIDE_DRIVER_NAME, &devList); + if (numdevList <= 0) return FALSE; num_sst = glide_get_num_boards(); @@ -322,7 +323,8 @@ GLIDEProbe(DriverPtr drv, int flags) pScrn = NULL; /* Allocate a ScrnInfoRec and claim the slot */ - if ((pScrn = xf86AllocateScreen(drv, 0))) { + pScrn = xf86AllocateScreen(drv, 0); + if (pScrn) { GLIDEPtr pGlide; xf86AddEntityToScreen(pScrn, entityIndex); commit 6250d5c052768b706dd897e5db399fa9ee4c2c1e Author: Guillem Jover <guil...@hadrons.org> Date: Wed Sep 18 19:30:48 2013 +0200 Unify return value variable name to ret Use that instead of r or i, which is way more clear. Signed-off-by: Guillem Jover <guil...@hadrons.org> diff --git a/src/glide_driver.c b/src/glide_driver.c index 2e340a6..be1f079 100644 --- a/src/glide_driver.c +++ b/src/glide_driver.c @@ -257,10 +257,10 @@ static int glide_get_num_boards(void) { FxI32 num_sst; - int r; + int ret; - r = grGet(GR_NUM_BOARDS, sizeof(num_sst), &num_sst); - if (!r) { + ret = grGet(GR_NUM_BOARDS, sizeof(num_sst), &num_sst); + if (!ret) { xf86Msg(X_ERROR, "GLIDEProbe(): Error calling grGet(GR_NUM_BOARDS)!\n"); return -1; @@ -273,10 +273,10 @@ static int glide_get_num_boards(void) { GrHwConfiguration hw; - int r; + int ret; - r = grSstQueryBoards(&hw); - if (!r) { + ret = grSstQueryBoards(&hw); + if (!ret) { xf86Msg(X_ERROR, "GLIDEProbe(): Error calling grSstQueryBoards!\n"); return -1; } @@ -372,7 +372,7 @@ GLIDEPreInit(ScrnInfoPtr pScrn, int flags) { GLIDEPtr pGlide; MessageType from; - int i; + int ret; ClockRangePtr clockRanges; if (flags & PROBE_DETECT) @@ -495,16 +495,14 @@ GLIDEPreInit(ScrnInfoPtr pScrn, int flags) clockRanges->doubleScanAllowed = TRUE; /* Select valid modes from those available */ - i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, - pScrn->display->modes, clockRanges, - NULL, 256, 2048, - pScrn->bitsPerPixel, 128, 2048, - pScrn->display->virtualX, - pScrn->display->virtualY, - pScrn->videoRam * 1024, - LOOKUP_BEST_REFRESH); - - if (i == -1) { + ret = xf86ValidateModes(pScrn, pScrn->monitor->Modes, + pScrn->display->modes, clockRanges, + NULL, 256, 2048, + pScrn->bitsPerPixel, 128, 2048, + pScrn->display->virtualX, + pScrn->display->virtualY, + pScrn->videoRam * 1024, LOOKUP_BEST_REFRESH); + if (ret == -1) { GLIDEFreeRec(pScrn); return FALSE; } @@ -513,7 +511,7 @@ GLIDEPreInit(ScrnInfoPtr pScrn, int flags) xf86PruneDriverModes(pScrn); /* If no valid modes, return */ - if (i == 0 || pScrn->modes == NULL) { + if (ret == 0 || pScrn->modes == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n"); GLIDEFreeRec(pScrn); return FALSE; @@ -774,7 +772,7 @@ static Bool GLIDEModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) { GLIDEPtr pGlide; - int r; + int ret; int width, height; double refresh; Bool match = FALSE; @@ -850,16 +848,12 @@ GLIDEModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) grGlideInit(); grSstSelect(pGlide->SST_Index); - r = grSstWinOpen(0, - pGlide->grResolution, - pGlide->grRefreshRate, - GR_COLORFORMAT_ARGB, - GR_ORIGIN_UPPER_LEFT, - 2, 0); - if (!r) { + ret = grSstWinOpen(0, pGlide->grResolution, pGlide->grRefreshRate, + GR_COLORFORMAT_ARGB, GR_ORIGIN_UPPER_LEFT, 2, 0); + if (!ret) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "grSstWinOpen returned %d. " "You are probably trying to use a resolution that is not " - "supported by your hardware.", r); + "supported by your hardware.", ret); return FALSE; } commit 45a85c82c66b2435606bf0cb712f5b18f5094404 Author: Guillem Jover <guil...@hadrons.org> Date: Wed Sep 18 19:49:31 2013 +0200 Remove unused bool typedef We are already using the X Bool type. Signed-off-by: Guillem Jover <guil...@hadrons.org> diff --git a/src/glide_driver.c b/src/glide_driver.c index b304d00..2e340a6 100644 --- a/src/glide_driver.c +++ b/src/glide_driver.c @@ -82,7 +82,6 @@ typedef signed short int s16; typedef unsigned short int u16; typedef signed long int s32; typedef unsigned long int u32; -typedef u8 bool; /* Card-specific driver information */ commit fa72126d3736f557becea8f5707e639be1d6f6f4 Author: Guillem Jover <guil...@hadrons.org> Date: Wed Sep 18 19:38:30 2013 +0200 Remove dead loader code The function LoaderCheckUnresolved() was removed from the X server in 2009, and had been a stub since 2006. Signed-off-by: Guillem Jover <guil...@hadrons.org> diff --git a/src/glide_driver.c b/src/glide_driver.c index faba80c..b304d00 100644 --- a/src/glide_driver.c +++ b/src/glide_driver.c @@ -671,11 +671,6 @@ GLIDEScreenInit(SCREEN_INIT_ARGS_DECL) if (serverGeneration == 1) xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); -#if 0 - LoaderCheckUnresolved(LD_RESOLV_NOW); - return FALSE; -#endif - /* Done */ return TRUE; } commit 601d6af9fcefa69d7a76c6f968a153bac6f33c61 Author: Guillem Jover <guil...@hadrons.org> Date: Wed Sep 18 19:22:48 2013 +0200 Remove unreachable error check code branch There's no framebuffer locking funcion being called, and the last value assigned to r is from grSstWinOpen(), so there has already been an error check, and doing it later on will never trigger again. Just remove the error check and error call. Signed-off-by: Guillem Jover <guil...@hadrons.org> diff --git a/src/glide_driver.c b/src/glide_driver.c index 909f91e..faba80c 100644 --- a/src/glide_driver.c +++ b/src/glide_driver.c @@ -873,12 +873,6 @@ GLIDEModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) grClipWindow(0, 0, 1024, 768); grBufferClear(0, 0, GR_ZDEPTHVALUE_FARTHEST); - if (!r) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Could not lock glide frame buffer\n"); - return FALSE; - } - pGlide->Blanked = FALSE; pGlide->GlideInitiated = TRUE; commit da1797b6cc582f1fe31697aa744731f0f9fb6f74 Author: Guillem Jover <guil...@hadrons.org> Date: Wed Sep 18 05:10:33 2013 +0200 Fix coding style Run x-indent.sh from the modules repository over the driver code base, and manually fix the fall out. Signed-off-by: Guillem Jover <guil...@hadrons.org> diff --git a/src/glide_driver.c b/src/glide_driver.c index 5ac5b11..909f91e 100644 --- a/src/glide_driver.c +++ b/src/glide_driver.c @@ -1,48 +1,47 @@ /* - XFree86 driver for Glide(tm). (Mainly for Voodoo 1 and 2 cards) - - Since Voodoo 1 and Voodoo 2 cards are very, very NOT made for - running a 2D windowing system, this driver is a little - special. Basically, we have a virtual framebuffer in RAM (the - Shadow Framebuffer) and we copy selected regions of this to the - voodoo card at appropriate times. We get no hardware acceleration - help (there isn't any for 2D on these cards), but since the - framebuffer is in cached RAM, we get a useable display - anyway. Also, we don't have any interaction with any hardware since - Glide is the layer beneath the driver. - - Author: - Henrik Harmsen (h...@cd.chalmers.se or henrik.harm...@erv.ericsson.se) - - HISTORY - 1999-04-05 - - First release for 3.9Pi - - 1999-04-17 - - Soft link to libglide2x.so instead of addition to ModulePath - - Changed "EXTERN_MODULE" to EXTERN_MODULE - - Uses the "GlideDevice" option instead of the "BusID" line to select - which voodoo board to use. - - Manpage updates - - 1999-06-25 - - Modify glideSetup to not register the driver when libglide2x.so cannot - be loaded, and to return appropriate error codes when it fails. - - Prevent GLIDEFreeScreen() from crashing if called early. - - 1999-08-22 - - Minor fixes. - - 1999-11-22 - - Minor change in GLIDE_FIND_FUNC by Loïc Grenié, gre...@math.jussieu.fr. - - TODO - * Support for adjusting gamma correction. - * Support for setting gamma individually for R,G,B when Glide 3 arrives - for Linux. This will allow me to get rid of that sick green tint my - voodoo2 board produces... - * Support static loading. -*/ + * XFree86 driver for Glide(tm). (Mainly for Voodoo 1 and 2 cards) + * + * Since Voodoo 1 and Voodoo 2 cards are very, very NOT made for running a + * 2D windowing system, this driver is a little special. Basically, we have + * a virtual framebuffer in RAM (the Shadow Framebuffer) and we copy selected + * regions of this to the voodoo card at appropriate times. We get no hardware + * acceleration help (there isn't any for 2D on these cards), but since the + * framebuffer is in cached RAM, we get a useable display anyway. Also, we + * don't have any interaction with any hardware since Glide is the layer + * beneath the driver. + * + * Author: + * Henrik Harmsen (h...@cd.chalmers.se or henrik.harm...@erv.ericsson.se) + * + * HISTORY + * 1999-04-05 + * - First release for 3.9Pi + * + * 1999-04-17 + * - Soft link to libglide2x.so instead of addition to ModulePath + * - Changed "EXTERN_MODULE" to EXTERN_MODULE + * - Uses the "GlideDevice" option instead of the "BusID" line to select + * which voodoo board to use. + * - Manpage updates + * + * 1999-06-25 + * - Modify glideSetup to not register the driver when libglide2x.so + * cannot be loaded, and to return appropriate error codes when it fails. + * - Prevent GLIDEFreeScreen() from crashing if called early. + * + * 1999-08-22 + * - Minor fixes. + * + * 1999-11-22 + * - Minor change in GLIDE_FIND_FUNC by Loïc Grenié, gre...@math.jussieu.fr. + * + * TODO + * - Support for adjusting gamma correction. + * - Support for setting gamma individually for R,G,B when Glide 3 arrives + * for Linux. This will allow me to get rid of that sick green tint my + * voodoo2 board produces... + * - Support static loading. + */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -77,51 +76,50 @@ #define TRUE 1 #define FALSE 0 -typedef signed char s8; -typedef unsigned char u8; -typedef signed short int s16; +typedef signed char s8; +typedef unsigned char u8; +typedef signed short int s16; typedef unsigned short int u16; -typedef signed long int s32; -typedef unsigned long int u32; -typedef u8 bool; +typedef signed long int s32; +typedef unsigned long int u32; +typedef u8 bool; /* Card-specific driver information */ #define GLIDEPTR(p) ((GLIDEPtr)((p)->driverPrivate)) typedef struct { - u8* ShadowPtr; - u32 ShadowPitch; - u32 SST_Index; - CloseScreenProcPtr CloseScreen; - Bool Blanked; - u32 grRefreshRate; - u32 grResolution; - Bool OnAtExit; - Bool GlideInitiated; - EntityInfoPtr pEnt; - OptionInfoPtr Options; + u8 *ShadowPtr; + u32 ShadowPitch; + u32 SST_Index; + CloseScreenProcPtr CloseScreen; + Bool Blanked; + u32 grRefreshRate; + u32 grResolution; + Bool OnAtExit; + Bool GlideInitiated; + EntityInfoPtr pEnt; + OptionInfoPtr Options; } GLIDERec, *GLIDEPtr; -static const OptionInfoRec * GLIDEAvailableOptions(int chipid, int busid); -static void GLIDEIdentify(int flags); -static Bool GLIDEProbe(DriverPtr drv, int flags); -static Bool GLIDEPreInit(ScrnInfoPtr pScrn, int flags); -static Bool GLIDEScreenInit(SCREEN_INIT_ARGS_DECL); -static Bool GLIDEEnterVT(VT_FUNC_ARGS_DECL); -static void GLIDELeaveVT(VT_FUNC_ARGS_DECL); -static Bool GLIDECloseScreen(CLOSE_SCREEN_ARGS_DECL); -static Bool GLIDESaveScreen(ScreenPtr pScreen, int mode); -static void GLIDEFreeScreen(FREE_SCREEN_ARGS_DECL); -static void GLIDERefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox); -static Bool GLIDEModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); -static void GLIDERestore(ScrnInfoPtr pScrn, Bool Closing); -static void GLIDERefreshAll(ScrnInfoPtr pScrn); - -static void GLIDEDisplayPowerManagementSet(ScrnInfoPtr pScrn, - int PowerManagementMode, - int flags); - +static const OptionInfoRec *GLIDEAvailableOptions(int chipid, int busid); +static void GLIDEIdentify(int flags); +static Bool GLIDEProbe(DriverPtr drv, int flags); +static Bool GLIDEPreInit(ScrnInfoPtr pScrn, int flags); +static Bool GLIDEScreenInit(SCREEN_INIT_ARGS_DECL); +static Bool GLIDEEnterVT(VT_FUNC_ARGS_DECL); +static void GLIDELeaveVT(VT_FUNC_ARGS_DECL); +static Bool GLIDECloseScreen(CLOSE_SCREEN_ARGS_DECL); +static Bool GLIDESaveScreen(ScreenPtr pScreen, int mode); +static void GLIDEFreeScreen(FREE_SCREEN_ARGS_DECL); +static void GLIDERefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox); +static Bool GLIDEModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); +static void GLIDERestore(ScrnInfoPtr pScrn, Bool Closing); +static void GLIDERefreshAll(ScrnInfoPtr pScrn); + +static void GLIDEDisplayPowerManagementSet(ScrnInfoPtr pScrn, + int PowerManagementMode, + int flags); #define GLIDE_VERSION 4000 #define GLIDE_NAME "GLIDE" @@ -137,154 +135,154 @@ static void GLIDEDisplayPowerManagementSet(ScrnInfoPtr pScrn, * reference to this is compiled in, and this requires that the name of * this DriverRec be an upper-case version of the driver name. */ - _X_EXPORT DriverRec GLIDE = { - GLIDE_VERSION, - GLIDE_DRIVER_NAME, - GLIDEIdentify, - GLIDEProbe, - GLIDEAvailableOptions, - NULL, - 0 + GLIDE_VERSION, + GLIDE_DRIVER_NAME, + GLIDEIdentify, + GLIDEProbe, + GLIDEAvailableOptions, + NULL, + 0 }; typedef enum { - OPTION_ON_AT_EXIT, - OPTION_GLIDEDEVICE + OPTION_ON_AT_EXIT, + OPTION_GLIDEDEVICE } GLIDEOpts; static const OptionInfoRec GLIDEOptions[] = { - { OPTION_ON_AT_EXIT, "OnAtExit", OPTV_BOOLEAN, {0}, FALSE }, - { OPTION_GLIDEDEVICE, "GlideDevice", OPTV_INTEGER, {0}, FALSE }, - { -1, NULL, OPTV_NONE, {0}, FALSE } + { OPTION_ON_AT_EXIT, "OnAtExit", OPTV_BOOLEAN, { 0 }, FALSE }, + { OPTION_GLIDEDEVICE, "GlideDevice", OPTV_INTEGER, { 0 }, FALSE }, + { -1, NULL, OPTV_NONE, { 0 }, FALSE } }; /* Supported chipsets */ static SymTabRec GLIDEChipsets[] = { - { 0, "Voodoo" }, - {-1, NULL } + { 0, "Voodoo" }, + { -1, NULL } }; - #ifdef XFree86LOADER static MODULESETUPPROTO(glideSetup); -static XF86ModuleVersionInfo glideVersRec = -{ - "glide", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - GLIDE_MAJOR_VERSION, GLIDE_MINOR_VERSION, GLIDE_PATCHLEVEL, - ABI_CLASS_VIDEODRV, /* This is a video driver */ - ABI_VIDEODRV_VERSION, - MOD_CLASS_VIDEODRV, - {0,0,0,0} +static XF86ModuleVersionInfo glideVersRec = { + "glide", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XORG_VERSION_CURRENT, + GLIDE_MAJOR_VERSION, GLIDE_MINOR_VERSION, GLIDE_PATCHLEVEL, + ABI_CLASS_VIDEODRV, /* This is a video driver */ + ABI_VIDEODRV_VERSION, + MOD_CLASS_VIDEODRV, + { 0, 0, 0, 0 } }; -_X_EXPORT XF86ModuleData glideModuleData = { &glideVersRec, glideSetup, NULL }; +_X_EXPORT XF86ModuleData glideModuleData = { + &glideVersRec, + glideSetup, + NULL +}; static pointer glideSetup(pointer module, pointer opts, int *errmaj, int *errmin) { - static Bool setupDone = FALSE; - int errmaj2 = 0, errmin2 = 0; - - if (!setupDone) - { - setupDone = TRUE; - /* This module should be loaded only once */ - *errmaj = LDR_ONCEONLY; - xf86AddDriver(&GLIDE, module, 0); - - /* - * The return value must be non-NULL on success even though there - * is no TearDownProc. - */ - return (pointer)1; - } - else - { - if (errmaj) - *errmaj = LDR_ONCEONLY; - return NULL; - } + static Bool setupDone = FALSE; + int errmaj2 = 0, errmin2 = 0; + + if (!setupDone) { + setupDone = TRUE; + /* This module should be loaded only once */ + *errmaj = LDR_ONCEONLY; + xf86AddDriver(&GLIDE, module, 0); + + /* + * The return value must be non-NULL on success even though there + * is no TearDownProc. + */ + return (pointer)1; + } + else { + if (errmaj) + *errmaj = LDR_ONCEONLY; + return NULL; + } } -#endif /* XFree86LOADER */ +#endif /* XFree86LOADER */ static Bool GLIDEGetRec(ScrnInfoPtr pScrn) { - /* - * Allocate an GLIDERec, and hook it into pScrn->driverPrivate. - * pScrn->driverPrivate is initialised to NULL, so we can check if - * the allocation has already been done. + /* + * Allocate an GLIDERec, and hook it into pScrn->driverPrivate. + * pScrn->driverPrivate is initialised to NULL, so we can check if + * the allocation has already been done. */ - if (pScrn->driverPrivate != NULL) - return TRUE; + if (pScrn->driverPrivate != NULL) + return TRUE; - pScrn->driverPrivate = xnfcalloc(sizeof(GLIDERec), 1); + pScrn->driverPrivate = xnfcalloc(sizeof(GLIDERec), 1); - /* Initialize it */ - /* No init here yet */ - return TRUE; + /* Initialize it */ + /* No init here yet */ + + return TRUE; } static void GLIDEFreeRec(ScrnInfoPtr pScrn) { - if (pScrn->driverPrivate == NULL) - return; - free(pScrn->driverPrivate); - pScrn->driverPrivate = NULL; + if (pScrn->driverPrivate == NULL) + return; + free(pScrn->driverPrivate); + pScrn->driverPrivate = NULL; } static const OptionInfoRec * GLIDEAvailableOptions(int chipid, int busid) { - return GLIDEOptions; + return GLIDEOptions; } /* Mandatory */ static void GLIDEIdentify(int flags) { - xf86PrintChipsets(GLIDE_NAME, "driver for Glide devices (Voodoo cards)", GLIDEChipsets); + xf86PrintChipsets(GLIDE_NAME, "driver for Glide devices (Voodoo cards)", + GLIDEChipsets); } #if defined(GLIDE3) static int glide_get_num_boards(void) { - FxI32 num_sst; - int r; - - r = grGet(GR_NUM_BOARDS, sizeof(num_sst), &num_sst); - if (!r) - { - xf86Msg(X_ERROR, "GLIDEProbe(): Error calling grGet(GR_NUM_BOARDS)!\n"); - return -1; - } + FxI32 num_sst; + int r; + + r = grGet(GR_NUM_BOARDS, sizeof(num_sst), &num_sst); + if (!r) { + xf86Msg(X_ERROR, + "GLIDEProbe(): Error calling grGet(GR_NUM_BOARDS)!\n"); + return -1; + } - return num_sst; + return num_sst; } #else static int glide_get_num_boards(void) { - GrHwConfiguration hw; - int r; + GrHwConfiguration hw; + int r; - r = grSstQueryBoards(&hw); - if (!r) - { - xf86Msg(X_ERROR, "GLIDEProbe(): Error calling grSstQueryBoards!\n"); - return -1; - } + r = grSstQueryBoards(&hw); + if (!r) { + xf86Msg(X_ERROR, "GLIDEProbe(): Error calling grSstQueryBoards!\n"); + return -1; + } - return hw.num_sst; + return hw.num_sst; } #endif @@ -292,387 +290,394 @@ glide_get_num_boards(void) static Bool GLIDEProbe(DriverPtr drv, int flags) { - int i, num_sst, sst; - GDevPtr *devList; - GDevPtr dev = NULL; - int numdevList; - Bool foundScreen = FALSE; - ScrnInfoPtr pScrn; - int GlideDevice; - - if ((numdevList = xf86MatchDevice(GLIDE_DRIVER_NAME, &devList)) <= 0) - return FALSE; - - num_sst = glide_get_num_boards(); - if (num_sst < 0) - goto cleanup; - - /* num_sst: number of Glide boards available */ - if (num_sst > 0 && (flags & PROBE_DETECT)) { - /* XXX Need to call xf886AddDeviceToConfigure() here */ - return TRUE; - } + int i, num_sst, sst; + GDevPtr *devList; + GDevPtr dev = NULL; + int numdevList; + Bool foundScreen = FALSE; + ScrnInfoPtr pScrn; + int GlideDevice; + + if ((numdevList = xf86MatchDevice(GLIDE_DRIVER_NAME, &devList)) <= 0) + return FALSE; + + num_sst = glide_get_num_boards(); + if (num_sst < 0) + goto cleanup; + + /* num_sst: number of Glide boards available */ + if (num_sst > 0 && (flags & PROBE_DETECT)) { + /* XXX Need to call xf886AddDeviceToConfigure() here */ + return TRUE; + } - for (sst = 0; sst < num_sst; sst++) - { - for (i = 0; i < numdevList; i++) - { - dev = devList[i]; - GlideDevice = xf86SetIntOption(dev->options, "GlideDevice", 0); - if (GlideDevice == sst) - { - int entityIndex; - /* Match */ - entityIndex = xf86ClaimNoSlot(drv, 0, dev, TRUE); - pScrn = NULL; - - /* Allocate a ScrnInfoRec and claim the slot */ - if ((pScrn = xf86AllocateScreen(drv, 0))) { - GLIDEPtr pGlide; - - xf86AddEntityToScreen(pScrn, entityIndex); - - /* I'm not going to "claim" the glide device since no other driver than this can drive it */ - /* (A glide device is not a PCI device) */ - /* XXX Need to see how this fits in with the new RAC */ - - /* Fill in what we can of the ScrnInfoRec */ - pScrn->driverVersion = GLIDE_VERSION; - pScrn->driverName = GLIDE_DRIVER_NAME; - pScrn->name = GLIDE_NAME; - pScrn->Probe = GLIDEProbe; - pScrn->PreInit = GLIDEPreInit; - pScrn->ScreenInit = GLIDEScreenInit; - pScrn->EnterVT = GLIDEEnterVT; - pScrn->LeaveVT = GLIDELeaveVT; - pScrn->FreeScreen = GLIDEFreeScreen; - - /* Allocate the GLIDERec driverPrivate */ - if (!GLIDEGetRec(pScrn)) - break; - - pGlide = GLIDEPTR(pScrn); - pGlide->SST_Index = sst; - - /* - * XXX This is a hack because don't have the PCI info. Set it as - * an ISA entity with no resources. - */ - foundScreen = TRUE; - } - break; - } + for (sst = 0; sst < num_sst; sst++) { + for (i = 0; i < numdevList; i++) { + dev = devList[i]; + GlideDevice = xf86SetIntOption(dev->options, "GlideDevice", 0); + if (GlideDevice == sst) { + int entityIndex; + + /* Match */ + entityIndex = xf86ClaimNoSlot(drv, 0, dev, TRUE); + pScrn = NULL; + + /* Allocate a ScrnInfoRec and claim the slot */ + if ((pScrn = xf86AllocateScreen(drv, 0))) { + GLIDEPtr pGlide; + + xf86AddEntityToScreen(pScrn, entityIndex); + + /* I'm not going to "claim" the glide device since no + * other driver than this can drive it */ + /* (A glide device is not a PCI device) */ + /* XXX Need to see how this fits in with the new RAC */ + + /* Fill in what we can of the ScrnInfoRec */ + pScrn->driverVersion = GLIDE_VERSION; + pScrn->driverName = GLIDE_DRIVER_NAME; + pScrn->name = GLIDE_NAME; + pScrn->Probe = GLIDEProbe; + pScrn->PreInit = GLIDEPreInit; + pScrn->ScreenInit = GLIDEScreenInit; + pScrn->EnterVT = GLIDEEnterVT; + pScrn->LeaveVT = GLIDELeaveVT; + pScrn->FreeScreen = GLIDEFreeScreen; + + /* Allocate the GLIDERec driverPrivate */ + if (!GLIDEGetRec(pScrn)) + break; + + pGlide = GLIDEPTR(pScrn); + pGlide->SST_Index = sst; + + /* + * XXX This is a hack because don't have the PCI info. + * Set it as an ISA entity with no resources. + */ + foundScreen = TRUE; + } + break; + } + } } - } - cleanup: - free(devList); - return foundScreen; +cleanup: + free(devList); + return foundScreen; } /* Mandatory */ static Bool GLIDEPreInit(ScrnInfoPtr pScrn, int flags) { - GLIDEPtr pGlide; - MessageType from; - int i; - ClockRangePtr clockRanges; + GLIDEPtr pGlide; + MessageType from; + int i; + ClockRangePtr clockRanges; - if (flags & PROBE_DETECT) return FALSE; + if (flags & PROBE_DETECT) + return FALSE; - /* Check the number of entities, and fail if it isn't one. */ - if (pScrn->numEntities != 1) - return FALSE; + /* Check the number of entities, and fail if it isn't one. */ + if (pScrn->numEntities != 1) + return FALSE; - /* Set pScrn->monitor */ - pScrn->monitor = pScrn->confScreen->monitor; + /* Set pScrn->monitor */ + pScrn->monitor = pScrn->confScreen->monitor; - if (!xf86SetDepthBpp(pScrn, 16, 0, 0, Support32bppFb)) { - return FALSE; - } - - /* Check that the returned depth is one we support */ - switch (pScrn->depth) { - case 16: - case 24: - /* OK */ - break; - default: - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Given depth (%d) is not supported by this driver\n", - pScrn->depth); - return FALSE; - } - xf86PrintDepthBpp(pScrn); - - /* - * This must happen after pScrn->display has been set because - * xf86SetWeight references it. - */ - if (pScrn->depth > 8) { - /* The defaults are OK for us */ - rgb zeros = {0, 0, 0}; - - if (!xf86SetWeight(pScrn, zeros, zeros)) { - return FALSE; - } else { - /* XXX check that weight returned is supported */ - ; + if (!xf86SetDepthBpp(pScrn, 16, 0, 0, Support32bppFb)) + return FALSE; + + /* Check that the returned depth is one we support */ + switch (pScrn->depth) { + case 16: + case 24: + /* OK */ + break; + default: + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Given depth (%d) is not supported by this driver\n", + pScrn->depth); + return FALSE; } - } + xf86PrintDepthBpp(pScrn); - /* Set the default visual. */ - if (!xf86SetDefaultVisual(pScrn, -1)) { - return FALSE; - } - /* We don't support DirectColor at > 8bpp */ - if (pScrn->depth > 8 && pScrn->defaultVisual != TrueColor) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given default visual" - " (%s) is not supported at depth %d\n", - xf86GetVisualName(pScrn->defaultVisual), pScrn->depth); - return FALSE; - } + /* + * This must happen after pScrn->display has been set because + * xf86SetWeight references it. + */ + if (pScrn->depth > 8) { -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/e1vmkrq-0002nb...@vasks.debian.org