summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-08-12 19:29:31 -0700
committerEric Anholt <eric@anholt.net>2009-08-18 18:00:46 -0700
commit465a4ab416b2e5ad53b96702720331a44fffa2fe (patch)
treeb0dd70cd7446e2117c057889fa6eb4aaa5f7f000
parenta3962e6f74ddd954ae1390d150a347745d7bdb24 (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.
-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 bb1c6161..af43a416 100644
--- a/src/i830_uxa.c
+++ b/src/i830_uxa.c
@@ -615,3 +615,7 @@ i830_uxa_create_pixmap (ScreenPtr screen, int w, int h, int depth, unsigned usag
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 {
@@ -622,3 +626,2 @@ i830_uxa_create_pixmap (ScreenPtr screen, int w, int h, int depth, unsigned usag
aligned_h = ALIGN(h, 32);
- assert(aligned_h >= h);