Re: inteldrm: reduce i2c busy-wait to 100us

2017-11-03 Thread joshua stein
On Wed, 11 Oct 2017 at 11:16:07 +0200, Mark Kettenis wrote:
> > Date: Tue, 10 Oct 2017 15:42:26 -0500
> > From: joshua stein 
> > 
> > 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.
> 
> This will need careful testing on older hardware, especially with
> multi-screen desktop setups.

Has anyone tested this on multi-screen desktop setups?



Re: inteldrm: reduce i2c busy-wait to 100us

2017-10-11 Thread Mark Kettenis
> Date: Tue, 10 Oct 2017 15:42:26 -0500
> From: joshua stein 
> 
> 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.

This will need careful testing on older hardware, especially with
multi-screen desktop setups.

> 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 -  1.12
> +++ sys/dev/pci/drm/i915/intel_i2c.c  10 Oct 2017 20:32:59 -
> @@ -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);
> 
> 



inteldrm: reduce i2c busy-wait to 100us

2017-10-10 Thread joshua stein
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.c30 Sep 2017 07:36:56 -  1.12
+++ sys/dev/pci/drm/i915/intel_i2c.c10 Oct 2017 20:32:59 -
@@ -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);