OSDN Git Service

drm/i2c: tda998x: re-implement "Fix EDID read timeout on HDMI connect"
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 6 Jun 2015 20:41:09 +0000 (21:41 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 15 Sep 2015 15:19:48 +0000 (16:19 +0100)
commit0fc6f44d9683c61678da4b0eebc89e8fa624de39
treebf0e5d5e975a34c36e352d48609e0a1df7e871c8
parentf84a97d4804a09240372dc7b195f9d6162152228
drm/i2c: tda998x: re-implement "Fix EDID read timeout on HDMI connect"

Commit 6833d26ef823 ("drm: tda998x: Fix EDID read timeout on HDMI
connect") used a weak scheme to try and delay reading EDID on a HDMI
connect event.  It is weak because delaying the notification of a
hotplug event does not stop userspace from trying to read the EDID
within the 100ms delay.

The solution provided here solves this issue:
* When a HDMI connection event is detected, mark a blocking flag for
  EDID reads, and start a timer for the delay.
* If an EDID read is attempted, and the blocking flag is set, wait
  for the blocking flag to clear.
* When the timer expires, clear the blocking flag and wake any thread
  waiting for the EDID read.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/gpu/drm/i2c/tda998x_drv.c