>From a121507f31e37a809dfa21c9756aa83f36d7acbf Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <ar...@linux.intel.com>
Date: Mon, 23 Mar 2009 13:37:20 -0700
Subject: [PATCH] KMS: do a faster EDID

for some outputs (like LVDS), the current delays in the EDID reader are way
overkill.

This patch makes the EDID reader try twice; first with a 5x faster probe, and
if that fails, it probes at the current speed. This reduces probe time on my 
LVDS
panel significantly.

Signed-off-by: Arjan van de Ven <ar...@linux.intel.com>
---
 drivers/gpu/drm/drm_edid.c |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index a839a28..069b189 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -588,20 +588,22 @@ static unsigned char *drm_ddc_read(struct i2c_adapter 
*adapter)
 {
        struct i2c_algo_bit_data *algo_data = adapter->algo_data;
        unsigned char *edid = NULL;
+       int divider = 5;
        int i, j;
 
        algo_data->setscl(algo_data->data, 1);
 
-       for (i = 0; i < 1; i++) {
+       for (i = 0; i < 2; i++) {
                /* For some old monitors we need the
                 * following process to initialize/stop DDC
                 */
+
                algo_data->setsda(algo_data->data, 1);
-               msleep(13);
+               msleep(13 / divider);
 
                algo_data->setscl(algo_data->data, 1);
                for (j = 0; j < 5; j++) {
-                       msleep(10);
+                       msleep(10 / divider);
                        if (algo_data->getscl(algo_data->data))
                                break;
                }
@@ -609,31 +611,33 @@ static unsigned char *drm_ddc_read(struct i2c_adapter 
*adapter)
                        continue;
 
                algo_data->setsda(algo_data->data, 0);
-               msleep(15);
+               msleep(15 / divider);
                algo_data->setscl(algo_data->data, 0);
-               msleep(15);
+               msleep(15  / divider);
                algo_data->setsda(algo_data->data, 1);
-               msleep(15);
+               msleep(15 / divider);
 
                /* Do the real work */
                edid = drm_do_probe_ddc_edid(adapter);
                algo_data->setsda(algo_data->data, 0);
                algo_data->setscl(algo_data->data, 0);
-               msleep(15);
+               msleep(15 / divider);
 
                algo_data->setscl(algo_data->data, 1);
                for (j = 0; j < 10; j++) {
-                       msleep(10);
+                       msleep(10 / divider);
                        if (algo_data->getscl(algo_data->data))
                                break;
                }
 
                algo_data->setsda(algo_data->data, 1);
-               msleep(15);
+               msleep(15 / divider);
                algo_data->setscl(algo_data->data, 0);
                algo_data->setsda(algo_data->data, 0);
+
                if (edid)
                        break;
+               divider = 1;
        }
        /* Release the DDC lines when done or the Apple Cinema HD display
         * will switch off
-- 
1.6.0.6




-- 
Arjan van de Ven        Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to