A crappy script to set custom EDID without YCbCr support to force RGB output on HDMI when using Radeon GPUs.
Thanks to:
https://www.wezm.net/v2/posts/2020/linux-amdgpu-pixel-format/
https://gist.github.com/RLovelett/171c374be1ad4f14eb22fe4e271b7eeb
I wrote this for personal use, oriented to Arch Linux + GRUB (with initial support for Fedora and Debian-based distros) using a patched EDID from my AOC 22" monitor that may not be suitable for your use case. Please refer to the links above for custom EDID creation steps.
I switched to a laptop with the Ryzen 5 4500U "APU", which contains a Radeon integrated GPU. I use a cheap external HDMI monitor that doesn't allow to choose a pixel input format, but its EDID reports being compatible with YCbCr, since amdgpu hardcodes this pixel format when is detected as supported, the result is a terrible dark and oversaturated image.
There is an easy fix for Windows users, via Radeon Software:
However, for Linux users there are two ways of fixing this issue:
- Patching amdgpu and recompiling the kernel.
- Tricking the GPU into thinking YCbCr is not supported to force RGB using a custom EDID.
I decided to take the second approach because the kernel is frequently updated in Arch Linux and I don't feel Gentoo-user enough to recompile it patched on every update.
Simply clone the repo and run rgb.sh
as root.
# git clone https://github.com/ncr6/rgb-hdmi-aoc-amdgpu
# cd rgb-hdmi-aoc-amdgpu
# ./rgb.sh