diff options
author | Kenneth Graunke <[email protected]> | 2019-03-06 14:49:39 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-03-06 18:04:53 -0800 |
commit | 744b8e1c12f2f3857070a895bf6a4351f071a3f9 (patch) | |
tree | 7522439bb611699f3d44ec10e94631284b06a9a5 /src/gallium/drivers/iris/iris_blit.c | |
parent | ecceb076e5c99cea94b853a9600947fe78b3ca74 (diff) |
iris: Fix MOCS for blits and clears
I915_MOCS_CACHED is the wrong value. Expose mocs() and use that.
Diffstat (limited to 'src/gallium/drivers/iris/iris_blit.c')
-rw-r--r-- | src/gallium/drivers/iris/iris_blit.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/gallium/drivers/iris/iris_blit.c b/src/gallium/drivers/iris/iris_blit.c index 836c9e69132..eb795a08cbe 100644 --- a/src/gallium/drivers/iris/iris_blit.c +++ b/src/gallium/drivers/iris/iris_blit.c @@ -221,7 +221,8 @@ apply_blit_scissor(const struct pipe_scissor_state *scissor, } void -iris_blorp_surf_for_resource(struct blorp_surf *surf, +iris_blorp_surf_for_resource(struct iris_vtable *vtbl, + struct blorp_surf *surf, struct pipe_resource *p_res, enum isl_aux_usage aux_usage, unsigned level, @@ -239,7 +240,7 @@ iris_blorp_surf_for_resource(struct blorp_surf *surf, .buffer = res->bo, .offset = 0, // XXX: ??? .reloc_flags = is_render_target ? EXEC_OBJECT_WRITE : 0, - .mocs = I915_MOCS_CACHED, // XXX: BDW MOCS, PTE MOCS + .mocs = vtbl->mocs(res->bo), }, .aux_usage = aux_usage, }; @@ -250,7 +251,7 @@ iris_blorp_surf_for_resource(struct blorp_surf *surf, .buffer = res->aux.bo, .offset = res->aux.offset, .reloc_flags = is_render_target ? EXEC_OBJECT_WRITE : 0, - .mocs = I915_MOCS_CACHED, + .mocs = vtbl->mocs(res->bo), }; } @@ -310,9 +311,9 @@ iris_blit(struct pipe_context *ctx, const struct pipe_blit_info *info) bool dst_clear_supported = dst_aux_usage != ISL_AUX_USAGE_NONE; struct blorp_surf src_surf, dst_surf; - iris_blorp_surf_for_resource(&src_surf, info->src.resource, + iris_blorp_surf_for_resource(&ice->vtbl, &src_surf, info->src.resource, src_aux_usage, info->src.level, false); - iris_blorp_surf_for_resource(&dst_surf, info->dst.resource, + iris_blorp_surf_for_resource(&ice->vtbl, &dst_surf, info->dst.resource, dst_aux_usage, info->dst.level, true); iris_resource_prepare_access(ice, batch, dst_res, info->dst.level, 1, @@ -418,9 +419,9 @@ iris_blit(struct pipe_context *ctx, const struct pipe_blit_info *info) struct iris_resource *src_res, *dst_res, *junk; iris_get_depth_stencil_resources(info->src.resource, &junk, &src_res); iris_get_depth_stencil_resources(info->dst.resource, &junk, &dst_res); - iris_blorp_surf_for_resource(&src_surf, &src_res->base, + iris_blorp_surf_for_resource(&ice->vtbl, &src_surf, &src_res->base, ISL_AUX_USAGE_NONE, info->src.level, false); - iris_blorp_surf_for_resource(&dst_surf, &dst_res->base, + iris_blorp_surf_for_resource(&ice->vtbl, &dst_surf, &dst_res->base, ISL_AUX_USAGE_NONE, info->dst.level, true); for (int slice = 0; slice < info->dst.box.depth; slice++) { @@ -520,9 +521,9 @@ iris_resource_copy_region(struct pipe_context *ctx, // XXX: what about one surface being a buffer and not the other? struct blorp_surf src_surf, dst_surf; - iris_blorp_surf_for_resource(&src_surf, src, src_aux_usage, + iris_blorp_surf_for_resource(&ice->vtbl, &src_surf, src, src_aux_usage, src_level, false); - iris_blorp_surf_for_resource(&dst_surf, dst, dst_aux_usage, + iris_blorp_surf_for_resource(&ice->vtbl, &dst_surf, dst, dst_aux_usage, dst_level, true); iris_resource_prepare_access(ice, batch, src_res, src_level, 1, |