]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/i915/display: Only query DP state of a DDI encoder
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 25 May 2020 12:49:12 +0000 (13:49 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 26 May 2020 11:53:52 +0000 (12:53 +0100)
Avoid a NULL dereference for a mismatched encoder type, hit when
probing state for all encoders.

This is a band aid to prevent the OOPS as the right fix is "probably to
swap the psr vs infoframes.enable checks, or outright disappear from
this function" (Ville).

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/1892
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200525124912.16019-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/display/intel_dp.c

index 1768731678a161cfee851328e53742f96887b088..4749d2fe2324ea0d2e7c6225bb5460e37b8ad2b6 100644 (file)
@@ -5212,6 +5212,9 @@ void intel_read_dp_sdp(struct intel_encoder *encoder,
                       struct intel_crtc_state *crtc_state,
                       unsigned int type)
 {
+       if (encoder->type != INTEL_OUTPUT_DDI)
+               return;
+
        switch (type) {
        case DP_SDP_VSC:
                intel_read_dp_vsc_sdp(encoder, crtc_state,