Mesa (staging/19.3): i965: Use brw_batch_references in tex_busy check

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jan 30 18:51:24 UTC 2020


Module: Mesa
Branch: staging/19.3
Commit: 12fd92c7d35ba5c7c3cf28bf8d78ed60db1a7a03
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=12fd92c7d35ba5c7c3cf28bf8d78ed60db1a7a03

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed Jan 29 00:22:02 2020 -0800

i965: Use brw_batch_references in tex_busy check

If the batch references the buffer, we will have to flush the batch
immediately before mapping it, at which point it will be busy.

(This bug has existed for a long time...even going back to BLT-era...)

Fixes: 779923194c6 ("i965/tex_image: Use meta for instead of the blitter PBO TexImage and GetTexImage")
Fixes: d5d4ba9139a ("i965/tex_subimage: use meta instead of the blitter for PBO TexSubImage")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3616>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3616>
(cherry picked from commit bdba744d700717a123232cf24647f11918fc0dcd)

---

 .pick_status.json                           | 2 +-
 src/mesa/drivers/dri/i965/intel_tex_image.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 98eba03ffe8..e27ac62433e 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -13,7 +13,7 @@
         "description": "i965: Use brw_batch_references in tex_busy check",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "779923194c65ed3a588d3503cc5d53e1945ada0f"
     },
diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
index 95c44a0313a..cb3ca588443 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -325,7 +325,8 @@ intel_upload_tex(struct gl_context * ctx,
    if (pixels == NULL && !_mesa_is_bufferobj(packing->BufferObj))
       return;
 
-   bool tex_busy = mt && brw_bo_busy(mt->bo);
+   bool tex_busy = mt &&
+      (brw_batch_references(&brw->batch, mt->bo) || brw_bo_busy(mt->bo));
 
    if (_mesa_is_bufferobj(packing->BufferObj) || tex_busy ||
        mt->aux_usage == ISL_AUX_USAGE_CCS_E) {



More information about the mesa-commit mailing list