Bug 109080

Summary: Broken VP9 video playback colors on AMD Ryzen 5 (PRO) Mobile 2500U in Chromium
Product: Mesa Reporter: Rafał Miłecki <zajec5>
Component: Drivers/Gallium/radeonsiAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED MOVED QA Contact: Default DRI bug account <dri-devel>
Severity: normal    
Priority: medium CC: boyuan.zhang
Version: 18.2   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Screenshot for Chromium with corrupted video
attachment-418-0.html

Description Rafał Miłecki 2018-12-17 20:46:07 UTC
Created attachment 142840 [details]
Screenshot for Chromium with corrupted video

When playing video on YouTube using Chromium I see broken colors.

Info from the YouTube player:
Codecs vp09.00.51.08.01.01.01.01 (247) / opus (251)
Color bt709 / bt709


I experience this problem on two machines:

1) HP EliteBook 745 G5 with Ryzen 5 PRO 2500U
It runs 1.03.01 BIOS with 0x0810100b CPU microcode.

2) MateBook D with Ryzen 5 2500U
It runs 1.12 BIOS with 0x08101007 CPU microcode.


I've bisected the *fix* down to the:
commit 55e7de7b193535133d4324e9f601ae44a0cdd9a7
Author: Boyuan Zhang <boyuan.zhang@amd.com>
Date:   Wed Oct 17 15:03:30 2018 -0400

    radeonsi: enable vcn jpeg decode for raven
    
    Enable vcn jpeg decode for raven.
    
    Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
    Reviewed-by: Leo Liu <leo.liu@amd.com>


Is that possible to either:
1) cherry-pick those vcn/va fixes to the 18.1 and 18.2 branches
2) disable unsupported formats support in the 18.2 and 18.2 branches
please?
Comment 1 Rafał Miłecki 2018-12-30 09:05:24 UTC
The announcement on Mesa 3D webpage says:

> NOTE: It is anticipated that 18.2.8 will be the final release in the 18.2 series. Users of 18.2 are encouraged to migrate to the 18.3 series in order to obtain future fixes.

So I guess nobody will care about cherry-picking those fixes? Should this just get closed? Boyuan could you comment on this?
Comment 2 Boyuan Zhang 2019-01-18 17:20:28 UTC
Hi Rafal,

First of all, sorry for getting back to you late. I somehow missed this message.

I took a look of your reported issue, but I got a little it confused here. So you saw color corruptions when playing a VP9 video using Ryzen 5 PRO 2500U (raven vcn), and you found that the "enable vcn jpeg deocde" patch/patch set can actually fix the VP9 color corruption, is that what you mean? I'm a bit confused why jpeg patch could affect VP9 decoding. Or did I misunderstand here? Please help me to clarify.

And it seems that there is no vcn jpeg decode support in 18.1 and 18.2 branch. I believe that vcn jpeg decode has been added to 18.3 branch.

Regards,
Boyuan
Comment 3 network723 2019-01-18 22:13:31 UTC
Looks just like Bug 104597
Comment 4 Rafał Miłecki 2019-03-17 18:01:14 UTC
Hey Boyuan,

thanks for looking at this issue! I agree it's quite confusing, but I finally found out what's going on.

*****

Let me provide a new summary of Mesa releases & this problem:

1) Accelerated VP9 decoding in Chromium is broken with 18.1 & 18.2.
2) Video Acceleration DOESN'T WORK in Chromium with 18.3.0 - 18.3.3
3) Accelerated VP9 decoding in Chromium is broken with 18.3.4 & 19.0.

By "broken" I mean corrupted colors.

*****

Earlier confusion was due to the commit 55e7de7b1935 ("radeonsi: enable vcn jpeg decode for raven") EXPOSING a bug 109107 which was related to reporting profiles. That commit STOPPED Chromium from using Video Acceleration and made it report following errors:
[21202:21202:0317/122002.223002:ERROR:vaapi_wrapper.cc(587)] : vaQueryConfigProfiles returned: 14
[21202:21202:0317/122002.223045:ERROR:vaapi_wrapper.cc(587)] : vaQueryConfigProfiles returned: 14

Bug 109107 got fixed with the commit 21cdb828a3f4 ("st/va: fix the incorrect max profiles report") and since then:
1) Chromium uses Video Acceleration again
2) I see corrupted VP9 YouTube colors again

So the commit 55e7de7b1935 ("radeonsi: enable vcn jpeg decode for raven") DIDN'T FIX anything but has only hidden the original problem. It stopped Chromium from using Video Acceleration including VP9 hardware decoding.

*****

The problem is still there (in the 18.3.4, 19.0 and master) and needs to be fixed :(
Comment 5 Michael Eagle 2019-03-17 21:11:17 UTC
Created attachment 143704 [details]
attachment-418-0.html

Does the 'corrupted colors' situation improve if you start chromium with
the following:

allow_rgb10_configs=false chromium

?
Comment 6 GitLab Migration User 2019-09-25 18:44:17 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/1350.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.