From mboxrd@z Thu Jan 1 00:00:00 1970 From: Egbert Eich Subject: [PATCH 04/17] DRM/KMS/EDID: Test EDDC if EDID announces more than one Extension Block. Date: Mon, 19 Nov 2012 15:23:05 -0500 Message-ID: <1353356598-10634-5-git-send-email-eich@suse.de> References: <1353356598-10634-1-git-send-email-eich@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTP id A30E9E622B for ; Mon, 19 Nov 2012 12:41:28 -0800 (PST) In-Reply-To: <1353356598-10634-1-git-send-email-eich@suse.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org Cc: Egbert Eich , Takashi Iwai List-Id: dri-devel@lists.freedesktop.org There are displays which announce EDID extension blocks in the Extension Flag of the EDID base block although they are not EDDC capable (ie. take a segment address at I2C slave address 0x30). We test this by looking for an EDID header which is only possible in the base block. If the segment address is not taken into account, this block will be identical to the base block in which case we stop reading further EEDID blocks, correct the extension flag and just return the base block. Signed-off-by: Egbert Eich --- drivers/gpu/drm/drm_edid.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index b258646..ec6f3bb 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -361,6 +361,19 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter) } if (drm_edid_block_valid(block + (valid_extensions + 1) * EDID_LENGTH, j, print_bad_edid)) { valid_extensions++; + /* Test if base block announced extension blocks although + * display is not EDDC capable. + */ + if (j == 2) { + int k; + for (k = 0; k < sizeof(edid_header); k++) + if (block[(EDID_LENGTH * 2) + k] != edid_header[k]) + break; + if (k == sizeof(edid_header)) { + valid_extensions = 0; + goto no_more; + } + } break; } } -- 1.7.7