summaryrefslogtreecommitdiff
path: root/src/radeon_dri.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2006-06-18 14:24:14 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2006-06-18 14:24:14 +0200
commitc8366d7b457565a06acdf6b40c5448c7f13f1641 (patch)
tree59283d3c503d2b7388b4f889c4d79d86b70aae9e /src/radeon_dri.c
parent23a21d00db6f3b88b54c44648f968018a03677d3 (diff)
Add Option "DepthBits".
This allows getting higher depth buffer precision and stencil hardware acceleration in depth 16 or saving some video RAM at the cost of these features in depth 24.
Diffstat (limited to 'src/radeon_dri.c')
-rw-r--r--src/radeon_dri.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/radeon_dri.c b/src/radeon_dri.c
index bbc858a..1e0d544 100644
--- a/src/radeon_dri.c
+++ b/src/radeon_dri.c
@@ -162,14 +162,15 @@ static Bool RADEONInitVisualConfigs(ScreenPtr pScreen)
pConfigs[i].doubleBuffer = FALSE;
pConfigs[i].stereo = FALSE;
pConfigs[i].bufferSize = 16;
- pConfigs[i].depthSize = 16;
+ pConfigs[i].depthSize = info->depthBits;
if (stencil)
pConfigs[i].stencilSize = 8;
else
pConfigs[i].stencilSize = 0;
pConfigs[i].auxBuffers = 0;
pConfigs[i].level = 0;
- if (accum || stencil) {
+ if (accum ||
+ (pConfigs[i].stencilSize && pConfigs[i].depthSize == 16)) {
pConfigs[i].visualRating = GLX_SLOW_CONFIG;
} else {
pConfigs[i].visualRating = GLX_NONE;
@@ -245,16 +246,16 @@ static Bool RADEONInitVisualConfigs(ScreenPtr pScreen)
pConfigs[i].doubleBuffer = FALSE;
pConfigs[i].stereo = FALSE;
pConfigs[i].bufferSize = 32;
+ pConfigs[i].depthSize = info->depthBits;
if (stencil) {
- pConfigs[i].depthSize = 24;
pConfigs[i].stencilSize = 8;
} else {
- pConfigs[i].depthSize = 24;
pConfigs[i].stencilSize = 0;
}
pConfigs[i].auxBuffers = 0;
pConfigs[i].level = 0;
- if (accum) {
+ if (accum ||
+ (pConfigs[i].stencilSize && pConfigs[i].depthSize == 16)) {
pConfigs[i].visualRating = GLX_SLOW_CONFIG;
} else {
pConfigs[i].visualRating = GLX_NONE;
@@ -1061,14 +1062,14 @@ static int RADEONDRIKernelInit(RADEONInfoPtr info, ScreenPtr pScreen)
drmInfo.usec_timeout = info->CPusecTimeout;
drmInfo.fb_bpp = info->CurrentLayout.pixel_code;
- drmInfo.depth_bpp = info->CurrentLayout.pixel_code;
+ drmInfo.depth_bpp = (info->depthBits - 8) * 2;
drmInfo.front_offset = info->frontOffset;
drmInfo.front_pitch = info->frontPitch * cpp;
drmInfo.back_offset = info->backOffset;
drmInfo.back_pitch = info->backPitch * cpp;
drmInfo.depth_offset = info->depthOffset;
- drmInfo.depth_pitch = info->depthPitch * cpp;
+ drmInfo.depth_pitch = info->depthPitch * drmInfo.depth_bpp / 8;
drmInfo.fb_offset = info->fbHandle;
drmInfo.mmio_offset = info->registerHandle;