From patchwork Mon Dec 23 02:59:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13918442 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 6DB12E77188 for ; Mon, 23 Dec 2024 03:11:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1M6HwiDjtz6MVhwJBxGtnK97LOfqJCVvtnZY32TOfk0=; b=GqDLeRmp/xRXfPcbx0DhB76NkM Fyyu3sEdoGtSsDzAXswW1oYuWwJR90rWb61CjXkXvgIRkVvDChw1CctfS+fdkzhFcqbEafVyZ10UV NmKq3fQr3tpMRdeQGDeaMR/eRl8rUCL3XVu883fzV0Mw7kqkAwFCy/sERRYWI95rm1x1gnOMLw1JV 1M+kqjnMc7h8HVzngGJoT7BtMEm0fVEuYqI+3R6E5HW32xjjcwd424uf+er89W0QXT/wUVYcm1aIA rj/X+tjbFaszx6LCdRh9kHh0pCjL0u1pYlLeYAtm3+DHPaOu4+Hcmac24w1EyZBxQV9QWvrFyXPwq cFOjtCyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tPYqe-00000009EoO-2oZ9; Mon, 23 Dec 2024 03:11:12 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tPYfE-00000009C1U-0bCv for linux-arm-kernel@lists.infradead.org; Mon, 23 Dec 2024 02:59:25 +0000 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-53e3c47434eso4112489e87.3 for ; Sun, 22 Dec 2024 18:59:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734922762; x=1735527562; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=1M6HwiDjtz6MVhwJBxGtnK97LOfqJCVvtnZY32TOfk0=; b=OM2ktskLenmHZL2kJ/aIi0TM7ptjszCNZ9JKcInRlKmuCV0XduzgfbONhhgYBGSDoK 3ZXmSzY3yvNSqsbaRzrXvH/laXFTazrz10XEOLtir82fYhmFBC0cS+CGk8ZufJNJwDjx SMNKM88kmMytpDx/GSMNTN+s7VnSCv7FhzMwEUOOQ0N11DGNunehUzVkf0PK+qtizPKS +d65m4DVqHb6ZY/p6ikhip4WGu2U7V5NbCbIIWOetuomogTKWQfJFDR5AIni5X3TdZlE bOISLPB9hzTYr3R6ir2XZkbOGfP/O2FIUqvRgpHJ0D9NYNsLBia/VDC8pzu8XrYwfmvV bLfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734922762; x=1735527562; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1M6HwiDjtz6MVhwJBxGtnK97LOfqJCVvtnZY32TOfk0=; b=MLXKcR2ol2ClaTJCWEHQQwMIQVjWgOpGK0NX4nl2onU+Y3k9IdiJGgLSxgteSUe86z +D0sTikK9KhhttftBVpecsB9oe2YSaXNsgxD82eOJqgG/8ibWxOYNiwxiq7Ka44Kxr3i X075BJlV7FulI4Omcla8VPYKSh16We+YeJdrR5u8sEJjFMqG8x2Cx6VUyXfz7peHJzfi xcby4N2ME2gBxLf0ytwaHEzOO3pG04qc6UYXgB52L4yRKySDKxBXaqTm5zf738uWnCGX NN5FtTgCk6EcVBiyE8z21g7RURM33KULWFpNxX5vs+rZulUXiHyMN7T8VSguMNwdNsTy 23vg== X-Forwarded-Encrypted: i=1; AJvYcCWwaoSUw/o+y6AxocNwAOdhGAeXvWwuzV8loP9sWkJ2hWrywVnPsdMhM1IxaT4tD+Q43KmdXUeXcTE0g0jgSK0c@lists.infradead.org X-Gm-Message-State: AOJu0Yxuo5hvrrGihciNtNDQztOv3z2V0BOTSNTPoKgiB1uafB1nNnf+ 23G3NoSEs86BIBNy5+QaRDeoHFUZOInkBKb7Hs2u+BRqezdD4yk+ZI3FGT1b38k= X-Gm-Gg: ASbGncsBFKiGVn0/PNRokZ+pCeAaJxWWCbYt7qNZ8WnLXFfiyFkjd5zomCpRCoc47DP Xfbw5hEmLe6GLOUriM9If/YLz5CiPI1m1nfjdv7EFUIhUrRW2de2YZZ6cHE2hOFTWE460vppXNU oSVdVxZ+DWKvsHfRSle6O99Qn0ejFjWTMgBPiJeS6kKPwfbSkHaL6wJIjmSLWXol+CCb6t239Ng EDOhFoqwmkw4mVYn7+AtfwbrLPYew7nexPLU8Ya4bILMLDl6lHY8nUAgKhDX4cY X-Google-Smtp-Source: AGHT+IGXP4rXvq7W3fLpzfisWqyUJAOUer76ywuuwhoE5fp8LHSToAxEcbOqHJy2piepiuWIG7rxUA== X-Received: by 2002:ac2:4e07:0:b0:540:25a6:c342 with SMTP id 2adb3069b0e04-54229525435mr3832068e87.4.1734922762189; Sun, 22 Dec 2024 18:59:22 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-542235f658csm1124639e87.44.2024.12.22.18.59.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 18:59:21 -0800 (PST) From: Dmitry Baryshkov Date: Mon, 23 Dec 2024 04:59:00 +0200 Subject: [PATCH v9 09/10] drm/vc4: hdmi: stop rereading EDID in get_modes() MIME-Version: 1.0 Message-Id: <20241223-drm-bridge-hdmi-connector-v9-9-6ce16bcedb8b@linaro.org> References: <20241223-drm-bridge-hdmi-connector-v9-0-6ce16bcedb8b@linaro.org> In-Reply-To: <20241223-drm-bridge-hdmi-connector-v9-0-6ce16bcedb8b@linaro.org> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown , Phong LE , Inki Dae , Seung-Woo Kim , Kyungmin Park , Krzysztof Kozlowski , Alim Akhtar , Russell King , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Alain Volmat , Raphael Gallais-Pou , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance Cc: Jani Nikula , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1990; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=zd/Y8mBxMdBApDi5CzqJHH1RW7mj7RyJYMvyUl/+gqU=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnaNHxS+CfU4MvBlw2osJl83QA+wZ5kGncYgdoc JR2tU6eRoKJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ2jR8QAKCRCLPIo+Aiko 1TOJCACrRFuRB+oY+c98sRz7Ma4pmcP9hkSpViEb1HhcqhQ+wSNrwsLQ11Regmd4mJBK79nOzwT Nfpri3HXgX0HS3qFYrZcUzi+B68x6wvwU60GwKMd/PZvyFIX8OxvcXzgOk2EQ/3yygWo8fFGThO X2MGTJqbpeegKvCKA3d3otC6Eu9/QitcjoKBNIh5HDbkAMlRMwzWQ2lriSa9FMiZYkSuA8vpt76 bPSe/sIipmve9fE5crzyrvzklzHGaOofu5vsyHZI8cgf3TMNtOEi0MelWz3Xs3r09Ix2sCQ34be pLuk4G41OLEBneTNS266BoRuUdJI0xxWKkNROz1buEXtKh/I X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241222_185924_192378_046C2A41 X-CRM114-Status: GOOD ( 14.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The vc4_hdmi_connector_detect_ctx() via vc4_hdmi_handle_hotplug() already reads EDID and propagates it to the drm_connector. Stop rereading EDID as a part of the .get_modes() callback and just update the list of modes. This matches the behaviour of the i915 driver. Acked-by: Maxime Ripard Tested-by: Dave Stevenson Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/vc4/vc4_hdmi.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 24199b511f2ee1bc3aa5f4a30e9d3d928d556ff1..5282dd765cc9478361a705dca85f615015b12e8e 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -470,31 +470,10 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector, static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) { - struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector); struct vc4_dev *vc4 = to_vc4_dev(connector->dev); - const struct drm_edid *drm_edid; int ret = 0; - /* - * NOTE: This function should really take vc4_hdmi->mutex, but doing so - * results in reentrancy issues since cec_s_phys_addr() might call - * .adap_enable, which leads to that funtion being called with our mutex - * held. - * - * Concurrency isn't an issue at the moment since we don't share - * any state with any of the other frameworks so we can ignore - * the lock for now. - */ - - drm_edid = drm_edid_read_ddc(connector, vc4_hdmi->ddc); - drm_edid_connector_update(connector, drm_edid); - cec_s_phys_addr(vc4_hdmi->cec_adap, - connector->display_info.source_physical_address, false); - if (!drm_edid) - return 0; - ret = drm_edid_connector_add_modes(connector); - drm_edid_free(drm_edid); if (!vc4->hvs->vc5_hdmi_enable_hdmi_20) { struct drm_device *drm = connector->dev;