mirror of
https://github.com/torvalds/linux.git
synced 2025-11-03 01:59:51 +02:00
drm/bridge: Introduce drm_bridge_is_atomic() helper
We test for whether the bridge is atomic in several places in the source code, so let's consolidate them. Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20250313-bridge-connector-v6-11-511c54a604fb@kernel.org Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
parent
e17fadff7a
commit
ba6c94d51a
1 changed files with 7 additions and 2 deletions
|
|
@ -281,6 +281,11 @@ static const struct drm_private_state_funcs drm_bridge_priv_state_funcs = {
|
|||
.atomic_destroy_state = drm_bridge_atomic_destroy_priv_state,
|
||||
};
|
||||
|
||||
static bool drm_bridge_is_atomic(struct drm_bridge *bridge)
|
||||
{
|
||||
return bridge->funcs->atomic_reset != NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* drm_bridge_attach - attach the bridge to an encoder's chain
|
||||
*
|
||||
|
|
@ -333,7 +338,7 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge,
|
|||
goto err_reset_bridge;
|
||||
}
|
||||
|
||||
if (bridge->funcs->atomic_reset) {
|
||||
if (drm_bridge_is_atomic(bridge)) {
|
||||
struct drm_bridge_state *state;
|
||||
|
||||
state = bridge->funcs->atomic_reset(bridge);
|
||||
|
|
@ -378,7 +383,7 @@ void drm_bridge_detach(struct drm_bridge *bridge)
|
|||
if (WARN_ON(!bridge->dev))
|
||||
return;
|
||||
|
||||
if (bridge->funcs->atomic_reset)
|
||||
if (drm_bridge_is_atomic(bridge))
|
||||
drm_atomic_private_obj_fini(&bridge->base);
|
||||
|
||||
if (bridge->funcs->detach)
|
||||
|
|
|
|||
Loading…
Reference in a new issue