diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-11-30 20:50:31 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-11-30 22:21:49 +0000 |
commit | 00aa4f7a45a318af5b651f9f3928e9da4443233a (patch) | |
tree | baf156d235a9497fd9151ea470d65e452acf40fd /src/i830_uxa.c | |
parent | 8dd1c9eca02fb8da0c51f6fa4a38eb5e5ff41855 (diff) |
uxa: Limit maximum size of tiled objects
On older chipsets (i.e. pre-i965) tiling is very restrictive and imposes
severe size and alignment constraints. Combine that with relatively
small apertures and it is very easy to create a batch buffer that
cannot be mapped into the aperture (but would otherwise fit based purely
on total object size). To prevent this we need to not use tiling for large
buffers (the very same buffers where tiling would be of most benefit!).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/i830_uxa.c')
-rw-r--r-- | src/i830_uxa.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/i830_uxa.c b/src/i830_uxa.c index 89da5d00..801c2c77 100644 --- a/src/i830_uxa.c +++ b/src/i830_uxa.c @@ -138,6 +138,7 @@ i830_uxa_pixmap_compute_size(PixmapPtr pixmap, *tiling = I915_TILING_NONE; } + repeat: if (*tiling == I915_TILING_NONE) { pitch_align = intel->accel_pixmap_pitch_alignment; } else { @@ -171,6 +172,11 @@ i830_uxa_pixmap_compute_size(PixmapPtr pixmap, assert(size >= *stride * aligned_h); } + if (*tiling != I915_TILING_NONE && size > intel->max_tiling_size) { + *tiling = I915_TILING_NONE; + goto repeat; + } + return size; } |