diff options
author | Eric Anholt <anholt@freebsd.org> | 2004-07-22 06:58:15 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2004-07-22 06:58:15 +0000 |
commit | d78bd665b20eb68e74b9b4c2d04fa177cc4447c6 (patch) | |
tree | 4ab0eac8a0344d2cdcbe0e41d257238f0e1def94 /src/radeon_driver.c | |
parent | bea8085e04136b0ef513c17bb65c54069ec531e1 (diff) |
DRI trunk-20040721 importDRI-trunk-20040721import-1.1.3
Diffstat (limited to 'src/radeon_driver.c')
-rw-r--r-- | src/radeon_driver.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c index bfc50c43..8a8aae7f 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -4474,15 +4474,21 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) 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 +4579,6 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) 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) { |