diff options
-rw-r--r-- | src/sis_cursor.c | 1 | ||||
-rw-r--r-- | src/sis_dri.c | 64 | ||||
-rw-r--r-- | src/sis_dri.h | 2 | ||||
-rw-r--r-- | src/sis_driver.c | 4 |
4 files changed, 46 insertions, 25 deletions
diff --git a/src/sis_cursor.c b/src/sis_cursor.c index 22cc24a..d7b6b46 100644 --- a/src/sis_cursor.c +++ b/src/sis_cursor.c @@ -48,7 +48,6 @@ extern void SISWaitRetraceCRT1(ScrnInfoPtr pScrn); extern void SISWaitRetraceCRT2(ScrnInfoPtr pScrn); -extern Bool InRegion(int x, int y, region r); /* Helper function for Xabre to convert mono image to ARGB */ /* The Xabre's cursor engine for CRT2 is buggy and can't diff --git a/src/sis_dri.c b/src/sis_dri.c index 08e17b3..5bb54de 100644 --- a/src/sis_dri.c +++ b/src/sis_dri.c @@ -67,9 +67,9 @@ static char SISClientDriverName[] = "sis"; static Bool SISInitVisualConfigs(ScreenPtr pScreen); static Bool SISCreateContext(ScreenPtr pScreen, VisualPtr visual, - drmContext hwContext, void *pVisualConfigPriv, + drm_context_t hwContext, void *pVisualConfigPriv, DRIContextType contextStore); -static void SISDestroyContext(ScreenPtr pScreen, drmContext hwContext, +static void SISDestroyContext(ScreenPtr pScreen, drm_context_t hwContext, DRIContextType contextStore); static void SISDRISwapContext(ScreenPtr pScreen, DRISyncType syncType, DRIContextType readContextType, @@ -132,18 +132,33 @@ SISInitVisualConfigs(ScreenPtr pScreen) pConfigs[i].vid = -1; pConfigs[i].class = -1; pConfigs[i].rgba = TRUE; - pConfigs[i].redSize = -1; - pConfigs[i].greenSize = -1; - pConfigs[i].blueSize = -1; - pConfigs[i].redMask = -1; - pConfigs[i].greenMask = -1; - pConfigs[i].blueMask = -1; - pConfigs[i].alphaMask = 0; + if (pScrn->bitsPerPixel == 16) { + pConfigs[i].redSize = 5; + pConfigs[i].greenSize = 6; + pConfigs[i].blueSize = 5; + pConfigs[i].alphaSize = 0; + pConfigs[i].redMask = 0x0000F800; + pConfigs[i].greenMask = 0x000007E0; + pConfigs[i].blueMask = 0x0000001F; + pConfigs[i].alphaMask = 0x00000000; + } else { + pConfigs[i].redSize = 8; + pConfigs[i].greenSize = 8; + pConfigs[i].blueSize = 8; + pConfigs[i].alphaSize = 8; + pConfigs[i].redMask = 0x00FF0000; + pConfigs[i].greenMask = 0x0000FF00; + pConfigs[i].blueMask = 0x000000FF; + pConfigs[i].alphaMask = 0xFF000000; + } if(accum) { pConfigs[i].accumRedSize = 16; pConfigs[i].accumGreenSize = 16; pConfigs[i].accumBlueSize = 16; - pConfigs[i].accumAlphaSize = 16; + if (pConfigs[i].alphaMask == 0) + pConfigs[i].accumAlphaSize = 0; + else + pConfigs[i].accumAlphaSize = 16; } else { pConfigs[i].accumRedSize = 0; pConfigs[i].accumGreenSize = 0; @@ -174,8 +189,11 @@ SISInitVisualConfigs(ScreenPtr pScreen) } pConfigs[i].auxBuffers = 0; pConfigs[i].level = 0; - pConfigs[i].visualRating = GLX_NONE_EXT; - pConfigs[i].transparentPixel = 0; + if (pConfigs[i].accumRedSize != 0) + pConfigs[i].visualRating = GLX_SLOW_CONFIG; + else + pConfigs[i].visualRating = GLX_NONE_EXT; + pConfigs[i].transparentPixel = GLX_NONE; pConfigs[i].transparentRed = 0; pConfigs[i].transparentGreen = 0; pConfigs[i].transparentBlue = 0; @@ -247,11 +265,15 @@ Bool SISDRIScreenInit(ScreenPtr pScreen) pDRIInfo->drmDriverName = SISKernelDriverName; pDRIInfo->clientDriverName = SISClientDriverName; - pDRIInfo->busIdString = xalloc(64); - sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d", - ((pciConfigPtr)pSIS->PciInfo->thisCard)->busnum, - ((pciConfigPtr)pSIS->PciInfo->thisCard)->devnum, - ((pciConfigPtr)pSIS->PciInfo->thisCard)->funcnum); + if (xf86LoaderCheckSymbol("DRICreatePCIBusID")) { + pDRIInfo->busIdString = DRICreatePCIBusID(pSIS->PciInfo); + } else { + pDRIInfo->busIdString = xalloc(64); + sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d", + ((pciConfigPtr)pSIS->PciInfo->thisCard)->busnum, + ((pciConfigPtr)pSIS->PciInfo->thisCard)->devnum, + ((pciConfigPtr)pSIS->PciInfo->thisCard)->funcnum); + } /* Hack to keep old DRI working -- checked for major==1 and * minor==1. */ @@ -369,7 +391,7 @@ Bool SISDRIScreenInit(ScreenPtr pScreen) pSISDRI->regs.size = SISIOMAPSIZE; pSISDRI->regs.map = 0; - if(drmAddMap(pSIS->drmSubFD, (drmHandle)pSIS->IOAddress, + if(drmAddMap(pSIS->drmSubFD, (drm_handle_t)pSIS->IOAddress, pSISDRI->regs.size, DRM_REGISTERS, 0, &pSISDRI->regs.handle) < 0) { SISDRICloseScreen(pScreen); @@ -429,7 +451,7 @@ Bool SISDRIScreenInit(ScreenPtr pScreen) /* pSIS->agpBase = */ pSISDRI->agp.size = pSIS->agpSize; - if(drmAddMap(pSIS->drmSubFD, (drmHandle)0, + if(drmAddMap(pSIS->drmSubFD, (drm_handle_t)0, pSISDRI->agp.size, DRM_AGP, 0, &pSISDRI->agp.handle) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, @@ -537,14 +559,14 @@ SISDRICloseScreen(ScreenPtr pScreen) */ static Bool SISCreateContext(ScreenPtr pScreen, VisualPtr visual, - drmContext hwContext, void *pVisualConfigPriv, + drm_context_t hwContext, void *pVisualConfigPriv, DRIContextType contextStore) { return TRUE; } static void -SISDestroyContext(ScreenPtr pScreen, drmContext hwContext, +SISDestroyContext(ScreenPtr pScreen, drm_context_t hwContext, DRIContextType contextStore) { } diff --git a/src/sis_dri.h b/src/sis_dri.h index d38e39a..ce7c9a3 100644 --- a/src/sis_dri.h +++ b/src/sis_dri.h @@ -35,7 +35,7 @@ typedef struct { #define SIS_DEPTH 2 typedef struct { - drmHandle handle; + drm_handle_t handle; drmSize size; drmAddress map; } sisRegion, *sisRegionPtr; diff --git a/src/sis_driver.c b/src/sis_driver.c index 2940dd7..7138cd5 100644 --- a/src/sis_driver.c +++ b/src/sis_driver.c @@ -142,7 +142,6 @@ static void SISBridgeRestore(ScrnInfoPtr pScrn); static void SiSEnableTurboQueue(ScrnInfoPtr pScrn); unsigned char SISSearchCRT1Rate(ScrnInfoPtr pScrn, DisplayModePtr mode); static void SISWaitVBRetrace(ScrnInfoPtr pScrn); -Bool InRegion(int x, int y, region r); void SISWaitRetraceCRT1(ScrnInfoPtr pScrn); void SISWaitRetraceCRT2(ScrnInfoPtr pScrn); @@ -387,6 +386,7 @@ static const char *driSymbols[] = { "DRIScreenInit", "DRIUnlock", "GlxSetVisualConfigs", + "DRICreatePCIBusID", NULL }; #endif @@ -6882,7 +6882,7 @@ SISSetStartAddressCRT2(SISPtr pSiS, unsigned long base) } #ifdef SISMERGED -Bool +static Bool InRegion(int x, int y, region r) { return (r.x0 <= x) && (x <= r.x1) && (r.y0 <= y) && (y <= r.y1); |