On my Kaby Lake laptop, running xbacklight or xrandr causes the
audio and mouse cursor to pause briefly.  This is because those
codepaths do DRM operations that have to probe all of the available
connectors, even disconnected ones.  For HDMI, it does i2c
operations that have to timeout.

Reducing the DELAY() calls to 100us avoids this, while still making
HDMI output work when it's actually connected.

intel_gmbus_exec appears to be an OpenBSD-specific function.


Index: sys/dev/pci/drm/i915/intel_i2c.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/drm/i915/intel_i2c.c,v
retrieving revision 1.12
diff -u -p -u -p -r1.12 intel_i2c.c
--- sys/dev/pci/drm/i915/intel_i2c.c    30 Sep 2017 07:36:56 -0000      1.12
+++ sys/dev/pci/drm/i915/intel_i2c.c    10 Oct 2017 20:32:59 -0000
@@ -231,7 +231,7 @@ intel_gmbus_exec(void *cookie, i2c_op_t 
                                st = I915_READ(GMBUS2);
                                if (st & (GMBUS_SATOER | GMBUS_HW_RDY))
                                        break;
-                               DELAY(1000);
+                               DELAY(100);
                        }
                        if (st & GMBUS_SATOER) {
                                bus_err = 1;
@@ -254,7 +254,7 @@ intel_gmbus_exec(void *cookie, i2c_op_t 
                                st = I915_READ(GMBUS2);
                                if (st & (GMBUS_SATOER | GMBUS_HW_RDY))
                                        break;
-                               DELAY(1000);
+                               DELAY(100);
                        }
                        if (st & GMBUS_SATOER) {
                                bus_err = 1;
@@ -279,7 +279,7 @@ out:
                                bus_err = 1;
                        if ((st & GMBUS_ACTIVE) == 0)
                                break;
-                       DELAY(1000);
+                       DELAY(100);
                }
                if (st & GMBUS_ACTIVE)
                        return (ETIMEDOUT);

Reply via email to