Skip to content

Commit 67e023b

Browse files
vsyrjalajlahtine-intel
authored andcommitted
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: ab0b0eb ("drm/i915/tv: convert to struct intel_display") Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]> (cherry picked from commit dc3806d) Signed-off-by: Joonas Lahtinen <[email protected]>
1 parent db0fc58 commit 67e023b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/i915/display/intel_tv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ intel_enable_tv(struct intel_atomic_state *state,
928928
const struct intel_crtc_state *pipe_config,
929929
const struct drm_connector_state *conn_state)
930930
{
931-
struct intel_display *display = to_intel_display(state);
931+
struct intel_display *display = to_intel_display(encoder);
932932

933933
/* Prevents vblank waits from timing out in intel_tv_detect_type() */
934934
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,
942942
const struct intel_crtc_state *old_crtc_state,
943943
const struct drm_connector_state *old_conn_state)
944944
{
945-
struct intel_display *display = to_intel_display(state);
945+
struct intel_display *display = to_intel_display(encoder);
946946

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

0 commit comments

Comments
 (0)