Detecting HDMI attach/detach with drm driver active?

I'm trying to get hot resizing working. When I plug in HDMI monitor, extend the desktop; when I detach, collect all applications on my laptop. I thought that I could hook into devd(8)(), but I can't detect an event there (while I am doing just such a thing for USB attach/detach). I will note that I have the drm module for i915kms running. Is there a way to hook into that to detect an event that starts a reconfiguration?

I thought that xrandr(1)() might be the way, but right now, on my laptop on my couch it's showing:

$ xrandr|grep HDMI
HDMI-1 connected (normal left inverted right x axis y axis)


and I definitely do not have a cable long enough to run back to my desk to make that true!
 
Is there a way to hook into that to detect an event that starts a reconfiguration?
HDMI also contains I2C signalling for the HDMI handshake so maybe you could monitor i2c for chatter?

 
The i2c-tools port has hooks into python. Even though encrypted just the presence of a signal exchange might be enough to give you a bone to pick on.
 
Back
Top