Mesa (staging/21.0): anv: Invalidate the correct AUX-TT entry

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 26 17:20:07 UTC 2021


Module: Mesa
Branch: staging/21.0
Commit: 90f8855080f427011acbe9059883d32ec0aa4d22
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=90f8855080f427011acbe9059883d32ec0aa4d22

Author: Sagar Ghuge <sagar.ghuge at intel.com>
Date:   Sat Jan 23 17:21:17 2021 -0800

anv: Invalidate the correct AUX-TT entry

While invalidating the AUX-TT entries, we have to consider the surface
offset as well otherwise, we will end up invalidating another surface's
CCS portion.

For eg. when we have HiZ+CCS and STC_CCS enabled, both will use the CCS
portion allocated at the end of BO. While invalidating the CCS portion
of stencil buffer, we will end up invalidating the CCS portion that
belongs to the depth main surface and vice-versa, if the surface offset
is not considered.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4123
Signed-off-by: Sagar Ghuge <sagar.ghuge at intel.com>
Acked-by: Nanley Chery <nanley.g.chery at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8677>
(cherry picked from commit dab229ef69656179e1786eb097705c8d5505ade9)

---

 .pick_status.json                  | 2 +-
 src/intel/vulkan/genX_cmd_buffer.c | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index a39174f69ba..c7cbf4cf97f 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -337,7 +337,7 @@
         "description": "anv: Invalidate the correct AUX-TT entry",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index a9c49e0f592..85341ab940e 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -462,8 +462,10 @@ anv_image_init_aux_tt(struct anv_cmd_buffer *cmd_buffer,
 {
    uint32_t plane = anv_image_aspect_to_plane(image->aspects, aspect);
 
+   const struct anv_surface *surface = &image->planes[plane].surface;
    uint64_t base_address =
-      anv_address_physical(image->planes[plane].address);
+      anv_address_physical(anv_address_add(image->planes[plane].address,
+                                           surface->offset));
 
    const struct isl_surf *isl_surf = &image->planes[plane].surface.isl;
    uint64_t format_bits = gen_aux_map_format_bits_for_isl_surf(isl_surf);



More information about the mesa-commit mailing list