Skip to contentSkip to conversation

FAILED: patch "[PATCH] drm/i915/dsi: filter invalid backlight and CABC ports" failed to apply to 5.10-stable tree

PATCH [email protected] 1 participant 1 message Sep 6, 2022

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

Possible dependencies:

e5e6886f4d7e ("drm/i915/dsi: filter invalid backlight and CABC ports") 3cf050762534 ("drm/i915/bios: Split VBT data into per-panel vs. global parts") c2fdb424d322 ("drm/i915/bios: Split VBT parsing to global vs. panel specific parts") c3fbcf60bc74 ("drm/i915/bios: Split parse_driver_features() into two parts") 75bd0d5e4ead ("drm/i915/pps: Split pps_init_delays() into distinct parts") 822e5ae701af ("drm/i915: Extract intel_edp_fixup_vbt_bpp()") 949665a6e237 ("drm/i915: Respect VBT seamless DRRS min refresh rate") 790b45f1bc67 ("drm/i915/bios: Parse the seamless DRRS min refresh rate") 901a0cad2ab8 ("drm/i915/bios: Get access to the tail end of the LFP data block") 13367132a7ad ("drm/i915/bios: Reorder panel DTD parsing")
5ab58d6996d7 ("drm/i915/bios: Validate the panel_name table") 58b2e3829ec6 ("drm/i915/bios: Trust the LFP data pointers") 514003e1421e ("drm/i915/bios: Validate LFP data table pointers") 918f3025960f ("drm/i915/bios: Use the copy of the LFP data table always") e163cfb4c96d ("drm/i915/bios: Make copies of VBT data blocks") d58a3d699797 ("drm/i915/bios: Use the cached BDB version") ca2a3c9204ec ("drm/i915/bios: Extract struct lvds_lfp_data_ptr_table") 001b6169a920 ("drm/i915: Allow static DRRS on LVDS")
1159c8339278 ("drm/i915: Allow static DRRS on all eDP ports") f244cdfa72b8 ("drm/i915: Move intel_drrs_compute_config() into intel_dp.c")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From e5e6886f4d7e34b6539abddb591d515271caa634 Mon Sep 17 00:00:00 2001
From: Jani Nikula <[email protected]>
Date: Tue, 16 Aug 2022 18:37:20 +0300
Subject: [PATCH] drm/i915/dsi: filter invalid backlight and CABC ports

Avoid using ports that aren't initialized in case the VBT backlight or CABC ports have invalid values. This fixes a NULL pointer dereference of intel_dsi->dsi_hosts[port] in such cases.

drivers/gpu/drm/i915/display/icl_dsi.c +7 -0
index 5dcfa7feffa9..885c74f60366 100644
@@ -2070,7 +2070,14 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
 	else
 		intel_dsi->ports = BIT(port);
 
+	if (drm_WARN_ON(&dev_priv->drm, intel_connector->panel.vbt.dsi.bl_ports & ~intel_dsi->ports))
+		intel_connector->panel.vbt.dsi.bl_ports &= intel_dsi->ports;
+
 	intel_dsi->dcs_backlight_ports = intel_connector->panel.vbt.dsi.bl_ports;
+
+	if (drm_WARN_ON(&dev_priv->drm, intel_connector->panel.vbt.dsi.cabc_ports & ~intel_dsi->ports))
+		intel_connector->panel.vbt.dsi.cabc_ports &= intel_dsi->ports;
+
 	intel_dsi->dcs_cabc_ports = intel_connector->panel.vbt.dsi.cabc_ports;
 
 	for_each_dsi_port(port, intel_dsi->ports) {
drivers/gpu/drm/i915/display/vlv_dsi.c +7 -0
index b9b1fed99874..35136d26e517 100644
@@ -1933,7 +1933,14 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
 	else
 		intel_dsi->ports = BIT(port);
 
+	if (drm_WARN_ON(&dev_priv->drm, intel_connector->panel.vbt.dsi.bl_ports & ~intel_dsi->ports))
+		intel_connector->panel.vbt.dsi.bl_ports &= intel_dsi->ports;
+
 	intel_dsi->dcs_backlight_ports = intel_connector->panel.vbt.dsi.bl_ports;
+
+	if (drm_WARN_ON(&dev_priv->drm, intel_connector->panel.vbt.dsi.cabc_ports & ~intel_dsi->ports))
+		intel_connector->panel.vbt.dsi.cabc_ports &= intel_dsi->ports;
+
 	intel_dsi->dcs_cabc_ports = intel_connector->panel.vbt.dsi.cabc_ports;
 
 	/* Create a DSI host (and a device) for each port. */