drm/i915: Init DDI ports in VBT order
Subsystems (3)
cover drm/i915: Init DDI ports in VBT order
From: Ville Syrjälä <[email protected]>
I just wanted to init DDI ports in VBT child device order without any up front assumptions about which conflicting child device defition is valid. That is pretty much what we need to do for the ADL laptops with the phantom eDP vs. native HDMI on DDI B.
However that approach doesn't work for some of the weird SKL boards that have a phantom eDP on DDI A+AUX A and and a real DP->VGA converter on DDI E+AUX A. For those I had to introduce HPD live status check during eDP init.
One of the remaining concerns I still have is what happens when we encounter VBTs with more AUX CH/DDC pin conflicts? I think what we might want to do eventually is ignore the conflicts as much as possible, and just init everything based on VBT, trusting HPD to take care of things in the end. That of course does have certain issues wrt. connector forcing, but dunno if we can avoid those at all.
Also I think we need to nuke all the platform default AUX CH/DDC pin stuff, or at least only try to utilize those only once we've consumed the VBT fully.
Ville Syrjälä (17):
drm/i915: Populate dig_port->connected() before connector init drm/i915: Get rid of the gm45 HPD live state nonsense drm/i915: Introduce <platoform>_hotplug_mask() drm/i915: Introduce intel_hpd_detection()
drm/i915: Check HPD live state during eDP probe drm/i915: Sanitize child devices later
drm/i915: Split map_aux_ch() into per-platform arrays drm/i915: Flip VBT DDC pin maps around
drm/i915: Nuke intel_bios_is_port_dp_dual_mode() drm/i915: Remove bogus DDI-F from hsw/bdw output init drm/i915: Introduce device info port_mask
drm/i915: Assert that device info bitmasks have enough bits drm/i915: Assert that the port being initialized is valid drm/i915: Beef up SDVO/HDMI port checks
drm/i915: Init DDI outputs based on port_mask on skl+ drm/i915: Try to initialize DDI/ICL+ DSI ports for every VBT child
device
drm/i915: Convert HSW/BDW to use VBT driven DDI probe
drivers/gpu/drm/i915/display/g4x_dp.c | 34 +- drivers/gpu/drm/i915/display/g4x_hdmi.c | 23 +- drivers/gpu/drm/i915/display/icl_dsi.c | 11 +- drivers/gpu/drm/i915/display/icl_dsi.h | 6 +- drivers/gpu/drm/i915/display/intel_bios.c | 380 ++++++++++-------- drivers/gpu/drm/i915/display/intel_bios.h | 12 +- drivers/gpu/drm/i915/display/intel_crt.c | 2 + drivers/gpu/drm/i915/display/intel_ddi.c | 128 ++++-- drivers/gpu/drm/i915/display/intel_ddi.h | 5 +- drivers/gpu/drm/i915/display/intel_display.c | 89 +--- drivers/gpu/drm/i915/display/intel_display.h | 2 + .../gpu/drm/i915/display/intel_display_core.h | 2 - drivers/gpu/drm/i915/display/intel_dp.c | 28 ++ drivers/gpu/drm/i915/display/intel_dvo.c | 2 + drivers/gpu/drm/i915/display/intel_hdmi.c | 6 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 20 +- drivers/gpu/drm/i915/i915_irq.c | 363 +++++++++++++---- drivers/gpu/drm/i915/i915_irq.h | 2 + drivers/gpu/drm/i915/i915_pci.c | 31 ++ drivers/gpu/drm/i915/i915_reg.h | 13 +- drivers/gpu/drm/i915/intel_device_info.c | 9 + drivers/gpu/drm/i915/intel_device_info.h | 1 + 22 files changed, 756 insertions(+), 413 deletions(-)
Signature · 1 line
2.39.2
PATCH 1/17 drm/i915: Populate dig_port->connected() before connector init
From: Ville Syrjälä <[email protected]>
We'll need dig_port->connected() to be there for a HPD live state check during eDP connector probing. Reorder intel_ddi_init() accordingly. g4x_dp_init() is already fine.
--- drivers/gpu/drm/i915/display/intel_ddi.c | 40 ++++++++++++------------ 1 file changed, 20 insertions(+), 20 deletions(-)
drivers/gpu/drm/i915/display/intel_ddi.c +20 -20
@@ -4503,8 +4503,28 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)drm_WARN_ON (&dev_priv->drm, port >PORT_I ); dig_port->ddi_io_power_domain =intel_display_power_ddi_io_domain (dev_priv, port); +if (DISPLAY_VER (dev_priv) >=11 ) { +if (intel_phy_is_tc (dev_priv, phy)) + dig_port->connected = intel_tc_port_connected; +else + dig_port->connected = lpt_digital_port_connected; + }else if (DISPLAY_VER (dev_priv) >=8 ) { +if (port ==PORT_A ||IS_GEMINILAKE (dev_priv) || +IS_BROXTON (dev_priv)) + dig_port->connected = bdw_digital_port_connected; +else + dig_port->connected = lpt_digital_port_connected; + }else { +if (port ==PORT_A ) + dig_port->connected = hsw_digital_port_connected; +else + dig_port->connected = lpt_digital_port_connected; + } + +intel_infoframe_init (dig_port); +if (init_dp) {if (!intel_ddi_init_dp_connector (dig_port)) goto err;
@@ -4520,28 +4540,8 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)if (!intel_ddi_init_hdmi_connector (dig_port)) goto err; } -if (DISPLAY_VER (dev_priv) >=11 ) { -if (intel_phy_is_tc (dev_priv, phy)) - dig_port->connected = intel_tc_port_connected; -else - dig_port->connected = lpt_digital_port_connected; - }else if (DISPLAY_VER (dev_priv) >=8 ) { -if (port ==PORT_A ||IS_GEMINILAKE (dev_priv) || -IS_BROXTON (dev_priv)) - dig_port->connected = bdw_digital_port_connected; -else - dig_port->connected = lpt_digital_port_connected; - }else { -if (port ==PORT_A ) - dig_port->connected = hsw_digital_port_connected; -else - dig_port->connected = lpt_digital_port_connected; - } - -intel_infoframe_init (dig_port); -return ; err:drm_encoder_cleanup (&encoder->base);
Signature · 1 line
2.39.2
PATCH 2/17 drm/i915: Get rid of the gm45 HPD live state nonsense
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
The idea that ctg uses different HPD live state bits is total nonsense, at least on my machine (Dell Latitude E5400).
The only reason DP-B even works on my ctg is that DP-D live state is stuck high, even though there is no physical DP-D port. So when the detect checks DP-B live state it sees the stuck live state of DP-D instead. If I hack the driver to not register DP-D at all, and thus we never enabe DP-D HPD, DP-B stops working as well.
Just to put some conclusive evidence into this mess, here are the actual hotplug register values for each port:
Everything disconnected:
PORT_HOTPLUG_EN (0x00061110): 0x00000000
PORT_HOTPLUG_STAT (0x00061114): 0x00000000
PORT_HOTPLUG_EN (0x00061110): 0x08000000
PORT_HOTPLUG_STAT (0x00061114): 0x08000000
PORT_HOTPLUG_EN (0x00061110): 0x10000000
PORT_HOTPLUG_STAT (0x00061114): 0x00000000
PORT_HOTPLUG_EN (0x00061110): 0x20000000
PORT_HOTPLUG_STAT (0x00061114): 0x00000000
Only port B connected:
PORT_HOTPLUG_EN (0x00061110): 0x00000000
PORT_HOTPLUG_STAT (0x00061114): 0x00000000
PORT_HOTPLUG_EN (0x00061110): 0x08000000
PORT_HOTPLUG_STAT (0x00061114): 0x08000000
PORT_HOTPLUG_EN (0x00061110): 0x10000000
PORT_HOTPLUG_STAT (0x00061114): 0x00000000
PORT_HOTPLUG_EN (0x00061110): 0x20000000
PORT_HOTPLUG_STAT (0x00061114): 0x20000000
Only port C connected:
PORT_HOTPLUG_EN (0x00061110): 0x00000000
PORT_HOTPLUG_STAT (0x00061114): 0x00000000
PORT_HOTPLUG_EN (0x00061110): 0x08000000
PORT_HOTPLUG_STAT (0x00061114): 0x08000000
PORT_HOTPLUG_EN (0x00061110): 0x10000000
PORT_HOTPLUG_STAT (0x00061114): 0x10000000
PORT_HOTPLUG_EN (0x00061110): 0x20000000
PORT_HOTPLUG_STAT (0x00061114): 0x00000000So the enable bit and live state bit always match 1:1.
--- drivers/gpu/drm/i915/display/g4x_dp.c | 28 +-------------------------- drivers/gpu/drm/i915/i915_reg.h | 13 +------------ 2 files changed, 2 insertions(+), 39 deletions(-)
drivers/gpu/drm/i915/display/g4x_dp.c +1 -27
@@ -1196,31 +1196,8 @@ static bool g4x_digital_port_connected(struct intel_encoder *encoder)return intel_de_read (dev_priv,PORT_HOTPLUG_STAT ) & bit; } -static bool gm45_digital_port_connected (struct intel_encoder *encoder) -{ -struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev); -u32 bit; - -switch (encoder->hpd_pin) { -case HPD_PORT_B : - bit =PORTB_HOTPLUG_LIVE_STATUS_GM45 ; -break ; -case HPD_PORT_C : - bit =PORTC_HOTPLUG_LIVE_STATUS_GM45 ; -break ; -case HPD_PORT_D : - bit =PORTD_HOTPLUG_LIVE_STATUS_GM45 ; -break ; -default : -MISSING_CASE (encoder->hpd_pin); -return false; - } - -return intel_de_read (dev_priv,PORT_HOTPLUG_STAT ) & bit; -} -static bool ilk_digital_port_connected (struct intel_encoder *encoder) {struct drm_i915_private *dev_priv =to_i915 (encoder->base.dev);u32 bit = dev_priv->display.hotplug.hpd[encoder->hpd_pin];
@@ -1383,12 +1360,9 @@ bool g4x_dp_init(struct drm_i915_private *dev_priv, dig_port->hpd_pulse = intel_dp_hpd_pulse;if (HAS_GMCH (dev_priv)) { -if (IS_GM45 (dev_priv)) - dig_port->connected = gm45_digital_port_connected; -else - dig_port->connected = g4x_digital_port_connected; + dig_port->connected = g4x_digital_port_connected; }else {if (port ==PORT_A ) dig_port->connected = ilk_digital_port_connected;else
drivers/gpu/drm/i915/i915_reg.h +1 -12
@@ -2482,20 +2482,9 @@#define CRT_HOTPLUG_DETECT_VOLTAGE_325MV (0 << 2)#define CRT_HOTPLUG_DETECT_VOLTAGE_475MV (1 << 2)#define PORT_HOTPLUG_STAT _MMIO(DISPLAY_MMIO_BASE(dev_priv) + 0x61114) -/* -* HDMI/DP bits are g4x+ -* -* WARNING: Bspec for hpd status bits on gen4 seems to be completely confused. -* Please check the detailed lore in the commit message for for experimental -* evidence. -*/ -/* Bspec says GM45 should match G4X/VLV/CHV, but reality disagrees */ -#define PORTD_HOTPLUG_LIVE_STATUS_GM45 (1 << 29) -#define PORTC_HOTPLUG_LIVE_STATUS_GM45 (1 << 28) -#define PORTB_HOTPLUG_LIVE_STATUS_GM45 (1 << 27) -/* G4X/VLV/CHV DP/HDMI bits again match Bspec */ +/* HDMI/DP bits are g4x+ */ #define PORTD_HOTPLUG_LIVE_STATUS_G4X (1 << 27)#define PORTC_HOTPLUG_LIVE_STATUS_G4X (1 << 28)#define PORTB_HOTPLUG_LIVE_STATUS_G4X (1 << 29)#define PORTD_HOTPLUG_INT_STATUS (3 << 21)
Signature · 1 line
2.39.2
PATCH 3/17 drm/i915: Introduce <platoform>_hotplug_mask()
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Pair each <platform>_hotplug_enables() function with a corresponding <platform>_hotplug_mask() function so that we can determine right bits to clear on a per hpd_pin basis. We'll need this for turning on HPD sense for a specific encoder rather than just all of them.
--- drivers/gpu/drm/i915/i915_irq.c | 231 ++++++++++++++++++++++---------- 1 file changed, 160 insertions(+), 71 deletions(-)
drivers/gpu/drm/i915/i915_irq.c +160 -71
@@ -2833,8 +2833,25 @@ static void cherryview_irq_reset(struct drm_i915_private *dev_priv)vlv_display_irq_reset (dev_priv);spin_unlock_irq (&dev_priv->irq_lock); } +static u32 ibx_hotplug_mask (struct drm_i915_private *i915, +enum hpd_pin hpd_pin) +{ +switch (hpd_pin) { +case HPD_PORT_A : +return PORTA_HOTPLUG_ENABLE ; +case HPD_PORT_B : +return PORTB_HOTPLUG_ENABLE |PORTB_PULSE_DURATION_MASK ; +case HPD_PORT_C : +return PORTC_HOTPLUG_ENABLE |PORTC_PULSE_DURATION_MASK ; +case HPD_PORT_D : +return PORTD_HOTPLUG_ENABLE |PORTD_PULSE_DURATION_MASK ; +default : +return 0 ; + } +} +static u32 ibx_hotplug_enables (struct intel_encoder *encoder) {struct drm_i915_private *i915 =to_i915 (encoder->base.dev);
@@ -2867,15 +2884,12 @@ static void ibx_hpd_detection_setup(struct drm_i915_private *dev_priv)* duration to 2ms (which is the minimum in the Display Port spec). * The pulse duration bits are reserved on LPT+. */ intel_uncore_rmw (&dev_priv->uncore,PCH_PORT_HOTPLUG , -PORTA_HOTPLUG_ENABLE | -PORTB_HOTPLUG_ENABLE | -PORTC_HOTPLUG_ENABLE | -PORTD_HOTPLUG_ENABLE | -PORTB_PULSE_DURATION_MASK | -PORTC_PULSE_DURATION_MASK | -PORTD_PULSE_DURATION_MASK , +ibx_hotplug_mask (dev_priv,HPD_PORT_A ) | +ibx_hotplug_mask (dev_priv,HPD_PORT_B ) | +ibx_hotplug_mask (dev_priv,HPD_PORT_C ) | +ibx_hotplug_mask (dev_priv,HPD_PORT_D ),intel_hpd_hotplug_enables (dev_priv, ibx_hotplug_enables)); }static void ibx_hpd_irq_setup (struct drm_i915_private *dev_priv)
@@ -2889,55 +2903,75 @@ static void ibx_hpd_irq_setup(struct drm_i915_private *dev_priv)ibx_hpd_detection_setup (dev_priv); } +static u32 _icp_ddi_hotplug_enables (enum hpd_pin hpd_pin) +{ +switch (hpd_pin) { +case HPD_PORT_A : +case HPD_PORT_B : +case HPD_PORT_C : +case HPD_PORT_D : +return SHOTPLUG_CTL_DDI_HPD_ENABLE (hpd_pin); +default : +return 0 ; + } +} + +static u32 icp_ddi_hotplug_mask (struct drm_i915_private *i915,enum hpd_pin hpd_pin) +{ +return _icp_ddi_hotplug_enables (hpd_pin); +} +static u32 icp_ddi_hotplug_enables (struct intel_encoder *encoder) { -switch (encoder->hpd_pin) { -case HPD_PORT_A : -case HPD_PORT_B : -case HPD_PORT_C : -case HPD_PORT_D : -return SHOTPLUG_CTL_DDI_HPD_ENABLE (encoder->hpd_pin); +return _icp_ddi_hotplug_enables (encoder->hpd_pin); +} + +static u32 _icp_tc_hotplug_enables (enum hpd_pin hpd_pin) +{ +switch (hpd_pin) { +case HPD_PORT_TC1 : +case HPD_PORT_TC2 : +case HPD_PORT_TC3 : +case HPD_PORT_TC4 : +case HPD_PORT_TC5 : +case HPD_PORT_TC6 : +return ICP_TC_HPD_ENABLE (hpd_pin);default :return 0 ; } } +static u32 icp_tc_hotplug_mask (struct drm_i915_private *i915,enum hpd_pin hpd_pin) +{ +return _icp_tc_hotplug_enables (hpd_pin); +} +static u32 icp_tc_hotplug_enables (struct intel_encoder *encoder) { -switch (encoder->hpd_pin) { -case HPD_PORT_TC1 : -case HPD_PORT_TC2 : -case HPD_PORT_TC3 : -case HPD_PORT_TC4 : -case HPD_PORT_TC5 : -case HPD_PORT_TC6 : -return ICP_TC_HPD_ENABLE (encoder->hpd_pin); -default : -return 0 ; - } +return _icp_tc_hotplug_enables (encoder->hpd_pin); }static void icp_ddi_hpd_detection_setup (struct drm_i915_private *dev_priv) {intel_uncore_rmw (&dev_priv->uncore,SHOTPLUG_CTL_DDI , -SHOTPLUG_CTL_DDI_HPD_ENABLE (HPD_PORT_A ) | -SHOTPLUG_CTL_DDI_HPD_ENABLE (HPD_PORT_B ) | -SHOTPLUG_CTL_DDI_HPD_ENABLE (HPD_PORT_C ) | -SHOTPLUG_CTL_DDI_HPD_ENABLE (HPD_PORT_D ), +icp_ddi_hotplug_mask (dev_priv,HPD_PORT_A ) | +icp_ddi_hotplug_mask (dev_priv,HPD_PORT_B ) | +icp_ddi_hotplug_mask (dev_priv,HPD_PORT_C ) | +icp_ddi_hotplug_mask (dev_priv,HPD_PORT_D ),intel_hpd_hotplug_enables (dev_priv, icp_ddi_hotplug_enables)); }static void icp_tc_hpd_detection_setup (struct drm_i915_private *dev_priv) {intel_uncore_rmw (&dev_priv->uncore,SHOTPLUG_CTL_TC , -ICP_TC_HPD_ENABLE (HPD_PORT_TC1 ) | -ICP_TC_HPD_ENABLE (HPD_PORT_TC2 ) | -ICP_TC_HPD_ENABLE (HPD_PORT_TC3 ) | -ICP_TC_HPD_ENABLE (HPD_PORT_TC4 ) | -ICP_TC_HPD_ENABLE (HPD_PORT_TC5 ) | -ICP_TC_HPD_ENABLE (HPD_PORT_TC6 ), +icp_tc_hotplug_mask (dev_priv,HPD_PORT_TC1 ) | +icp_tc_hotplug_mask (dev_priv,HPD_PORT_TC2 ) | +icp_tc_hotplug_mask (dev_priv,HPD_PORT_TC3 ) | +icp_tc_hotplug_mask (dev_priv,HPD_PORT_TC4 ) | +icp_tc_hotplug_mask (dev_priv,HPD_PORT_TC5 ) | +icp_tc_hotplug_mask (dev_priv,HPD_PORT_TC6 ),intel_hpd_hotplug_enables (dev_priv, icp_tc_hotplug_enables)); }static void icp_hpd_irq_setup (struct drm_i915_private *dev_priv)
@@ -2955,21 +2989,31 @@ static void icp_hpd_irq_setup(struct drm_i915_private *dev_priv)icp_ddi_hpd_detection_setup (dev_priv);icp_tc_hpd_detection_setup (dev_priv); } +static u32 _gen11_hotplug_enables (enum hpd_pin hpd_pin) +{ +switch (hpd_pin) { +case HPD_PORT_TC1 : +case HPD_PORT_TC2 : +case HPD_PORT_TC3 : +case HPD_PORT_TC4 : +case HPD_PORT_TC5 : +case HPD_PORT_TC6 : +return GEN11_HOTPLUG_CTL_ENABLE (hpd_pin); +default : +return 0 ; + } +} + +static u32 gen11_hotplug_mask (struct drm_i915_private *i915,enum hpd_pin hpd_pin) +{ +return _gen11_hotplug_enables (hpd_pin); +} +static u32 gen11_hotplug_enables (struct intel_encoder *encoder) { -switch (encoder->hpd_pin) { -case HPD_PORT_TC1 : -case HPD_PORT_TC2 : -case HPD_PORT_TC3 : -case HPD_PORT_TC4 : -case HPD_PORT_TC5 : -case HPD_PORT_TC6 : -return GEN11_HOTPLUG_CTL_ENABLE (encoder->hpd_pin); -default : -return 0 ; - } +return _gen11_hotplug_enables (encoder->hpd_pin); }static void dg1_hpd_invert (struct drm_i915_private *i915) {
@@ -2988,26 +3032,26 @@ static void dg1_hpd_irq_setup(struct drm_i915_private *dev_priv)static void gen11_tc_hpd_detection_setup (struct drm_i915_private *dev_priv) {intel_uncore_rmw (&dev_priv->uncore,GEN11_TC_HOTPLUG_CTL , -GEN11_HOTPLUG_CTL_ENABLE (HPD_PORT_TC1 ) | -GEN11_HOTPLUG_CTL_ENABLE (HPD_PORT_TC2 ) | -GEN11_HOTPLUG_CTL_ENABLE (HPD_PORT_TC3 ) | -GEN11_HOTPLUG_CTL_ENABLE (HPD_PORT_TC4 ) | -GEN11_HOTPLUG_CTL_ENABLE (HPD_PORT_TC5 ) | -GEN11_HOTPLUG_CTL_ENABLE (HPD_PORT_TC6 ), +gen11_hotplug_mask (dev_priv,HPD_PORT_TC1 ) | +gen11_hotplug_mask (dev_priv,HPD_PORT_TC2 ) | +gen11_hotplug_mask (dev_priv,HPD_PORT_TC3 ) | +gen11_hotplug_mask (dev_priv,HPD_PORT_TC4 ) | +gen11_hotplug_mask (dev_priv,HPD_PORT_TC5 ) | +gen11_hotplug_mask (dev_priv,HPD_PORT_TC6 ),intel_hpd_hotplug_enables (dev_priv, gen11_hotplug_enables)); }static void gen11_tbt_hpd_detection_setup (struct drm_i915_private *dev_priv) {intel_uncore_rmw (&dev_priv->uncore,GEN11_TBT_HOTPLUG_CTL , -GEN11_HOTPLUG_CTL_ENABLE (HPD_PORT_TC1 ) | -GEN11_HOTPLUG_CTL_ENABLE (HPD_PORT_TC2 ) | -GEN11_HOTPLUG_CTL_ENABLE (HPD_PORT_TC3 ) | -GEN11_HOTPLUG_CTL_ENABLE (HPD_PORT_TC4 ) | -GEN11_HOTPLUG_CTL_ENABLE (HPD_PORT_TC5 ) | -GEN11_HOTPLUG_CTL_ENABLE (HPD_PORT_TC6 ), +gen11_hotplug_mask (dev_priv,HPD_PORT_TC1 ) | +gen11_hotplug_mask (dev_priv,HPD_PORT_TC2 ) | +gen11_hotplug_mask (dev_priv,HPD_PORT_TC3 ) | +gen11_hotplug_mask (dev_priv,HPD_PORT_TC4 ) | +gen11_hotplug_mask (dev_priv,HPD_PORT_TC5 ) | +gen11_hotplug_mask (dev_priv,HPD_PORT_TC6 ),intel_hpd_hotplug_enables (dev_priv, gen11_hotplug_enables)); }static void gen11_hpd_irq_setup (struct drm_i915_private *dev_priv)
@@ -3027,11 +3071,11 @@ static void gen11_hpd_irq_setup(struct drm_i915_private *dev_priv)if (INTEL_PCH_TYPE (dev_priv) >=PCH_ICP )icp_hpd_irq_setup (dev_priv); } -static u32 spt_hotplug_enables (struct intel_encoder *encoder) +static u32 _spt_hotplug_enables (enum hpd_pin hpd_pin) { -switch (encoder->hpd_pin) { +switch (hpd_pin) {case HPD_PORT_A :return PORTA_HOTPLUG_ENABLE ;case HPD_PORT_B :return PORTB_HOTPLUG_ENABLE ;
@@ -3043,18 +3087,38 @@ static u32 spt_hotplug_enables(struct intel_encoder *encoder)return 0 ; } } -static u32 spt_hotplug2_enables (struct intel_encoder *encoder) +static u32 spt_hotplug_mask (struct drm_i915_private *i915,enum hpd_pin hpd_pin) { -switch (encoder->hpd_pin) { +return _spt_hotplug_enables (hpd_pin); +} + +static u32 spt_hotplug_enables (struct intel_encoder *encoder) +{ +return _spt_hotplug_enables (encoder->hpd_pin); +} + +static u32 _spt_hotplug2_enables (enum hpd_pin hpd_pin) +{ +switch (hpd_pin) {case HPD_PORT_E :return PORTE_HOTPLUG_ENABLE ;default :return 0 ; } } +static u32 spt_hotplug2_mask (struct drm_i915_private *i915,enum hpd_pin hpd_pin) +{ +return _spt_hotplug2_enables (hpd_pin); +} + +static u32 spt_hotplug2_enables (struct intel_encoder *encoder) +{ +return _spt_hotplug2_enables (encoder->hpd_pin); +} +static void spt_hpd_detection_setup (struct drm_i915_private *dev_priv) {/* Display WA #1179 WaHardHangonHotPlug: cnp */ if (HAS_PCH_CNP (dev_priv)) {
@@ -3063,15 +3127,16 @@ static void spt_hpd_detection_setup(struct drm_i915_private *dev_priv) }/* Enable digital hotplug on the PCH */ intel_uncore_rmw (&dev_priv->uncore,PCH_PORT_HOTPLUG , -PORTA_HOTPLUG_ENABLE | -PORTB_HOTPLUG_ENABLE | -PORTC_HOTPLUG_ENABLE | -PORTD_HOTPLUG_ENABLE , +spt_hotplug_mask (dev_priv,HPD_PORT_A ) | +spt_hotplug_mask (dev_priv,HPD_PORT_B ) | +spt_hotplug_mask (dev_priv,HPD_PORT_C ) | +spt_hotplug_mask (dev_priv,HPD_PORT_D ),intel_hpd_hotplug_enables (dev_priv, spt_hotplug_enables)); -intel_uncore_rmw (&dev_priv->uncore,PCH_PORT_HOTPLUG2 ,PORTE_HOTPLUG_ENABLE , +intel_uncore_rmw (&dev_priv->uncore,PCH_PORT_HOTPLUG2 , +spt_hotplug2_mask (dev_priv,HPD_PORT_E ),intel_hpd_hotplug_enables (dev_priv, spt_hotplug2_enables)); }static void spt_hpd_irq_setup (struct drm_i915_private *dev_priv)
@@ -3088,8 +3153,19 @@ static void spt_hpd_irq_setup(struct drm_i915_private *dev_priv)spt_hpd_detection_setup (dev_priv); } +static u32 ilk_hotplug_mask (struct drm_i915_private *i915,enum hpd_pin hpd_pin) +{ +switch (hpd_pin) { +case HPD_PORT_A : +return DIGITAL_PORTA_HOTPLUG_ENABLE | +DIGITAL_PORTA_PULSE_DURATION_MASK ; +default : +return 0 ; + } +} +static u32 ilk_hotplug_enables (struct intel_encoder *encoder) {switch (encoder->hpd_pin) {case HPD_PORT_A :
@@ -3107,9 +3183,9 @@ static void ilk_hpd_detection_setup(struct drm_i915_private *dev_priv)* duration to 2ms (which is the minimum in the Display Port spec) * The pulse duration bits are reserved on HSW+. */ intel_uncore_rmw (&dev_priv->uncore,DIGITAL_PORT_HOTPLUG_CNTRL , -DIGITAL_PORTA_HOTPLUG_ENABLE |DIGITAL_PORTA_PULSE_DURATION_MASK , +ilk_hotplug_mask (dev_priv,HPD_PORT_A ),intel_hpd_hotplug_enables (dev_priv, ilk_hotplug_enables)); }static void ilk_hpd_irq_setup (struct drm_i915_private *dev_priv)
@@ -3128,8 +3204,22 @@ static void ilk_hpd_irq_setup(struct drm_i915_private *dev_priv)ibx_hpd_irq_setup (dev_priv); } +static u32 bxt_hotplug_mask (struct drm_i915_private *i915,enum hpd_pin hpd_pin) +{ +switch (hpd_pin) { +case HPD_PORT_A : +return PORTA_HOTPLUG_ENABLE |BXT_DDIA_HPD_INVERT ; +case HPD_PORT_B : +return PORTB_HOTPLUG_ENABLE |BXT_DDIB_HPD_INVERT ; +case HPD_PORT_C : +return PORTC_HOTPLUG_ENABLE |BXT_DDIC_HPD_INVERT ; +default : +return 0 ; + } +} +static u32 bxt_hotplug_enables (struct intel_encoder *encoder) {u32 hotplug;
@@ -3156,12 +3246,11 @@ static u32 bxt_hotplug_enables(struct intel_encoder *encoder)static void bxt_hpd_detection_setup (struct drm_i915_private *dev_priv) {intel_uncore_rmw (&dev_priv->uncore,PCH_PORT_HOTPLUG , -PORTA_HOTPLUG_ENABLE | -PORTB_HOTPLUG_ENABLE | -PORTC_HOTPLUG_ENABLE | -BXT_DDI_HPD_INVERT_MASK , +bxt_hotplug_mask (dev_priv,HPD_PORT_A ) | +bxt_hotplug_mask (dev_priv,HPD_PORT_B ) | +bxt_hotplug_mask (dev_priv,HPD_PORT_C ),intel_hpd_hotplug_enables (dev_priv, bxt_hotplug_enables)); }static void bxt_hpd_irq_setup (struct drm_i915_private *dev_priv)
Signature · 1 line
2.39.2
PATCH 4/17 drm/i915: Introduce intel_hpd_detection()
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Add a mechanism by which we can toggle the HPD sense for individual encoders.
This will be used during eDP probing to figure out if anything is actually connected. The normal intel_hpd_irq_setup() thing doesn't work since we only do that after probing the outputs, and we only enable HPD sense for encoders that were successfully probed.
The other idea that crossed my minds was to just turn on HPD sense for all pins before output probing and let hpd_irq_setup() clean it up afterwards. But that doesn't work for BXT/GLK where the HPD invert information comes from the VBT child device. So looks like this really needs to be per-encoder.
--- drivers/gpu/drm/i915/i915_irq.c | 132 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_irq.h | 2 + 2 files changed, 134 insertions(+)
drivers/gpu/drm/i915/i915_irq.c +132 -0
@@ -2891,8 +2891,17 @@ static void ibx_hpd_detection_setup(struct drm_i915_private *dev_priv)ibx_hotplug_mask (dev_priv,HPD_PORT_D ), intel_hpd_hotplug_enables(dev_priv, ibx_hotplug_enables)); } +static void ibx_hpd_detection (struct intel_encoder *encoder,bool enable) +{ +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); + +intel_uncore_rmw (&i915->uncore,PCH_PORT_HOTPLUG , +ibx_hotplug_mask (i915, encoder->hpd_pin), + enable ?ibx_hotplug_enables (encoder) :0 ); +} +static void ibx_hpd_irq_setup (struct drm_i915_private *dev_priv) {u32 hotplug_irqs, enabled_irqs;
@@ -2961,8 +2970,17 @@ static void icp_ddi_hpd_detection_setup(struct drm_i915_private *dev_priv)icp_ddi_hotplug_mask (dev_priv,HPD_PORT_D ), intel_hpd_hotplug_enables(dev_priv, icp_ddi_hotplug_enables)); } +static void icp_ddi_hpd_detection (struct intel_encoder *encoder,bool enable) +{ +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); + +intel_uncore_rmw (&i915->uncore,SHOTPLUG_CTL_DDI , +icp_ddi_hotplug_mask (i915, encoder->hpd_pin), + enable ?icp_ddi_hotplug_enables (encoder) :0 ); +} +static void icp_tc_hpd_detection_setup (struct drm_i915_private *dev_priv) { intel_uncore_rmw(&dev_priv->uncore, SHOTPLUG_CTL_TC, icp_tc_hotplug_mask(dev_priv, HPD_PORT_TC1) |
@@ -2973,8 +2991,23 @@ static void icp_tc_hpd_detection_setup(struct drm_i915_private *dev_priv)icp_tc_hotplug_mask (dev_priv,HPD_PORT_TC6 ), intel_hpd_hotplug_enables(dev_priv, icp_tc_hotplug_enables)); } +static void icp_tc_hpd_detection (struct intel_encoder *encoder,bool enable) +{ +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); + +intel_uncore_rmw (&i915->uncore,SHOTPLUG_CTL_TC , +icp_tc_hotplug_mask (i915, encoder->hpd_pin), + enable ?icp_tc_hotplug_enables (encoder) :0 ); +} + +static void icp_hpd_detection (struct intel_encoder *encoder,bool enable) +{ +icp_ddi_hpd_detection (encoder, enable); +icp_tc_hpd_detection (encoder, enable); +} +static void icp_hpd_irq_setup (struct drm_i915_private *dev_priv) {u32 hotplug_irqs, enabled_irqs;
@@ -3023,8 +3056,16 @@ static void dg1_hpd_invert(struct drm_i915_private *i915) INVERT_DDID_HPD);intel_uncore_rmw (&i915->uncore,SOUTH_CHICKEN1 ,0 , val); } +static void dg1_hpd_detection (struct intel_encoder *encoder,bool enable) +{ +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); + +dg1_hpd_invert (i915); +icp_hpd_detection (encoder, enable); +} +static void dg1_hpd_irq_setup (struct drm_i915_private *dev_priv) {dg1_hpd_invert (dev_priv);icp_hpd_irq_setup (dev_priv);
@@ -3041,8 +3082,17 @@ static void gen11_tc_hpd_detection_setup(struct drm_i915_private *dev_priv)gen11_hotplug_mask (dev_priv,HPD_PORT_TC6 ), intel_hpd_hotplug_enables(dev_priv, gen11_hotplug_enables)); } +static void gen11_tc_hpd_detection (struct intel_encoder *encoder,bool enable) +{ +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); + +intel_uncore_rmw (&i915->uncore,GEN11_TC_HOTPLUG_CTL , +gen11_hotplug_mask (i915, encoder->hpd_pin), + enable ?gen11_hotplug_enables (encoder) :0 ); +} +static void gen11_tbt_hpd_detection_setup (struct drm_i915_private *dev_priv) { intel_uncore_rmw(&dev_priv->uncore, GEN11_TBT_HOTPLUG_CTL, gen11_hotplug_mask(dev_priv, HPD_PORT_TC1) |
@@ -3053,8 +3103,28 @@ static void gen11_tbt_hpd_detection_setup(struct drm_i915_private *dev_priv)gen11_hotplug_mask (dev_priv,HPD_PORT_TC6 ), intel_hpd_hotplug_enables(dev_priv, gen11_hotplug_enables)); } +static void gen11_tbt_hpd_detection (struct intel_encoder *encoder,bool enable) +{ +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); + +intel_uncore_rmw (&i915->uncore,GEN11_TBT_HOTPLUG_CTL , +gen11_hotplug_mask (i915, encoder->hpd_pin), + enable ?gen11_hotplug_enables (encoder) :0 ); +} + +static void gen11_hpd_detection (struct intel_encoder *encoder,bool enable) +{ +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); + +gen11_tc_hpd_detection (encoder, enable); +gen11_tbt_hpd_detection (encoder, enable); + +if (INTEL_PCH_TYPE (i915) >=PCH_ICP ) +icp_hpd_detection (encoder, enable); +} +static void gen11_hpd_irq_setup (struct drm_i915_private *dev_priv) {u32 hotplug_irqs, enabled_irqs;
@@ -3138,8 +3208,28 @@ static void spt_hpd_detection_setup(struct drm_i915_private *dev_priv)spt_hotplug2_mask (dev_priv,HPD_PORT_E ), intel_hpd_hotplug_enables(dev_priv, spt_hotplug2_enables)); } +static void spt_hpd_detection (struct intel_encoder *encoder,bool enable) +{ +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); + +/* Display WA #1179 WaHardHangonHotPlug: cnp */ +if (HAS_PCH_CNP (i915)) { +intel_uncore_rmw (&i915->uncore,SOUTH_CHICKEN1 , +CHASSIS_CLK_REQ_DURATION_MASK , +CHASSIS_CLK_REQ_DURATION (0xf )); + } + +intel_uncore_rmw (&i915->uncore,PCH_PORT_HOTPLUG , +spt_hotplug_mask (i915, encoder->hpd_pin), + enable ?spt_hotplug_enables (encoder) :0 ); + +intel_uncore_rmw (&i915->uncore,PCH_PORT_HOTPLUG2 , +spt_hotplug2_mask (i915, encoder->hpd_pin), + enable ?spt_hotplug2_enables (encoder) :0 ); +} +static void spt_hpd_irq_setup (struct drm_i915_private *dev_priv) {u32 hotplug_irqs, enabled_irqs;
@@ -3187,8 +3277,19 @@ static void ilk_hpd_detection_setup(struct drm_i915_private *dev_priv)ilk_hotplug_mask (dev_priv,HPD_PORT_A ), intel_hpd_hotplug_enables(dev_priv, ilk_hotplug_enables)); } +static void ilk_hpd_detection (struct intel_encoder *encoder,bool enable) +{ +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); + +intel_uncore_rmw (&i915->uncore,DIGITAL_PORT_HOTPLUG_CNTRL , +ilk_hotplug_mask (i915, encoder->hpd_pin), + enable ?ilk_hotplug_enables (encoder) :0 ); + +ibx_hpd_detection (encoder, enable); +} +static void ilk_hpd_irq_setup (struct drm_i915_private *dev_priv) {u32 hotplug_irqs, enabled_irqs;
@@ -3252,8 +3353,17 @@ static void bxt_hpd_detection_setup(struct drm_i915_private *dev_priv)bxt_hotplug_mask (dev_priv,HPD_PORT_C ), intel_hpd_hotplug_enables(dev_priv, bxt_hotplug_enables)); } +static void bxt_hpd_detection (struct intel_encoder *encoder,bool enable) +{ +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); + +intel_uncore_rmw (&i915->uncore,PCH_PORT_HOTPLUG , +bxt_hotplug_mask (i915, encoder->hpd_pin), + enable ?bxt_hotplug_enables (encoder) :0 ); +} +static void bxt_hpd_irq_setup (struct drm_i915_private *dev_priv) {u32 hotplug_irqs, enabled_irqs;
@@ -3883,8 +3993,18 @@ static void i965_irq_postinstall(struct drm_i915_private *dev_priv)i915_enable_asle_pipestat (dev_priv); } +static void i915_hpd_detection (struct intel_encoder *encoder,bool enable) +{ +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); +u32 hotplug_en = hpd_mask_i915[encoder->hpd_pin]; + +/* HPD sense and interrupt enable are one and the same */ +i915_hotplug_interrupt_update (i915, hotplug_en, + enable ? hotplug_en :0 ); +} +static void i915_hpd_irq_setup (struct drm_i915_private *dev_priv) {u32 hotplug_en;
@@ -3968,14 +4088,18 @@ static irqreturn_t i965_irq_handler(int irq, void *arg)return ret; }struct intel_hotplug_funcs { +/* Enable HPD sense and interrupts for all present encoders */ void (*hpd_irq_setup)(struct drm_i915_private *i915); +/* Enable/disable HPD sense for a single encoder */ +void (*hpd_detection)(struct intel_encoder *encoder,bool enable); };#define HPD_FUNCS (platform) \ static const struct intel_hotplug_funcs platform##_hpd_funcs = { \ .hpd_irq_setup = platform##_hpd_irq_setup, \ + .hpd_detection = platform##_hpd_detection, \ }HPD_FUNCS (i915);HPD_FUNCS (dg1);
@@ -3985,8 +4109,16 @@ HPD_FUNCS(icp);HPD_FUNCS (spt);HPD_FUNCS (ilk);#undef HPD_FUNCS +void intel_hpd_detection (struct intel_encoder *encoder,bool enable) +{ +struct drm_i915_private *i915 =to_i915 (encoder->base.dev); + +if (i915->display.funcs.hotplug) + i915->display.funcs.hotplug->hpd_detection (encoder, enable); +} +void intel_hpd_irq_setup (struct drm_i915_private *i915) {if (i915->display_irqs_enabled && i915->display.funcs.hotplug) i915->display.funcs.hotplug->hpd_irq_setup (i915);
drivers/gpu/drm/i915/i915_irq.h +2 -0
@@ -16,8 +16,9 @@ struct drm_crtc;struct drm_device ;struct drm_display_mode ;struct drm_i915_private ;struct intel_crtc ; +struct intel_encoder ;struct intel_uncore ;void intel_irq_init (struct drm_i915_private *dev_priv);void intel_irq_fini (struct drm_i915_private *dev_priv);
@@ -36,8 +37,9 @@ i915_disable_pipestat(struct drm_i915_private *dev_priv, enum pipe pipe,void valleyview_enable_display_irqs (struct drm_i915_private *dev_priv);void valleyview_disable_display_irqs (struct drm_i915_private *dev_priv); +void intel_hpd_detection (struct intel_encoder *encoder,bool enable);void intel_hpd_irq_setup (struct drm_i915_private *i915);void i915_hotplug_interrupt_update (struct drm_i915_private *dev_priv,u32 mask,u32 bits);
Signature · 1 line
2.39.2
PATCH 5/17 drm/i915: Check HPD live state during eDP probe
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
We need to untangle the mess where some SKL machines (at least) declare both DDI A and DDI E to be present in their VBT, and both using AUX A. DDI A is a ghost eDP, wheres DDI E may be a real DP->VGA converter.
Currently that is handled by checking the VBT child devices for conflicts before output probing. But that kind of solution will not work for the ADL phantom dual eDP VBTs. I think on those we just have to probe the eDP first. And would be nice to use the same probe scheme for everything.
On these SKL systems if we probe DDI A first (which is only natural given it's declared by VBT first) we will get an answer via AUX, but it came from the DP->VGA converter hooked to the DDI E, not DDI A. Thus we mistakenly register eDP on DDI A and screw up the real DP device in DDI E.
To fix this let's check the HPD live state during the eDP probe. If we got an answer via DPCD but HPD is still down let's assume we got the answer from someone else.
Smoke tested on all my eDP machines (ilk,hsw-ult,tgl,adl) and I also tested turning off all HPD hardware prior to loading i915 to make sure it all comes up properly. And I simulated the failure path too by not turning on HPD sense and that correctly gave up on eDP.
I *think* Windows might just fully depend on HPD here. I couldn't really find any other way they probe displays. And I did find code where they also check the live state prior to AUX transfers (something Imre and I have also talked about perhaps doing). That would also solve this as we'd not succeed in the eDP probe DPCD reads.
Other solutions I've considered:
- Reintrduce DDI strap checks on SKL. Unfortunately we just don't have any idea how reliable they are on real production hardware, and commit 5a2376d1360b ("drm/i915/skl: WaIgnoreDDIAStrap is forever, always init DDI A") does suggest that not very. Sadly that commit is very poor in details :/
Also the systems (Asrock B250M-HDV at least) fixed by commit 41e35ffb380b ("drm/i915: Favor last VBT child device with conflicting AUX ch/DDC pin") might still not work since we don't know what their straps indicate. Stupid me for not asking the reporter to check those at the time :(
We have currently two CI machines (fi-cfl-guc,fi-cfl-8700k both MS-7B54/Z370M) that also declare both DDI A and DDI E in VBT to use AUX A, and on these the DDI A strap is also set. There doesn't seem to be anything hooked up to either DDI however. But given the DDI A strap is wrong on these it might well be wrong on the Asrock too.
Most other CI machines seem to have straps that generally match the VBT. fi-kbl-soraka is an exception though as DDI D strap is not set, but it is declared in VBT as a DP++ port. No idea if there's a real physical port to go with it or not.
- Some kind of quirk just for the cases where both DDI A and DDI E are present in VBT. Might be feasible given we've ignored DDI A in these cases up to now successfully. But feels rather unsatisfactory, and not very future proof against funny VBTs.
References: https://bugs.freedesktop.org/show_bug.cgi?id=111966
--- drivers/gpu/drm/i915/display/intel_dp.c | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
drivers/gpu/drm/i915/display/intel_dp.c +28 -0
@@ -45,8 +45,9 @@#include "g4x_dp.h" #include "i915_debugfs.h" #include "i915_drv.h" +#include "i915_irq.h" #include "i915_reg.h" #include "intel_atomic.h" #include "intel_audio.h" #include "intel_backlight.h"
@@ -5303,8 +5304,17 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,*/ goto out_vdd_off; } +/* +* Enable HPD sense for live status check. +* intel_hpd_irq_setup() will turn it off again +* if it's no longer needed later. +* +* The DPCD probe below will make sure VDD is on. +*/ +intel_hpd_detection (encoder, true); +/* Cache DPCD and EDID for edp. */ has_dpcd =intel_edp_init_dpcd (intel_dp);if (!has_dpcd) {
@@ -5314,8 +5324,26 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, encoder->base.base.id, encoder->base.name); goto out_vdd_off; } +/* +* VBT and straps are liars. Also check HPD as that seems +* to be the most reliable piece of information available. +*/ +if (!intel_digital_port_connected (encoder)) { +/* +* If this fails, presume the DPCD answer came +* from some other port using the same AUX CH. +* +* FIXME maybe cleaner to check this before the +* DPCD read? Would need sort out the VDD handling... +*/ +drm_info (&dev_priv->drm, +"[ENCODER:%d:%s] HPD is down, disabling eDP\n" , + encoder->base.base.id, encoder->base.name); + goto out_vdd_off; + } +mutex_lock (&dev_priv->drm.mode_config.mutex); drm_edid =drm_edid_read_ddc (connector, &intel_dp->aux.ddc);if (!drm_edid) {/* Fallback to EDID from ACPI OpRegion, if any */
Signature · 1 line
2.39.2
PATCH 6/17 drm/i915: Sanitize child devices later
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Currently we sanitize the child device aux_ch/ddc_pin while parsing the ports from VBT. But that won't work when we have duplicate child devices for the same port.
Instead let's sanitize just before initializing the encoder, based on which resources were consumed by encoders that were (successfully) initialized earlier.
I also included the intel_bios_encoder_sanitize() calls in the g4x+ DP/HDMI code, but there we need to be careful not confuse the split DP vs. HDMI encoders as conflicting child devices. Checking encoder->devdata for equality should suffice.
TODO: the sanitation only affects the VBT assigned stuff, but
we could still have a conflict if one port came from VBT with a non-default pin, and another port just used the platform default which happens be the same pin...
TODO: Need to double check the details on commit 41e35ffb380b ("drm/i915:
Favor last VBT child device with conflicting AUX ch/DDC pin") to make sure we're not breaking stuff with the new sanitation scheme
--- drivers/gpu/drm/i915/display/g4x_dp.c | 3 +- drivers/gpu/drm/i915/display/g4x_hdmi.c | 3 +- drivers/gpu/drm/i915/display/intel_bios.c | 91 +++++++++++++---------- drivers/gpu/drm/i915/display/intel_bios.h | 4 +- drivers/gpu/drm/i915/display/intel_ddi.c | 4 +- 5 files changed, 62 insertions(+), 43 deletions(-)
drivers/gpu/drm/i915/display/g4x_dp.c +2 -1
@@ -1252,15 +1252,16 @@ static const struct drm_encoder_funcs intel_dp_enc_funcs = {bool g4x_dp_init (struct drm_i915_private *dev_priv,i915_reg_t output_reg,enum port port) { -const struct intel_bios_encoder_data *devdata; +struct intel_bios_encoder_data *devdata;struct intel_digital_port *dig_port;struct intel_encoder *intel_encoder;struct drm_encoder *encoder;struct intel_connector *intel_connector; devdata =intel_bios_encoder_data_lookup (dev_priv, port); +intel_bios_encoder_sanitize (devdata, port);/* FIXME bail? */ if (!devdata) drm_dbg_kms(&dev_priv->drm, "No VBT child device for DP-%c\n",
drivers/gpu/drm/i915/display/g4x_hdmi.c +2 -1
@@ -548,14 +548,15 @@ intel_hdmi_hotplug(struct intel_encoder *encoder,void g4x_hdmi_init (struct drm_i915_private *dev_priv,i915_reg_t hdmi_reg,enum port port) { -const struct intel_bios_encoder_data *devdata; +struct intel_bios_encoder_data *devdata;struct intel_digital_port *dig_port;struct intel_encoder *intel_encoder;struct intel_connector *intel_connector; devdata =intel_bios_encoder_data_lookup (dev_priv, port); +intel_bios_encoder_sanitize (devdata, port);/* FIXME bail? */ if (!devdata) drm_dbg_kms(&dev_priv->drm, "No VBT child device for HDMI-%c\n",
drivers/gpu/drm/i915/display/intel_bios.c +52 -39
190 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_bios.h +3 -1
@@ -253,10 +253,12 @@ bool intel_bios_get_dsc_params(struct intel_encoder *encoder,struct intel_crtc_state *crtc_state, int dsc_max_bpc);bool intel_bios_port_supports_typec_usb (struct drm_i915_private *i915,enum port port);bool intel_bios_port_supports_tbt (struct drm_i915_private *i915,enum port port); +void intel_bios_encoder_sanitize (struct intel_bios_encoder_data *devdata, +enum port port); -const struct intel_bios_encoder_data * +struct intel_bios_encoder_data *intel_bios_encoder_data_lookup (struct drm_i915_private *i915,enum port port);bool intel_bios_encoder_supports_dvi (const struct intel_bios_encoder_data *devdata);bool intel_bios_encoder_supports_hdmi (const struct intel_bios_encoder_data *devdata);
drivers/gpu/drm/i915/display/intel_ddi.c +3 -1
@@ -34,8 +34,9 @@#include "i915_reg.h" #include "intel_audio.h" #include "intel_audio_regs.h" #include "intel_backlight.h" +#include "intel_bios.h" #include "intel_combo_phy.h" #include "intel_combo_phy_regs.h" #include "intel_connector.h" #include "intel_crtc.h"
@@ -4259,9 +4260,9 @@ static void intel_ddi_encoder_shutdown(struct intel_encoder *encoder)void intel_ddi_init (struct drm_i915_private *dev_priv,enum port port) {struct intel_digital_port *dig_port;struct intel_encoder *encoder; -const struct intel_bios_encoder_data *devdata; +struct intel_bios_encoder_data *devdata;bool init_hdmi, init_dp;enum phy phy =intel_port_to_phy (dev_priv, port);/*
@@ -4282,8 +4283,9 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)"VBT says port %c is not present\n" , port_name(port));return ; } +intel_bios_encoder_sanitize (devdata, port); init_hdmi =intel_bios_encoder_supports_dvi (devdata) ||intel_bios_encoder_supports_hdmi (devdata); init_dp =intel_bios_encoder_supports_dp (devdata);
Signature · 1 line
2.39.2
PATCH 7/17 drm/i915: Split map_aux_ch() into per-platform arrays
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
The big switch+if statement mess in map_aux_ch() is illegible. Split up into cleaner per-platform arrays like we already have for the gmbus pins.
We use enum aux_ch as the index and the VBT thing as the value. Slightly non-intuitive perhaps but if we did it the other way around we'd have problems with AUX_CH_A being zero, and thus any non-populated element would look like AUX_CH_A.
v2: flip the index vs. value around
TODO: Didn't bother with the platform variants beyond the
ones that really need remapping, which means if the VBT is bogus we end up with a nonexistent aux ch. Might be nice to check this a bit better. Yet another bitmask in device info?
--- drivers/gpu/drm/i915/display/intel_bios.c | 144 +++++++++++----------- 1 file changed, 71 insertions(+), 73 deletions(-)
drivers/gpu/drm/i915/display/intel_bios.c +71 -73
@@ -3584,86 +3584,84 @@ bool intel_bios_get_dsc_params(struct intel_encoder *encoder,return false; } +static const u8 xelpd_aux_ch_map[] = { + [AUX_CH_A ] =DP_AUX_A , + [AUX_CH_B ] =DP_AUX_B , + [AUX_CH_C ] =DP_AUX_C , + [AUX_CH_D_XELPD ] =DP_AUX_D , + [AUX_CH_E_XELPD ] =DP_AUX_E , + [AUX_CH_USBC1 ] =DP_AUX_F , + [AUX_CH_USBC2 ] =DP_AUX_G , + [AUX_CH_USBC3 ] =DP_AUX_H , + [AUX_CH_USBC4 ] =DP_AUX_I , +}; + +/* +* ADL-S VBT uses PHY based mapping. Combo PHYs A,B,C,D,E +* map to DDI A,TC1,TC2,TC3,TC4 respectively. +*/ +static const u8 adls_aux_ch_map[] = { + [AUX_CH_A ] =DP_AUX_A , + [AUX_CH_USBC1 ] =DP_AUX_B , + [AUX_CH_USBC2 ] =DP_AUX_C , + [AUX_CH_USBC3 ] =DP_AUX_D , + [AUX_CH_USBC4 ] =DP_AUX_E , +}; + +/* +* RKL/DG1 VBT uses PHY based mapping. Combo PHYs A,B,C,D +* map to DDI A,B,TC1,TC2 respectively. +*/ +static const u8 rkl_aux_ch_map[] = { + [AUX_CH_A ] =DP_AUX_A , + [AUX_CH_B ] =DP_AUX_B , + [AUX_CH_USBC1 ] =DP_AUX_C , + [AUX_CH_USBC2 ] =DP_AUX_D , +}; + +static const u8 direct_aux_ch_map[] = { + [AUX_CH_A ] =DP_AUX_A , + [AUX_CH_B ] =DP_AUX_B , + [AUX_CH_C ] =DP_AUX_C , + [AUX_CH_D ] =DP_AUX_D ,/* aka AUX_CH_USBC1 */ + [AUX_CH_E ] =DP_AUX_E ,/* aka AUX_CH_USBC2 */ + [AUX_CH_F ] =DP_AUX_F ,/* aka AUX_CH_USBC3 */ + [AUX_CH_G ] =DP_AUX_G ,/* aka AUX_CH_USBC4 */ + [AUX_CH_H ] =DP_AUX_H ,/* aka AUX_CH_USBC5 */ + [AUX_CH_I ] =DP_AUX_I ,/* aka AUX_CH_USBC6 */ +}; +static enum aux_ch map_aux_ch (struct drm_i915_private *i915,u8 aux_channel) { -enum aux_ch aux_ch; +const u8 *aux_ch_map; +int i, n_entries; -/* -* RKL/DG1 VBT uses PHY based mapping. Combo PHYs A,B,C,D -* map to DDI A,B,TC1,TC2 respectively. -* -* ADL-S VBT uses PHY based mapping. Combo PHYs A,B,C,D,E -* map to DDI A,TC1,TC2,TC3,TC4 respectively. -*/ -switch (aux_channel) { -case DP_AUX_A : - aux_ch =AUX_CH_A ; -break ; -case DP_AUX_B : -if (IS_ALDERLAKE_S (i915)) - aux_ch =AUX_CH_USBC1 ; -else - aux_ch =AUX_CH_B ; -break ; -case DP_AUX_C : -if (IS_ALDERLAKE_S (i915)) - aux_ch =AUX_CH_USBC2 ; -else if (IS_DG1 (i915) ||IS_ROCKETLAKE (i915)) - aux_ch =AUX_CH_USBC1 ; -else - aux_ch =AUX_CH_C ; -break ; -case DP_AUX_D : -if (DISPLAY_VER (i915) >=13 ) - aux_ch =AUX_CH_D_XELPD ; -else if (IS_ALDERLAKE_S (i915)) - aux_ch =AUX_CH_USBC3 ; -else if (IS_DG1 (i915) ||IS_ROCKETLAKE (i915)) - aux_ch =AUX_CH_USBC2 ; -else - aux_ch =AUX_CH_D ; -break ; -case DP_AUX_E : -if (DISPLAY_VER (i915) >=13 ) - aux_ch =AUX_CH_E_XELPD ; -else if (IS_ALDERLAKE_S (i915)) - aux_ch =AUX_CH_USBC4 ; -else - aux_ch =AUX_CH_E ; -break ; -case DP_AUX_F : -if (DISPLAY_VER (i915) >=13 ) - aux_ch =AUX_CH_USBC1 ; -else - aux_ch =AUX_CH_F ; -break ; -case DP_AUX_G : -if (DISPLAY_VER (i915) >=13 ) - aux_ch =AUX_CH_USBC2 ; -else - aux_ch =AUX_CH_G ; -break ; -case DP_AUX_H : -if (DISPLAY_VER (i915) >=13 ) - aux_ch =AUX_CH_USBC3 ; -else - aux_ch =AUX_CH_H ; -break ; -case DP_AUX_I : -if (DISPLAY_VER (i915) >=13 ) - aux_ch =AUX_CH_USBC4 ; -else - aux_ch =AUX_CH_I ; -break ; -default : -MISSING_CASE (aux_channel); - aux_ch =AUX_CH_A ; -break ; +if (DISPLAY_VER (i915) >=13 ) { + aux_ch_map = xelpd_aux_ch_map; + n_entries =ARRAY_SIZE (xelpd_aux_ch_map); + }else if (IS_ALDERLAKE_S (i915)) { + aux_ch_map = adls_aux_ch_map; + n_entries =ARRAY_SIZE (adls_aux_ch_map); + }else if (IS_DG1 (i915) ||IS_ROCKETLAKE (i915)) { + aux_ch_map = rkl_aux_ch_map; + n_entries =ARRAY_SIZE (rkl_aux_ch_map); + }else { + aux_ch_map = direct_aux_ch_map; + n_entries =ARRAY_SIZE (direct_aux_ch_map); } -return aux_ch; +for (i =0 ; i < n_entries; i++) { +if (aux_ch_map[i] == aux_channel) +return i; + } + +drm_dbg_kms (&i915->drm, +"Ignoring alternate AUX CH: VBT claims AUX 0x%x, which is not valid for this platform\n" , + aux_channel); + +return AUX_CH_NONE ; }enum aux_ch intel_bios_dp_aux_ch (const struct intel_bios_encoder_data *devdata) {
Signature · 1 line
2.39.2
PATCH 8/17 drm/i915: Flip VBT DDC pin maps around
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Swap the roles of the index vs. value for the VBT DDC pin mapping tables. This is not strictly necessary for DDC pins but it will make this work exactly like the AUX CH mapping tables where the role reversal is necessary (or at least makes things easier). Consistency is good.
--- drivers/gpu/drm/i915/display/intel_bios.c | 70 ++++++++++++----------- 1 file changed, 36 insertions(+), 34 deletions(-)
drivers/gpu/drm/i915/display/intel_bios.c +36 -34
@@ -2134,60 +2134,60 @@ static u8 translate_iboost(u8 val) }static const u8 cnp_ddc_pin_map[] = { [0 ] =0 ,/* N/A */ - [DDC_BUS_DDI_B ] =GMBUS_PIN_1_BXT , - [DDC_BUS_DDI_C ] =GMBUS_PIN_2_BXT , - [DDC_BUS_DDI_D ] =GMBUS_PIN_4_CNP ,/* sic */ - [DDC_BUS_DDI_F ] =GMBUS_PIN_3_BXT ,/* sic */ + [GMBUS_PIN_1_BXT ] =DDC_BUS_DDI_B , + [GMBUS_PIN_2_BXT ] =DDC_BUS_DDI_C , + [GMBUS_PIN_4_CNP ] =DDC_BUS_DDI_D ,/* sic */ + [GMBUS_PIN_3_BXT ] =DDC_BUS_DDI_F ,/* sic */ };static const u8 icp_ddc_pin_map[] = { - [ICL_DDC_BUS_DDI_A ] =GMBUS_PIN_1_BXT , - [ICL_DDC_BUS_DDI_B ] =GMBUS_PIN_2_BXT , - [TGL_DDC_BUS_DDI_C ] =GMBUS_PIN_3_BXT , - [ICL_DDC_BUS_PORT_1 ] =GMBUS_PIN_9_TC1_ICP , - [ICL_DDC_BUS_PORT_2 ] =GMBUS_PIN_10_TC2_ICP , - [ICL_DDC_BUS_PORT_3 ] =GMBUS_PIN_11_TC3_ICP , - [ICL_DDC_BUS_PORT_4 ] =GMBUS_PIN_12_TC4_ICP , - [TGL_DDC_BUS_PORT_5 ] =GMBUS_PIN_13_TC5_TGP , - [TGL_DDC_BUS_PORT_6 ] =GMBUS_PIN_14_TC6_TGP , + [GMBUS_PIN_1_BXT ] =ICL_DDC_BUS_DDI_A , + [GMBUS_PIN_2_BXT ] =ICL_DDC_BUS_DDI_B , + [GMBUS_PIN_3_BXT ] =TGL_DDC_BUS_DDI_C , + [GMBUS_PIN_9_TC1_ICP ] =ICL_DDC_BUS_PORT_1 , + [GMBUS_PIN_10_TC2_ICP ] =ICL_DDC_BUS_PORT_2 , + [GMBUS_PIN_11_TC3_ICP ] =ICL_DDC_BUS_PORT_3 , + [GMBUS_PIN_12_TC4_ICP ] =ICL_DDC_BUS_PORT_4 , + [GMBUS_PIN_13_TC5_TGP ] =TGL_DDC_BUS_PORT_5 , + [GMBUS_PIN_14_TC6_TGP ] =TGL_DDC_BUS_PORT_6 , };static const u8 rkl_pch_tgp_ddc_pin_map[] = { - [ICL_DDC_BUS_DDI_A ] =GMBUS_PIN_1_BXT , - [ICL_DDC_BUS_DDI_B ] =GMBUS_PIN_2_BXT , - [RKL_DDC_BUS_DDI_D ] =GMBUS_PIN_9_TC1_ICP , - [RKL_DDC_BUS_DDI_E ] =GMBUS_PIN_10_TC2_ICP , + [GMBUS_PIN_1_BXT ] =ICL_DDC_BUS_DDI_A , + [GMBUS_PIN_2_BXT ] =ICL_DDC_BUS_DDI_B , + [GMBUS_PIN_9_TC1_ICP ] =RKL_DDC_BUS_DDI_D , + [GMBUS_PIN_10_TC2_ICP ] =RKL_DDC_BUS_DDI_E , };static const u8 adls_ddc_pin_map[] = { - [ICL_DDC_BUS_DDI_A ] =GMBUS_PIN_1_BXT , - [ADLS_DDC_BUS_PORT_TC1 ] =GMBUS_PIN_9_TC1_ICP , - [ADLS_DDC_BUS_PORT_TC2 ] =GMBUS_PIN_10_TC2_ICP , - [ADLS_DDC_BUS_PORT_TC3 ] =GMBUS_PIN_11_TC3_ICP , - [ADLS_DDC_BUS_PORT_TC4 ] =GMBUS_PIN_12_TC4_ICP , + [GMBUS_PIN_1_BXT ] =ICL_DDC_BUS_DDI_A , + [GMBUS_PIN_9_TC1_ICP ] =ADLS_DDC_BUS_PORT_TC1 , + [GMBUS_PIN_10_TC2_ICP ] =ADLS_DDC_BUS_PORT_TC2 , + [GMBUS_PIN_11_TC3_ICP ] =ADLS_DDC_BUS_PORT_TC3 , + [GMBUS_PIN_12_TC4_ICP ] =ADLS_DDC_BUS_PORT_TC4 , };static const u8 gen9bc_tgp_ddc_pin_map[] = { - [DDC_BUS_DDI_B ] =GMBUS_PIN_2_BXT , - [DDC_BUS_DDI_C ] =GMBUS_PIN_9_TC1_ICP , - [DDC_BUS_DDI_D ] =GMBUS_PIN_10_TC2_ICP , + [GMBUS_PIN_2_BXT ] =DDC_BUS_DDI_B , + [GMBUS_PIN_9_TC1_ICP ] =DDC_BUS_DDI_C , + [GMBUS_PIN_10_TC2_ICP ] =DDC_BUS_DDI_D , };static const u8 adlp_ddc_pin_map[] = { - [ICL_DDC_BUS_DDI_A ] =GMBUS_PIN_1_BXT , - [ICL_DDC_BUS_DDI_B ] =GMBUS_PIN_2_BXT , - [ADLP_DDC_BUS_PORT_TC1 ] =GMBUS_PIN_9_TC1_ICP , - [ADLP_DDC_BUS_PORT_TC2 ] =GMBUS_PIN_10_TC2_ICP , - [ADLP_DDC_BUS_PORT_TC3 ] =GMBUS_PIN_11_TC3_ICP , - [ADLP_DDC_BUS_PORT_TC4 ] =GMBUS_PIN_12_TC4_ICP , + [GMBUS_PIN_1_BXT ] =ICL_DDC_BUS_DDI_A , + [GMBUS_PIN_2_BXT ] =ICL_DDC_BUS_DDI_B , + [GMBUS_PIN_9_TC1_ICP ] =ADLP_DDC_BUS_PORT_TC1 , + [GMBUS_PIN_10_TC2_ICP ] =ADLP_DDC_BUS_PORT_TC2 , + [GMBUS_PIN_11_TC3_ICP ] =ADLP_DDC_BUS_PORT_TC3 , + [GMBUS_PIN_12_TC4_ICP ] =ADLP_DDC_BUS_PORT_TC4 , };static u8 map_ddc_pin (struct drm_i915_private *i915,u8 vbt_pin) {const u8 *ddc_pin_map; -int n_entries; +int i, n_entries;if (HAS_PCH_MTP (i915) ||IS_ALDERLAKE_P (i915)) { ddc_pin_map = adlp_ddc_pin_map; n_entries =ARRAY_SIZE (adlp_ddc_pin_map);
@@ -2212,10 +2212,12 @@ static u8 map_ddc_pin(struct drm_i915_private *i915, u8 vbt_pin)/* Assuming direct map */ return vbt_pin; } -if (vbt_pin < n_entries && ddc_pin_map[vbt_pin] !=0 ) -return ddc_pin_map[vbt_pin]; +for (i =0 ; i < n_entries; i++) { +if (ddc_pin_map[i] == vbt_pin) +return i; + }drm_dbg_kms (&i915->drm,"Ignoring alternate pin: VBT claims DDC pin %d, which is not valid for this platform\n" , vbt_pin);
Signature · 1 line
2.39.2
PATCH 9/17 drm/i915: Nuke intel_bios_is_port_dp_dual_mode()
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Now that we have encoder->devdata everwhere we don't need the intel_bios_is_port_dp_dual_mode() wrapper any more.
And while at it let's include it in the child device log dump as well since the logic in there is a bit more complex than just DP&&HDMI.
--- drivers/gpu/drm/i915/display/intel_bios.c | 14 +++----------- drivers/gpu/drm/i915/display/intel_bios.h | 2 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 6 +++--- 3 files changed, 7 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/display/intel_bios.c +3 -11
@@ -2676,10 +2676,11 @@ static void print_ddi_port(const struct intel_bios_encoder_data *devdata, supports_typec_usb =intel_bios_encoder_supports_typec_usb (devdata); supports_tbt =intel_bios_encoder_supports_tbt (devdata);drm_dbg_kms (&i915->drm, -"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" , +"Port %c VBT info: CRT:%d DVI:%d HDMI:%d DP:%d eDP:%d DSI:%d DP++:%d LSPCON:%d USB-Type-C:%d TBT:%d DSC:%d\n" ,port_name (port), is_crt, is_dvi, is_hdmi, is_dp, is_edp, is_dsi, +intel_bios_encoder_supports_dp_dual_mode (devdata),intel_bios_encoder_is_lspcon (devdata), supports_typec_usb, supports_tbt, devdata->dsc !=NULL );
@@ -3432,9 +3433,9 @@ bool intel_bios_is_port_present(struct drm_i915_private *i915, enum port port)return false; } -static bool intel_bios_encoder_supports_dp_dual_mode (const struct intel_bios_encoder_data *devdata) +bool intel_bios_encoder_supports_dp_dual_mode (const struct intel_bios_encoder_data *devdata) {const struct child_device_config *child = &devdata->child; if (!intel_bios_encoder_supports_dp(devdata) ||
@@ -3451,17 +3452,8 @@ static bool intel_bios_encoder_supports_dp_dual_mode(const struct intel_bios_encreturn false; } -bool intel_bios_is_port_dp_dual_mode (struct drm_i915_private *i915, -enum port port) -{ -const struct intel_bios_encoder_data *devdata = -intel_bios_encoder_data_lookup (i915, port); - -return devdata &&intel_bios_encoder_supports_dp_dual_mode (devdata); -} -/** * intel_bios_is_dsi_present - is DSI present in VBT * @i915: i915 device instance * @port: port for DSI if present
drivers/gpu/drm/i915/display/intel_bios.h +1 -1
@@ -246,9 +246,8 @@ bool intel_bios_is_valid_vbt(const void *buf, size_t size);bool intel_bios_is_tv_present (struct drm_i915_private *dev_priv);bool intel_bios_is_lvds_present (struct drm_i915_private *dev_priv,u8 *i2c_pin);bool intel_bios_is_port_present (struct drm_i915_private *dev_priv,enum port port);bool intel_bios_is_port_edp (struct drm_i915_private *dev_priv,enum port port); -bool intel_bios_is_port_dp_dual_mode (struct drm_i915_private *dev_priv,enum port port);bool intel_bios_is_dsi_present (struct drm_i915_private *dev_priv,enum port *port);bool intel_bios_get_dsc_params (struct intel_encoder *encoder,struct intel_crtc_state *crtc_state,int dsc_max_bpc);
@@ -265,8 +264,9 @@ bool intel_bios_encoder_supports_hdmi(const struct intel_bios_encoder_data *devdbool intel_bios_encoder_supports_dp (const struct intel_bios_encoder_data *devdata);bool intel_bios_encoder_supports_edp (const struct intel_bios_encoder_data *devdata);bool intel_bios_encoder_supports_typec_usb (const struct intel_bios_encoder_data *devdata);bool intel_bios_encoder_supports_tbt (const struct intel_bios_encoder_data *devdata); +bool intel_bios_encoder_supports_dp_dual_mode (const struct intel_bios_encoder_data *devdata);bool intel_bios_encoder_is_lspcon (const struct intel_bios_encoder_data *devdata);bool intel_bios_encoder_lane_reversal (const struct intel_bios_encoder_data *devdata);bool intel_bios_encoder_hpd_invert (const struct intel_bios_encoder_data *devdata);enum aux_ch intel_bios_dp_aux_ch (const struct intel_bios_encoder_data *devdata);
drivers/gpu/drm/i915/display/intel_hdmi.c +3 -3
@@ -2371,9 +2371,9 @@ static void intel_hdmi_dp_dual_mode_detect(struct drm_connector *connector) {struct drm_i915_private *dev_priv =to_i915 (connector->dev);struct intel_hdmi *hdmi =intel_attached_hdmi (to_intel_connector (connector)); -enum port port =hdmi_to_dig_port (hdmi)->base.port; +struct intel_encoder *encoder = &hdmi_to_dig_port (hdmi)->base;struct i2c_adapter *adapter =intel_gmbus_get_adapter (dev_priv, hdmi->ddc_bus);enum drm_dp_dual_mode_type type =drm_dp_dual_mode_detect (&dev_priv->drm, adapter);
@@ -2387,9 +2387,9 @@ intel_hdmi_dp_dual_mode_detect(struct drm_connector *connector)* if the port is a dual mode capable DP port. */ if (type ==DRM_DP_DUAL_MODE_UNKNOWN ) {if (!connector->force && -intel_bios_is_port_dp_dual_mode (dev_priv, port)) { +intel_bios_encoder_supports_dp_dual_mode (encoder->devdata)) {drm_dbg_kms (&dev_priv->drm,"Assuming DP dual mode adaptor presence based on VBT\n" ); type =DRM_DP_DUAL_MODE_TYPE1_DVI ; }else {
@@ -2410,9 +2410,9 @@ intel_hdmi_dp_dual_mode_detect(struct drm_connector *connector) hdmi->dp_dual_mode.max_tmds_clock);/* Older VBTs are often buggy and can't be trusted :( Play it safe. */ if ((DISPLAY_VER (dev_priv) >=8 ||IS_HASWELL (dev_priv)) && - !intel_bios_is_port_dp_dual_mode (dev_priv, port)) { + !intel_bios_encoder_supports_dp_dual_mode (encoder->devdata)) {drm_dbg_kms (&dev_priv->drm,"Ignoring DP dual mode adaptor max TMDS clock for native HDMI port\n" ); hdmi->dp_dual_mode.max_tmds_clock =0 ; }
Signature · 1 line
2.39.2
PATCH 10/17 drm/i915: Remove bogus DDI-F from hsw/bdw output init
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
HSW/BDW don't have DDI-F so don't go looking for one.
Seems to have been accidentally left behind when the skl+ stuff got split out in commit 097d9e902068 ("drm/i915/display: remove strap checks from gen 9").
--- drivers/gpu/drm/i915/display/intel_display.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +0 -2
@@ -7884,10 +7884,8 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)if (found &SFUSE_STRAP_DDIC_DETECTED )intel_ddi_init (dev_priv,PORT_C );if (found &SFUSE_STRAP_DDID_DETECTED )intel_ddi_init (dev_priv,PORT_D ); -if (found &SFUSE_STRAP_DDIF_DETECTED ) -intel_ddi_init (dev_priv,PORT_F ); }else if (HAS_PCH_SPLIT (dev_priv)) {int found;/*
Signature · 1 line
2.39.2
PATCH 11/17 drm/i915: Introduce device info port_mask
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Declare the available DVO/SDVO/HDMI/DP/DDI ports in the device info. The other outputs (LVDS/TV/DSI/VGA) are left out since for most of them we don't consider them as "ports".
DSI we should probably perhaps include somehow in the device info. Just not sure how. Or we just introduce a HAS_DSI() and call it a day?
TODO: figure out what to do about the subplatform stuff. Would
it be better to declare those directly with a different device info or not? Also not sure the icl port-f stuff matters even. Bspec claims there are icl SKUs with far less ports than that and we don't seem to check for those either?
--- drivers/gpu/drm/i915/i915_pci.c | 31 ++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_device_info.c | 5 ++++ drivers/gpu/drm/i915/intel_device_info.h | 1 + 3 files changed, 37 insertions(+)
drivers/gpu/drm/i915/i915_pci.c +31 -0
@@ -217,31 +217,36 @@static const struct intel_device_info i830_info = {I830_FEATURES ,PLATFORM (INTEL_I830 ), + .__runtime.port_mask =BIT (PORT_A ) |BIT (PORT_B ) |BIT (PORT_C ),/* DVO A/B/C */ };static const struct intel_device_info i845g_info = {I845_FEATURES ,PLATFORM (INTEL_I845G ), + .__runtime.port_mask =BIT (PORT_B ) |BIT (PORT_C ),/* DVO B/C */ };static const struct intel_device_info i85x_info = {I830_FEATURES ,PLATFORM (INTEL_I85X ), .__runtime.fbc_mask =BIT (INTEL_FBC_A ), + .__runtime.port_mask =BIT (PORT_B ) |BIT (PORT_C ),/* DVO B/C */ };static const struct intel_device_info i865g_info = {I845_FEATURES ,PLATFORM (INTEL_I865G ), .__runtime.fbc_mask =BIT (INTEL_FBC_A ), + .__runtime.port_mask =BIT (PORT_B ) |BIT (PORT_C ),/* DVO B/C */ }; #define GEN3_FEATURES \ GEN(3), \ .__runtime.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B), \ .__runtime.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B), \ + .__runtime.port_mask = BIT(PORT_B) | BIT(PORT_C), /* SDVO B/C */ \ .display.has_gmch = 1, \ .gpu_reset_clobbers_display = true, \ .__runtime.platform_engine_mask = BIT(RCS0), \ .has_3d_pipeline = 1, \
@@ -348,8 +353,9 @@ static const struct intel_device_info pnv_m_info = {static const struct intel_device_info i965g_info = {GEN4_FEATURES ,PLATFORM (INTEL_I965G ), + .__runtime.port_mask =BIT (PORT_B ) |BIT (PORT_C ),/* SDVO B/C */ .display.has_overlay =1 , .hws_needs_physical =1 , .has_snoop = false, };
@@ -358,8 +364,9 @@ static const struct intel_device_info i965gm_info = {GEN4_FEATURES ,PLATFORM (INTEL_I965GM ), .is_mobile = 1, .__runtime.fbc_mask = BIT(INTEL_FBC_A), + .__runtime.port_mask = BIT(PORT_B) | BIT(PORT_C), /* SDVO B/C */ .display.has_overlay = 1, .display.supports_tv = 1, .hws_needs_physical = 1, .has_snoop = false,
@@ -367,8 +374,9 @@ static const struct intel_device_info i965gm_info = {static const struct intel_device_info g45_info = {GEN4_FEATURES ,PLATFORM (INTEL_G45 ), + .__runtime.port_mask =BIT (PORT_B ) |BIT (PORT_C ) |BIT (PORT_D ),/* SDVO/HDMI/DP B/C, DP D */ .__runtime.platform_engine_mask =BIT (RCS0 ) |BIT (VCS0 ), .gpu_reset_clobbers_display = false, };
@@ -376,8 +384,9 @@ static const struct intel_device_info gm45_info = {GEN4_FEATURES ,PLATFORM (INTEL_GM45 ), .is_mobile = 1, .__runtime.fbc_mask = BIT(INTEL_FBC_A), + .__runtime.port_mask = BIT(PORT_B) | BIT(PORT_C) | BIT(PORT_D), /* SDVO/HDMI/DP B/C, DP D */ .display.supports_tv = 1, .__runtime.platform_engine_mask = BIT(RCS0) | BIT(VCS0), .gpu_reset_clobbers_display = false, };
@@ -385,8 +394,9 @@ static const struct intel_device_info gm45_info = { #define GEN5_FEATURES \ GEN(5), \ .__runtime.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B), \ .__runtime.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B), \ + .__runtime.port_mask = BIT(PORT_A) | BIT(PORT_B) | BIT(PORT_C) | BIT(PORT_D), /* DP A, SDVO/HDMI/DP B, HDMI/DP C/D */ \ .display.has_hotplug = 1, \ .__runtime.platform_engine_mask = BIT(RCS0) | BIT(VCS0), \ .has_3d_pipeline = 1, \ .has_snoop = true, \
@@ -416,8 +426,9 @@ static const struct intel_device_info ilk_m_info = { #define GEN6_FEATURES \ GEN(6), \ .__runtime.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B), \ .__runtime.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B), \ + .__runtime.port_mask = BIT(PORT_A) | BIT(PORT_B) | BIT(PORT_C) | BIT(PORT_D), /* DP A, SDVO/HDMI/DP B, HDMI/DP C/D */ \ .display.has_hotplug = 1, \ .__runtime.fbc_mask = BIT(INTEL_FBC_A), \ .__runtime.platform_engine_mask = BIT(RCS0) | BIT(VCS0) | BIT(BCS0), \ .has_3d_pipeline = 1, \
@@ -469,8 +480,9 @@ static const struct intel_device_info snb_m_gt2_info = { #define GEN7_FEATURES \ GEN(7), \ .__runtime.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C), \ .__runtime.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | BIT(TRANSCODER_C), \ + .__runtime.port_mask = BIT(PORT_A) | BIT(PORT_B) | BIT(PORT_C) | BIT(PORT_D), /* DP A, SDVO/HDMI/DP B, HDMI/DP C/D */ \ .display.has_hotplug = 1, \ .__runtime.fbc_mask = BIT(INTEL_FBC_A), \ .__runtime.platform_engine_mask = BIT(RCS0) | BIT(VCS0) | BIT(BCS0), \ .has_3d_pipeline = 1, \
@@ -533,8 +545,9 @@ static const struct intel_device_info vlv_info = { GEN(7), .is_lp = 1, .__runtime.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B), .__runtime.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B), + .__runtime.port_mask = BIT(PORT_B) | BIT(PORT_C), /* HDMI/DP B/C */ .has_runtime_pm = 1, .has_rc6 = 1, .has_reset_engine = true, .has_rps = true,
@@ -558,8 +571,9 @@ static const struct intel_device_info vlv_info = { GEN7_FEATURES, \ .__runtime.platform_engine_mask = BIT(RCS0) | BIT(VCS0) | BIT(BCS0) | BIT(VECS0), \ .__runtime.cpu_transcoder_mask =BIT (TRANSCODER_A ) |BIT (TRANSCODER_B ) | \ BIT(TRANSCODER_C) | BIT(TRANSCODER_EDP), \ + .__runtime.port_mask = BIT(PORT_A) | BIT(PORT_B) | BIT(PORT_C) | BIT(PORT_D) | BIT(PORT_E), \ .display.has_ddi = 1, \ .display.has_fpga_dbg = 1, \ .display.has_dp_mst = 1, \ .has_rc6p = 0 /* RC6p removed-by HSW */, \
@@ -628,8 +642,9 @@ static const struct intel_device_info chv_info = {PLATFORM (INTEL_CHERRYVIEW ),GEN (8 ), .__runtime.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C), .__runtime.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | BIT(TRANSCODER_C), + .__runtime.port_mask = BIT(PORT_B) | BIT(PORT_C) | BIT(PORT_D), /* HDMI/DP B/C/D */ .display.has_hotplug = 1, .is_lp = 1, .__runtime.platform_engine_mask = BIT(RCS0) | BIT(VCS0) | BIT(BCS0) | BIT(VECS0), .has_64bit_reloc = 1,
@@ -708,8 +723,9 @@ static const struct intel_device_info skl_gt4_info = { .__runtime.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C), \ .__runtime.cpu_transcoder_mask =BIT (TRANSCODER_A ) |BIT (TRANSCODER_B ) | \BIT (TRANSCODER_C ) |BIT (TRANSCODER_EDP ) | \ BIT(TRANSCODER_DSI_A) | BIT(TRANSCODER_DSI_C), \ + .__runtime.port_mask = BIT(PORT_A) | BIT(PORT_B) | BIT(PORT_C), \ .has_3d_pipeline = 1, \ .has_64bit_reloc = 1, \ .display.has_ddi = 1, \ .display.has_fpga_dbg = 1, \
@@ -845,22 +861,25 @@ static const struct intel_device_info cml_gt2_info = {static const struct intel_device_info icl_info = {GEN11_FEATURES ,PLATFORM (INTEL_ICELAKE ), + .__runtime.port_mask =BIT (PORT_A ) |BIT (PORT_B ) |BIT (PORT_C ) |BIT (PORT_D ) |BIT (PORT_E ), .__runtime.platform_engine_mask =BIT (RCS0 ) |BIT (BCS0 ) |BIT (VECS0 ) |BIT (VCS0 ) |BIT (VCS2 ), };static const struct intel_device_info ehl_info = {GEN11_FEATURES ,PLATFORM (INTEL_ELKHARTLAKE ), + .__runtime.port_mask =BIT (PORT_A ) |BIT (PORT_B ) |BIT (PORT_C ) |BIT (PORT_D ), .__runtime.platform_engine_mask =BIT (RCS0 ) |BIT (BCS0 ) |BIT (VCS0 ) |BIT (VECS0 ), .__runtime.ppgtt_size =36 , };static const struct intel_device_info jsl_info = {GEN11_FEATURES ,PLATFORM (INTEL_JASPERLAKE ), + .__runtime.port_mask =BIT (PORT_A ) |BIT (PORT_B ) |BIT (PORT_C ) |BIT (PORT_D ), .__runtime.platform_engine_mask =BIT (RCS0 ) |BIT (BCS0 ) |BIT (VCS0 ) |BIT (VECS0 ), .__runtime.ppgtt_size =36 , };
@@ -895,8 +914,10 @@ static const struct intel_device_info jsl_info = {static const struct intel_device_info tgl_info = {GEN12_FEATURES ,PLATFORM (INTEL_TIGERLAKE ), + .__runtime.port_mask =BIT (PORT_A ) |BIT (PORT_B ) |BIT (PORT_C ) | +BIT (PORT_TC1 ) |BIT (PORT_TC2 ) |BIT (PORT_TC3 ) |BIT (PORT_TC4 ) |BIT (PORT_TC5 ) |BIT (PORT_TC5 ), .display.has_modular_fia =1 , .__runtime.platform_engine_mask =BIT (RCS0 ) |BIT (BCS0 ) |BIT (VECS0 ) |BIT (VCS0 ) |BIT (VCS2 ), };
@@ -907,8 +928,10 @@ static const struct intel_device_info rkl_info = { .display.abox_mask = BIT(0), .__runtime.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C), .__runtime.cpu_transcoder_mask =BIT (TRANSCODER_A ) |BIT (TRANSCODER_B ) | BIT(TRANSCODER_C), + .__runtime.port_mask =BIT (PORT_A ) |BIT (PORT_B ) | + BIT(PORT_TC1) | BIT(PORT_TC2), .display.has_hti = 1, .display.has_psr_hw_tracking = 0, .__runtime.platform_engine_mask = BIT(RCS0) | BIT(BCS0) | BIT(VECS0) | BIT(VCS0),
@@ -927,8 +950,10 @@ static const struct intel_device_info dg1_info = { DGFX_FEATURES, .__runtime.graphics.ip.rel =10 ,PLATFORM (INTEL_DG1 ), .__runtime.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D), + .__runtime.port_mask = BIT(PORT_A) | BIT(PORT_B) | +BIT (PORT_TC1 ) |BIT (PORT_TC2 ), .require_force_probe = 1, .__runtime.platform_engine_mask =BIT (RCS0 ) |BIT (BCS0 ) |BIT (VECS0 ) | BIT(VCS0) | BIT(VCS2),
@@ -939,8 +964,10 @@ static const struct intel_device_info dg1_info = {static const struct intel_device_info adl_s_info = {GEN12_FEATURES ,PLATFORM (INTEL_ALDERLAKE_S ), .__runtime.pipe_mask =BIT (PIPE_A ) |BIT (PIPE_B ) |BIT (PIPE_C ) |BIT (PIPE_D ), + .__runtime.port_mask =BIT (PORT_A ) | +BIT (PORT_TC1 ) |BIT (PORT_TC2 ) |BIT (PORT_TC3 ) |BIT (PORT_TC4 ), .display.has_hti =1 , .display.has_psr_hw_tracking =0 , .__runtime.platform_engine_mask =BIT (RCS0 ) |BIT (BCS0 ) |BIT (VECS0 ) |BIT (VCS0 ) |BIT (VCS2 ),
@@ -994,8 +1021,10 @@ static const struct intel_device_info adl_p_info = {PLATFORM (INTEL_ALDERLAKE_P ), .__runtime.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) |BIT (TRANSCODER_C ) |BIT (TRANSCODER_D ) |BIT (TRANSCODER_DSI_0 ) |BIT (TRANSCODER_DSI_1 ), + .__runtime.port_mask = BIT(PORT_A) | BIT(PORT_B) | +BIT (PORT_TC1 ) |BIT (PORT_TC2 ) |BIT (PORT_TC3 ) |BIT (PORT_TC4 ), .display.has_cdclk_crawl = 1, .display.has_modular_fia = 1, .display.has_psr_hw_tracking = 0, .__runtime.platform_engine_mask =
@@ -1079,8 +1108,10 @@ static const struct intel_device_info dg2_info = {DG2_FEATURES ,XE_LPD_FEATURES , .__runtime.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) |BIT (TRANSCODER_C ) |BIT (TRANSCODER_D ), + .__runtime.port_mask = BIT(PORT_A) | BIT(PORT_B) | BIT(PORT_C) | BIT(PORT_D_XELPD) | + BIT(PORT_TC1), };static const struct intel_device_info ats_m_info = { DG2_FEATURES,
drivers/gpu/drm/i915/intel_device_info.c +5 -0
@@ -258,17 +258,21 @@ static void intel_device_info_subplatform_init(struct drm_i915_private *i915)/* Find and mark subplatform bits based on the PCI device id. */ if (find_devid (devid, subplatform_ult_ids,ARRAY_SIZE (subplatform_ult_ids))) { mask =BIT (INTEL_SUBPLATFORM_ULT ); +if (IS_HASWELL (i915) ||IS_BROADWELL (i915)) +RUNTIME_INFO (i915)->port_mask &= ~BIT (PORT_D ); }else if (find_devid (devid, subplatform_ulx_ids,ARRAY_SIZE (subplatform_ulx_ids))) { mask =BIT (INTEL_SUBPLATFORM_ULX );if (IS_HASWELL (i915) ||IS_BROADWELL (i915)) {/* ULX machines are also considered ULT. */ mask |=BIT (INTEL_SUBPLATFORM_ULT ); +RUNTIME_INFO (i915)->port_mask &= ~BIT (PORT_D ); } }else if (find_devid (devid, subplatform_portf_ids,ARRAY_SIZE (subplatform_portf_ids))) { +RUNTIME_INFO (i915)->port_mask |=BIT (PORT_F ); mask =BIT (INTEL_SUBPLATFORM_PORTF ); }else if (find_devid (devid, subplatform_uy_ids,ARRAY_SIZE (subplatform_uy_ids))) { mask =BIT (INTEL_SUBPLATFORM_UY );
@@ -533,8 +537,9 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv) DRIVER_ATOMIC);memset (&info->display,0 ,sizeof (info->display)); runtime->cpu_transcoder_mask =0 ; + runtime->port_mask =0 ;memset (runtime->num_sprites,0 ,sizeof (runtime->num_sprites));memset (runtime->num_scalers,0 ,sizeof (runtime->num_scalers)); runtime->fbc_mask =0 ; runtime->has_hdcp = false;
drivers/gpu/drm/i915/intel_device_info.h +1 -0
@@ -250,8 +250,9 @@ struct intel_runtime_info {/* display */ struct {u8 pipe_mask;u8 cpu_transcoder_mask; +u16 port_mask;/* DVO/sDVO/DP/HDMI/DDI ports */ u8 num_sprites[I915_MAX_PIPES ];u8 num_scalers[I915_MAX_PIPES ];
Signature · 1 line
2.39.2
PATCH 12/17 drm/i915: Assert that device info bitmasks have enough bits
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Sprinkle in some BUILD_BUG_ON()s to make sure some of the bitmasks used in the device info have enough bits.
Do we have a better place for this sort of stuff?
--- drivers/gpu/drm/i915/intel_device_info.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/intel_device_info.c +4 -0
@@ -406,8 +406,12 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)struct intel_device_info *info =mkwrite_device_info (dev_priv);struct intel_runtime_info *runtime =RUNTIME_INFO (dev_priv);enum pipe pipe; +BUILD_BUG_ON (BITS_PER_TYPE (runtime->pipe_mask) <I915_MAX_PIPES ); +BUILD_BUG_ON (BITS_PER_TYPE (runtime->cpu_transcoder_mask) <I915_MAX_TRANSCODERS ); +BUILD_BUG_ON (BITS_PER_TYPE (runtime->port_mask) <I915_MAX_PORTS ); +/* Wa_14011765242: adl-s A0,A1 */ if (IS_ADLS_DISPLAY_STEP (dev_priv,STEP_A0 ,STEP_A2 ))for_each_pipe (dev_priv, pipe) runtime->num_scalers[pipe] =0 ;
Signature · 1 line
2.39.2
PATCH 13/17 drm/i915: Assert that the port being initialized is valid
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Sprinkle some asserts to catch any mishaps in the port_mask vs. output init.
For DDI/DP/HDMI/SDVO I decided that we want to bail out for an invalid port since those are the encoder types where we might want consider driving the whole thing from the VBT child device list, and bogus VBTs could be a real issue (if for no other reason than the i915.vbt_firmware).
For DVO and HSW/BDW CRT port I just threw the assert in there for good measure.
--- drivers/gpu/drm/i915/display/g4x_dp.c | 3 +++ drivers/gpu/drm/i915/display/g4x_hdmi.c | 3 +++ drivers/gpu/drm/i915/display/intel_crt.c | 2 ++ drivers/gpu/drm/i915/display/intel_ddi.c | 3 +++ drivers/gpu/drm/i915/display/intel_display.c | 6 ++++++ drivers/gpu/drm/i915/display/intel_display.h | 2 ++ drivers/gpu/drm/i915/display/intel_dvo.c | 2 ++ drivers/gpu/drm/i915/display/intel_sdvo.c | 3 +++ 8 files changed, 24 insertions(+)
drivers/gpu/drm/i915/display/g4x_dp.c +3 -0
@@ -1258,8 +1258,11 @@ bool g4x_dp_init(struct drm_i915_private *dev_priv,struct intel_encoder *intel_encoder;struct drm_encoder *encoder;struct intel_connector *intel_connector; +if (!assert_port_valid (dev_priv, port)) +return false; + devdata =intel_bios_encoder_data_lookup (dev_priv, port);intel_bios_encoder_sanitize (devdata, port);/* FIXME bail? */
drivers/gpu/drm/i915/display/g4x_hdmi.c +3 -0
@@ -553,8 +553,11 @@ void g4x_hdmi_init(struct drm_i915_private *dev_priv,struct intel_digital_port *dig_port;struct intel_encoder *intel_encoder;struct intel_connector *intel_connector; +if (!assert_port_valid (dev_priv, port)) +return ; + devdata =intel_bios_encoder_data_lookup (dev_priv, port);intel_bios_encoder_sanitize (devdata, port);/* FIXME bail? */
drivers/gpu/drm/i915/display/intel_crt.c +2 -0
@@ -1057,8 +1057,10 @@ void intel_crt_init(struct drm_i915_private *dev_priv) intel_connector->polled =DRM_CONNECTOR_POLL_CONNECT ; }if (HAS_DDI (dev_priv)) { +assert_port_valid (dev_priv,PORT_E ); + crt->base.port =PORT_E ; crt->base.get_config = hsw_crt_get_config; crt->base.get_hw_state = intel_ddi_get_hw_state; crt->base.compute_config = hsw_crt_compute_config;
drivers/gpu/drm/i915/display/intel_ddi.c +3 -0
@@ -4264,8 +4264,11 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)struct intel_bios_encoder_data *devdata;bool init_hdmi, init_dp;enum phy phy =intel_port_to_phy (dev_priv, port); +if (!assert_port_valid (dev_priv, port)) +return ; +/* * On platforms with HTI (aka HDPORT), if it's enabled at boot it may * have taken over some of the PHYs and made them unavailable to the * driver. In that case we should skip initializing the corresponding
drivers/gpu/drm/i915/display/intel_display.c +6 -0
@@ -7796,8 +7796,14 @@ static bool intel_ddi_crt_present(struct drm_i915_private *dev_priv)return true; } +bool assert_port_valid (struct drm_i915_private *i915,enum port port) +{ +return !drm_WARN (&i915->drm, !(RUNTIME_INFO (i915)->port_mask &BIT (port)), +"Platform does not support port %c\n" ,port_name (port)); +} +static void intel_setup_outputs (struct drm_i915_private *dev_priv) {struct intel_encoder *encoder;bool dpd_is_edp = false;
drivers/gpu/drm/i915/display/intel_display.h +2 -0
@@ -553,8 +553,10 @@ void assert_transcoder(struct drm_i915_private *dev_priv, enum transcoder cpu_transcoder, bool state);#define assert_transcoder_enabled (d, t) assert_transcoder(d, t, true)#define assert_transcoder_disabled (d, t) assert_transcoder(d, t, false) +bool assert_port_valid (struct drm_i915_private *i915,enum port port); +/* Use I915_STATE_WARN(x) and I915_STATE_WARN_ON() (rather than WARN() and * WARN_ON()) for hw state sanity checks to check for unexpected conditions * which may not necessarily be a user visible problem. This will either * WARN() or DRM_ERROR() depending on the verbose_checks moduleparam, to
drivers/gpu/drm/i915/display/intel_dvo.c +2 -0
@@ -507,8 +507,10 @@ void intel_dvo_init(struct drm_i915_private *i915)intel_connector_free (connector);return ; } +assert_port_valid (i915, intel_dvo->dev.port); + encoder->type =INTEL_OUTPUT_DVO ; encoder->power_domain =POWER_DOMAIN_PORT_OTHER ; encoder->port = intel_dvo->dev.port; encoder->pipe_mask = ~0 ;
drivers/gpu/drm/i915/display/intel_sdvo.c +3 -0
@@ -3328,8 +3328,11 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv,struct intel_encoder *intel_encoder;struct intel_sdvo *intel_sdvo;int i; +if (!assert_port_valid (dev_priv, port)) +return false; +assert_sdvo_port_valid (dev_priv, port); intel_sdvo =kzalloc (sizeof (*intel_sdvo),GFP_KERNEL );if (!intel_sdvo)
Signature · 1 line
2.39.2
PATCH 14/17 drm/i915: Beef up SDVO/HDMI port checks
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
The SDVO code already warns when the port in question doesn't actually support SDVO. Let's make that also bail the encoder registration like the generic assert_port_valid() we added.
And add a similar thing for g4x HDMI, mainly because on g4x itsefl port D only supports DP but not SDVO/HDMI. For the other platforms the generic port_mask check should actually be sufficient, but since we're here might as well list the ports.
--- drivers/gpu/drm/i915/display/g4x_hdmi.c | 17 +++++++++++++++++ drivers/gpu/drm/i915/display/intel_sdvo.c | 17 ++++++++++++----- 2 files changed, 29 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/display/g4x_hdmi.c +17 -0
@@ -545,8 +545,22 @@ intel_hdmi_hotplug(struct intel_encoder *encoder,return state; } +static bool is_hdmi_port_valid (struct drm_i915_private *i915,enum port port) +{ +if (IS_G4X (i915) ||IS_VALLEYVIEW (i915)) +return port ==PORT_B || port ==PORT_C ; +else +return port ==PORT_B || port ==PORT_C || port ==PORT_D ; +} + +static bool assert_hdmi_port_valid (struct drm_i915_private *i915,enum port port) +{ +return !drm_WARN (&i915->drm, !is_hdmi_port_valid (i915, port), +"Platform does not support HDMI %c\n" ,port_name (port)); +} +void g4x_hdmi_init (struct drm_i915_private *dev_priv,i915_reg_t hdmi_reg,enum port port) {struct intel_bios_encoder_data *devdata;
@@ -556,8 +570,11 @@ void g4x_hdmi_init(struct drm_i915_private *dev_priv,if (!assert_port_valid (dev_priv, port))return ; +if (!assert_hdmi_port_valid (dev_priv, port)) +return ; + devdata =intel_bios_encoder_data_lookup (dev_priv, port);intel_bios_encoder_sanitize (devdata, port);/* FIXME bail? */
drivers/gpu/drm/i915/display/intel_sdvo.c +12 -5
@@ -3312,15 +3312,21 @@ intel_sdvo_init_ddc_proxy(struct intel_sdvo *sdvo,return i2c_add_adapter (&sdvo->ddc) ==0 ; } -static void assert_sdvo_port_valid (const struct drm_i915_private *dev_priv, -enum port port) +static bool is_sdvo_port_valid (struct drm_i915_private *dev_priv,enum port port) {if (HAS_PCH_SPLIT (dev_priv)) -drm_WARN_ON (&dev_priv->drm, port !=PORT_B ); +return port ==PORT_B ;else -drm_WARN_ON (&dev_priv->drm, port !=PORT_B && port !=PORT_C ); +return port ==PORT_B || port ==PORT_C ; +} + +static bool assert_sdvo_port_valid (struct drm_i915_private *dev_priv, +enum port port) +{ +return !drm_WARN (&dev_priv->drm, !is_sdvo_port_valid (dev_priv, port), +"Platform does not support SDVO %c\n" ,port_name (port)); }bool intel_sdvo_init (struct drm_i915_private *dev_priv,i915_reg_t sdvo_reg,enum port port)
@@ -3331,9 +3337,10 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv,if (!assert_port_valid (dev_priv, port))return false; -assert_sdvo_port_valid (dev_priv, port); +if (!assert_sdvo_port_valid (dev_priv, port)) +return false; intel_sdvo =kzalloc (sizeof (*intel_sdvo),GFP_KERNEL );if (!intel_sdvo)return false;
Signature · 1 line
2.39.2
PATCH 15/17 drm/i915: Init DDI outputs based on port_mask on skl+
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Instead of listing every platform's possible DDI outputs in intel_setup_outputs() just loop over the new port_mask to achieve the same thing.
HSW/BDW were left as is since they still look at the straps as well.
DSI is still a mess. For now just check for the relevant platforms explicitly.
--- drivers/gpu/drm/i915/display/intel_display.c | 73 ++++---------------- 1 file changed, 13 insertions(+), 60 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +13 -60
@@ -7812,68 +7812,21 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)if (!HAS_DISPLAY (dev_priv))return ; -if (IS_DG2 (dev_priv)) { -intel_ddi_init (dev_priv,PORT_A ); -intel_ddi_init (dev_priv,PORT_B ); -intel_ddi_init (dev_priv,PORT_C ); -intel_ddi_init (dev_priv,PORT_D_XELPD ); -intel_ddi_init (dev_priv,PORT_TC1 ); - }else if (IS_ALDERLAKE_P (dev_priv)) { -intel_ddi_init (dev_priv,PORT_A ); -intel_ddi_init (dev_priv,PORT_B ); -intel_ddi_init (dev_priv,PORT_TC1 ); -intel_ddi_init (dev_priv,PORT_TC2 ); -intel_ddi_init (dev_priv,PORT_TC3 ); -intel_ddi_init (dev_priv,PORT_TC4 ); -icl_dsi_init (dev_priv); - }else if (IS_ALDERLAKE_S (dev_priv)) { -intel_ddi_init (dev_priv,PORT_A ); -intel_ddi_init (dev_priv,PORT_TC1 ); -intel_ddi_init (dev_priv,PORT_TC2 ); -intel_ddi_init (dev_priv,PORT_TC3 ); -intel_ddi_init (dev_priv,PORT_TC4 ); - }else if (IS_DG1 (dev_priv) ||IS_ROCKETLAKE (dev_priv)) { -intel_ddi_init (dev_priv,PORT_A ); -intel_ddi_init (dev_priv,PORT_B ); -intel_ddi_init (dev_priv,PORT_TC1 ); -intel_ddi_init (dev_priv,PORT_TC2 ); - }else if (DISPLAY_VER (dev_priv) >=12 ) { -intel_ddi_init (dev_priv,PORT_A ); -intel_ddi_init (dev_priv,PORT_B ); -intel_ddi_init (dev_priv,PORT_TC1 ); -intel_ddi_init (dev_priv,PORT_TC2 ); -intel_ddi_init (dev_priv,PORT_TC3 ); -intel_ddi_init (dev_priv,PORT_TC4 ); -intel_ddi_init (dev_priv,PORT_TC5 ); -intel_ddi_init (dev_priv,PORT_TC6 ); -icl_dsi_init (dev_priv); - }else if (IS_JSL_EHL (dev_priv)) { -intel_ddi_init (dev_priv,PORT_A ); -intel_ddi_init (dev_priv,PORT_B ); -intel_ddi_init (dev_priv,PORT_C ); -intel_ddi_init (dev_priv,PORT_D ); -icl_dsi_init (dev_priv); - }else if (DISPLAY_VER (dev_priv) ==11 ) { -intel_ddi_init (dev_priv,PORT_A ); -intel_ddi_init (dev_priv,PORT_B ); -intel_ddi_init (dev_priv,PORT_C ); -intel_ddi_init (dev_priv,PORT_D ); -intel_ddi_init (dev_priv,PORT_E ); -intel_ddi_init (dev_priv,PORT_F ); -icl_dsi_init (dev_priv); - }else if (IS_GEMINILAKE (dev_priv) ||IS_BROXTON (dev_priv)) { -intel_ddi_init (dev_priv,PORT_A ); -intel_ddi_init (dev_priv,PORT_B ); -intel_ddi_init (dev_priv,PORT_C ); -vlv_dsi_init (dev_priv); - }else if (DISPLAY_VER (dev_priv) >=9 ) { -intel_ddi_init (dev_priv,PORT_A ); -intel_ddi_init (dev_priv,PORT_B ); -intel_ddi_init (dev_priv,PORT_C ); -intel_ddi_init (dev_priv,PORT_D ); -intel_ddi_init (dev_priv,PORT_E ); +if (DISPLAY_VER (dev_priv) >=9 ) { +enum port port; + +for_each_port_masked (port,RUNTIME_INFO (dev_priv)->port_mask) +intel_ddi_init (dev_priv, port); + +/* FIXME do something about DSI */ +if (IS_ALDERLAKE_P (dev_priv) ||IS_TIGERLAKE (dev_priv) || +DISPLAY_VER (dev_priv) ==11 ) +icl_dsi_init (dev_priv); + +if (IS_GEMINILAKE (dev_priv) ||IS_BROXTON (dev_priv)) +vlv_dsi_init (dev_priv); }else if (HAS_DDI (dev_priv)) {u32 found;if (intel_ddi_crt_present (dev_priv))
Signature · 1 line
2.39.2
PATCH 16/17 drm/i915: Try to initialize DDI/ICL+ DSI ports for every VBT child device
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Try to deal with duplicate child devices for the same DDI port by attempting to initialize them in VBT defined order The first on to succeed for a specific DDI port will be the one we use.
TODO: DSI dual link handling is sketchy at best
--- drivers/gpu/drm/i915/display/icl_dsi.c | 11 ++-- drivers/gpu/drm/i915/display/icl_dsi.h | 6 +- drivers/gpu/drm/i915/display/intel_bios.c | 65 ++++++++++++++----- drivers/gpu/drm/i915/display/intel_bios.h | 6 ++ drivers/gpu/drm/i915/display/intel_ddi.c | 56 ++++++++++++---- drivers/gpu/drm/i915/display/intel_ddi.h | 5 +- drivers/gpu/drm/i915/display/intel_display.c | 19 ++---- .../gpu/drm/i915/display/intel_display_core.h | 2 - 8 files changed, 117 insertions(+), 53 deletions(-)
drivers/gpu/drm/i915/display/icl_dsi.c +5 -6
@@ -1891,18 +1891,16 @@ static void icl_dsi_add_properties(struct intel_connector *connector) fixed_mode->hdisplay, fixed_mode->vdisplay); } -void icl_dsi_init (struct drm_i915_private *dev_priv) +void icl_dsi_init (struct drm_i915_private *dev_priv, +struct intel_bios_encoder_data *devdata, +enum port port) {struct intel_dsi *intel_dsi;struct intel_encoder *encoder;struct intel_connector *intel_connector;struct drm_connector *connector; -enum port port; - -if (!intel_bios_is_dsi_present (dev_priv, &port)) -return ; intel_dsi =kzalloc (sizeof (*intel_dsi),GFP_KERNEL );if (!intel_dsi)return ;
@@ -1916,8 +1914,10 @@ void icl_dsi_init(struct drm_i915_private *dev_priv) encoder = &intel_dsi->base; intel_dsi->attached_connector = intel_connector; connector = &intel_connector->base; + encoder->devdata = devdata; +/* register DSI encoder with DRM subsystem */ drm_encoder_init (&dev_priv->drm, &encoder->base, &gen11_dsi_encoder_funcs,DRM_MODE_ENCODER_DSI ,"DSI %c" ,port_name (port));
@@ -1950,9 +1950,8 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)/* attach connector to encoder */ intel_connector_attach_encoder (intel_connector, encoder); - encoder->devdata =intel_bios_encoder_data_lookup (dev_priv, port);intel_bios_init_panel_late (dev_priv, &intel_connector->panel, encoder->devdata,NULL );mutex_lock (&dev_priv->drm.mode_config.mutex);intel_panel_add_vbt_lfp_fixed_mode (intel_connector);
drivers/gpu/drm/i915/display/icl_dsi.h +5 -1
@@ -5,11 +5,15 @@#ifndef __ICL_DSI_H__#define __ICL_DSI_H__ +enum port ;struct drm_i915_private ; +struct intel_bios_encoder_data ;struct intel_crtc_state ; -void icl_dsi_init (struct drm_i915_private *i915); +void icl_dsi_init (struct drm_i915_private *i915, +struct intel_bios_encoder_data *devdata, +enum port port);void icl_dsi_frame_update (struct intel_crtc_state *crtc_state);#endif /* __ICL_DSI_H__ */
drivers/gpu/drm/i915/display/intel_bios.c +47 -18
115 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_bios.h +6 -0
@@ -264,8 +264,9 @@ bool intel_bios_encoder_supports_hdmi(const struct intel_bios_encoder_data *devdbool intel_bios_encoder_supports_dp (const struct intel_bios_encoder_data *devdata);bool intel_bios_encoder_supports_edp (const struct intel_bios_encoder_data *devdata);bool intel_bios_encoder_supports_typec_usb (const struct intel_bios_encoder_data *devdata);bool intel_bios_encoder_supports_tbt (const struct intel_bios_encoder_data *devdata); +bool intel_bios_encoder_supports_dsi (const struct intel_bios_encoder_data *devdata);bool intel_bios_encoder_supports_dp_dual_mode (const struct intel_bios_encoder_data *devdata);bool intel_bios_encoder_is_lspcon (const struct intel_bios_encoder_data *devdata);bool intel_bios_encoder_lane_reversal (const struct intel_bios_encoder_data *devdata);bool intel_bios_encoder_hpd_invert (const struct intel_bios_encoder_data *devdata);
@@ -277,5 +278,10 @@ int intel_bios_hdmi_boost_level(const struct intel_bios_encoder_data *devdata);int intel_bios_hdmi_ddc_pin (const struct intel_bios_encoder_data *devdata);int intel_bios_hdmi_level_shift (const struct intel_bios_encoder_data *devdata);int intel_bios_hdmi_max_tmds_clock (const struct intel_bios_encoder_data *devdata); +void intel_bios_for_each_encoder (struct drm_i915_private *i915, +void (*func)(struct drm_i915_private *i915, +struct intel_bios_encoder_data *devdata, +enum port port)); +#endif /* _INTEL_BIOS_H_ */
drivers/gpu/drm/i915/display/intel_ddi.c +45 -11
89 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_ddi.h +4 -1
@@ -10,8 +10,9 @@struct drm_connector_state ;struct drm_i915_private ;struct intel_atomic_state ; +struct intel_bios_encoder_data ;struct intel_connector ;struct intel_crtc ;struct intel_crtc_state ;struct intel_dp ;
@@ -46,9 +47,11 @@ struct intel_shared_dpll *icl_ddi_combo_get_pll(struct intel_encoder *encoder);void hsw_prepare_dp_ddi_buffers (struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state);void intel_wait_ddi_buf_idle (struct drm_i915_private *dev_priv,enum port port); -void intel_ddi_init (struct drm_i915_private *dev_priv,enum port port); +void intel_ddi_init (struct drm_i915_private *dev_priv, +struct intel_bios_encoder_data *devdata, +enum port port);bool intel_ddi_get_hw_state (struct intel_encoder *encoder,enum pipe *pipe);void intel_ddi_enable_transcoder_func (struct intel_encoder *encoder,const struct intel_crtc_state *crtc_state);void intel_ddi_disable_transcoder_func (const struct intel_crtc_state *crtc_state);
drivers/gpu/drm/i915/display/intel_display.c +5 -14
@@ -55,9 +55,8 @@#include "i915_reg.h" #include "i915_utils.h" #include "i9xx_plane.h" #include "i9xx_wm.h" -#include "icl_dsi.h" #include "intel_acpi.h" #include "intel_atomic.h" #include "intel_atomic_plane.h" #include "intel_audio.h"
@@ -7813,17 +7812,9 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)if (!HAS_DISPLAY (dev_priv))return ;if (DISPLAY_VER (dev_priv) >=9 ) { -enum port port; - -for_each_port_masked (port,RUNTIME_INFO (dev_priv)->port_mask) -intel_ddi_init (dev_priv, port); - -/* FIXME do something about DSI */ -if (IS_ALDERLAKE_P (dev_priv) ||IS_TIGERLAKE (dev_priv) || -DISPLAY_VER (dev_priv) ==11 ) -icl_dsi_init (dev_priv); +intel_bios_for_each_encoder (dev_priv, intel_ddi_init);if (IS_GEMINILAKE (dev_priv) ||IS_BROXTON (dev_priv))vlv_dsi_init (dev_priv); }else if (HAS_DDI (dev_priv)) {
@@ -7834,17 +7825,17 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)/* Haswell uses DDI functions to detect digital outputs. */ found =intel_de_read (dev_priv,DDI_BUF_CTL (PORT_A )) &DDI_INIT_DISPLAY_DETECTED ;if (found) -intel_ddi_init (dev_priv,PORT_A ); +intel_ddi_init (dev_priv,NULL ,PORT_A ); found =intel_de_read (dev_priv,SFUSE_STRAP );if (found &SFUSE_STRAP_DDIB_DETECTED ) -intel_ddi_init (dev_priv,PORT_B ); +intel_ddi_init (dev_priv,NULL ,PORT_B );if (found &SFUSE_STRAP_DDIC_DETECTED ) -intel_ddi_init (dev_priv,PORT_C ); +intel_ddi_init (dev_priv,NULL ,PORT_C );if (found &SFUSE_STRAP_DDID_DETECTED ) -intel_ddi_init (dev_priv,PORT_D ); +intel_ddi_init (dev_priv,NULL ,PORT_D ); }else if (HAS_PCH_SPLIT (dev_priv)) {int found;/*
drivers/gpu/drm/i915/display/intel_display_core.h +0 -2
@@ -33,9 +33,8 @@ struct drm_property_blob;struct i915_audio_component ;struct i915_hdcp_comp_master ;struct intel_atomic_state ;struct intel_audio_funcs ; -struct intel_bios_encoder_data ;struct intel_cdclk_funcs ;struct intel_cdclk_vals ;struct intel_color_funcs ;struct intel_crtc ;
@@ -206,9 +205,8 @@ struct intel_vbt_data {struct list_head display_devices;struct list_head bdb_blocks; -struct intel_bios_encoder_data *ports[I915_MAX_PORTS ];/* Non-NULL if port present. */ struct sdvo_device_mapping {u8 initialized;u8 dvo_port;u8 slave_addr;
Signature · 1 line
2.39.2
PATCH 17/17 drm/i915: Convert HSW/BDW to use VBT driven DDI probe
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Make HSW/BDW use the new VBT child device driven output probing as well. To achieve that the strap checks are moved into intel_ddi_init() itself.
I have one HSW ULT laptop here which declares all the ports A-D in the VBT, so in order to avoid assert_port_valid() tripping on DDI D (which is not present on ULT/ULX) I kept the strap check as the first thing we do. Thought arguably this particular machine is an internal development device so not something any real user should have. But I suppose it's possible that real consumer systems also had similar VBTs in this era.
--- drivers/gpu/drm/i915/display/intel_ddi.c | 37 +++++++++++++++++--- drivers/gpu/drm/i915/display/intel_display.c | 17 +-------- 2 files changed, 34 insertions(+), 20 deletions(-)
drivers/gpu/drm/i915/display/intel_ddi.c +33 -4
@@ -4277,8 +4277,29 @@ static bool port_in_use(struct drm_i915_private *i915, enum port port)return false; } +static bool port_strap_detected (struct drm_i915_private *i915,enum port port) +{ +/* straps not used on skl+ */ +if (DISPLAY_VER (i915) >=9 ) +return true; + +switch (port) { +case PORT_A : +return intel_de_read (i915,DDI_BUF_CTL (PORT_A )) &DDI_INIT_DISPLAY_DETECTED ; +case PORT_B : +return intel_de_read (i915,SFUSE_STRAP ) &SFUSE_STRAP_DDIB_DETECTED ; +case PORT_C : +return intel_de_read (i915,SFUSE_STRAP ) &SFUSE_STRAP_DDIC_DETECTED ; +case PORT_D : +return intel_de_read (i915,SFUSE_STRAP ) &SFUSE_STRAP_DDID_DETECTED ; +default : +MISSING_CASE (port); +return false; + } +} +void intel_ddi_init (struct drm_i915_private *dev_priv,struct intel_bios_encoder_data *devdata,enum port port) {
@@ -4286,8 +4307,20 @@ void intel_ddi_init(struct drm_i915_private *dev_priv,struct intel_encoder *encoder;bool init_hdmi, init_dp;enum phy phy =intel_port_to_phy (dev_priv, port); +/* +* On some HSW ULT systems the VBT has been observed +* to advertise DDI D, even though it does not exist on +* the platform. Check the strap first to avoid tripping +* assert_port_valid(). +*/ +if (!port_strap_detected (dev_priv, port)) { +drm_dbg_kms (&dev_priv->drm, +"Port %c strap not detected\n" ,port_name (port)); +return ; + } +if (!assert_port_valid (dev_priv, port))return ;if (port_in_use (dev_priv, port)) {
@@ -4295,12 +4328,8 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, "Port %c already claimed\n", port_name(port));return ; } -/* FIXME convert HSW/BDW */ -if (!devdata) - devdata =intel_bios_encoder_data_lookup (dev_priv, port); -intel_bios_encoder_sanitize (devdata, port);if (intel_bios_encoder_supports_dsi (devdata)) {/* BXT/GLK handled elsewhere, for now at least */
drivers/gpu/drm/i915/display/intel_display.c +1 -16
@@ -7811,31 +7811,16 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)if (!HAS_DISPLAY (dev_priv))return ; -if (DISPLAY_VER (dev_priv) >=9 ) { +if (HAS_DDI (dev_priv)) {intel_bios_for_each_encoder (dev_priv, intel_ddi_init);if (IS_GEMINILAKE (dev_priv) ||IS_BROXTON (dev_priv))vlv_dsi_init (dev_priv); - }else if (HAS_DDI (dev_priv)) { -u32 found;if (intel_ddi_crt_present (dev_priv))intel_crt_init (dev_priv); - -/* Haswell uses DDI functions to detect digital outputs. */ - found =intel_de_read (dev_priv,DDI_BUF_CTL (PORT_A )) &DDI_INIT_DISPLAY_DETECTED ; -if (found) -intel_ddi_init (dev_priv,NULL ,PORT_A ); - - found =intel_de_read (dev_priv,SFUSE_STRAP ); -if (found &SFUSE_STRAP_DDIB_DETECTED ) -intel_ddi_init (dev_priv,NULL ,PORT_B ); -if (found &SFUSE_STRAP_DDIC_DETECTED ) -intel_ddi_init (dev_priv,NULL ,PORT_C ); -if (found &SFUSE_STRAP_DDID_DETECTED ) -intel_ddi_init (dev_priv,NULL ,PORT_D ); }else if (HAS_PCH_SPLIT (dev_priv)) {int found;/*
Signature · 1 line
2.39.2
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Init DDI ports in VBT order
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm/i915: Init DDI ports in VBT order
URL : https://patchwork.freedesktop.org/series/114200/
State : warning
== Summary ==
Error: dim checkpatch failed782a06c663af drm/i915: Populate dig_port->connected() before connector init -:59: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #59: FILE: drivers/gpu/drm/i915/display/intel_ddi.c:4538:
+ * case we have some really bad VBTs... */
total: 0 errors, 1 warnings, 0 checks, 46 lines checked948c7ff341e9 drm/i915: Get rid of the gm45 HPD live state nonsensebaed564d362e drm/i915: Introduce <platoform>_hotplug_mask()09b3eea3a52c drm/i915: Introduce intel_hpd_detection()32fb2eef5ab4 drm/i915: Check HPD live state during eDP probe
-:51: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 41e35ffb380b ("drm/i915: Favor last VBT child device with conflicting AUX ch/DDC pin")' #51:
Also the systems (Asrock B250M-HDV at least) fixed by commit
total: 1 errors, 0 warnings, 0 checks, 46 lines checked 746e0b0b5c42 drm/i915: Sanitize child devices later 639fab668b6c drm/i915: Split map_aux_ch() into per-platform arrays 8205eee1779d drm/i915: Flip VBT DDC pin maps around 7bb73ce45b0f drm/i915: Nuke intel_bios_is_port_dp_dual_mode() 71c495397bf2 drm/i915: Remove bogus DDI-F from hsw/bdw output init 4a2e1cf807aa drm/i915: Introduce device info port_mask -:101: WARNING:LONG_LINE: line length of 127 exceeds 100 columns #101: FILE: drivers/gpu/drm/i915/i915_pci.c:398:
+ .__runtime.port_mask = BIT(PORT_A) | BIT(PORT_B) | BIT(PORT_C) | BIT(PORT_D), /* DP A, SDVO/HDMI/DP B, HDMI/DP C/D */ \
-:109: WARNING:LONG_LINE: line length of 127 exceeds 100 columns #109: FILE: drivers/gpu/drm/i915/i915_pci.c:430:
+ .__runtime.port_mask = BIT(PORT_A) | BIT(PORT_B) | BIT(PORT_C) | BIT(PORT_D), /* DP A, SDVO/HDMI/DP B, HDMI/DP C/D */ \
-:117: WARNING:LONG_LINE: line length of 127 exceeds 100 columns #117: FILE: drivers/gpu/drm/i915/i915_pci.c:484:
+ .__runtime.port_mask = BIT(PORT_A) | BIT(PORT_B) | BIT(PORT_C) | BIT(PORT_D), /* DP A, SDVO/HDMI/DP B, HDMI/DP C/D */ \
-:133: WARNING:LONG_LINE: line length of 101 exceeds 100 columns #133: FILE: drivers/gpu/drm/i915/i915_pci.c:575:
+ .__runtime.port_mask = BIT(PORT_A) | BIT(PORT_B) | BIT(PORT_C) | BIT(PORT_D) | BIT(PORT_E), \
-:182: WARNING:LONG_LINE: line length of 110 exceeds 100 columns #182: FILE: drivers/gpu/drm/i915/i915_pci.c:919:
+ BIT(PORT_TC1) | BIT(PORT_TC2) | BIT(PORT_TC3) | BIT(PORT_TC4) | BIT(PORT_TC5) | BIT(PORT_TC5),
total: 0 errors, 5 warnings, 0 checks, 213 lines checkedeb6b79faec3c drm/i915: Assert that device info bitmasks have enough bits e044a16d9a0d drm/i915: Assert that the port being initialized is valid cc5ccfb164ac drm/i915: Beef up SDVO/HDMI port checks09b82754731e drm/i915: Init DDI outputs based on port_mask on skl+ cc3e68d8a608 drm/i915: Try to initialize DDI/ICL+ DSI ports for every VBT child device -:174: ERROR:OPEN_BRACE: that open brace { should be on the previous line #174: FILE: drivers/gpu/drm/i915/display/intel_bios.c:3726:
+void intel_bios_for_each_encoder(struct drm_i915_private *i915,
+ void (*func)(struct drm_i915_private *i915,
+ struct intel_bios_encoder_data *devdata,
+ enum port port))
+{
total: 1 errors, 0 warnings, 0 checks, 326 lines checked 6f4e30e6bcc4 drm/i915: Convert HSW/BDW to use VBT driven DDI probe
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: Init DDI ports in VBT order
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm/i915: Init DDI ports in VBT order
URL : https://patchwork.freedesktop.org/series/114200/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_12763 -> Patchwork_114200v1
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_114200v1 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_114200v1, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_114200v1/index.html
Participating hosts (37 -> 35)
------------------------------
Missing (2): fi-snb-2520m bat-adlp-6
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_114200v1:
### IGT changes ###
#### Possible regressions ####
* igt@i915_module_load@load:
- fi-skl-6600u: [PASS][1] -> [ABORT][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12763/fi-skl-6600u/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_114200v1/fi-skl-6600u/igt@[email protected]
Known issues
------------
Here are the changes found in Patchwork_114200v1 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live@slpc:
- bat-rpls-1: NOTRUN -> [DMESG-FAIL][3] ([i915#6367])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_114200v1/bat-rpls-1/igt@i915_selftest@[email protected]
- bat-rplp-1: [PASS][4] -> [DMESG-FAIL][5] ([i915#6367] / [i915#7913])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12763/bat-rplp-1/igt@i915_selftest@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_114200v1/bat-rplp-1/igt@i915_selftest@[email protected]
* igt@kms_chamelium_hpd@common-hpd-after-suspend:
- bat-rpls-1: NOTRUN -> [SKIP][6] ([i915#7828])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_114200v1/bat-rpls-1/igt@[email protected]
* igt@kms_pipe_crc_basic@suspend-read-crc:
- bat-rpls-1: NOTRUN -> [SKIP][7] ([i915#1845])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_114200v1/bat-rpls-1/igt@[email protected]
#### Possible fixes ####
* igt@i915_selftest@live@reset:
- bat-rpls-1: [ABORT][8] ([i915#4983] / [i915#7981]) -> [PASS][9]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12763/bat-rpls-1/igt@i915_selftest@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_114200v1/bat-rpls-1/igt@i915_selftest@[email protected]
[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7981]: https://gitlab.freedesktop.org/drm/intel/issues/7981
Build changes
-------------
* Linux: CI_DRM_12763 -> Patchwork_114200v1
CI-20190529: 20190529
CI_DRM_12763: 205c062ab01e006382e54e699678a50463ffe438 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7167: fdaac15d525635c9ce8cdba4dac55550553f1a65 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_114200v1: 205c062ab01e006382e54e699678a50463ffe438 @ git://anongit.freedesktop.org/gfx-ci/linux
### Linux commits
1da8081491d4 drm/i915: Convert HSW/BDW to use VBT driven DDI probe b04f6cda7dcf drm/i915: Try to initialize DDI/ICL+ DSI ports for every VBT child device e9d7263826dc drm/i915: Init DDI outputs based on port_mask on skl+ cf6beb372d65 drm/i915: Beef up SDVO/HDMI port checksd19765d0c3bf drm/i915: Assert that the port being initialized is valid 86acbd5ec2aa drm/i915: Assert that device info bitmasks have enough bits 1c89c635e1cc drm/i915: Introduce device info port_mask3a66e626dda0 drm/i915: Remove bogus DDI-F from hsw/bdw output init 7f52ed831005 drm/i915: Nuke intel_bios_is_port_dp_dual_mode() a2e1b5bbc40d drm/i915: Flip VBT DDC pin maps aroundee4ab5800b8e drm/i915: Split map_aux_ch() into per-platform arrays cec1f6cc3c3f drm/i915: Sanitize child devices later017f630a4108 drm/i915: Check HPD live state during eDP probe f84c17596e72 drm/i915: Introduce intel_hpd_detection()a9fab0e7712b drm/i915: Introduce <platoform>_hotplug_mask()2e9fc6575702 drm/i915: Get rid of the gm45 HPD live state nonsense b49bbdf3b3fe drm/i915: Populate dig_port->connected() before connector init
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_114200v1/index.html