Mesa (master): radeonsi/tmz: add workaround for mpv/vaapi subtitles

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Sep 24 15:06:53 UTC 2020


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

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date:   Fri Jul 24 16:04:14 2020 +0200

radeonsi/tmz: add workaround for mpv/vaapi subtitles

Subtitles are rendering with an upload through a staging texture.
So the sequence is:
  1. draw video (with a secure cs)
  2. copy staging texture to the real texture (via si_resource_copy_region) in
    a non-secure cs.
  3. draw video (with a secure cs)

Step 2 and 3 both generates a flush with RADEON_FLUSH_TOGGLE_SECURE_SUBMISSION.
These flushes are executed quite late: right before doing the draw/dispatch,
so maybe the issue here is the handling of dependencies.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049>

---

 src/gallium/drivers/radeonsi/si_gfx_cs.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeonsi/si_gfx_cs.c b/src/gallium/drivers/radeonsi/si_gfx_cs.c
index 0243542eabe..7efa3f08aa9 100644
--- a/src/gallium/drivers/radeonsi/si_gfx_cs.c
+++ b/src/gallium/drivers/radeonsi/si_gfx_cs.c
@@ -97,7 +97,12 @@ void si_flush_gfx_cs(struct si_context *ctx, unsigned flags, struct pipe_fence_h
    } else if (ctx->chip_class == GFX6) {
       /* The kernel flushes L2 before shaders are finished. */
       wait_flags |= wait_ps_cs;
-   } else if (!(flags & RADEON_FLUSH_START_NEXT_GFX_IB_NOW)) {
+   } else if (!(flags & RADEON_FLUSH_START_NEXT_GFX_IB_NOW) ||
+              ((flags & RADEON_FLUSH_TOGGLE_SECURE_SUBMISSION) &&
+                !ws->cs_is_secure(cs))) {
+      /* TODO: this workaround fixes subtitles rendering with mpv -vo=vaapi and
+       * tmz but shouldn't be necessary.
+       */
       wait_flags |= wait_ps_cs;
    }
 



More information about the mesa-commit mailing list