diff mbox

CHROMIUM: drm/i915/intel_drv: reduce wait_for polling time

Message ID 1376613069-15790-35-git-send-email-james.ausmus@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

James Ausmus Aug. 16, 2013, 12:30 a.m. UTC
From: Daniel Kurtz <djkurtz@chromium.org>

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:246465
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>
Reviewed-on: https://gerrit.chromium.org/gerrit/57458
Tested-by: Yufeng Shen <miletus@chromium.org>
Commit-Queue: Yufeng Shen <miletus@chromium.org>
---
 drivers/gpu/drm/i915/intel_drv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 60ec305..9f32cfc 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -42,7 +42,7 @@ 
 			break;						\
 		}							\
 		if (W && drm_can_sleep())  {				\
-			msleep(W);					\
+			usleep_range(W * 50, W * 100);			\
 		} else {						\
 			cpu_relax();					\
 		}							\