From 01a9c1157cdfbc5f74b035383e060b8419979563 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 8 Mar 2005 23:41:37 +0000 Subject: Fix accidentally removed depth pitch adjustment if displayWidth is not a multiple of 32 pixels (bug #788) --- src/radeon_driver.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 1d78c289..8895073c 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -5086,11 +5086,12 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) + RADEON_BUFFER_ALIGN) & ~RADEON_BUFFER_ALIGN; } /* Due to tiling, the Z buffer pitch must be a multiple of 32 pixels, - * which is always the case due to color pitch and its height a multiple of 16 lines. + * which is always the case if color tiling is used due to color pitch + * but not necessarily otherwise, and its height a multiple of 16 lines. */ - info->depthPitch = pScrn->displayWidth; + info->depthPitch = (pScrn->displayWidth + 31) & ~31; depthSize = ((((pScrn->virtualY + 15) & ~15) * info->depthPitch - * cpp + RADEON_BUFFER_ALIGN) & ~RADEON_BUFFER_ALIGN); + * cpp + RADEON_BUFFER_ALIGN) & ~RADEON_BUFFER_ALIGN); switch (info->CPMode) { case RADEON_DEFAULT_CP_PIO_MODE: -- cgit v1.2.3