diff options
author | Eric Anholt <eric@anholt.net> | 2007-03-12 17:47:32 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2007-03-12 17:47:32 -0700 |
commit | 1ed3843f73a0d8efa405daff3483ebe70bf6134f (patch) | |
tree | deeca0efaaf940ba8a469d4577fdf4cd376acf80 /src/i830_memory.c | |
parent | 7aa257154685bd2520649ce87a3a84e55644d02c (diff) |
Make the 965 use Y-major tiling for the depth buffer, as required by the spec.
An example of the failure can be seen with the reflect demo when set to
depth buffer mode.
Reported by: Haihao Xiang <haihao.xiang@intel.com>
Diffstat (limited to 'src/i830_memory.c')
-rw-r--r-- | src/i830_memory.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/i830_memory.c b/src/i830_memory.c index e5168e1d..0742d8c0 100644 --- a/src/i830_memory.c +++ b/src/i830_memory.c @@ -1122,12 +1122,19 @@ i830_allocate_depthbuffer(ScrnInfoPtr pScrn) /* First try allocating it tiled */ if (!pI830->disableTiling && IsTileable(pScrn, pitch)) { + enum tile_format tile_format; + size = ROUND_TO_PAGE(pitch * ALIGN(height, 16)); + /* The 965 requires that the depth buffer be in Y Major format, while + * the rest appear to fail when handed that format. + */ + tile_format = IS_I965G(pI830) ? TILING_YMAJOR: TILING_XMAJOR; + pI830->depth_buffer = i830_allocate_memory_tiled(pScrn, "depth buffer", size, pitch, GTT_PAGE_SIZE, ALIGN_BOTH_ENDS, - TILING_XMAJOR); + tile_format); pI830->depth_tiled = FENCE_XMAJOR; } |