mirror of
https://github.com/torvalds/linux.git
synced 2026-10-28 17:55:02 +01:00
drm/imx: ipuv3: Convert to atomic_create_state
The ipuv3 crtc implementation provides a custom reset hook. However, this hook only allocates the state, initializes it with __drm_atomic_helper_crtc_reset(), and frees the previous state. It does not perform any hardware reset. Since this is exactly what the atomic_create_state hook is meant to do, minus the old state cleanup which the caller handles, convert the implementation to use atomic_create_state with __drm_atomic_helper_crtc_state_init() instead. Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patch.msgid.link/20260821-drm-no-more-crtc-reset-v1-49-fb793475c05a@kernel.org Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
parent
280b1f73da
commit
79499ac290
|
|
@ -107,19 +107,17 @@ static void ipu_crtc_atomic_disable(struct drm_crtc *crtc,
|
|||
spin_unlock_irq(&crtc->dev->event_lock);
|
||||
}
|
||||
|
||||
static void imx_drm_crtc_reset(struct drm_crtc *crtc)
|
||||
static struct drm_crtc_state *imx_drm_crtc_create_state(struct drm_crtc *crtc)
|
||||
{
|
||||
struct imx_crtc_state *state;
|
||||
|
||||
if (crtc->state)
|
||||
__drm_atomic_helper_crtc_destroy_state(crtc->state);
|
||||
|
||||
kfree(to_imx_crtc_state(crtc->state));
|
||||
crtc->state = NULL;
|
||||
|
||||
state = kzalloc_obj(*state);
|
||||
if (state)
|
||||
__drm_atomic_helper_crtc_reset(crtc, &state->base);
|
||||
if (!state)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
__drm_atomic_helper_crtc_state_init(&state->base, crtc);
|
||||
|
||||
return &state->base;
|
||||
}
|
||||
|
||||
static struct drm_crtc_state *imx_drm_crtc_duplicate_state(struct drm_crtc *crtc)
|
||||
|
|
@ -164,7 +162,7 @@ static void ipu_disable_vblank(struct drm_crtc *crtc)
|
|||
static const struct drm_crtc_funcs ipu_crtc_funcs = {
|
||||
.set_config = drm_atomic_helper_set_config,
|
||||
.page_flip = drm_atomic_helper_page_flip,
|
||||
.reset = imx_drm_crtc_reset,
|
||||
.atomic_create_state = imx_drm_crtc_create_state,
|
||||
.atomic_duplicate_state = imx_drm_crtc_duplicate_state,
|
||||
.atomic_destroy_state = imx_drm_crtc_destroy_state,
|
||||
.enable_vblank = ipu_enable_vblank,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user