CHROMIUM: drm/i915/intel_drv: reduce wait_for polling time
authorDaniel Kurtz <djkurtz@chromium.org>
Tue, 8 May 2012 00:32:41 +0000 (00:32 +0000)
committerOlof Johansson <olof@lixom.net>
Fri, 1 Jun 2012 06:51:29 +0000 (23:51 -0700)
Currently, 400kHz i2c transactions on i915 ddc adapters are gated by
long polling loops in the wait_for() macro.
For the case where the polling loops sleep, make them tighter by
converting a msleep(1) to usleep_range(50, 100);

A better solution might be to eliminate this polling entirely, and use
the i915 interrupts to detect state transitions instead of polling.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:26118
TEST=i2c reads over ddc succeed.  On a scope, single transactions no
  longer have large gaps.

Change-Id: I96cef50ed8a3d0ad8a3c6fa6f079234242fa17d3
Reviewed-on: https://gerrit.chromium.org/gerrit/17937
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>

drivers/gpu/drm/i915/intel_drv.h

index 715afa1..ffd3823 100644 (file)
@@ -40,7 +40,8 @@
                        ret__ = -ETIMEDOUT;                             \
                        break;                                          \
                }                                                       \
-               if (W && drm_can_sleep()) msleep(W);    \
+               if (W && drm_can_sleep())                               \
+                       usleep_range(W * 50, W * 100);                  \
        }                                                               \
        ret__;                                                          \
 })