drm/i915/bios: move aux ch and ddc checks at a lower level
Unify the code paths at the higher level. Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/44559ef456015f65a863c3d89a9bea9157d13a05.1615998927.git.jani.nikula@intel.com
This commit is contained in:
parent
894d17398f
commit
95bbede5a2
|
@ -1505,6 +1505,9 @@ static enum port get_port_by_ddc_pin(struct drm_i915_private *i915, u8 ddc_pin)
|
|||
const struct ddi_vbt_port_info *info;
|
||||
enum port port;
|
||||
|
||||
if (!ddc_pin)
|
||||
return PORT_NONE;
|
||||
|
||||
for_each_port(port) {
|
||||
info = &i915->vbt.ddi_port_info[port];
|
||||
|
||||
|
@ -1521,9 +1524,6 @@ static void sanitize_ddc_pin(struct drm_i915_private *i915,
|
|||
struct ddi_vbt_port_info *info = &i915->vbt.ddi_port_info[port];
|
||||
enum port p;
|
||||
|
||||
if (!info->alternate_ddc_pin)
|
||||
return;
|
||||
|
||||
p = get_port_by_ddc_pin(i915, info->alternate_ddc_pin);
|
||||
if (p == PORT_NONE)
|
||||
return;
|
||||
|
@ -1555,6 +1555,9 @@ static enum port get_port_by_aux_ch(struct drm_i915_private *i915, u8 aux_ch)
|
|||
const struct ddi_vbt_port_info *info;
|
||||
enum port port;
|
||||
|
||||
if (!aux_ch)
|
||||
return PORT_NONE;
|
||||
|
||||
for_each_port(port) {
|
||||
info = &i915->vbt.ddi_port_info[port];
|
||||
|
||||
|
@ -1571,9 +1574,6 @@ static void sanitize_aux_ch(struct drm_i915_private *i915,
|
|||
struct ddi_vbt_port_info *info = &i915->vbt.ddi_port_info[port];
|
||||
enum port p;
|
||||
|
||||
if (!info->alternate_aux_channel)
|
||||
return;
|
||||
|
||||
p = get_port_by_aux_ch(i915, info->alternate_aux_channel);
|
||||
if (p == PORT_NONE)
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue