iris/icl+: Report same caching domain as main surface for clear color BO.
authorFrancisco Jerez <currojerez@riseup.net>
Tue, 9 Jun 2020 22:23:30 +0000 (15:23 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Thu, 11 Jun 2020 21:00:49 +0000 (14:00 -0700)
Even though the clear color BO is bound as a read-only buffer, report
the same caching domain as the main BO in use_surface() (typically
IRIS_DOMAIN_RENDER_WRITE) in order to avoid ping-ponging back and
forth between IRIS_DOMAIN_RENDER_WRITE and IRIS_DOMAIN_OTHER_READ,
which leads to increased stall-at-pixel-scoreboard synchronization
between draw calls.

Fixes a 5%-10% FPS regression in some benchmarks spotted on ICL.

Reported-by: Clayton Craft <clayton.a.craft@intel.com>
Fixes: eb5d1c27227302167d299 "iris: Annotate all BO uses with domain and sequence number information."
Closes: #3097
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5411>

src/gallium/drivers/iris/iris_state.c

index 5b8a53f1369af9838261d245efc70741cc6c9440..462a04091beab2babcf5cff3e89c97e0e0bbbe97 100644 (file)
@@ -4641,8 +4641,7 @@ use_surface(struct iris_context *ice,
    if (res->aux.bo) {
       iris_use_pinned_bo(batch, res->aux.bo, writeable, access);
       if (res->aux.clear_color_bo)
-         iris_use_pinned_bo(batch, res->aux.clear_color_bo,
-                            false, IRIS_DOMAIN_OTHER_READ);
+         iris_use_pinned_bo(batch, res->aux.clear_color_bo, false, access);
 
       if (memcmp(&res->aux.clear_color, &surf->clear_color,
                  sizeof(surf->clear_color)) != 0) {