drm/exynos: dp: Reduce video stream detection time
authorSean Paul <seanpaul@chromium.org>
Wed, 21 Nov 2012 17:38:40 +0000 (12:38 -0500)
committerGerrit <chrome-bot@google.com>
Mon, 26 Nov 2012 14:23:57 +0000 (06:23 -0800)
Reduce the time we take for video stream detection by removing the
"done_count" wait of 1.1s since it's not blocking anything from
happening.

Also replace the msleep(100) with a usleep_range since we don't need to
wait 100ms to retry the detection.

BUG=chrome-os-partner:15261
TEST=Tested on snow, display on time reduced from 1.3s to 90ms

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: Ib4ef14352256b6b6627a3dff8bf77db2f368e547
Reviewed-on: https://gerrit.chromium.org/gerrit/38470
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
drivers/gpu/drm/exynos/exynos_dp_core.c

index b81f510..142c0cf 100644 (file)
@@ -825,7 +825,6 @@ static int exynos_dp_config_video(struct exynos_dp_device *dp)
 {
        int retval = 0;
        int timeout_loop = 0;
-       int done_count = 0;
 
        exynos_dp_config_video_slave_mode(dp);
 
@@ -838,14 +837,14 @@ static int exynos_dp_config_video(struct exynos_dp_device *dp)
 
        for (;;) {
                timeout_loop++;
-               if (exynos_dp_is_slave_video_stream_clock_on(dp) == 0)
+               if (!exynos_dp_is_slave_video_stream_clock_on(dp))
                        break;
                if (DP_TIMEOUT_LOOP_COUNT < timeout_loop) {
-                       dev_err(dp->dev, "Timeout of video streamclk ok\n");
+                       dev_err(dp->dev, "Wait for stream clock timed out\n");
                        return -ETIMEDOUT;
                }
 
-               msleep(100);
+               usleep_range(1000, 5000);
        }
 
        /* Set to use the register calculated M/N video */
@@ -867,19 +866,15 @@ static int exynos_dp_config_video(struct exynos_dp_device *dp)
 
        for (;;) {
                timeout_loop++;
-               if (exynos_dp_is_video_stream_on(dp) == 0) {
-                       done_count++;
-                       if (done_count > 10)
-                               break;
-               } else if (done_count) {
-                       done_count = 0;
-               }
+               if (!exynos_dp_is_video_stream_on(dp))
+                       break;
+
                if (DP_TIMEOUT_LOOP_COUNT < timeout_loop) {
-                       dev_err(dp->dev, "Timeout of video streamclk ok\n");
+                       dev_err(dp->dev, "Wait for video stream timed out\n");
                        return -ETIMEDOUT;
                }
 
-               msleep(100);
+               usleep_range(1000, 5000);
        }
 
        if (retval != 0)