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//uQDIh+H3ERL22wMoUuKT22Mi/BneN2j4cZun/2DTAImB1DccajPK?= =?iso-8859-1?q?7Zo2PEe+z0iubCGwqf+SfFEKnTi+Y/gK0CPWlvB7m1kaP2kdqEL6+47GJESn?= =?iso-8859-1?q?PT64FkMHUQ7tg2GShRSwhh/O/C1bx3uNlCaHE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/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 */