aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-11-17 16:10:54 -0800
committerJason Ekstrand <[email protected]>2018-01-21 23:07:18 -0800
commitad424b2243023b0299de700fb2d220c2f7849ce6 (patch)
tree1496cf76c5175282b3759e44a2a07ab5d88805dd /src/mesa/drivers/dri
parent0465dd13d26451e2a57684d1ca6329dfbdeac9f4 (diff)
i965/miptree: Use the tiling from the modifier instead of the BO
This fixes a bug where we were taking the tiling from the BO regardless of what the modifier said. When we got images in from Vulkan where it doesn't set the tiling on the BO, we would treat them as linear even though the modifier expressly said to treat it as Y-tiled. Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index fd506163e95..e129d5eb9fb 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -990,7 +990,11 @@ intel_miptree_create_for_dri_image(struct brw_context *brw,
uint32_t bo_tiling, bo_swizzle;
brw_bo_get_tiling(image->bo, &bo_tiling, &bo_swizzle);
- const enum isl_tiling tiling = isl_tiling_from_i915_tiling(bo_tiling);
+ const struct isl_drm_modifier_info *mod_info =
+ isl_drm_modifier_get_info(image->modifier);
+
+ const enum isl_tiling tiling =
+ mod_info ? mod_info->tiling : isl_tiling_from_i915_tiling(bo_tiling);
if (image->planar_format && image->planar_format->nplanes > 1)
return miptree_create_for_planar_image(brw, image, target, tiling);
@@ -1014,9 +1018,6 @@ intel_miptree_create_for_dri_image(struct brw_context *brw,
if (!brw->ctx.TextureFormatSupported[format])
return NULL;
- const struct isl_drm_modifier_info *mod_info =
- isl_drm_modifier_get_info(image->modifier);
-
enum intel_miptree_create_flags mt_create_flags = 0;
/* If this image comes in from a window system, we have different