Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+10 -1
+10 -1
drivers/gpu/drm/tidss/tidss_crtc.c
··· 343 343 tidss_runtime_put(tidss); 344 344 } 345 345 346 + static void tidss_crtc_destroy_state(struct drm_crtc *crtc, 347 + struct drm_crtc_state *state) 348 + { 349 + struct tidss_crtc_state *tstate = to_tidss_crtc_state(state); 350 + 351 + __drm_atomic_helper_crtc_destroy_state(&tstate->base); 352 + kfree(tstate); 353 + } 354 + 346 355 static void tidss_crtc_reset(struct drm_crtc *crtc) 347 356 { 348 357 struct tidss_crtc_state *tstate; ··· 407 398 .set_config = drm_atomic_helper_set_config, 408 399 .page_flip = drm_atomic_helper_page_flip, 409 400 .atomic_duplicate_state = tidss_crtc_duplicate_state, 410 - .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, 401 + .atomic_destroy_state = tidss_crtc_destroy_state, 411 402 .enable_vblank = tidss_crtc_enable_vblank, 412 403 .disable_vblank = tidss_crtc_disable_vblank, 413 404 };