Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp3183897rwo; Fri, 4 Aug 2023 00:11:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGBPIJXGikAK89IsO2HozAtgauRhJHz1DAW4cHY77iwD1gfzhmEjcY9u6Kevb49hVdy2p+s X-Received: by 2002:a17:906:3f47:b0:994:4e16:d430 with SMTP id f7-20020a1709063f4700b009944e16d430mr762346ejj.20.1691133102243; Fri, 04 Aug 2023 00:11:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1691133102; cv=pass; d=google.com; s=arc-20160816; b=Q1/pxKxGxS00EipnuyTO9iFK3gijn1cIIQnqQsk9yMBFtjN65WzuWovwas8OOSm0SV 2bmp+YqGY3ulW9Lm3LpKBGrqfSuhPwafgli0RkBej+Xj/+3l2HShJysypAGys0hV/t13 eObxCgkQdlgI8qmDLqxs7wBf/V3hJBsLQXBg2BcHXdqwQB3SQjoXKb/qi96ks92pTCJx CRKGbY6WIu6t6gJZRY8edF2mu9xLXZNgo7kg857l8XP5Y1l8v61NS6E4pfo4HZf56jxF 2Wxa9vLoSnF5oTXiSIa0czrpxaDgawDikNlLszMHcsql9+GRyXzBiLsd7XcThY8NBp1q X0Og== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=9pqDlp8NbSJUqyvctfy+3VuNilza2OTPgQRYXfOcw34=; fh=XOczGQ6bQKdviQgFLeVOO9HCRDOaV2hZGiI8G3UunSk=; b=NCSH5ywvSvHduJxI06Y4xncDQ4SzGaJqqyIsP/c5nrhFn5loEnef73lT77gAw66tWA 7V7GnByBzWjaQQC+2HmXTPjN/22RjC2RUXhp41CKTR73qRCMVDAP2t9+IvNBGG3C/dHU htb2m88sA/HEnvV0wAWANpIeNxu3zibPsUd269bB1k0wV+uQAEebeFaTx/2MkTSr0l/y mBbnmUIvR1EZOKCIVkSCB3WmDW6m3O2te5DhNuWuahMRCDxlOMLg9RCqC/VJkl56QIUN TGPel+8s1PFwAX5Qq9n3Q44sH1P78C0ZpuBVd7QQveaagxD9mRqf6fTY2uKV4iU0fbEm CVdw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=QokvSIOy; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z6-20020a17090655c600b009823816586esi1184328ejp.500.2023.08.04.00.11.17; Fri, 04 Aug 2023 00:11:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=QokvSIOy; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232767AbjHDGMk (ORCPT + 99 others); Fri, 4 Aug 2023 02:12:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232615AbjHDGMe (ORCPT ); Fri, 4 Aug 2023 02:12:34 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2042.outbound.protection.outlook.com [40.107.21.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 433C73C01 for ; Thu, 3 Aug 2023 23:12:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d9SUWZgb1fk1Pojr+DTWhZO8pDc0gS0yM49wbmXNaSoOu5CYRk0U5jirizwTmYYEi28PeZ5pH2S4jW0MT9Tck5fC8kCmDmC5IqUsA8jZYDc1vPF/Qj7Gz78zuOALR2OEFBCDwjwKQF9mpLJNybGJAGb9nMjW0Lj+HOndHYpDXQIjBQyP7Ky+sRRsOqj+60Xg8b0XIUSufAeRrg1G3hWfXtPKv6ND4zyOcSoQqXP35a6iGy/pNyVYIYB/2w9N3mM6AQsXsuZqhBUTrYn9SlnLc2aeAiSE4c0GajMKORr1Fu2VozVRJ6hrk1qCrZHIvtGSejf4EKl/LO+Gb7KZftXoUg== 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=9pqDlp8NbSJUqyvctfy+3VuNilza2OTPgQRYXfOcw34=; b=jiveFtumVtDobD1eJrRaizVB21dzi+8kETJYIiSj1Q5Rn1KwRJy5TuY7sH5iCXgb3p7GynKqSJ6Yy7bO7QfSOoCqLEPHdtMbwZ5eNJlOeTf2wrKHZy51638Z+CSoSttQv+FP8QV34uSbznWB9S1tdMP9VZLWKNhX6v9xyQTHf1sD3NA+wZsXznoTVArWY2rOALP02Al4x6A79XbnvrQ9BvyriY+rMcTUivnPWj+lV+NBWq30Ym/IyDfk3miHT/zva/swdSDV2hPPLfMgD+fTcHPC0lhLrdp2qQ+EECBNrBaH8NpRopxudCTOs6V+NzXcLvJtmCkdBAupIAzqBPb2zA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9pqDlp8NbSJUqyvctfy+3VuNilza2OTPgQRYXfOcw34=; b=QokvSIOyro8eSwzHht/Qy1G7cOeVUxU06CzCC5W8ObevweHAfrsVxYIkIJ38vjhg6R9QpUCW3kDauntJmS60JUQf0J2N405HQRxOTE/fnPXSgfQVjU6qKRrEO+t1BG2mU922fkHHcGXGfRov8pDze+9fCdvNpqcP8/kjWaFak+Q= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9448.eurprd04.prod.outlook.com (2603:10a6:102:2b1::21) by DB9PR04MB8493.eurprd04.prod.outlook.com (2603:10a6:10:2c5::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.21; Fri, 4 Aug 2023 06:12:29 +0000 Received: from PAXPR04MB9448.eurprd04.prod.outlook.com ([fe80::3505:c499:96d4:1429]) by PAXPR04MB9448.eurprd04.prod.outlook.com ([fe80::3505:c499:96d4:1429%4]) with mapi id 15.20.6631.046; Fri, 4 Aug 2023 06:12:29 +0000 From: Sandor Yu To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, adrian.larumbe@collabora.com, treding@nvidia.com, the.cheaterman@gmail.com, l.stach@pengutronix.de, ville.syrjala@linux.intel.com, cychiang@chromium.org, Sandor.yu@nxp.com, shengjiu.wang@nxp.com Subject: [PATCH v2] drm: bridge: dw_hdmi: Fix ELD is not updated issue Date: Fri, 4 Aug 2023 14:11:45 +0800 Message-Id: <20230804061145.2824843-1-Sandor.yu@nxp.com> X-Mailer: git-send-email 2.34.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0040.apcprd02.prod.outlook.com (2603:1096:4:196::6) To PAXPR04MB9448.eurprd04.prod.outlook.com (2603:10a6:102:2b1::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9448:EE_|DB9PR04MB8493:EE_ X-MS-Office365-Filtering-Correlation-Id: f389d3cd-6b43-4e9a-703a-08db94b1c811 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zVJ48XHmZW5f0LUgL8KvZGLWbW/Xj2SrKpcW9y/Aa3cIjUNKWGoiBB6uA72vDu4unC8hIryC7Yi9+YBcw4NhpYh4HOiIFoaPwqWUGVrBJwueJ3pDmHvXAzBmo+e8dy1dnUO5smLMuKg45vgsp0eJNC1b9UecyLpRe6BpTpXBPAf4RMhGvq1KXgN7/jSOR5q4O8KeJWZByqGVwUSxIB4KYO+na8vShAeeWFX0SvJObyPIujw6GjE+IT1c9HthvJNZ7Rb04oG3gFRgbSza/kiuipQ7XQL6w3YogLU1fIh6xV6PtH01apWfIgh3KX73qKZPMsZOFP/lLf8g3LZyYrbvMwtGW04fJaDB71MUlF16kKe2FYhJ+31NvYk/bN+7pJFsSCL8A9wNv5F7HyeMlNzws4NxrZoGh0N9PBG69YkxkyrIpX7dSPd4UFE1Luhd5rewiNdM0Gzs7pgP2ZLzeXnM45q1ZejV4UnTAIziiVbmTv5lKWrYi0MhSP0q0rg+qR6z+C/B8iwHHpT3n1nCnubdjsKz9sT/XDEdoQgN0NZREO6KD8Fx4CdEP90EpX0hAjF5Z1ymYpFqYtljUKb5UB6ukoSkgYpcRMJa1VKo/a0hiBr/sexRfN+dDtcMqhTZ0IFg X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9448.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(376002)(39860400002)(396003)(366004)(186006)(451199021)(1800799003)(66476007)(66946007)(66556008)(4326008)(2906002)(38100700002)(38350700002)(2616005)(1076003)(6506007)(7416002)(83380400001)(86362001)(6512007)(26005)(478600001)(36756003)(6486002)(52116002)(6666004)(8936002)(8676002)(5660300002)(15650500001)(41300700001)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?BWzZiDwwDQnwUT2HmXA3/pYbuM0zleAZ/FpmWhm11vxcqpjLiwAhnu94LZJC?= =?us-ascii?Q?dkOcoQmBwzID1ggA/whWQnj/d+PoYq3YAC7O1cZFNbaBYzLWCc9gj0qX7c8z?= =?us-ascii?Q?Nw/wOqszstMAtPT8Xu5AaqCJKTskf0dxjshYrzsc0PSSivd9oZnH0lYdnTrv?= =?us-ascii?Q?fmBUYaSXHIYhjorYXL9IpNdd8g2TxfnEjX1EFBihEEPtjEW2JyUZo22mqxGH?= =?us-ascii?Q?eeSvgOVLUEd/PKbockkNeKIwvQ25Tho8HZPBnCwrxL29IIGCkb1rOjHdqDVi?= =?us-ascii?Q?cjXS+jM38KqGrIp8iDQC63HfVPCQUUcaiJC8f3krI+YfyOIpk3eHYJjwzQOf?= =?us-ascii?Q?Onc9/hlNgGhGIlo5fRmQMfFNCF3U3tH0svdJ65At1b0yBRiHYqkCCuGEOovt?= =?us-ascii?Q?ojljmf+CFHcCPEuKzutCOnNhXSgmxrKBd1soGu8OcZOPls0iIbHIqHc2S4RZ?= =?us-ascii?Q?9mnQovno5qmOIdhnJc9c3dCQuEMHw6BXwtnW97e48lDJwT8OmnO6WEcucKAP?= =?us-ascii?Q?O1dNmyVYaJo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?= =?us-ascii?Q?/6jwPjTpqXUyy+5ZptDnpCIs+ajScUVQabDObeDt2Zt2pZ/tjO9d5gJMzm7V?= =?us-ascii?Q?faqayPEZyoxKTJX5ys8eA1OvDPI4AkSd4K/AQOoorY6/OA9e8Ff+j2VG86Yx?= =?us-ascii?Q?TU0nS2adVhCfRyn9Izzs3yZr7zH+osOalK10vxdq?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f389d3cd-6b43-4e9a-703a-08db94b1c811 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9448.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2023 06:12:29.2609 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 75cFUlSvfV4qUxuV8btBHScVbXa3HyHTAqcXUWv3W1yQQhzl2zPrpSbITn2A9qoi2eYYbQHJ4ZzlDyPJOZCjqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8493 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ELD (EDID-Like Data) is not updated when the HDMI cable is plugged into different HDMI monitors. This is because the EDID is not updated in the HDMI HPD function. As a result, the ELD data remains unchanged and may not reflect the capabilities of the newly connected HDMI sink device. To address this issue, the handle_plugged_change function should move to the bridge_atomic_enable and bridge_atomic_disable functions. Make sure the EDID is properly updated before updating ELD. Signed-off-by: Sandor Yu --- v2: - Add the variable of last_connector_result back to driver. It will only be used to initialize audio codec jack status when audio codec driver probe. --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index aa51c61a78c7..963050de42c3 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2463,15 +2463,7 @@ static enum drm_connector_status dw_hdmi_detect(struct dw_hdmi *hdmi) enum drm_connector_status result; result = hdmi->phy.ops->read_hpd(hdmi, hdmi->phy.data); - - mutex_lock(&hdmi->mutex); - if (result != hdmi->last_connector_result) { - dev_dbg(hdmi->dev, "read_hpd result: %d", result); - handle_plugged_change(hdmi, - result == connector_status_connected); - hdmi->last_connector_result = result; - } - mutex_unlock(&hdmi->mutex); + hdmi->last_connector_result = result; return result; } @@ -2971,6 +2963,7 @@ static void dw_hdmi_bridge_atomic_disable(struct drm_bridge *bridge, hdmi->curr_conn = NULL; dw_hdmi_update_power(hdmi); dw_hdmi_update_phy_mask(hdmi); + handle_plugged_change(hdmi, false); mutex_unlock(&hdmi->mutex); } @@ -2989,6 +2982,7 @@ static void dw_hdmi_bridge_atomic_enable(struct drm_bridge *bridge, hdmi->curr_conn = connector; dw_hdmi_update_power(hdmi); dw_hdmi_update_phy_mask(hdmi); + handle_plugged_change(hdmi, true); mutex_unlock(&hdmi->mutex); } -- 2.34.1