]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
HACK: drm/msm/adv7511: Don't rely on interrupts for EDID parsing
authorArchit Taneja <architt@codeaurora.org>
Mon, 29 Jan 2018 10:15:08 +0000 (15:45 +0530)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Wed, 11 Apr 2018 16:43:54 +0000 (13:43 -0300)
BugLink: http://bugs.launchpad.net/bugs/1763040
The adv7511 driver is currently woken up on successful EDID read
after a EDID_READY interrupt is triggered by the chip. If the driver
doesn't get the interrupt within 200 ms, its concluded that we failed
to read EDID from the monitor.

This interrupt doesn't seem to occur consistently in certain use cases
(for example, if we execute power-on -> get_modes -> power-off
repeatedly, this can be done by calling xrandr successively really
fast).

For now, execute the lesser preferred POLL path where the driver
manually checks on the interrupt status register after every 25ms.

We should ideally rootcause why we don't get EDID_READY interrupts
consistently instead of relying on the above approach.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
(cherry picked from commit 38d51d8575e77c2c79f0959774eb3da9bb5c6562
http://git.linaro.org/landing-teams/working/qualcomm/kernel.git release/qcomlt-4.14)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/gpu/drm/bridge/adv7511/adv7511_drv.c

index 9d6e93a7a56d4d6c6ef4976dc2f1b6df96030b07..301f59c06c1184b0f28dbbce8159c93e6fae4313 100644 (file)
@@ -496,7 +496,13 @@ static int adv7511_wait_for_edid(struct adv7511 *adv7511, int timeout)
 {
        int ret;
 
-       if (adv7511->i2c_main->irq) {
+       /*
+        * HACK: EDID-Ready interrupt doesn't seem to happen if we try to do
+        * "power-on - read EDID - power-off" consecutively really fast.
+        * Inserting a delay after powering on ADV7511 improves things a
+        * bit but doesn't solve it entirely.
+        */
+        if (0 /*adv7511->i2c_main->irq*/) {
                ret = wait_event_interruptible_timeout(adv7511->wq,
                                adv7511->edid_read, msecs_to_jiffies(timeout));
        } else {