It looks like the content of the bin file is ignored and only the filename is used to select among the available built in modes. As an example an empty 1024x768.bin file correctly select the built in mode 1024x768. If the file name is different from the built in modes, the edid injection fails.
This behavior is evident in the file ~/bin/build-torizon/tmp/work-shared/verdin-imx8mp/kernel-source/drivers/gpu/drm/drm_edid_load.c
I could not find a method to inject a custom format ex: 1280x800
Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!
Did you like my answer?
To inject a custom EDID mode, you can follow these steps:
Create a Custom EDID File:
Use a tool like edid-decode to create a custom EDID file. You can generate an EDID file with the desired resolution and timings. For example, you can use edid-generator or edid-decode to create a custom EDID file.
Convert the EDID File to Binary:
Ensure that the EDID file is in binary format. If you have an EDID file in text format, you can convert it to binary using tools like xxd or hexdump.
Place the EDID File in the Firmware Directory:
Copy the binary EDID file to the /lib/firmware/edid/ directory on your target system. For example:
sudo cp custom_edid.bin /lib/firmware/edid/
Modify the Kernel Command Line:
Add the following parameter to the kernel command line to load the custom EDID file:
drm.edid_firmware=edid/custom_edid.bin
You can modify the kernel command line in the U-Boot environment. For example:
After rebooting, you can verify that the custom EDID has been loaded by checking the DRM logs. You can use the dmesg command to check the logs:
dmesg | grep EDID
If you encounter issues with the custom EDID not being recognized, ensure that the EDID file is correctly formatted and that the kernel has the CONFIG_DRM_LOAD_EDID_FIRMWARE option enabled.
If the above steps do not work, you may need to modify the kernel source code to support custom EDID injection. Specifically, you can look into the drm_edid_load.c file and make necessary changes to support custom resolutions.
Thanks for opening another topic.
You should be able to try load any edid binary using this method.
What could be the problem in this case is that you are trying to load a firmware with the same name and path as one of the built-in edid configurations.
Can you try to put your edid file in /lib/firmware and set the kernel argument to load it from there?
setenv tdxargs drm.edid_firmware=800x600.bin
This should work as I have tested this with small timings adjustments in the past.
Hi @bruno.tx,
I tried. I copied the compiled edid file 800x600.bin from the source file 800x600.S.
The file was copied in both /lib/firmware and /lib/firmware/edid
ls -l /lib/firmware/800x600.bin /lib/firmware/edid/800x600.bin
-rw-r–r-- 1 root root 128 Sep 4 13:57 /lib/firmware/800x600.bin
-rw-r–r-- 1 root root 128 Sep 4 13:57 /lib/firmware/edid/800x600.bin
If I use
setenv tdxargs drm.edid_firmware=800x600.bin
I receive the error:
[ 2.729913] [drm:edid_load] ERROR Requesting EDID firmware “800x600.bin” failed (err=-2)
If I use
setenv tdxargs drm.edid_firmware=edid/800x600.bin
then no error is generated.
Furthermore, I’m sure that the 800X600.bin file generate is correct because I converted to binary the generic_edid[0] array obtained from the file ~/bin/build-torizon/tmp/work-shared/verdin-imx8mp/kernel-source/drivers/gpu/drm/drm_edid_load.c. This array is the one used when the built in mode 800x600 is used. This binary file has the same content of the 800x600.bin file I used for the test. 800x600.bin (128 Bytes)
Thanks for trying this.
I believe the actual issue here is that your custom edid is not available when the kernel tries to load it.
Can you try to put the edid file in the /ostree/deploy/torizon/deploy/<ostree hash>/lib/firmware directory instead of remounting the partitions as read/write?
Please note that <ostree hash> will change depending on the currently installed image.
If the file is the directory above, it will be available to the kernel at boot.
In the folder
/ostree/deploy/torizon/deploy/b12faa53b893915925285efd96bc240ee08bd011de32d0acd3521822684edcac.0/lib/firmware/
there is already an edid file 800x600.bin.
Thanks for the clarification.
I can confirm that I was able to reproduce this problem on a Verdin iMX8M Plus.
Recently I supported another user doing the exact same thing and it worked on an Apalis iMX8, so I will look into what may be the difference here.
Once there are more updates I will send them here.
Upon further investigation, I was able to conclude that the procedure described above works for the Apalis iMX8, but not for the Verdin iMX8M Plus when using the same version of Torizon OS (6.7.0).
I will raise this internally so we can fix it.