summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@student.ethz.ch>2005-03-08 23:41:37 +0000
committerRoland Scheidegger <sroland@student.ethz.ch>2005-03-08 23:41:37 +0000
commit6bcdf2fd3ca01b7b6f4f2435e7db36c2f9a2a31d (patch)
tree457742e3c4c884ba2bb381bbd6ed60ee56aba90f
parent3dc0136bf608f7681d89c5e8789fba06e1908c92 (diff)
Fix accidentally removed depth pitch adjustment if displayWidth is not a
multiple of 32 pixels (bug #788)
-rw-r--r--src/radeon_driver.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 1d78c28..8895073 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: