summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-08-12 19:29:31 -0700
committerCarl Worth <cworth@cworth.org>2009-08-25 16:43:01 -0700
commit215ee68a5aa1d0f24884cd8bc226959c30c20bd3 (patch)
treee8af33bb3c60cbcb8d55437070d106e25aa4c00d
parent180a9d160f28087db20e34c838f19ff0a26fabcc (diff)
Align the height of untiled pixmaps to 2 lines as well.
The 965 docs note, and it's probably the case on 915 as well, that the 2x2 subspans are read as a unit, even if the bottom row isn't used. If the address in that bottom row extended beyond the end of the GTT, a fault could occur. Thanks to Chris Wilson for pointing out the problem. (cherry picked from commit 465a4ab416b2e5ad53b96702720331a44fffa2fe)
-rw-r--r--src/i830_uxa.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/i830_uxa.c b/src/i830_uxa.c
index c05d4d6f..28a19cbe 100644
--- a/src/i830_uxa.c
+++ b/src/i830_uxa.c
@@ -613,14 +613,17 @@ i830_uxa_create_pixmap (ScreenPtr screen, int w, int h, int depth, unsigned usag
pitch_align);
if (tiling == I915_TILING_NONE) {
- size = stride * h;
+ /* Round the height up so that the GPU's access to a 2x2 aligned
+ * subspan doesn't address an invalid page offset beyond the
+ * end of the GTT.
+ */
+ size = stride * ALIGN(h, 2);
} else {
int aligned_h = h;
if (tiling == I915_TILING_X)
aligned_h = ALIGN(h, 8);
else
aligned_h = ALIGN(h, 32);
- assert(aligned_h >= h);
stride = i830_get_fence_pitch(i830, stride, tiling);
/* Round the object up to the size of the fence it will live in