From 1a3141acc3c1e31b5c33ae917da0462b535f76fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Mon, 11 Apr 2022 15:04:55 +0300 Subject: [PATCH] iris: implement VF_STATISTICS emit for Wa_16012775297 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Emit dummy VF_STATISTICS state before each VF state. Cc: mesa-stable Signed-off-by: Tapani Pälli Reviewed-by: Lionel Landwerlin Part-of: (cherry picked from commit 9465d6e3d7cb2925c63f2e6ed057de87f0699352) --- .pick_status.json | 2 +- src/gallium/drivers/iris/iris_state.c | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 8e39b766fe2..c5a78f37b06 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -84,7 +84,7 @@ "description": "iris: implement VF_STATISTICS emit for Wa_16012775297", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index e100d20616c..1c4dabb2356 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -8097,7 +8097,23 @@ iris_upload_dirty_render_state(struct iris_context *ice, } } + if (dirty & IRIS_DIRTY_VF_STATISTICS) { + iris_emit_cmd(batch, GENX(3DSTATE_VF_STATISTICS), vf) { + vf.StatisticsEnable = true; + } + } + if (dirty & IRIS_DIRTY_VF) { +#if INTEL_WA_16012775297_GFX_VER + /* Emit dummy VF statistics before each 3DSTATE_VF. */ + if (intel_needs_workaround(batch->screen->devinfo, 16012775297) && + (dirty & IRIS_DIRTY_VF_STATISTICS) == 0) { + iris_emit_cmd(batch, GENX(3DSTATE_VF_STATISTICS), vfs) { + vfs.StatisticsEnable = true; + } + } +#endif + iris_emit_cmd(batch, GENX(3DSTATE_VF), vf) { #if GFX_VERx10 >= 125 vf.GeometryDistributionEnable = true; @@ -8144,12 +8160,6 @@ iris_upload_dirty_render_state(struct iris_context *ice, } #endif - if (dirty & IRIS_DIRTY_VF_STATISTICS) { - iris_emit_cmd(batch, GENX(3DSTATE_VF_STATISTICS), vf) { - vf.StatisticsEnable = true; - } - } - #if GFX_VER == 8 if (dirty & IRIS_DIRTY_PMA_FIX) { bool enable = want_pma_fix(ice);