Mesa (master): i965: Use brw_batch_references in tex_busy check

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jan 30 10:19:30 UTC 2020


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

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>

---

 src/mesa/drivers/dri/i965/intel_tex_image.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
index fba925dee5a..bc72827802c 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