]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/tidss: crtc: Cleanup reset implementation
authorMaxime Ripard <mripard@kernel.org>
Tue, 2 Sep 2025 08:32:50 +0000 (10:32 +0200)
committerMaxime Ripard <mripard@kernel.org>
Tue, 30 Sep 2025 09:57:12 +0000 (11:57 +0200)
commitb83c30ac9d3d2c15cd7e1d013ec9ff73ef945405
treeb79f4c8b798eca330a16349c021275c91d1f7217
parentec1049f66df4751e87c036cd2e45a38a7649d8af
drm/tidss: crtc: Cleanup reset implementation

The tidss_crtc_reset() function will (rightfully) destroy any
pre-existing state.

However, the tidss CRTC driver has its own CRTC state structure that
subclasses drm_crtc_state, and yet will destroy the previous state
by calling __drm_atomic_helper_crtc_destroy_state() and kfree() on its
drm_crtc_state pointer.

It works only because the drm_crtc_state is the first field in the
structure, and thus its offset is 0. It's incredibly fragile however, so
let's call our destroy implementation in such a case to deal with it
properly.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-22-14ad5315da3f@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250902-drm-state-readout-v1-22-14ad5315da3f@kernel.org
drivers/gpu/drm/tidss/tidss_crtc.c