Bug 508615 - Weird color behavior when playing HDR videos using MPV dmabuf-wayland
Summary: Weird color behavior when playing HDR videos using MPV dmabuf-wayland
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: colour-management (other bugs)
Version First Reported In: 6.4.4
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-22 17:20 UTC by Shengyu Qu
Modified: 2025-10-22 11:43 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.4.6
Sentry Crash Report:


Attachments
WAYLAND_DEBUG=1 log for mpv (990.08 KB, text/x-log)
2025-08-22 17:20 UTC, Shengyu Qu
Details
Screenshots to compare (3.53 MB, image/png)
2025-08-22 17:21 UTC, Shengyu Qu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shengyu Qu 2025-08-22 17:20:03 UTC
Created attachment 184357 [details]
WAYLAND_DEBUG=1 log for mpv

SUMMARY
When using MPV to playback HDR videos using dmabuf-wayland, some videos would become very gray-ish, while others behaves basically the same as gpu-next.

STEPS TO REPRODUCE
1. Download demo video from here: https://4kmedia.org/sony-camping-in-nature-4k-demo/
2. use MPV code from here to playback(this branch adds chroma_location support which is accidentally omitted from wp-color-representation-v1 implementation PR) https://github.com/Headcrabed/mpv/tree/chroma_loc
3. compare playback result between "vo=dmabuf-wayland" and "vo=gpu-next target-colorspace-hint=yes target-colorspace-hint-mode=source"

OBSERVED RESULT
dmabuf-wayland looks extremely gray than gpu-next, but from log we can find that color range and chroma location are set correctly.

EXPECTED RESULT
both vo would have very similar color.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 42
KDE Plasma Version: 6.4.4
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.1
Kernel Version: 6.15.10-200.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i5-1135G7 @ 2.40GHz
Memory: 16 GiB of RAM (15.4 GiB usable)
Graphics Processor: Intel® Iris® Xe Graphics

ADDITIONAL INFORMATION
This only happens in some HDR videos, others look great. Maybe they lack some extra metadata and gpu-next has different method to deal with this?
Comment 1 Shengyu Qu 2025-08-22 17:21:21 UTC
Created attachment 184358 [details]
Screenshots to compare
Comment 2 Shengyu Qu 2025-08-23 16:39:49 UTC
Update: now there's no need to use my custom branch of mpv. It's get merged. To test this just use mpv git master.
Comment 3 Zamundaaa 2025-09-01 11:46:30 UTC
dmabuf-wayland looks exactly the same as gpu-next here, the issue was probably missing bt1886 support.
Comment 4 Shengyu Qu 2025-09-01 13:47:42 UTC
(In reply to Zamundaaa from comment #3)
> dmabuf-wayland looks exactly the same as gpu-next here, the issue was
> probably missing bt1886 support.

Sorry the sample video link is wrong. That’s SDR version. My problem is about playing back HDR version of that video (PQ EOTF).
Download link here: https://drive.google.com/file/d/1LYGc7FQBGfNlBdtonOi8-U8m7zFJ9EI_/view?usp=drivesdk
Comment 5 Bug Janitor Service 2025-10-09 16:26:32 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8225
Comment 6 Zamundaaa 2025-10-10 14:04:53 UTC
Git commit 2e76f8fb4baa48f5f23af152a2042848f889705d by Xaver Hugl.
Committed on 10/10/2025 at 12:32.
Pushed by zamundaaa into branch 'master'.

colorrepresentation: fix color range being ignored
Related: bug 503080

M  +10   -3    src/backends/drm/drm_pipeline.cpp
M  +5    -0    src/core/colorspace.cpp
M  +1    -0    src/wayland/colorrepresentation_v1.cpp

https://invent.kde.org/plasma/kwin/-/commit/2e76f8fb4baa48f5f23af152a2042848f889705d
Comment 7 Zamundaaa 2025-10-10 18:53:32 UTC
Git commit 6f998dab335d73f62020eccc0a1a2ea4be3ee8fe by Xaver Hugl.
Committed on 10/10/2025 at 18:10.
Pushed by zamundaaa into branch 'Plasma/6.5'.

colorrepresentation: fix color range being ignored
Related: bug 503080


(cherry picked from commit 2e76f8fb4baa48f5f23af152a2042848f889705d)

Co-authored-by: Xaver Hugl <xaver.hugl@kde.org>

M  +10   -3    src/backends/drm/drm_pipeline.cpp
M  +5    -0    src/core/colorspace.cpp
M  +1    -0    src/wayland/colorrepresentation_v1.cpp

https://invent.kde.org/plasma/kwin/-/commit/6f998dab335d73f62020eccc0a1a2ea4be3ee8fe
Comment 8 Zamundaaa 2025-10-10 21:46:15 UTC
Git commit d0880fe10e92f124ab13cadc97b59657608ee096 by Xaver Hugl.
Committed on 10/10/2025 at 21:45.
Pushed by zamundaaa into branch 'Plasma/6.4'.

colorrepresentation: fix color range being ignored
Related: bug 503080
(cherry picked from commit 2e76f8fb4baa48f5f23af152a2042848f889705d)

M  +11   -3    src/backends/drm/drm_pipeline.cpp
M  +5    -0    src/core/colorspace.cpp
M  +1    -0    src/wayland/colorrepresentation_v1.cpp

https://invent.kde.org/plasma/kwin/-/commit/d0880fe10e92f124ab13cadc97b59657608ee096