Commit 67e023b9 authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Joonas Lahtinen
Browse files

drm/i915: Grab intel_display from the encoder to avoid potential oopsies



Grab the intel_display from 'encoder' rather than 'state'
in the encoder hooks to avoid the massive footgun that is
intel_sanitize_encoder(), which passes NULL as the 'state'
argument to encoder .disable() and .post_disable().

TODO: figure out how to actually fix intel_sanitize_encoder()...

Fixes: ab0b0eb5 ("drm/i915/tv: convert to struct intel_display")
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241107161123.16269-2-ville.syrjala@linux.intel.com


Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
(cherry picked from commit dc3806d9)
Signed-off-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
parent db0fc586
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -928,7 +928,7 @@ intel_enable_tv(struct intel_atomic_state *state,
		const struct intel_crtc_state *pipe_config,
		const struct drm_connector_state *conn_state)
{
	struct intel_display *display = to_intel_display(state);
	struct intel_display *display = to_intel_display(encoder);

	/* Prevents vblank waits from timing out in intel_tv_detect_type() */
	intel_crtc_wait_for_next_vblank(to_intel_crtc(pipe_config->uapi.crtc));
@@ -942,7 +942,7 @@ intel_disable_tv(struct intel_atomic_state *state,
		 const struct intel_crtc_state *old_crtc_state,
		 const struct drm_connector_state *old_conn_state)
{
	struct intel_display *display = to_intel_display(state);
	struct intel_display *display = to_intel_display(encoder);

	intel_de_rmw(display, TV_CTL, TV_ENC_ENABLE, 0);
}