From nobody Wed Feb 5 16:56:54 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E3041DED6C for ; Wed, 15 Jan 2025 21:06:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736975207; cv=none; b=CgjTT8ADbb3d3jD7PCD6UY0VnnoRDO+fJchs/bVVvEtUXGeDOMpFQhQcPAsCTI0GlGgBBNp8AOfN+keOzv9KgivnEeWIWrnORZprxUlM7OXEHEA+AXYZtNG/r+oIMEUo0v3r38BqXrl2OsexveSdipYzc+46rrd3TJ5pvLTWnuY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736975207; c=relaxed/simple; bh=5zLzfFZPREyjvEuyET+bvMC8ZsqMF5Ry5XDxOdMfXqs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WRCyAmPI20qpUZvn4EmtY/FIwSA7IvQHTVS+JrffZiSrOeiq7wZTl4oKUiJsJdkwCQi43B9zqhtQAhvIatvmjrDM5k5O3vyi0RL4SBaB4nrNVVwbisXgPo5u5lF04Z7I+NtaNlutB9pompt7AXGSVbxdSPoOaYiMi4v+EXWUauA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=n6UiRYFZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="n6UiRYFZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12BDBC4CED1; Wed, 15 Jan 2025 21:06:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736975207; bh=5zLzfFZPREyjvEuyET+bvMC8ZsqMF5Ry5XDxOdMfXqs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=n6UiRYFZNzvlTfen819iBAVzF6FfZpArJHliz49TPpZZ+aqdEL/sGaVcxWjDziOgC GGLZtfck4gFI1HO/LSSirx0AWYxaxBKbIGai7V8KDdFgrUUpqzH61eZwLwkEFmGa66 krlOePI1jnnj0slUNIyVSMocBRuZKkWl+5bkUicmfvvLVZy5ZkANROS/CIqcom5IRx EYlLC+THZjcni++cEO0kveyp6au+mC3J/U4p8qDuqWicOJgdrtlt4osz7/jCMnRqLe vFTgkvhkRE9vRlb4V3CfLrIWiRLAC458WDfDceW7VEILfyMTsIn1Spe+W1qZUqdikV xaY2IVwWhk72A== From: Maxime Ripard Date: Wed, 15 Jan 2025 22:05:31 +0100 Subject: [PATCH 24/29] drm/bridge: Provide a helper to get the global state from a bridge state Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250115-bridge-connector-v1-24-9a2fecd886a6@kernel.org> References: <20250115-bridge-connector-v1-0-9a2fecd886a6@kernel.org> In-Reply-To: <20250115-bridge-connector-v1-0-9a2fecd886a6@kernel.org> To: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Douglas Anderson Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maxime Ripard X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1469; i=mripard@kernel.org; h=from:subject:message-id; bh=5zLzfFZPREyjvEuyET+bvMC8ZsqMF5Ry5XDxOdMfXqs=; b=owGbwMvMwCmsHn9OcpHtvjLG02pJDOkdyvJ3FL9NcPi4LnNzf0pHU6vd0UtMfOebJFsW8X+xm Xrk9oIFHVNZGIQ5GWTFFFmeyISdXt6+uMrBfuUPmDmsTCBDGLg4BWAiu/UYG9521p24H2B9Qtvv lU33ZPaApBunFh3VOVwkLXlvtfOcRNtXqeelZ2qm+a9RSRU80vx0NWOt2JXtzDE/Hk0IN/55fXr e0c6327aq5ZT6lCgt+y+g/ZVvyY/KO647l5lynlLMzohl2M4CAA== X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D We have access to the global drm_atomic_state from a drm_bridge_state, but since it's fairly indirect it's not as obvious as it can be for other KMS entities. Provide a helper to make it easier to figure out. Signed-off-by: Maxime Ripard --- include/drm/drm_atomic.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index 31ca88deb10d262fb3a3f8e14d2afe24f8410cb1..bd7959ae312c99c0a0034d36378= ae44f04f6a374 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h @@ -1183,10 +1183,26 @@ static inline struct drm_bridge_state * drm_priv_to_bridge_state(struct drm_private_state *priv) { return container_of(priv, struct drm_bridge_state, base); } =20 +/** + * @drm_bridge_state_get_atomic_state() - Get the atomic state from a brid= ge state + * @bridge_state: bridge state object + * + * RETURNS: + * The global atomic state @bridge_state is a part of, or NULL if there is= none. + */ +static inline struct drm_atomic_state * +drm_bridge_state_get_atomic_state(struct drm_bridge_state *bridge_state) +{ + if (!bridge_state) + return NULL; + + return bridge_state->base.state; +} + struct drm_bridge_state * drm_atomic_get_bridge_state(struct drm_atomic_state *state, struct drm_bridge *bridge); struct drm_bridge_state * drm_atomic_get_old_bridge_state(const struct drm_atomic_state *state, --=20 2.47.1