intel: Align region height as required for tiled regions.
diff mbox

Message ID 1249694345-9228-2-git-send-email-eric@anholt.net
State Not Applicable
Headers show

Commit Message

Eric Anholt Aug. 8, 2009, 1:19 a.m. UTC
Otherwise, we would address beyond the end of our buffers.
---
 src/mesa/drivers/dri/intel/intel_regions.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Patch
diff mbox

diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c
index 69574f2..a68e29a 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.c
+++ b/src/mesa/drivers/dri/intel/intel_regions.c
@@ -181,6 +181,11 @@  intel_region_alloc(struct intel_context *intel,
    dri_bo *buffer;
    struct intel_region *region;
 
+   if (tiling == I915_TILING_X)
+      height = ALIGN(height, 8);
+   else if (tiling == I915_TILING_Y)
+      height = ALIGN(height, 16);
+
    if (expect_accelerated_upload) {
       buffer = drm_intel_bo_alloc_for_render(intel->bufmgr, "region",
 					     pitch * cpp * height, 64);