i965: Drop the tiling argument to intel_miptree_create_for_bo.
authorEric Anholt <eric@anholt.net>
Fri, 25 Apr 2014 19:10:57 +0000 (12:10 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 1 May 2014 22:12:26 +0000 (15:12 -0700)
The drm function to get the tiling is just a getter storing the two
pointers, so we don't need to go out of our way to avoid it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/i965/intel_fbo.c
src/mesa/drivers/dri/i965/intel_mipmap_tree.c
src/mesa/drivers/dri/i965/intel_mipmap_tree.h
src/mesa/drivers/dri/i965/intel_pixel_draw.c
src/mesa/drivers/dri/i965/intel_pixel_read.c
src/mesa/drivers/dri/i965/intel_tex_image.c

index e6e35fe..408beb9 100644 (file)
@@ -389,8 +389,7 @@ intel_image_target_renderbuffer_storage(struct gl_context *ctx,
                                          image->offset,
                                          image->region->width,
                                          image->region->height,
-                                         image->region->pitch,
-                                         image->region->tiling);
+                                         image->region->pitch);
    if (!irb->mt)
       return;
 
index 63b80bd..58a6b86 100644 (file)
@@ -643,15 +643,17 @@ intel_miptree_create_for_bo(struct brw_context *brw,
                             uint32_t offset,
                             uint32_t width,
                             uint32_t height,
-                            int pitch,
-                            uint32_t tiling)
+                            int pitch)
 {
    struct intel_mipmap_tree *mt;
+   uint32_t tiling, swizzle;
 
    struct intel_region *region = calloc(1, sizeof(*region));
    if (!region)
       return NULL;
 
+   drm_intel_bo_get_tiling(bo, &tiling, &swizzle);
+
    /* Nothing will be able to use this miptree with the BO if the offset isn't
     * aligned.
     */
@@ -717,8 +719,7 @@ intel_update_winsys_renderbuffer_miptree(struct brw_context *intel,
                                                  0,
                                                  region->width,
                                                  region->height,
-                                                 region->pitch,
-                                                 region->tiling);
+                                                 region->pitch);
    if (!singlesample_mt)
       goto fail;
 
index d76c0cd..d4f9575 100644 (file)
@@ -478,8 +478,7 @@ intel_miptree_create_for_bo(struct brw_context *brw,
                             uint32_t offset,
                             uint32_t width,
                             uint32_t height,
-                            int pitch,
-                            uint32_t tiling);
+                            int pitch);
 
 void
 intel_update_winsys_renderbuffer_miptree(struct brw_context *intel,
index 8ca8ae4..96bbd3d 100644 (file)
@@ -113,7 +113,7 @@ do_blit_drawpixels(struct gl_context * ctx,
                                   irb->mt->format,
                                   src_offset,
                                   width, height,
-                                  src_stride, I915_TILING_NONE);
+                                  src_stride);
    if (!pbo_mt)
       return false;
 
index 8cd7579..24d2800 100644 (file)
@@ -144,7 +144,7 @@ do_blit_readpixels(struct gl_context * ctx,
                                   irb->mt->format,
                                   dst_offset,
                                   width, height,
-                                  dst_stride, I915_TILING_NONE);
+                                  dst_stride);
 
    if (!intel_miptree_blit(brw,
                            irb->mt, irb->mt_level, irb->mt_layer,
index c225e4e..46cbaf7 100644 (file)
@@ -140,7 +140,7 @@ try_pbo_upload(struct gl_context *ctx,
                                   intelImage->mt->format,
                                   src_offset,
                                   image->Width, image->Height,
-                                  src_stride, I915_TILING_NONE);
+                                  src_stride);
    if (!pbo_mt)
       return false;