summaryrefslogtreecommitdiff
path: root/src/i830_dri.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-02-26 15:04:56 -0800
committerEric Anholt <eric@anholt.net>2007-02-26 15:04:56 -0800
commit732885c08daaf17034da8f4855d0b957ec3df9d7 (patch)
treefb17561504705657f33deb21396ca471ab87d38d /src/i830_dri.c
parent0bfaeaab2838184827236c5c0fcc17f06d9e1372 (diff)
Bug #9604: Align the sizes of allocations to page increments as well.
Without this, the 965 DRI driver fell over when pitch * height wasn't page-size aligned. Since the allocator only allocates at page-aligned offsets anyway this shouldn't hurt us at all.
Diffstat (limited to 'src/i830_dri.c')
-rw-r--r--src/i830_dri.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/i830_dri.c b/src/i830_dri.c
index e14880f6..f81251a5 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -1449,7 +1449,8 @@ I830UpdateDRIBuffers(ScrnInfoPtr pScrn, drmI830Sarea *sarea)
/* Don't use front_buffer->size here as it includes the pixmap cache area
* Instead, calculate the entire framebuffer.
*/
- sarea->front_size = pScrn->displayWidth * pScrn->virtualY * pI830->cpp;
+ sarea->front_size = ROUND_TO_PAGE(pScrn->displayWidth * pScrn->virtualY *
+ pI830->cpp);
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"[drm] init sarea width,height = %d x %d (pitch %d)\n",