diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-11 13:37:18 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-11 13:37:18 +0000 |
commit | 2f35d77cd07a4974051c922f4809ce44939b0556 (patch) | |
tree | 271e309d4614ff9161b8645457900b87de81d9d9 | |
parent | 5a0139487f5a5caada56121395aa166fc9f08663 (diff) |
sna: Update computation of untiled pitch to cater for CREATE_SCANOUT
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/kgem.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 3609a6f3..6657dc8b 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -507,6 +507,14 @@ static uint32_t kgem_surface_size(struct kgem *kgem, return tile_width; } +static uint32_t kgem_untiled_pitch(struct kgem *kgem, + uint32_t width, + uint32_t bpp, + bool scanout) +{ + return ALIGN(width * bpp / 8, scanout ? 64 : 4); +} + static uint32_t kgem_aligned_height(struct kgem *kgem, uint32_t height, uint32_t tiling) { @@ -1527,7 +1535,9 @@ struct kgem_bo *kgem_create_2d(struct kgem *kgem, if (flags & CREATE_INACTIVE) goto skip_active_search; - untiled_pitch = ALIGN(width * bpp / 8, bpp > 8 ? 64 : 4); + untiled_pitch = kgem_untiled_pitch(kgem, + width, bpp, + flags & CREATE_SCANOUT); for (i = 0; i <= I915_TILING_Y; i++) tiled_height[i] = kgem_aligned_height(kgem, height, i); |