summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranholt <anholt>2004-06-07 19:08:11 +0000
committeranholt <anholt>2004-06-07 19:08:11 +0000
commitf58f4263e06cfe921d06ece79abb2dc92be0ee98 (patch)
treefd423256b2c5ecce5375628826e04189678a872a
parent0eafc97b49ada2cf4a19c4193aca7416affef4d5 (diff)
Fix SiS DRI visual configs with guidance from idr:
* Fill in the size/mask values for the framebuffer by hand, because the automatic filling didn't seem to be complete. Matches other drivers. * Don't use an alpha channel in accum if framebuffer lacks alpha. * Mark visuals with accum buffer as GLX_SLOW_CONFIG.
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c36
1 files changed, 27 insertions, 9 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c
index b5ece2e62..5bb54de8c 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c
@@ -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,7 +189,10 @@ SISInitVisualConfigs(ScreenPtr pScreen)
}
pConfigs[i].auxBuffers = 0;
pConfigs[i].level = 0;
- pConfigs[i].visualRating = GLX_NONE_EXT;
+ 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;