From patchwork Fri Oct 27 12:22:35 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: 13438583 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 D33A0C25B47 for ; Fri, 27 Oct 2023 12:22:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1E22410E990; Fri, 27 Oct 2023 12:22:41 +0000 (UTC) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on0715.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0d::715]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0BC0110E990 for ; Fri, 27 Oct 2023 12:22:40 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OgybxZKyItdNbRwDXu8uosncZf6iv9T8DkripjNIdPRj6RVPGAChGaldFYZEZ4WhC77pAm13uuHRGkfz8hJ7Q8DYgomJ/FY5svi8a+L9Te8KvjZXWuJHk76Z0CT97k9qGsEqCjnE5DUbE1Io8DUBv3ipyfQrVKleA57/44Cc+XMU3THgmQZEd551ktj1iMJGrHLgmBLsaAWna4BNK2qx2ngopCfkoXgNPuRK+GzPFenJdWNWtwkiQLA/6Anw2c2VIFZshWn9pPEwijauMG7jvU97sOE502FpzIwMjUlcf4p8a3NCe9AxBHeh2EilKb9h6kUD8+4Y1evqtvmIsLYBlw== 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=tdNeI5yuNXaMNmVWLdD/+zfx1yJ3pmbKtdCxZRg8Bi0=; b=SqraQfeJWrueFbXdBcxGGb6va1SMjlc5xKYaiAe9tGxNTLkcj5oifRM08G8AxG34UVQzkG5BXUMEUq8edK2jqeF7zH3XwIU4+yYXuvGwTGVtV9P65WZ48bc7swDej48uwjGRyJDBGsXNjiopRJC/6X2IX22yY/NDbZd5X/0L0QYqNldBN6+t+Qv5am1vNiDbRV2Kw+41qGlXljtF013lZXDSk8UkB7lmPiEvXsT9n3Op3PtuBS7RFJr647y8tJe058CUS7o/8BRXu1ETkk8pekuWQvkO3EJvuzTZcOAlcHMSmkeN5M0qa6ZWNuXLb4PJW0m4sk/pwc/y9pePchFmXg== 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=tdNeI5yuNXaMNmVWLdD/+zfx1yJ3pmbKtdCxZRg8Bi0=; b=pr/vFCGlv+aPrWgdlJA9fNjGe+Zm6SfyhQkA3jS+/G9oDxuTBOmzaWXsxUN+blxT0+20ouu9+tZpzVudRym8AeLgFncj9atRqo7J+88d7YxCENRdRNea4wLZ6gj5Vt8LoDMvLXZXmy7BR0mpbry2DGYwlr+Dii3hRVa34k3DXHI= Received: from VI1PR03MB4942.eurprd03.prod.outlook.com (2603:10a6:803:b6::20) by PAVPR03MB9822.eurprd03.prod.outlook.com (2603:10a6:102:310::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.33; Fri, 27 Oct 2023 12:22:35 +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.6933.024; Fri, 27 Oct 2023 12:22:35 +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 v2 1/2] drm: bridge: adv7511: fix reading edid segments Thread-Topic: [PATCH v2 1/2] drm: bridge: adv7511: fix reading edid segments Thread-Index: AQHaCNBEeoF+BOSElkqjnDUZsMG67g== Date: Fri, 27 Oct 2023 12:22:35 +0000 Message-ID: <20231027122214.599067-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_|PAVPR03MB9822:EE_ x-ms-office365-filtering-correlation-id: 7ac968c7-88ec-47ba-476c-08dbd6e766c5 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ZoqTo+EUd4LZtJPPb2sv87czjO+FVj8A3eHMNfXWe14wSVHvUjk3LQEWe89eilDGo6fBKylCxMncyiaJJNIRiYxUPminrRV3UdGtOrn0pF1zytW5fKJImx4iwaWY39IYIznzvNF94oFyMkq6j8iUKHb4j/SxCsIpyENw05ZkDKNK8MapHCE59td4vBD0Dn1QnT/+B2au1a725ITGiED4GjSGW0CKsbDb+R1I+ktUH0bdL+v3hlu0a5h0hhhgw7qv29gTkTZCrRC+1s2Z/Z3ylV1OfA96qJlaxX0hyofrqPTVH+pie4ogoinbVIE7NP5OfDMQjMcVeIgAl0eqSsVt8FGV5ePgltJUcM7nhtzWJ2uB/4IQ+2QpgFh3UtUXQ6upH0mGwH8NoxYph/ohzyCQN6wLhczzLzs2239MECVBSQ8h4nQ3QmLcckrYqGj8qQaYAyR0F/Qd0WQcrGBbbr/CdD/moAUV9HDjTsoTAUhzUGTmrEEyA1Bk6xzC+UZMtuz6C8qLlDA2MeD3yq6XZafgCG1LGw14BC+wYYygFeulxsB25IUi5re//26zzAQG4KT3OuXiETa6BILlPR2dJ8ydlMUvFF1z57MKdoxt3NIjzHZannu7SH0VQ0u0VcYBcNLI 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)(39860400002)(396003)(136003)(366004)(346002)(376002)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(6506007)(71200400001)(86362001)(5660300002)(41300700001)(83380400001)(26005)(2906002)(36756003)(7416002)(1076003)(2616005)(6512007)(122000001)(38100700002)(66556008)(66446008)(66476007)(91956017)(478600001)(6486002)(110136005)(54906003)(64756008)(966005)(76116006)(316002)(8976002)(66946007)(8936002)(38070700009)(4326008)(8676002)(921008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?zIN8u1DQRltHdoYBlp5B2Qv?= =?iso-8859-1?q?t42CzODPaXVA3QGrXnFXndi7ivbNCLW3ZzLxbsTNKmTbP7imSZFfl8uyVqzL?= =?iso-8859-1?q?0MUoEmM4xKkwJDGKJ69wDk21Zc8YuvG8G92ccZYKH49FbwR7eiAPsij8dGgZ?= =?iso-8859-1?q?WLjtc2XKiF46caLElgeV8DPQK+u2MRhKNTuzHL6zWR7GTUPPFOO2YpS2ZRiO?= =?iso-8859-1?q?E0UxnL+ggUIUWRyaXWJ7JHpTnAuG5kKjpjjBRiEc5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-8859-1?q?TqtII00Q4C7KDAzshzwXFsJCBrcaRbWF/GMGasIpEznwfApeFqZYg2W56Fle?= =?iso-8859-1?q?OWLY/J5uZN6yeI6HqeqIhHLnPp56qHWkvSoyogKI0npr6wG0pXWc/Gx2kbu+?= =?iso-8859-1?q?U32XHSYvkkQ/2cj+XKqh1e0F4SZOq5c7d1L/zoSYHezCKHTIDKsdhMT3dIQR?= =?iso-8859-1?q?bvQXfIZHRvKavryGXDwV3A/UZBiwrcKnmjx0i6l1POUrxP6x/42tz7GvU/5S?= =?iso-8859-1?q?6bRPbkkvX28AWU6iEGeTsOHowwleoB4VvpPntsZ0v5EtztbBAt+im0faZoSA?= =?iso-8859-1?q?9vJAd2Nhc0s25PXglOhPmEH+R1VEqO4qLjkbIL6z2uuO2m5vvSNnO67CFmg5?= =?iso-8859-1?q?hmPOEOqBaA8qRkWc1GeGOIH4paiQtM55VhibvIS440SlieUwb03Umk1UgAaP?= =?iso-8859-1?q?icUcw5VZ21hmAtCYkrm/iO0jkshq4owaHY2TpDnSQ+DOvlREOkGKZkANxmMf?= =?iso-8859-1?q?p96F+HDVYdlhYLFRBkSkXJxxEFKzf67LXGSHA2g=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: 7ac968c7-88ec-47ba-476c-08dbd6e766c5 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Oct 2023 12:22:35.2670 (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: QKLnUxselrmB/xBIVpc/98F7eYE/a3oQZdDQLJkABIjgPvg+1jrw9xaMnHl4W8V9PPuFPEFza71rTKQSAuiAfg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR03MB9822 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 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 --- v2: - Split into two patches. - Add Fixes tag. v1: https://lore.kernel.org/all/20231026113029.575846-1-emas@bang-olufsen.dk/ 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) From patchwork Fri Oct 27 12:22:35 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: 13438584 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 0D8E9C25B67 for ; Fri, 27 Oct 2023 12:22:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 45CBA10E991; Fri, 27 Oct 2023 12:22:42 +0000 (UTC) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on0715.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0d::715]) by gabe.freedesktop.org (Postfix) with ESMTPS id 900C410E990 for ; Fri, 27 Oct 2023 12:22:39 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OXyUzx8XjK8XYaQMR7ux4ab9aKiP8SanJrKvjVERaRpCTEBnU4alkvJp/iBfZ1p1uvOzZjl/U38HfbWJsMRzbc1g8LhBi7Z8G8BhQrpO2ZcWIsRxQE9JmdFXuBZfez5UEWj0Kwk2y305rXjDIcgoB953AVRIrqh3qcLFWlQkXRBP0RJmBNoecimUjV2LIu9btXRLexILMcP7au3aD6Twmd+0Dt+9Zq0cyemQRIxe4D8uyb/AWg0WDg9ixrlBL/tdeqpbRznuNorhte/j+0rBLnrZKP0Sfq0RUvxwIVNeVo9fgRe/xLL9RMYguBasxEq6FAbTjHqH8AV78Y8/TnW06A== 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=6Gpgnx0M4KisGfgNTNvIoX7z+mtz2Tm+g+Z+YwzB2tg=; b=HxZxcQ0Gfv/ri62lb76Adn0qqT62cLRjl2MnPaBRK2JYhK+HjaCFdbxOzRrR62djEOxSFMS/h/BbO5+LtWmamsis+uiqFnkaFU9MN9wvVmKoiTS0s8SwhvPwiCtVsr2TjTEjb/6s8m0YmdI6qJb5Dz7MZqExxJ1mbbmo7GEm80GduaLqM79Ida4Fxi3p3ACjCtI0rgTGnTfwG4WeQmwf5jjy+f2UeUVu+R4u9K7FdUt07ny+DtG/0nrDziEaT4vUk9VJiDm7dQjJeKiiVGR2PuvzdPlXt4HLcTO2Z1YVS4r+07V0uZInL/wLBJquXW1tv9tvkdOpWCGcjDQEgLmQeQ== 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=6Gpgnx0M4KisGfgNTNvIoX7z+mtz2Tm+g+Z+YwzB2tg=; b=toeAqdHmIZbYKAtMvva9GE7OkuZ+nbY8TLGvBUwEngPutirI9wrBOpE6yeACzBwY9qLjofu4HsPiHmfluEF90DDKlJ0BDxyqv5MgM7F+HB89RufKxxpPk3Rl18BzQiACUTSZav2hNFAzbo4YB/qwpIy8JnBub/fyoiNjTOLkDz8= Received: from VI1PR03MB4942.eurprd03.prod.outlook.com (2603:10a6:803:b6::20) by PAVPR03MB9822.eurprd03.prod.outlook.com (2603:10a6:102:310::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.33; Fri, 27 Oct 2023 12:22:36 +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.6933.024; Fri, 27 Oct 2023 12:22:35 +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 v2 2/2] drm: bridge: adv7511: fix edid read in idle state Thread-Topic: [PATCH v2 2/2] drm: bridge: adv7511: fix edid read in idle state Thread-Index: AQHaCNBE5XPNVB1FYU2YawuwR7uICw== Date: Fri, 27 Oct 2023 12:22:35 +0000 Message-ID: <20231027122214.599067-2-emas@bang-olufsen.dk> References: <20231027122214.599067-1-emas@bang-olufsen.dk> In-Reply-To: <20231027122214.599067-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_|PAVPR03MB9822:EE_ x-ms-office365-filtering-correlation-id: 5040617f-ee3b-418e-a582-08dbd6e76724 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: h+CC47di24EpsrtDJg5XYGPiIfNqbzGbkSLkZXg1Q5PjIPkz+U59IhzavUnQ3tMe5beDqNNBtLirceO8cQstUc/mBTMSI+YULl1gEze68Z6C+3yLVWfCeZcDWfcJksIm/Y4hfiJuf4t5EFE4eDPSwJjgOMhlz6U6yD4voovQYnf/bUnKQx7t6n74uhjJz2/qXIpKc2vrFkjFeJgv4RWT6BgsApynVXpnVV/OLd/F/bReKUMkbFda7mJMGDuqOO9fsxCxHNWKmg6VHEeRNJg2pMyexfwtvb0NXiAzvPw3Da3jyAHLEJmxqjI4f4XlGJqi1mrnXLSMZuJkDUweaZbmdNElLjoULkKfSUUfb7eKf+nAUIEfo5L4+zp82KiNuJbJ5TrNzand0xETthMdqE/qpw4RG9OKi2uUyywGZOG922oDgIAosfezx2haRvsf2Wc1m/o2JJ41RKkrIFiXLdrXRAnt20/VRZfWiTe8CZoGslh7TWZhC8jx5u3O40Kpb+nW+kqZ6mxbqoP/qH+U+Dnm4i4iHXZdvgUIK4sHaouPLBZVTfzl2V/8KxJdKIaIkWKZPcqr0KSFi+sJb9akAlU9gExPRkMvHgKDK7gHyySOSiLijvpVjuSuhn3aiYzulrSi 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)(39860400002)(396003)(136003)(366004)(346002)(376002)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(6506007)(71200400001)(86362001)(5660300002)(41300700001)(83380400001)(26005)(2906002)(36756003)(7416002)(1076003)(2616005)(6512007)(122000001)(38100700002)(66556008)(66446008)(66476007)(91956017)(478600001)(6486002)(110136005)(54906003)(64756008)(966005)(76116006)(316002)(8976002)(66946007)(8936002)(38070700009)(4326008)(8676002)(921008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?B5TBJZJaTJpAHPE0eXipDhA?= =?iso-8859-1?q?pLWD6G//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IomddTHIbdCs1O7ic4b8yJzOb1HZR30BlkOjB32k?= =?iso-8859-1?q?TxWQpt/zqxET/mNBh224vH/asV5H4sg0QvhXMjRqaieZYnA1DUPFS08HDoQy?= =?iso-8859-1?q?tuAeWXloNVjQEo5PttoLe5yTWBZLSOB+kT1KJE3c4UlwrpQ0TUgA/HSoqa6M?= =?iso-8859-1?q?IT9fi6ti8EoMUpSr0ttfaZcGFN+hE3vbgHivV2/QLmxlo8tG3wmS0CmIudCa?= =?iso-8859-1?q?PtQ0TfSL3Xi61btBFQ/LQg6RFDQkcEpqTs94iwsLuqy+1mg5Fw0aKKZxmV98?= =?iso-8859-1?q?qg7qowyCSODNDHNE68bkxM5gKARkHsm2rqhLc6FP27v0baxIAz4llQmJSCaj?= =?iso-8859-1?q?yPDN4W3ppqupcqSgXcUV5TlmuYlsc3+JEj+vcV0n795svOu9SwJvMXtdG/+j?= =?iso-8859-1?q?A5rDXQqdz3t7USrevNpYmtE7JLaw/VxBGt8jpEpS7iFyzmCXD/WgY+xi0mrN?= =?iso-8859-1?q?xL12kNYawmSGF5jMQZ3zHjom8dR/zn5eIhL8MJ8LXam5j3klwPP76vddBmGu?= =?iso-8859-1?q?kW90Oz3krkkJcNn2q6iv209x74bmMXfdzG94eBG5teCcZarvwyDbVLw16PBW?= =?iso-8859-1?q?ziqneS8hgsQMu1tQBbQX6mKuE1eYGRHhqCRhllAdaUKEm/OdR295CEBxadxi?= =?iso-8859-1?q?SgNo0979d0l4o8mka07GbCsH3cMsGlCZ+9hvUscjk/olbvvPDQ/bouV61Bgq?= =?iso-8859-1?q?Tu7e14xJwMLRQoO4kmWOdWvfrARRzrwtcOvsOhQ=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: 5040617f-ee3b-418e-a582-08dbd6e76724 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Oct 2023 12:22:35.8885 (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: sZ7htH1ErJ9EKaZD7FH8UZ+mCRh/ndJi3tFC6XFygDlklpswjTw9GftW24haCXMFh9SmZGL4QuAorQ3vw6jo7w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR03MB9822 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 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Change check of DDC status. Instead of silently not reading EDID when in "IDLE" state [1]. Always read EDID but add a debug log when DDC controller is in reset. [1] ADV7511 Programming Guide: Table 11: DDCController Status: 0xC8 [3:0] DDC Controller State 0000 In Reset (No Hot Plug Detected) 0001 Reading EDID 0010 IDLE (Waiting for HDCP Requested) 0011 Initializing HDCP 0100 HDCP Enabled 0101 Initializing HDCP Repeater Fixes: 9c8af882bf12 ("drm: Add adv7511 encoder driver") Signed-off-by: Emil Svendsen --- v2: - Split into two patches. - Add Fixes tag. - Don't return -EIO when DDC controller is in reset state, only log. v1: https://lore.kernel.org/all/20231026113029.575846-1-emas@bang-olufsen.dk/ drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index 9b6294120516..713ad348dc46 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; + struct device* dev = &adv7511->i2c_edid->dev; int edid_segment = block / 2; struct i2c_msg xfer[2]; uint8_t offset; @@ -554,15 +555,18 @@ static int adv7511_get_edid_block(void *data, u8 *buf, unsigned int block, if (ret < 0) return ret; - if (status != 2) { - adv7511->edid_read = false; - regmap_write(adv7511->regmap, ADV7511_REG_EDID_SEGMENT, - edid_segment); - ret = adv7511_wait_for_edid(adv7511, 200); - if (ret < 0) - return ret; + if (!(status & 0x0F)) { + dev_dbg(dev, "DDC in reset no hot plug detected %x\n", + status); } + adv7511->edid_read = false; + regmap_write(adv7511->regmap, ADV7511_REG_EDID_SEGMENT, + edid_segment); + ret = adv7511_wait_for_edid(adv7511, 200); + if (ret < 0) + return ret; + /* Break this apart, hopefully more I2C controllers will * support 64 byte transfers than 256 byte transfers */