From patchwork Wed Dec 20 13:54:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Abildgaard Svendsen X-Patchwork-Id: 13500129 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1184AC3DA6E for ; Wed, 20 Dec 2023 13:54:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0442410E5A2; Wed, 20 Dec 2023 13:54:16 +0000 (UTC) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2127.outbound.protection.outlook.com [40.107.21.127]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9A3ED10E5C9 for ; Wed, 20 Dec 2023 13:54:14 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i1ZHYtzL2Kg+OnCGmcfH1R8cByDlMqmgD1MCIzf9cBQwqvIaQ01FyIbn957DrwTG662HXZyqw1dWoNSgslHV/StOWD7Z6VAJ/QD9NEcs5xNGpH666Gu8aGaFrW06LEoXEu7neDiC6uo9WOIyaPfUiM6JoO4weXlXONzm1uTTZ7cqcUl9sgiOYj538zvcOOED4385cwxenu66tsJWsqeg8hkzQBmIAtdWZl3SXVt9tt8VQT1c6pQkm7SYN5YdfBa1YTuBCaBPOB5GvvWuJ8dmK0RzN+9Mdd9SlaTIt8+xvPsjglW4xg0uxSjyO7d/CzVyegjgjdeIUMXtP7wbrbKFFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/h79rPHptj33/p0a9XGuhp1v71FXU06Q62jJ05eKGug=; b=VCcr2Pca8pRt46HW/iRKYE3Zw93jg/woMQe9eesbzujVJYwufVs+dfuRnc8iSuOpIc7jCtDdkQAq+4TMWaiXaLYZuvYvf7Dzoqgwsi5lN8FefTkP2koo5aNf55FxluiieriZofIAS/bqYGmN/GxsASESYb/cgAKdfJ8lWJsvegiPVzcAWOtmS0ar3BLT585kjt9LyJD6xLskKX4a0Yv4HStLADo5CtdO+xbhxttbZpMIz6buTbMgVW5Wt1AWUiCj6xyQWHCytygb5Z5rg7lY9GrzyZdl5v7DLQEPu0aHY1Z8CYTd6vdwlcKJJHco5YF1Qa08okxu9dJxXx4oiAHPaw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bang-olufsen.dk; dmarc=pass action=none header.from=bang-olufsen.dk; dkim=pass header.d=bang-olufsen.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bang-olufsen.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/h79rPHptj33/p0a9XGuhp1v71FXU06Q62jJ05eKGug=; b=hQRL0mrrSlNdsVxEXRjdDCHHsjj/I+jxSTepN5KvTH2EFpptVYhRCplQ/eUNRU9W7t6aF5ria4Agg9Jn2r/Y0d3EWGbqXb3myta9aVy+o6uLSxJEeJGMm0qE/QV0LBL3O2WrEuFHp8f/eaAu2SGhvMv1uwyKTYMzsr9yMhw4TSw= Received: from VI1PR03MB4942.eurprd03.prod.outlook.com (2603:10a6:803:b6::20) by AS4PR03MB8745.eurprd03.prod.outlook.com (2603:10a6:20b:574::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18; Wed, 20 Dec 2023 13:54:11 +0000 Received: from VI1PR03MB4942.eurprd03.prod.outlook.com ([fe80::67c9:f19a:51af:df35]) by VI1PR03MB4942.eurprd03.prod.outlook.com ([fe80::67c9:f19a:51af:df35%7]) with mapi id 15.20.7091.034; Wed, 20 Dec 2023 13:54:11 +0000 From: Emil Abildgaard Svendsen To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Lars-Peter Clausen Subject: [PATCH v3 1/2] drm: bridge: adv7511: fix reading edid segments Thread-Topic: [PATCH v3 1/2] drm: bridge: adv7511: fix reading edid segments Thread-Index: AQHaM0wCqc0YD3Ch8kmtNsN2ucnlEQ== Date: Wed, 20 Dec 2023 13:54:11 +0000 Message-ID: <20231220135406.2318148-1-emas@bang-olufsen.dk> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=bang-olufsen.dk; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: VI1PR03MB4942:EE_|AS4PR03MB8745:EE_ x-ms-office365-filtering-correlation-id: eca1dd98-c51a-4180-48d2-08dc016324e2 x-ms-exchange-atpmessageproperties: SA x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sRa47bPjlRBWBY2paIFsM5WW/exIWiK8H30I582DSwhF7/YP3s9F4RBmnYr0izcdBqkC9lb4QnUEwmMbxpjakHLaYZG/YnA55Y6uH5W5M6whXjlMzxdVUj5HJH8K37TbW/20fi6BjbuIZqQz1CKSHl8AL93jsmkx5tooTGQPlZWUpyitHdjYGXC8YM4P0+zvjfeLdUNdBHrzxeDLG4s7Xs03sUstu/mfk0M8bJck33+5kAm6uew6rs67FfgfOgIYtQIWzrEWyqbUm2ICUWpew+feWOg9zIqG7+BVPEv8xlialmxL3+RintmkzpqMmajqhzacjL+AqrQ5k5IDUcL+w3uLW4xy2Dsz5sRCqhTVKEgeoak2i7LkZxPtx0YmrT+I5kPddAQ2lLQW5BXPmsA0GntmD8wtQycClFR/Hw+VhvPpknTTakSPxrOkxcCsxHhhGbFgNNaodgzUMx6jnA+csYyyhoyFUr/2L3P7Wabs2nO0ris0N6LxBGQ3BDdfAw+p/Fa/xXC/GYWYIFn7Cky4+2WZGhKuRzq/qZjtLo+EJtBJt4TvAstmJGlpjIFzZ3S1NiRMZHQcfoGAeHPE5cuw26nEli7nspHlqnr+w203osbJHMdnc7C6cBptoCY/Bn1Mk8GraR49PTzb98rCn0Mu7g== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR03MB4942.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(376002)(396003)(346002)(39850400004)(366004)(451199024)(64100799003)(186009)(1800799012)(8676002)(8976002)(8936002)(4326008)(2906002)(6512007)(71200400001)(66946007)(316002)(64756008)(66446008)(66556008)(66476007)(54906003)(7416002)(83380400001)(110136005)(91956017)(5660300002)(76116006)(86362001)(122000001)(38100700002)(478600001)(2616005)(1076003)(26005)(6486002)(6506007)(41300700001)(36756003)(921008)(38070700009); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?MXQRsCT/yWPHquP9fx8hJGG?= =?iso-8859-1?q?QaFeT1Pu87dJiS8WkMouSyYLEsrof7qSP08XaNxPBdNjolDslIHHu1ZfATyA?= =?iso-8859-1?q?ob6EiLNbwrsjKsCvdjDnjBOc1YZptkqD6pvigIhmxxSSlp2tKepRWWNgyFLq?= =?iso-8859-1?q?NeTGuzir7Wfo+AC2ZWu52c0jdVTyaA3nrrARQKDrAUfCD9m6fHfDVufJ8LDP?= =?iso-8859-1?q?cdzbL2Pf5bhDoF6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PvIyt+DoX//YvFSvGG2?= =?iso-8859-1?q?L8/LIK3SJLc8D4WMN1yV87asETBnG8Bl7ROCQzpYBUpHlG/sYGW7TjObcDPx?= =?iso-8859-1?q?91nhqQJ4alTlr/tDp7oOJJ47L6BmmbVEs9RFupT7g7u2z3XX3ConqfeQZ7hE?= =?iso-8859-1?q?H/d5tNNS4KG0qo7InDaBb5seQMtf3ZwnHxQLHQgKrLUA0hQiRgRRTaOwWCci?= =?iso-8859-1?q?un7F1ZHADlQVTlwJq1wIV3pA+wjJxZ5nWJgZNli4b75MXD9bBpbzHQr7fvQA?= =?iso-8859-1?q?9AVm4gUddsG2NYQ4KpftjyHQRiuO33RspP74Ecrb+HEsxluK2Aj71uYJSSro?= =?iso-8859-1?q?Dqs1SFekbel8k/Nw75GP3QUCQMqKWfu2zvAhPd80K3KotQt36J9yrGdiOFgY?= =?iso-8859-1?q?t9AllWwLFMNc8XAl6iqKOLyd/PDSIDToY/3dmmkAf+fPXonglZrovbaEtIVT?= =?iso-8859-1?q?esJm0S48tuNtiYHEd2hRQbZ82jygGLBPAjjcou0Pi8OQaBpcV2ch/6Uu2E9h?= =?iso-8859-1?q?G1z3dmWWMDtENJh5641B2sS8mIA/ixei9YYtUvg=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: bang-olufsen.dk X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB4942.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: eca1dd98-c51a-4180-48d2-08dc016324e2 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Dec 2023 13:54:11.1568 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 210d08b8-83f7-470a-bc96-381193ca14a1 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: XjmWXZaYIeScjdholm1qmfe7WGtgaITx5vUZN+TVCLQiguJOw4XcT0QP8wBSX+cT0Uu+THUyF/5w+640wdiwqg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR03MB8745 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "dri-devel@lists.freedesktop.org" , Emil Abildgaard Svendsen , "frieder.schrempf@kontron.de" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Currently reading EDID only works because usually only two EDID blocks of 128 bytes is used. Where an EDID segment holds 256 bytes or two EDID blocks. And the first EDID segment read works fine but E-EDID specifies up to 128 segments. The logic is broken so change EDID segment index to multiple of 256 bytes and not 128 (block size). Fixes: 9c8af882bf12 ("drm: Add adv7511 encoder driver") Signed-off-by: Emil Svendsen --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index 8be235144f6d..9b6294120516 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -537,6 +537,7 @@ static int adv7511_get_edid_block(void *data, u8 *buf, unsigned int block, size_t len) { struct adv7511 *adv7511 = data; + int edid_segment = block / 2; struct i2c_msg xfer[2]; uint8_t offset; unsigned int i; @@ -545,7 +546,7 @@ static int adv7511_get_edid_block(void *data, u8 *buf, unsigned int block, if (len > 128) return -EINVAL; - if (adv7511->current_edid_segment != block / 2) { + if (adv7511->current_edid_segment != edid_segment) { unsigned int status; ret = regmap_read(adv7511->regmap, ADV7511_REG_DDC_STATUS, @@ -556,7 +557,7 @@ static int adv7511_get_edid_block(void *data, u8 *buf, unsigned int block, if (status != 2) { adv7511->edid_read = false; regmap_write(adv7511->regmap, ADV7511_REG_EDID_SEGMENT, - block); + edid_segment); ret = adv7511_wait_for_edid(adv7511, 200); if (ret < 0) return ret; @@ -589,7 +590,7 @@ static int adv7511_get_edid_block(void *data, u8 *buf, unsigned int block, offset += 64; } - adv7511->current_edid_segment = block / 2; + adv7511->current_edid_segment = edid_segment; } if (block % 2 == 0)