0

My monitor is displaying everything in pink-green color

I had same issue in Windows but fixed it by changing display's pixel format from YCbCr 4:4:4 to Full RGB 4:4:4 in AMD Radeon software. But how do I do that in Ubuntu?

View image of my monitor

I have Ryzen 5 5600G no dGPU + Samsung monitor

2 Answers 2

2

The amdgpu drivers do not support switching the display pixel format. People are/were working on a fix for that feature, but none has been completed yet because of various issues. See this GitLab issue for details.

However, there is a hack involving changing the EDID data of the display, so that it only reports as supporting RGB and not YCbCr. It works as follows:

  1. Install wxedid (must enable the universe repository first) using
sudo apt update && sudo apt install wxedid
  1. Find where the EDID for your monitor is stored using xrandr --props, then find where the EDID is listed for your monitor. If you are using Wayland, you may have to switch to xorg first in order for this to work.

  2. get the EDID data from your monitor and copy it to a file on your device

cp /substitute/this/with/whatever/you/found/from/the/last/step  ~/edid.bin
  1. run wxedid and edit the edid.bin file in your home directory. Do the following:

    1. Find SPF: Supported features -> vsig_format -> replace 0b01 wih 0b00
    2. Find CHD: CEA-861 header -> change the value of YCbCr420 and YCbCr444 to 0
    3. Recalculate the checksum: Options > Recalc Checksum
    4. Save the file
  2. Tell the kernel to use the file:

    1. sudo mkdir /lib/firmware/edid
    2. sudo mv edid.bin /lib/firmware/edid/edid.bin
    3. edit Grub to add the following kernel parameter: drm.edid_firmware=HDMI-A-1:edid/edid.bin
    4. regenerate your initramfs
    5. reboot
0

I was trying to use these instructions but had a devil of a time with dumping edid.bin. A mix of printf and perl finally seemed to work converting from ascii to hex:

printf '%b' $(xrandr --props | perl -pe 's/^((?![[:xdigit:]]{32}).)*$//g ; s/[\s\t]+//g ; s/([[:xdigit:]]{2})/\\x\1/g') > edid.bin

Use the expressions alone to check output:

 xrandr --props | perl -pe 's/^((?![[:xdigit:]]{32}).)*$//g ; s/[\s\t]+//g'
 xrandr --props | perl -pe 's/^((?![[:xdigit:]]{32}).)*$//g ; s/[\s\t]+//g ; s/([[:xdigit:]]{2})/\\x\1/g'

perl captures only lines that contain 32 hex characters, strips out whitespace/tabs, then reformats each two-digit pair to \x## so that printf interprets the escape sequence to ouput hex. The other accepted method uses edid-decode:

 xrandr --verbose | edid-decode - edid.bin

It wouldn't work in a multi-monitor environment since multiple edids would be present.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .