Message ID | 20231031-kms-hdmi-connector-state-v3-13-328b0fae43a7@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b90f:0:b0:403:3b70:6f57 with SMTP id t15csp373511vqg; Tue, 31 Oct 2023 09:50:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHcKW8z6aKjDjUY1pxN6cxzlurVNQtOcYTE/Vg8OKInNJr8AsKu0cQj/UYwO6+TCbpXlceo X-Received: by 2002:a05:6a21:99a6:b0:173:f45e:71c2 with SMTP id ve38-20020a056a2199a600b00173f45e71c2mr202621pzb.11.1698771031819; Tue, 31 Oct 2023 09:50:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698771031; cv=none; d=google.com; s=arc-20160816; b=M2HIRR4EM21xybFu8yx0dixYub+ShM34lqtn1g6Mve1CiQ2SebUwvUedXsp2MBfysz zkrBHD7R8ll/fjJvabTcCp6vGjTJEH9jUWRqfORMV8Erj1liMnSpfnR8bc1X6oQ40a0M yGHMzMISpGfdVJLamCpWCovfc9vKFyRlxPt9FcHHjIEv6VNEwMMH7hmqgpgA9VsexSwQ SRnEJ21L01TXG22IQhZ3KHOLpgyp/vj/vxtWQqNMiDfppRnxytwiqv4sj9aW6Dha6bzA UgMgKNohhBJnh4tANSMqcN7ygt2x8drFD9ZLbZO6A/Zg33kwN84dimeypv3zH7ZzduW6 XXUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=r376pOvUZDjk4nJNr1jZTROYu8wE8f1STd/qIwsIVOI=; fh=e6/uyeFf2k7v8JUtB6fPyaAS5iN3eSA1hjtg35V2Rzw=; b=OUAqoJAvHJhRPYoFBFSh6Mzp1vWrhDh8NZFZ6CCSXqZRCq7UuavaCCcdJB+uqYah+L +HuxDxp+X0TPpXitYZBBK3lkCQ2NAU16cRG/bCixy/GQqGlR3wxYjbzj8U+TKkG1ibsD NX8IYAAzZ1P7yqNOWIK4ZJOcA3AH8vO2Q3MXxN8Ol06H7Fyy/+naiNsII6W0mbvT7eMd qJvxXMclzpsWlKoWxPBHkKD+gjXCvktzxLhWCgzGLTspsb7RUasN2XlA6/UAfpZo8nbm TlJKz3GzjAcW1BXLIzBsbCaHf/1sAAU9+VVZY4csLLmqcBoUh4EKKiX+li2yj2no0Dlp dwHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iahrUcKq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id ca37-20020a056a0206a500b005b909d4a4a1si1270882pgb.358.2023.10.31.09.50.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 09:50:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iahrUcKq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4733B808462E; Tue, 31 Oct 2023 09:50:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346570AbjJaQtn (ORCPT <rfc822;chrisjones.unixmen@gmail.com> + 33 others); Tue, 31 Oct 2023 12:49:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346615AbjJaQtO (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 31 Oct 2023 12:49:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42546E8; Tue, 31 Oct 2023 09:49:12 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CB9FC433C8; Tue, 31 Oct 2023 16:49:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698770951; bh=3urbyxJOhBJnxOpaqPUf/XFZGd3bz5XAd4Th75mEdek=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=iahrUcKqSV3lX4ZqGjGm7cIqAZc5HYlXXHqvrLMWIRS2//1OQFrnc80OMc/fLKTQU 4bucmEXFJcZeBxWpnDWS9T9m9gTPVV3TCUNLJE37XeLggA6Bi7EbDcUNc/GnsCZCiS UnQY2OyxKw1dHDtqnIJMZ9ZU8JG0QJhOQwAaLjnHlMsOTjVoIBw94yzUR6Jzvdi+tC 7QxRkGr6ZgMpckTxXqItG3ByY3UHQ2SX22k/4Vll+N8ELjvzQozbCTKHnuTDiharJd YiBwwDkRi6aNYL/8UsE25Y51koM1hAboO36vqtHTTiqx7gWDJs0Eq8h6WSlW9p7Pau SINs4JdLMburg== From: Maxime Ripard <mripard@kernel.org> Date: Tue, 31 Oct 2023 17:48:26 +0100 Subject: [PATCH RFC v3 13/37] drm/vc4: hdmi: Create destroy state implementation MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231031-kms-hdmi-connector-state-v3-13-328b0fae43a7@kernel.org> References: <20231031-kms-hdmi-connector-state-v3-0-328b0fae43a7@kernel.org> In-Reply-To: <20231031-kms-hdmi-connector-state-v3-0-328b0fae43a7@kernel.org> To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Emma Anholt <emma@anholt.net>, Jonathan Corbet <corbet@lwn.net>, Sandy Huang <hjc@rock-chips.com>, =?utf-8?q?Heiko_St=C3=BCbner?= <heiko@sntech.de>, Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@gmail.com>, Samuel Holland <samuel@sholland.org> Cc: Hans Verkuil <hverkuil@xs4all.nl>, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-sunxi@lists.linux.dev, Maxime Ripard <mripard@kernel.org> X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1640; i=mripard@kernel.org; h=from:subject:message-id; bh=3urbyxJOhBJnxOpaqPUf/XFZGd3bz5XAd4Th75mEdek=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDKmO+veYFr399NOA4YHuhmZpjUCFe888Avc6K/vM4e34c OTCwTMrOkpZGMS4GGTFFFlihM2XxJ2a9bqTjW8ezBxWJpAhDFycAjCRAjuG/9lt+xbUHNaz/jBV 53SRrxeT0Tvpy4LlzxoeqnKXFD4zamBkOOqrW/PjOeP/iZ8mX1y20c03l89duyHqSMFENi6+J24 bOAA= X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 31 Oct 2023 09:50:07 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781290533713124633 X-GMAIL-MSGID: 1781290533713124633 |
Series |
drm/connector: Create HDMI Connector infrastructure
|
|
Commit Message
Maxime Ripard
Oct. 31, 2023, 4:48 p.m. UTC
Even though we were rolling our own custom state for the vc4 HDMI
controller driver, we were still using the generic helper to destroy
that state.
It was mostly working since the underlying state is the first member of
our state so the pointers are probably equal in all relevant cases, but
it's still fragile so let's fix this properly.
Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 25c9c71256d3..f05e2c95a60d 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -672,11 +672,21 @@ vc4_hdmi_connector_duplicate_state(struct drm_connector *connector) return &new_state->base; } +static void vc4_hdmi_connector_destroy_state(struct drm_connector *connector, + struct drm_connector_state *state) +{ + struct vc4_hdmi_connector_state *vc4_state = + conn_state_to_vc4_hdmi_conn_state(state); + + __drm_atomic_helper_connector_destroy_state(state); + kfree(vc4_state); +} + static const struct drm_connector_funcs vc4_hdmi_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .reset = vc4_hdmi_connector_reset, .atomic_duplicate_state = vc4_hdmi_connector_duplicate_state, - .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, + .atomic_destroy_state = vc4_hdmi_connector_destroy_state, .atomic_get_property = vc4_hdmi_connector_get_property, .atomic_set_property = vc4_hdmi_connector_set_property, };