Skip to content

Commit 1e9974c

Browse files
committed
drm/vc4: hdmi: Create destroy state implementation
Even though we were rolling our own custom state for the vc4 HDMI controller driver, we were still using the generic helper to destroy that state. It was mostly working since the underlying state is the first member of our state so the pointers are probably equal in all relevant cases, but it's still fragile so let's fix this properly. Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20231207-kms-hdmi-connector-state-v5-18-6538e19d634d@kernel.org
1 parent 1faed97 commit 1e9974c

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,11 +672,21 @@ vc4_hdmi_connector_duplicate_state(struct drm_connector *connector)
672672
return &new_state->base;
673673
}
674674

675+
static void vc4_hdmi_connector_destroy_state(struct drm_connector *connector,
676+
struct drm_connector_state *state)
677+
{
678+
struct vc4_hdmi_connector_state *vc4_state =
679+
conn_state_to_vc4_hdmi_conn_state(state);
680+
681+
__drm_atomic_helper_connector_destroy_state(state);
682+
kfree(vc4_state);
683+
}
684+
675685
static const struct drm_connector_funcs vc4_hdmi_connector_funcs = {
676686
.fill_modes = drm_helper_probe_single_connector_modes,
677687
.reset = vc4_hdmi_connector_reset,
678688
.atomic_duplicate_state = vc4_hdmi_connector_duplicate_state,
679-
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
689+
.atomic_destroy_state = vc4_hdmi_connector_destroy_state,
680690
.atomic_get_property = vc4_hdmi_connector_get_property,
681691
.atomic_set_property = vc4_hdmi_connector_set_property,
682692
};

0 commit comments

Comments
 (0)