Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libmali g24p0-4 incorrect colors (gamma) on Mutter (GNOME Wayland) when using vulkan renderer #39

Open
StonedEdge opened this issue Dec 18, 2024 · 8 comments

Comments

@StonedEdge
Copy link

StonedEdge commented Dec 18, 2024

We've been testing the latest g24p0 blob drivers with Vulkan and I'm finding that the colors are not rendering correctly with Mutter, but work fine with Weston.

Is this something that Rockchip are able to reproduce with the Mutter compositor? This happens in multiple apps (AetherSX2, Lime3DS and Chromium when trying to run with the Vulkan renderer). My guess it is something incorrect with either the swapchain configuration, or some sort of mismatch between rendering output of Vulkan and expected colorspace for Mutter.

image

Vulkaninfo output:
https://pastebin.com/ZvCy3YkH

Current WSI layer:
https://drive.google.com/file/d/1sor29bVrSe_wCUE4ptDZYwoqyk6fDmN_/view?usp=sharing

Steps to Reproduce:
Launch a Vulkan application under GNOME (Wayland session).
Observe incorrect color rendering (washed-out or overly saturated colors), likely due to failure to do any proper gamma correction in swapchain.
Run the same Vulkan application under Weston and observe that the color rendering is correct.

Expected Behavior:
The Vulkan application should render colors correctly, similar to its behavior on Weston, without any noticeable color distortion or incorrect gamma levels.

Actual Behavior:
Colors are rendered incorrectly, likely due to a mismatch in how Mutter (or Wayland) handles color space or the swapchain in conjunction with the closed-source driver.

Environment:
Desktop Environment: GNOME (Wayland)
Compositor: Mutter

Additional Information:
I have confirmed that my WSI (Window System Integration) layer is functioning correctly.
I have verified that the same application(s) works as expected on Weston, without any color issues.
Debugging suggests that the issue may be related to color space handling (linear vs. sRGB) and the compositing behavior of Mutter.

@JeffyCN
Copy link
Owner

JeffyCN commented Dec 19, 2024

sorry, this is just a mirror repo, i don't know much about the details in mali DDK.

please mail the maintainers(Rockchip's GPU team) for support, and maybe provide a rootfs image for them to reproduce:
Zhixiong Lin [email protected]
Jacob Chen [email protected]
Zhen Chen [email protected]

@JeffyCN
Copy link
Owner

JeffyCN commented Dec 20, 2024

@Caesar-github

@StonedEdge
Copy link
Author

FWIW, this issue seems to only happen on a DSI display. With each screen mirroring one another, the issue becomes more obvious. The external monitor renders correctly but the DSI screen does not... I wonder if this is a quirk of the Rockchip DSI driver itself.

IMG_6139.mov

@JeffyCN
Copy link
Owner

JeffyCN commented Jan 10, 2025

don't know much about that, but if it only happen on DSI, maybe not related to GPU.

maybe try to use kmsgrab to dump the display buffer:
https://filebin.net/53l5wb21wua42cg4/kmsgrab

usage
kmsgrab --help
Usage:
kmsgrab [--crtc|--connector|--plane|--fb] OBJ_ID > out
Valid crtcs: 144
:
kmsgrab --crtc 144 > /tmp/dump.raw
fb handle=1 size=1080x1920(4352)
first pixel: ff555555

if the buffer is correct, should be something wrong with the DSI, then you can contact the RK DSI maintainers(check the kernel driver's commit log)

@ginkage
Copy link

ginkage commented Jan 11, 2025

Haven't tried kmsgrab yet, but there is something I want to point out here.
The actual issue is not about gamma as such, the issue is that the swapchain buffers are rendered as translucent instead of being opaque. You can see it by running e.g. vkcube: even under Weston, it will be displayed in a semi-transparent box.
The difference between HDMI and DSI there is that HDMI has the whole screen buffer cleared every frame, whereas DSI keeps layering those translucent frames on top of each other, causing eventual color burnout.
So, the question is, how can that translucency be fixed? It could be a WSI issue, of course: we're using the standard one, and ARM doesn't post the modifications they did to it (and I know for a fact that they did modify it). I wonder if there's a Rockchip internal repo with the WSI for G610, and if that can be published.

@JeffyCN
Copy link
Owner

JeffyCN commented Jan 11, 2025

Arm doesn't allow to publish code.

Maybe you can ask jacob about it:
Jacob Chen [email protected]

@ginkage
Copy link

ginkage commented Jan 11, 2025

Why though? In theory, they should be doing it: https://developer.arm.com/downloads/-/mali-drivers/vulkan-wsi-layer
In practice, that page hosts some ancient sources without actual changes.

@JeffyCN
Copy link
Owner

JeffyCN commented Jan 13, 2025

no idea about that, please mail the maintainers for detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants