Index: programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c =================================================================== RCS file: /cvs/dri/xc/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v retrieving revision 1.87 diff -p -u -r1.87 radeon_driver.c --- programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c 4 Jun 2004 14:30:30 -0000 1.87 +++ programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c 21 Jun 2004 23:53:44 -0000 @@ -4474,15 +4516,21 @@ Bool RADEONScreenInit(int scrnIndex, Scr int bufferSize = ((pScrn->virtualY * width_bytes + RADEON_BUFFER_ALIGN) & ~RADEON_BUFFER_ALIGN); - int depthSize = ((((pScrn->virtualY+15) & ~15) * width_bytes - + RADEON_BUFFER_ALIGN) - & ~RADEON_BUFFER_ALIGN); + int depthSize; int l; int scanlines; info->frontOffset = 0; 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) { case RADEON_DEFAULT_CP_PIO_MODE: xf86DrvMsg(pScrn->scrnIndex, X_INFO, "CP in PIO mode\n"); @@ -4573,7 +4619,6 @@ Bool RADEONScreenInit(int scrnIndex, Scr info->depthOffset = ((info->textureOffset - depthSize + RADEON_BUFFER_ALIGN) & ~(CARD32)RADEON_BUFFER_ALIGN); - info->depthPitch = pScrn->displayWidth; /* Reserve space for the shared back buffer */ if (info->noBackBuffer) {