i915g: don't pot-align stride for tiled buffers
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Sat, 20 Nov 2010 09:23:03 +0000 (10:23 +0100)
committerJakob Bornecrantz <wallbraker@gmail.com>
Thu, 2 Dec 2010 00:34:13 +0000 (01:34 +0100)
libdrm will do this for us, if it's required (i.e. if tiling is
possible).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
src/gallium/drivers/i915/i915_resource_texture.c

index 6ff6ac7ad85497f5fe4d5b4c05e6b23dbb7e6416..bb45a421707370af91539bd60d8e5851cf4f9cad 100644 (file)
@@ -175,9 +175,10 @@ i9x5_scanout_layout(struct i915_texture *tex)
    i915_texture_set_image_offset(tex, 0, 0, 0, 0);
 
    if (pt->width0 >= 240) {
-      tex->stride = get_pot_stride(pt->format, pt->width0);
+      tex->stride = align(util_format_get_stride(pt->format, pt->width0), 64);
       tex->total_nblocksy = align_nblocksy(pt->format, pt->height0, 8);
       tex->tiling = I915_TILE_X;
+   /* special case for cursors */
    } else if (pt->width0 == 64 && pt->height0 == 64) {
       tex->stride = get_pot_stride(pt->format, pt->width0);
       tex->total_nblocksy = align_nblocksy(pt->format, pt->height0, 8);
@@ -212,7 +213,7 @@ i9x5_display_target_layout(struct i915_texture *tex)
    i915_texture_set_level_info(tex, 0, 1);
    i915_texture_set_image_offset(tex, 0, 0, 0, 0);
 
-   tex->stride = get_pot_stride(pt->format, pt->width0);
+   tex->stride = align(util_format_get_stride(pt->format, pt->width0), 64);
    tex->total_nblocksy = align_nblocksy(pt->format, pt->height0, 8);
    tex->tiling = I915_TILE_X;