From patchwork Tue Dec 17 00:40:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13910833 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 26808E7717F for ; Tue, 17 Dec 2024 00:52:51 +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=Lunr+AM74GTPPfWmRn+AT8+K2i2rNeiOvxZLJo+1HHg=; b=yAPxlqvZ+oho5aB+gdJthzMg1l zP+C2qXI81SpbYmap1EnHuAb9iZx3oxyg72BLLvEf78wQJP+s9wLPPv5+VH2h7D6T5R4pZe5R49jw FHBKB/+7gSjoXG6z1TMWugpaxqs2u2Lo+G3Wu7/uFP2Sl5gamNZk23i3MzbEgq2hifWaejlwLGmRQ AxA64abfdJd0knq2cTY/70Hj4cLIRKRjoh1s4zDQZn/VHLo+iq1Mh4DnXC01eaduOnMoGaJqXOQ5F w8p3XuLKnqizVf+tmAaGfMxvbuOF/12wYhF1wWaf4Gxzvpqfb6+cj1UEePV/vuE086OnaykhcvvF8 uWdWcpNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tNLpH-0000000Bo5I-3oBL; Tue, 17 Dec 2024 00:52:39 +0000 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tNLdv-0000000Bktu-0SSb for linux-arm-kernel@lists.infradead.org; Tue, 17 Dec 2024 00:40:56 +0000 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-53f22fd6832so4964661e87.1 for ; Mon, 16 Dec 2024 16:40:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734396053; x=1735000853; 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=Lunr+AM74GTPPfWmRn+AT8+K2i2rNeiOvxZLJo+1HHg=; b=Vdp/S55FdUNj4hMSzLzhuWMhtWXLJKPZY/YVZmOeuPh42vhWjPag1nfqnGqpk6O/t+ ZIgncXAvPez6mruhzg1u38gK0QuwXupvLkFLJeejtH7qyeGD7NFMpWaetZgKmX6VzUgT DwXHaSO1xSpzZYaPMvDYgoF2M+Id4qw52yZfG3c8nHf5h406CRwSRPpU6c+4AJ9Y3aXr W51M/QcNMpT1VQ+h3/ERo10lJ74PVw/T1dg5V/KR7wwkhr7KXezzBvf+QmDwajRicznc 8s3bysGSLr1c3dzaBCN7ioU2gTej6402ue2ZQyGZp8yyHlEW7wEOE1664NrGwKW6UfWI zKCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734396054; x=1735000854; 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=Lunr+AM74GTPPfWmRn+AT8+K2i2rNeiOvxZLJo+1HHg=; b=bNQ8O78NrOVwMbJP5hwYIQkYT73qemFWlXtO5iWhdO63d7TcBIDjvOsixlXqfi35MJ 6Asn2DmDKgw03Ob7wu3l3HLTOVwLQ9+2/xaEzTqL0qPix4w+BW4DO3W1k17C/3FI122r BabLlloOySI5FycJnCWxgfDah46mQqCeDf8u2aU8rCUVLxykbWP3yUD5L64Y9M1PhBgH k+uCnI6mlMb7FLAm0shS79uw4b95sBAbihfcjewqG2flTueSaRx6w8oLdOKGtmsXBnnP iMLWl/aY4lfFCq/8xIFDvQFHZxFe3BfEwbQpr8u4p1TRSAZg9QUuIXzeWIs1Kc8xxmHO AR2A== X-Forwarded-Encrypted: i=1; AJvYcCXu77fyLV385FansUEsZSLJV6THxOQY2wiJjb1eHrhVsT9/jWEvXuO6DntalXKzbzs2hnPYdl5vJQ7W0/KbhMGH@lists.infradead.org X-Gm-Message-State: AOJu0YznOFtyPPsdI4mfsAMcHXIPUvzngWaSHgw0+csEFM+c8O8Tu6UZ +08hfaF1XuqwsYcTm87u/63gs7MBXc7OW/8Wb18bzqUSlCoQblEOWjgKJ0bs0TA= X-Gm-Gg: ASbGncsjg+qctd0xhZ4hrj8f4LsDhu8kzoaZ6DKpcQjAiCgOvL4oKD37kW8D6TbX9Ri VAJEXySHYGp3oTpP2MDbwge9xb1mSZtpCnkU4vIFoSvRB3eL+l5Hlfg5sqmZiYSJ+t+7o5+N133 8hfheUYbhl+ASrvTfM/lX8pqDIFYJc6nFMkK96HXs06jSYfBEUQHbx+nj1NEpxy8312OsZUsy6W lRDTDKpWgE2FLT62UukAZhoLBAEBKziNfMmoPdTy8XoP0kw4MPIPV1Zp0TjNVGs X-Google-Smtp-Source: AGHT+IGe0QdLZY73JsApHksPxAww/oxjVlJdjygOnTwbgrdsohY4NxxLR2cwt2MC32di//BAmFafkQ== X-Received: by 2002:a05:6512:b06:b0:540:17ac:b371 with SMTP id 2adb3069b0e04-54099b6ecdcmr4290758e87.56.1734396053589; Mon, 16 Dec 2024 16:40:53 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-54120ba9ab2sm1009122e87.74.2024.12.16.16.40.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 16:40:52 -0800 (PST) From: Dmitry Baryshkov Date: Tue, 17 Dec 2024 02:40:32 +0200 Subject: [PATCH v7 10/10] drm/vc4: hdmi: use drm_atomic_helper_connector_hdmi_hotplug_edid() MIME-Version: 1.0 Message-Id: <20241217-drm-bridge-hdmi-connector-v7-10-cb9df2b6a515@linaro.org> References: <20241217-drm-bridge-hdmi-connector-v7-0-cb9df2b6a515@linaro.org> In-Reply-To: <20241217-drm-bridge-hdmi-connector-v7-0-cb9df2b6a515@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=1868; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=7s/0WO/aTzEx9yhjto9LxdTyBBJwSv9ES82NKKPeNQ4=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnYMh66KurD/so/4BhoqlDVPuK2xAohhbIWN/EG x67827EyE2JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ2DIegAKCRCLPIo+Aiko 1ZsiCACZHuxK0m8L9MH1NhE2yPwWUTbzhXV2jMuyyQcJBcJKvwYMEAdKnau9ASgbjUyjrS0EqxK PG9HYh7v6OQuoktgWtwxcZgo8DyLPYPsH3ep2lhRl3cz3v19tta06Uegl+D5MxWNoOployl5pF4 LYT81VevjzV55DOYBg/jYXMGpIZF+9d3Umz+KLMKQZ5DXC85lct2mD6XBUBijzLjKir8Yn92L2b o6p48mzqad3L+E2Mxe5QGYoLg5IvVV+ouFScCpgfmP28rZL9PzfgkdmP0ahbxw/xtzK1kfWSxSI 2DH1/dpfUzApuoHsTjp/y0HbjKkiH/BbrYduZ4L2RBFNDDAi 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-20241216_164055_162078_0DF36D18 X-CRM114-Status: GOOD ( 14.35 ) 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 Use the helper function to update the connector's information. This makes sure that HDMI-related events are handled in a generic way. Currently it is limited to the HDMI state reporting to the sound system. Signed-off-by: Dmitry Baryshkov Acked-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index bb5e8738845c74d975c1e0e1262ced46e4ef8fde..328a845ce0c4168b5463d344b3ad1f77a5437cff 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -383,7 +383,6 @@ static void vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi, enum drm_connector_status status) { struct drm_connector *connector = &vc4_hdmi->connector; - const struct drm_edid *drm_edid; int ret; /* @@ -405,17 +404,14 @@ static void vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi, return; } - drm_edid = drm_edid_read_ddc(connector, vc4_hdmi->ddc); + drm_atomic_helper_connector_hdmi_hotplug(connector, status); - 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) + if (status != connector_status_connected) return; - drm_edid_free(drm_edid); - for (;;) { ret = vc4_hdmi_reset_link(connector, ctx); if (ret == -EDEADLK) { @@ -549,6 +545,7 @@ static void vc4_hdmi_connector_reset(struct drm_connector *connector) } static const struct drm_connector_funcs vc4_hdmi_connector_funcs = { + .force = drm_atomic_helper_connector_hdmi_force, .fill_modes = drm_helper_probe_single_connector_modes, .reset = vc4_hdmi_connector_reset, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,