Skip to content

Commit d84b194

Browse files
committed
drm/i915/bios: Extract intel_bios_encoder_port()
We'll have a few places where we need to do the full (incl. ICL+ DSI) DVO port->port conversion, so extract the code for that into a helper. Suggested-by: Jani Nikula <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]>
1 parent b8a13e8 commit d84b194

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2374,6 +2374,19 @@ dsi_dvo_port_to_port(struct drm_i915_private *i915, u8 dvo_port)
23742374
}
23752375
}
23762376

2377+
static enum port intel_bios_encoder_port(const struct intel_bios_encoder_data *devdata)
2378+
{
2379+
struct drm_i915_private *i915 = devdata->i915;
2380+
const struct child_device_config *child = &devdata->child;
2381+
enum port port;
2382+
2383+
port = dvo_port_to_port(i915, child->dvo_port);
2384+
if (port == PORT_NONE && DISPLAY_VER(i915) >= 11)
2385+
port = dsi_dvo_port_to_port(i915, child->dvo_port);
2386+
2387+
return port;
2388+
}
2389+
23772390
static int parse_bdb_230_dp_max_link_rate(const int vbt_max_link_rate)
23782391
{
23792392
switch (vbt_max_link_rate) {
@@ -2613,12 +2626,9 @@ static void print_ddi_port(const struct intel_bios_encoder_data *devdata,
26132626
static void parse_ddi_port(struct intel_bios_encoder_data *devdata)
26142627
{
26152628
struct drm_i915_private *i915 = devdata->i915;
2616-
const struct child_device_config *child = &devdata->child;
26172629
enum port port;
26182630

2619-
port = dvo_port_to_port(i915, child->dvo_port);
2620-
if (port == PORT_NONE && DISPLAY_VER(i915) >= 11)
2621-
port = dsi_dvo_port_to_port(i915, child->dvo_port);
2631+
port = intel_bios_encoder_port(devdata);
26222632
if (port == PORT_NONE)
26232633
return;
26242634

0 commit comments

Comments
 (0)