Skip to content

Commit 14e591a

Browse files
vsyrjalajnikula
authored andcommitted
drm/i915: Populate encoder->devdata for DSI on icl+
We now have some eDP+DSI dual panel systems floating around where the DSI panel is the secondary LFP and thus needs to consult "panel type 2" in VBT in order to locate all the other panel type dependant stuff correctly. To that end we need to pass in the devdata to intel_bios_init_panel_late(), otherwise it'll just assume we want the primary panel type. So let's try to just populate the vbt.ports[] stuff and encoder->devdata for icl+ DSI panels as well. We can't do this on older platforms as there we risk a DSI port aliasing with a HDMI/DP port, which is a totally legal thing as the DSI ports live in their own little parallel universe. Cc: stable@vger.kernel.org Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8016 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230207064337.18697-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula <jani.nikula@intel.com> (cherry picked from commit ba00eb6) Signed-off-by: Jani Nikula <jani.nikula@intel.com>
1 parent 8f9f5fb commit 14e591a

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2043,7 +2043,8 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
20432043
/* attach connector to encoder */
20442044
intel_connector_attach_encoder(intel_connector, encoder);
20452045

2046-
intel_bios_init_panel_late(dev_priv, &intel_connector->panel, NULL, NULL);
2046+
encoder->devdata = intel_bios_encoder_data_lookup(dev_priv, port);
2047+
intel_bios_init_panel_late(dev_priv, &intel_connector->panel, encoder->devdata, NULL);
20472048

20482049
mutex_lock(&dev_priv->drm.mode_config.mutex);
20492050
intel_panel_add_vbt_lfp_fixed_mode(intel_connector);

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2593,6 +2593,12 @@ intel_bios_encoder_supports_edp(const struct intel_bios_encoder_data *devdata)
25932593
devdata->child.device_type & DEVICE_TYPE_INTERNAL_CONNECTOR;
25942594
}
25952595

2596+
static bool
2597+
intel_bios_encoder_supports_dsi(const struct intel_bios_encoder_data *devdata)
2598+
{
2599+
return devdata->child.device_type & DEVICE_TYPE_MIPI_OUTPUT;
2600+
}
2601+
25962602
static int _intel_bios_hdmi_level_shift(const struct intel_bios_encoder_data *devdata)
25972603
{
25982604
if (!devdata || devdata->i915->display.vbt.version < 158)
@@ -2643,21 +2649,22 @@ static void print_ddi_port(const struct intel_bios_encoder_data *devdata,
26432649
{
26442650
struct drm_i915_private *i915 = devdata->i915;
26452651
const struct child_device_config *child = &devdata->child;
2646-
bool is_dvi, is_hdmi, is_dp, is_edp, is_crt, supports_typec_usb, supports_tbt;
2652+
bool is_dvi, is_hdmi, is_dp, is_edp, is_dsi, is_crt, supports_typec_usb, supports_tbt;
26472653
int dp_boost_level, dp_max_link_rate, hdmi_boost_level, hdmi_level_shift, max_tmds_clock;
26482654

26492655
is_dvi = intel_bios_encoder_supports_dvi(devdata);
26502656
is_dp = intel_bios_encoder_supports_dp(devdata);
26512657
is_crt = intel_bios_encoder_supports_crt(devdata);
26522658
is_hdmi = intel_bios_encoder_supports_hdmi(devdata);
26532659
is_edp = intel_bios_encoder_supports_edp(devdata);
2660+
is_dsi = intel_bios_encoder_supports_dsi(devdata);
26542661

26552662
supports_typec_usb = intel_bios_encoder_supports_typec_usb(devdata);
26562663
supports_tbt = intel_bios_encoder_supports_tbt(devdata);
26572664

26582665
drm_dbg_kms(&i915->drm,
2659-
"Port %c VBT info: CRT:%d DVI:%d HDMI:%d DP:%d eDP:%d LSPCON:%d USB-Type-C:%d TBT:%d DSC:%d\n",
2660-
port_name(port), is_crt, is_dvi, is_hdmi, is_dp, is_edp,
2666+
"Port %c VBT info: CRT:%d DVI:%d HDMI:%d DP:%d eDP:%d DSI:%d LSPCON:%d USB-Type-C:%d TBT:%d DSC:%d\n",
2667+
port_name(port), is_crt, is_dvi, is_hdmi, is_dp, is_edp, is_dsi,
26612668
HAS_LSPCON(i915) && child->lspcon,
26622669
supports_typec_usb, supports_tbt,
26632670
devdata->dsc != NULL);
@@ -2710,6 +2717,8 @@ static void parse_ddi_port(struct intel_bios_encoder_data *devdata)
27102717
enum port port;
27112718

27122719
port = dvo_port_to_port(i915, child->dvo_port);
2720+
if (port == PORT_NONE && DISPLAY_VER(i915) >= 11)
2721+
port = dsi_dvo_port_to_port(i915, child->dvo_port);
27132722
if (port == PORT_NONE)
27142723
return;
27152724

0 commit comments

Comments
 (0)