drm/tidss: crtc: Implement destroy_state

The tidss crtc driver implements its own state, with its own
implementation of reset and duplicate_state, but uses the default
destroy_state helper.

This somewhat works for now because the drm_crtc_state field in
tidss_crtc_state is the first field so the offset is 0, but it's pretty
fragile and it should really have its own destroy_state implementation.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-21-14ad5315da3f@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-21-14ad5315da3f@kernel.org
This commit is contained in:
Maxime Ripard
2025-09-02 10:32:49 +02:00
parent 081da11774
commit ec1049f66d
+10 -1
View File
@@ -343,6 +343,15 @@ static void tidss_crtc_disable_vblank(struct drm_crtc *crtc)
tidss_runtime_put(tidss);
}
static void tidss_crtc_destroy_state(struct drm_crtc *crtc,
struct drm_crtc_state *state)
{
struct tidss_crtc_state *tstate = to_tidss_crtc_state(state);
__drm_atomic_helper_crtc_destroy_state(&tstate->base);
kfree(tstate);
}
static void tidss_crtc_reset(struct drm_crtc *crtc)
{
struct tidss_crtc_state *tstate;
@@ -398,7 +407,7 @@ static const struct drm_crtc_funcs tidss_crtc_funcs = {
.set_config = drm_atomic_helper_set_config,
.page_flip = drm_atomic_helper_page_flip,
.atomic_duplicate_state = tidss_crtc_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
.atomic_destroy_state = tidss_crtc_destroy_state,
.enable_vblank = tidss_crtc_enable_vblank,
.disable_vblank = tidss_crtc_disable_vblank,
};