Revert "drm: i2c: tda998x: Retry fetching the EDID if it fails first time."
authorLiviu Dudau <Liviu.Dudau@arm.com>
Fri, 8 Aug 2014 13:40:30 +0000 (14:40 +0100)
committerLiviu Dudau <Liviu.Dudau@arm.com>
Fri, 8 Aug 2014 13:44:52 +0000 (14:44 +0100)
This reverts commit 7d0d4cedd12513703239172eb9a7a3465cb8a6ec.

This was a stopgap solution until the real bug was properly understood.
Now that I2C transactions can be relied on, we don't need this anymore.

Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
drivers/gpu/drm/i2c/tda998x_drv.c

index 7e106f3..514e509 100644 (file)
@@ -1073,38 +1073,13 @@ read_edid_block(struct drm_encoder *encoder, uint8_t *buf, int blk)
        return 0;
 }
 
-static int
-read_validate_edid_block(struct drm_encoder *encoder, uint8_t *buf, int blk)
-{
-       bool print_bad_edid = drm_debug & DRM_UT_KMS;
-       int ret;
-       int retries = 1;
-
-       do
-       {
-               bool print_bad = print_bad_edid && (retries == 0);
-
-               ret = read_edid_block(encoder, buf, blk);
-               /* Fail on I2C error */
-               if (ret)
-                       break;
-
-               /* But retry checksum errored blocks */
-               if (drm_edid_block_valid(buf, blk, print_bad))
-                       break;
-               else
-                       ret = -EINVAL;
-       } while (retries-- > 0);
-
-       return ret;
-}
-
 static uint8_t *
 do_get_edid(struct drm_encoder *encoder)
 {
        struct tda998x_priv *priv = to_tda998x_priv(encoder);
        int j, valid_extensions = 0;
        uint8_t *block, *new;
+       bool print_bad_edid = drm_debug & DRM_UT_KMS;
 
        if ((block = kmalloc(EDID_LENGTH, GFP_KERNEL)) == NULL)
                return NULL;
@@ -1113,7 +1088,10 @@ do_get_edid(struct drm_encoder *encoder)
                reg_clear(priv, REG_TX4, TX4_PD_RAM);
 
        /* base block fetch */
-       if (read_validate_edid_block(encoder, block, 0))
+       if (read_edid_block(encoder, block, 0))
+               goto fail;
+
+       if (!drm_edid_block_valid(block, 0, print_bad_edid))
                goto fail;
 
        /* if there's no extensions, we're done */
@@ -1127,7 +1105,10 @@ do_get_edid(struct drm_encoder *encoder)
 
        for (j = 1; j <= block[0x7e]; j++) {
                uint8_t *ext_block = block + (valid_extensions + 1) * EDID_LENGTH;
-               if (read_validate_edid_block(encoder, ext_block, j))
+               if (read_edid_block(encoder, ext_block, j))
+                       goto fail;
+
+               if (!drm_edid_block_valid(ext_block, j, print_bad_edid))
                        goto fail;
 
                valid_extensions++;