mirror of
https://github.com/torvalds/linux.git
synced 2026-10-30 14:06:03 +01:00
drm/mediatek: Convert to atomic_create_state
The mediatek 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: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20260904-drm-no-more-crtc-reset-v3-10-27d9891512ce@kernel.org Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
parent
4288a0bb6d
commit
c60095d8cd
|
|
@ -150,19 +150,17 @@ static void mtk_crtc_destroy(struct drm_crtc *crtc)
|
|||
drm_crtc_cleanup(crtc);
|
||||
}
|
||||
|
||||
static void mtk_crtc_reset(struct drm_crtc *crtc)
|
||||
static struct drm_crtc_state *mtk_crtc_create_state(struct drm_crtc *crtc)
|
||||
{
|
||||
struct mtk_crtc_state *state;
|
||||
|
||||
if (crtc->state) {
|
||||
__drm_atomic_helper_crtc_destroy_state(crtc->state);
|
||||
kfree(to_mtk_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 *mtk_crtc_duplicate_state(struct drm_crtc *crtc)
|
||||
|
|
@ -886,7 +884,7 @@ static const struct drm_crtc_funcs mtk_crtc_funcs = {
|
|||
.set_config = drm_atomic_helper_set_config,
|
||||
.page_flip = drm_atomic_helper_page_flip,
|
||||
.destroy = mtk_crtc_destroy,
|
||||
.reset = mtk_crtc_reset,
|
||||
.atomic_create_state = mtk_crtc_create_state,
|
||||
.atomic_duplicate_state = mtk_crtc_duplicate_state,
|
||||
.atomic_destroy_state = mtk_crtc_destroy_state,
|
||||
.enable_vblank = mtk_crtc_enable_vblank,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user