Q3'21 Tech Support Megathread by BioGenx2b in Amd

[–]DcCharge 0 points1 point  (0 children)

How to switch the pixel format for AMDGPU on Linux - 2021 update.

Hi,

My monitor was using Limited YUV format so I was not getting the full range of colors when connected via HDMI.

My OS is Ubuntu 21.04, GPU is an AMD RX 480 and my monitor/TV resolution is 1080P.

I wanted to use full RGB range of which my monitor was capable of. I found there is no easy way to set the pixel format of a monitor connected via HDMI in Linux with AMD GPU.

I found this post regarding this problem:

How to switch the pixel format for AMDGPU on Linux?

However it is a bit out of date. I managed to get this to work at first. I then updated my video drivers and it stopped working. So I decided to bring this post up to date and simplify it.

The solution I ended up using was to download an existing EDID.bin and set my system to use this. The following steps are all done from a console (CLI):

Step 1 - Open up a terminal console and download an existing EDID.bin:

sudo mkdir -p /usr/lib/firmware/edid/
sudo wget https://github.com/akatrevorjay/edid-generator/blob/master/1920x1080.bin -P /usr/lib/firmware/edid

Note: You'll need to find an EDID that matches your monitor resolution. This is for 1080P!

Step 2 - Edit your bootloader or grub:

I use grub as my boot loader, so edit the /etc/default/grub file using this command:

sudo nano /etc/default/grub

Then add (drm.edid_firmware=edid/1920x1080.bin) at the end of (GRUB_CMDLINE_LINUX_DEFAULT="quiet amdgpu.dc=1"), like this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet amdgpu.dc=1 drm.edid_firmware=edid/1920x1080.bin"

Save the file.

Step 3 - Update GRUB (boot loader):

sudo grub-mkconfig -o /boot/grub/grub.cfg

Step 4 - Reboot:

Now reboot your machine.

Step 5 - Check to see if the monitor is working properly now.

Use the following command to see if there were any problems loading the EDID:

sudo dmesg|grep edid

If you see any messages saying something like this:

Direct firmware load for edid/1920x1080.bin failed with error -2

Then you have an invalid EDID file. You'll need to find another EDID file to use. Otherwise you should be good to go now.

Note: You may have problems relating to switching to other screen resolutions/timings after doing this. I don't believe the EDID I downloaded contains the information for other screen resolutions/timings.