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

Generate a message on the UART when EDID state changes #39

Open mithro opened 9 years ago

mithro commented 9 years ago

There are many reasons that a computer might detect the HDMI2USB when connected. We need better tools for debugging what is going on when this happens. Reading the EDID data is an important step in the computer detecting the device, hence we should have strong debugging around the EDID lines.

My suggestions are;

  1. By default, generate a message on the UART any time EDID is attempted to be read with if we think it was successful or not.
  2. Be able to turn on "edid debugging" which generates messages on the UART for each state transition the EDID (and information about the state when that occurs) emulation goes through.
  3. Be able to record the "raw signals" that are occurring on the EDID pins though something like liteScope (include the HPD information on the Opsis too). We want to get something which we can load into gtkwave and as closely as possible reflects what the electrical signals on the lines look like. This probably means that flterm+liteScope will need a way to dump the recorded data via the same UART that has the terminal on it.

Ultimately, we want to be able to corrolate the events seen to occur via the HDMI2USB UART and the debug information we get from doing a echo 6 > /sys/module/drm/parameters/debug (as shown on https://github.com/timvideos/HDMI2USB/wiki/EDID-Related-Code).

Some example messages that we have seen in the debug output log;

[11273.184291] [drm:intel_tv_detect], [CONNECTOR:25:SVIDEO-1] force=0
[11274.559525] [drm:i965_irq_handler], hotplug event received, stat 0x38040000
[11274.559545] [drm:intel_hpd_irq_handler], Received HPD interrupt on PIN 4 - cnt: 0
[11274.559607] [drm:i915_hotplug_work_func], running encoder hotplug functions
[11274.559615] [drm:i915_hotplug_work_func], Connector HDMI-A-1 (pin 4) received hotplug event.
[11274.559621] [drm:i915_hotplug_work_func], Connector DP-1 (pin 4) received hotplug event.
[11274.559630] [drm:intel_hdmi_detect], [CONNECTOR:14:HDMI-A-1]
[11274.560151] [drm:gmbus_xfer], GMBUS [i915 gmbus dpb] NAK for addr: 0050 w(1)
[11274.560161] [drm:gmbus_xfer], GMBUS [i915 gmbus dpb] NAK on first message, retry
[11274.564120] [drm:gmbus_xfer], GMBUS [i915 gmbus dpb] NAK for addr: 0050 w(1)
[11274.564128] [drm:drm_do_probe_ddc_edid], drm: skipping non-existent adapter i915 gmbus dpb
[11274.564137] [drm:intel_dp_detect], [CONNECTOR:18:DP-1]
[11274.566542] [drm:intel_dp_aux_ch], dp_aux_ch timeout status 0x51450064
[11274.574683] [drm:intel_dp_aux_ch], dp_aux_ch timeout status 0x51450064
[11274.582668] [drm:intel_dp_aux_ch], dp_aux_ch timeout status 0x51450064
[11283.200299] [drm:intel_tv_detect], [CONNECTOR:25:SVIDEO-1] force=0
[11293.216297] [drm:intel_tv_detect], [CONNECTOR:25:SVIDEO-1] force=0
mithro commented 9 years ago

The https://github.com/timvideos/HDMI2USB-misoc-firmware/issues/33 issue is tracking related stuff for the hot plug lines.