timvideos / HDMI2USB-litex-firmware

A version of the HDMI2USB firmware based around LiteX tools produced by @Enjoy-Digital (based on misoc+migen created by @M-Labs)
https://hdmi2usb.tv
BSD 2-Clause "Simplified" License
145 stars 71 forks source link

The EDID being read should notify the softcore #79

Open mithro opened 8 years ago

mithro commented 8 years ago

On the Atlys we don't have access to the hotplug line, so we don't know when a new device is plugged in. Most devices will however read the EDID information right after being connected. Hence if we have yet to see a valid signal, the EDID being read is a good sign we should try looking for one.

Hence the softcore needs to be notified when the EDID is read.

mithro commented 8 years ago

This is possible a duplicate of https://github.com/timvideos/HDMI2USB-misoc-firmware/issues/39

fallen commented 8 years ago

It is straight forward to set hdmi_in0_connected to 1 when the EDID is being read by the mean of raising an IRQ when the EDID FSM is not in its WAIT_START state. The IRQ handler running on the LM32 would then set the global variable hdmi_in0_connected to 1.

But on which condition do we set it back to 0? How can we detect that the source has been unplugged? Do we keep hdmi_in0_connected set to 1 regardless?

mithro commented 8 years ago

I think we want a hdmi_in0_edid_started and a hdmi_in0_edid_finished notifications (maybe with timestamps?). Like normal interrupts, they should be triggered by the gateware and then clearable by the lm32 firmware.

fallen commented 8 years ago

Can someone test this on Atlys board / hdmi2usb target? https://github.com/fallen/HDMI2USB-misoc-firmware/commit/5d771720b6553665b87058ae7fbe1d077dd0a5f6