aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorSagar Ghuge <[email protected]>2019-09-17 13:20:16 -0700
committerSagar Ghuge <[email protected]>2019-10-29 14:46:15 -0700
commitb22b3494430e40fcdeee0ea30c2af85d7d7b9c39 (patch)
tree8d23b34d88e1013682621e365a49834f2b651ca1 /src/gallium
parent5d331251cfbc304982517c60a854706fa6b60f71 (diff)
iris: Resolve stencil resource prior to copy or used by CPU
v2: Decide aux usage in get_copy_region_aux_settings (Nanley Chery) v3: Use isl_surf_usage_is_stencil function (Nanley Chery) Signed-off-by: Sagar Ghuge <[email protected]> Reviewed-by: Nanley Chery <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/iris/iris_blit.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/gallium/drivers/iris/iris_blit.c b/src/gallium/drivers/iris/iris_blit.c
index e10e54667f4..62179edd9bb 100644
--- a/src/gallium/drivers/iris/iris_blit.c
+++ b/src/gallium/drivers/iris/iris_blit.c
@@ -566,19 +566,29 @@ static void
get_copy_region_aux_settings(const struct gen_device_info *devinfo,
struct iris_resource *res,
enum isl_aux_usage *out_aux_usage,
- bool *out_clear_supported)
+ bool *out_clear_supported,
+ bool is_render_target)
{
switch (res->aux.usage) {
case ISL_AUX_USAGE_MCS:
case ISL_AUX_USAGE_MCS_CCS:
case ISL_AUX_USAGE_CCS_E:
- *out_aux_usage = res->aux.usage;
- /* Prior to Gen9, fast-clear only supported 0/1 clear colors. Since
- * we're going to re-interpret the format as an integer format possibly
- * with a different number of components, we can't handle clear colors
- * until Gen9.
+ /* A stencil resolve operation must be performed prior to doing resource
+ * copies or used by CPU.
+ * (see HSD 1209978162)
*/
- *out_clear_supported = devinfo->gen >= 9;
+ if (is_render_target && isl_surf_usage_is_stencil(res->surf.usage)) {
+ *out_aux_usage = ISL_AUX_USAGE_NONE;
+ *out_clear_supported = false;
+ } else {
+ *out_aux_usage = res->aux.usage;
+ /* Prior to Gen9, fast-clear only supported 0/1 clear colors. Since
+ * we're going to re-interpret the format as an integer format possibly
+ * with a different number of components, we can't handle clear colors
+ * until Gen9.
+ */
+ *out_clear_supported = devinfo->gen >= 9;
+ }
break;
default:
*out_aux_usage = ISL_AUX_USAGE_NONE;
@@ -615,9 +625,9 @@ iris_copy_region(struct blorp_context *blorp,
enum isl_aux_usage src_aux_usage, dst_aux_usage;
bool src_clear_supported, dst_clear_supported;
get_copy_region_aux_settings(devinfo, src_res, &src_aux_usage,
- &src_clear_supported);
+ &src_clear_supported, false);
get_copy_region_aux_settings(devinfo, dst_res, &dst_aux_usage,
- &dst_clear_supported);
+ &dst_clear_supported, true);
if (iris_batch_references(batch, src_res->bo))
tex_cache_flush_hack(batch, ISL_FORMAT_UNSUPPORTED, src_res->surf.format);