Commit db4d586b authored by daenzer's avatar daenzer
Browse files

The depth buffer pitch must be a multiple of 32 pixels. Thanks to Steffen

Hein for pointing out the problem.

Bug report:     http://freedesktop.org/bugzilla/show_bug.cgi?id=788
parent 60628c11
...@@ -4474,15 +4474,21 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) ...@@ -4474,15 +4474,21 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
int bufferSize = ((pScrn->virtualY * width_bytes int bufferSize = ((pScrn->virtualY * width_bytes
+ RADEON_BUFFER_ALIGN) + RADEON_BUFFER_ALIGN)
& ~RADEON_BUFFER_ALIGN); & ~RADEON_BUFFER_ALIGN);
int depthSize = ((((pScrn->virtualY+15) & ~15) * width_bytes int depthSize;
+ RADEON_BUFFER_ALIGN)
& ~RADEON_BUFFER_ALIGN);
int l; int l;
int scanlines; int scanlines;
info->frontOffset = 0; info->frontOffset = 0;
info->frontPitch = pScrn->displayWidth; info->frontPitch = pScrn->displayWidth;
/* Due to tiling, the Z buffer pitch must be a multiple of 32 pixels,
* and its height a multiple of 16 lines.
*/
info->depthPitch = (pScrn->displayWidth + 31) & ~31;
depthSize = ((((pScrn->virtualY+15) & ~15) * info->depthPitch
* info->CurrentLayout.pixel_bytes + RADEON_BUFFER_ALIGN)
& ~RADEON_BUFFER_ALIGN);
switch (info->CPMode) { switch (info->CPMode) {
case RADEON_DEFAULT_CP_PIO_MODE: case RADEON_DEFAULT_CP_PIO_MODE:
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CP in PIO mode\n"); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CP in PIO mode\n");
...@@ -4573,7 +4579,6 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) ...@@ -4573,7 +4579,6 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
info->depthOffset = ((info->textureOffset - depthSize + info->depthOffset = ((info->textureOffset - depthSize +
RADEON_BUFFER_ALIGN) & RADEON_BUFFER_ALIGN) &
~(CARD32)RADEON_BUFFER_ALIGN); ~(CARD32)RADEON_BUFFER_ALIGN);
info->depthPitch = pScrn->displayWidth;
/* Reserve space for the shared back buffer */ /* Reserve space for the shared back buffer */
if (info->noBackBuffer) { if (info->noBackBuffer) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment