hoglet67 / RGBtoHDMI

Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI
GNU General Public License v3.0
835 stars 113 forks source link

Use EDID for automatic adjustment to monitor geometry #1

Open BigEd opened 6 years ago

BigEd commented 6 years ago

If it can be done in bare metal, perhaps read the monitor's capabilities by EDID and adjust automatically?

In linux, you'd use tvservice -d edid.dat ; edidparser edid.dat

Perhaps TAG_GET_EDID_BLOCK in rpi-mailbox-interface.h is a clue.

The hope being that this removes the need to adjust the config file for different monitors.

hoglet67 commented 6 years ago

Yes, that would be a great feature.

What I'm not sure about is how easy it is to change the actual HDMI screen mode that's being used programatically. Currently this is set in config.txt, e.g.:

# 1920x1080p @ 50Hz
hdmi_group=1
hdmi_mode=31
overscan_top=-48
overscan_bottom=-48
overscan_left=240
overscan_right=240
framebuffer_aspect=-1

Dave

BigEd commented 6 years ago

So do we need a baremetal equivalent to tvservice --explicit=<string>? Ref: https://raspberrypi.stackexchange.com/a/40681

BigEd commented 6 years ago

(perhaps see https://github.com/raspberrypi/userland/blob/52758b7637d83530435ab2080d4f9b8ccf044710/interface/vmcs_host/vc_vchi_tvservice.c#L1008 )

hoglet67 commented 6 years ago

This looks relevant: https://github.com/raspberrypi/firmware/issues/637

BigEd commented 6 years ago

Good find!