Mesa (master): iris: disable aux on first get_param if not created with aux

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Sep 25 09:11:55 UTC 2019


Module: Mesa
Branch: master
Commit: f4d9169204e1b83f87779a350dd23501a085b36c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f4d9169204e1b83f87779a350dd23501a085b36c

Author: Tapani Pälli <tapani.palli at intel.com>
Date:   Mon Sep  2 13:02:33 2019 +0300

iris: disable aux on first get_param if not created with aux

This moves the fix from commit 361f3d19f1f to happen in get_param
(used now instead of get_handle by st/dri). This fixes artifacts
seen with Xorg and CCS_E.

Fixes: fc12fd05f56 "iris: Implement pipe_screen::resource_get_param"
Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

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

diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 7394825f637..72b68a28815 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -1023,6 +1023,25 @@ iris_flush_resource(struct pipe_context *ctx, struct pipe_resource *resource)
                                 mod ? mod->supports_clear_color : false);
 }
 
+static void
+iris_resource_disable_aux_on_first_query(struct pipe_resource *resource,
+                                         unsigned usage)
+{
+   struct iris_resource *res = (struct iris_resource *)resource;
+   bool mod_with_aux =
+      res->mod_info && res->mod_info->aux_usage != ISL_AUX_USAGE_NONE;
+
+   /* Disable aux usage if explicit flush not set and this is the first time
+    * we are dealing with this resource and the resource was not created with
+    * a modifier with aux.
+    */
+   if (!mod_with_aux &&
+      (!(usage & PIPE_HANDLE_USAGE_EXPLICIT_FLUSH) && res->aux.usage != 0) &&
+       p_atomic_read(&resource->reference.count) == 1) {
+         iris_resource_disable_aux(res);
+   }
+}
+
 static bool
 iris_resource_get_param(struct pipe_screen *screen,
                         struct pipe_context *context,
@@ -1041,6 +1060,8 @@ iris_resource_get_param(struct pipe_screen *screen,
    bool result;
    unsigned handle;
 
+   iris_resource_disable_aux_on_first_query(resource, handle_usage);
+
    switch (param) {
    case PIPE_RESOURCE_PARAM_NPLANES:
       if (mod_with_aux) {
@@ -1091,15 +1112,7 @@ iris_resource_get_handle(struct pipe_screen *pscreen,
    bool mod_with_aux =
       res->mod_info && res->mod_info->aux_usage != ISL_AUX_USAGE_NONE;
 
-   /* Disable aux usage if explicit flush not set and this is the first time
-    * we are dealing with this resource and the resource was not created with
-    * a modifier with aux.
-    */
-   if (!mod_with_aux &&
-       (!(usage & PIPE_HANDLE_USAGE_EXPLICIT_FLUSH) && res->aux.usage != 0) &&
-       p_atomic_read(&resource->reference.count) == 1) {
-         iris_resource_disable_aux(res);
-   }
+   iris_resource_disable_aux_on_first_query(resource, usage);
 
    struct iris_bo *bo;
    if (mod_with_aux && whandle->plane > 0) {




More information about the mesa-commit mailing list