Mesa (main): iris: Don't allocate and initialize CCS on XeHP

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Dec 11 04:39:16 UTC 2021


Module: Mesa
Branch: main
Commit: 7d3200a37dbda68d08663cb380d4b60986f36b59
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7d3200a37dbda68d08663cb380d4b60986f36b59

Author: Nanley Chery <nanley.g.chery at intel.com>
Date:   Wed Oct 20 13:30:33 2021 -0700

iris: Don't allocate and initialize CCS on XeHP

The memory for CCS on XeHP can't be mapped by the CPU.

Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13555>

---

 src/gallium/drivers/iris/iris_resource.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index cc10b4198be..7d497758379 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -707,10 +707,10 @@ iris_resource_configure_main(const struct iris_screen *screen,
 }
 
 static bool
-iris_get_ccs_surf(const struct isl_device *dev,
-                  const struct isl_surf *surf,
-                  struct isl_surf *aux_surf,
-                  struct isl_surf *extra_aux_surf)
+iris_get_ccs_surf_or_support(const struct isl_device *dev,
+                             const struct isl_surf *surf,
+                             struct isl_surf *aux_surf,
+                             struct isl_surf *extra_aux_surf)
 {
    assert(extra_aux_surf->size_B == 0);
 
@@ -726,7 +726,15 @@ iris_get_ccs_surf(const struct isl_device *dev,
       ccs_surf = aux_surf;
    }
 
-   return isl_surf_get_ccs_surf(dev, surf, hiz_or_mcs_surf, ccs_surf, 0);
+   if (dev->info->verx10 >= 125) {
+      /* CCS doesn't require VMA on XeHP. So, instead of creating a separate
+       * surface, we can just return whether CCS is supported for the given
+       * input surfaces.
+       */
+      return isl_surf_supports_ccs(dev, surf, hiz_or_mcs_surf);
+   } else  {
+      return isl_surf_get_ccs_surf(dev, surf, hiz_or_mcs_surf, ccs_surf, 0);
+   }
 }
 
 /**
@@ -750,8 +758,8 @@ iris_resource_configure_aux(struct iris_screen *screen,
       isl_surf_get_hiz_surf(&screen->isl_dev, &res->surf, &res->aux.surf);
 
    const bool has_ccs = !INTEL_DEBUG(DEBUG_NO_RBC) &&
-      iris_get_ccs_surf(&screen->isl_dev, &res->surf, &res->aux.surf,
-                        &res->aux.extra_aux.surf);
+      iris_get_ccs_surf_or_support(&screen->isl_dev, &res->surf,
+                                   &res->aux.surf, &res->aux.extra_aux.surf);
 
    if (has_mcs) {
       assert(!res->mod_info);



More information about the mesa-commit mailing list