Blurry display of h265 vaapi-decoded images on Prairie Falcon APU
System information
- OS: yocto 3.1
- GPU:
00:01.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Stoney [Radeon R2/R3/R4/R5 Graphics] [1002:98e4] (rev 81)
(Prairie Falcon APU, GX-224IJ) - Kernel version: 5.4.70
- Mesa version: 19.1 through 20.2
- Xserver version: 1.20.8
- Desktop manager and compositor: plain openbox
Describe the issue
VA-API rendering of h265-decoded video is blurry since mesa 19.1 , and still on 20.1.8 and 20.2.1.
The problem is visible when vaapi-decoding h265 and rendering using va-x11 or va-glx, but not when saving decoded frame to file, and more curiously does not appear when decoding h264.
Samples: sample.h265 sample.h264
Commands showing a blur (on a 1920x1080 display with attached sample):
mpv --vo=vaapi --hwdec=vaapi -pause -fs sample.h265
GST_VAAPI_ALL_DRIVERS=1 gst-launch-1.0 filesrc location=sample.h265 ! h265parse ! vaapih265dec ! imagefreeze ! vaapisink fullscreen=1 display=glx
GST_VAAPI_ALL_DRIVERS=1 gst-launch-1.0 filesrc location=sample.h265 ! h265parse ! vaapih265dec ! imagefreeze ! vaapisink fullscreen=1 display=x11
Commands that show a correct image:
gst-launch-1.0 filesrc location=/tmp/video-70mb-60Hz.h265 ! h265parse ! vaapih265dec ! videoconvert ! pngenc snapshot=true ! filesink location=/tmp/h265.png
mpv --vo=vaapi --hwdec=vaapi -v -pause -fs sample.h264
gst-launch-1.0 filesrc location=sample.h264 ! h264parse ! vaapih264dec ! imagefreeze ! vaapisink fullscreen=1
Regression
It works with the 19.0 versions. The problem appearance can be bisected to 9364d66c.
It can be countered by basically reverting the functionnality introduced in this commit, like on 20.0.8 with:
From acc9b175c1a7c71e14a0092ddc160c0aa3aaae76 Mon Sep 17 00:00:00 2001
From: Yann Dirson <yann@blade-group.com>
Date: Thu, 5 Nov 2020 18:40:05 +0100
Subject: [PATCH] HACK: do as if CS compositing was not supported, to avoid blur.
Blur observed on Prairie Falcon GX-224IJ, when decoding h265 (not
h264) with vaapi and displaying it with va-x11 or va-glx (not when
saving to file).
---
src/gallium/auxiliary/vl/vl_compositor.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c
index a381af108b3..9185e93e4f2 100644
--- a/src/gallium/auxiliary/vl/vl_compositor.c
+++ b/src/gallium/auxiliary/vl/vl_compositor.c
@@ -764,9 +764,7 @@ vl_compositor_init(struct vl_compositor *c, struct pipe_context *pipe)
memset(c, 0, sizeof(*c));
- c->pipe_cs_composit_supported = pipe->screen->get_param(pipe->screen, PIPE_CAP_PREFER_COMPUTE_FOR_MULTIMEDIA) &&
- pipe->screen->get_param(pipe->screen, PIPE_CAP_TGSI_TEX_TXF_LZ) &&
- pipe->screen->get_param(pipe->screen, PIPE_CAP_TGSI_DIV);
+ c->pipe_cs_composit_supported = 0;
c->pipe_gfx_supported = pipe->screen->get_param(pipe->screen, PIPE_CAP_GRAPHICS);
c->pipe = pipe;
--
2.28.0
Wondering why we don't have the same blur with h264 I tried forcing pipe_cs_composit_supported = 1
and could check that h264 still does not get blurred.
I did not dive into that compute shader yet, any idea would be appreciated :)