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 e6e35fe18e8244ce65873ac540498fa2338c98f9..408beb98b5f3eab712405e1cf455cf078d0fed1b 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 63b80bd2916246b0b1dbfbfdf64f5574c1d13e7d..58a6b86fce5243b2524a6db91182438700285fec 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 d76c0cd60eedf397ea9cbf6963587800f353e0bf..d4f9575e5f7c2a5a82a24aab59ff7ff62d6044a5 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 8ca8ae4fdbcd9e05a65f5d793883e744f583db5b..96bbd3d0bb76e9b0cc19d39eb225defa8157c3e6 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 8cd7579142aa115bdae72f5d613cb9a25c669317..24d2800670ce236ec448badef48e9ef7aab78cc1 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 c225e4e028b39f897682bb6cde4934e326bfc84c..46cbaf778f9105fca3d9256bd210207ca6be0c38 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;