From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v3 03/22] drm/i915: Get rid of the gm45 HPD live state nonsense
Date: Tue, 28 Feb 2023 20:19:33 +0200 [thread overview]
Message-ID: <875ybly7nu.fsf@intel.com> (raw)
In-Reply-To: <20230221230227.6244-4-ville.syrjala@linux.intel.com>
On Wed, 22 Feb 2023, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> 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): 0x00000000
>
> So the enable bit and live state bit always match 1:1.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
I'll take your word for it.
Acked-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/display/g4x_dp.c | 28 +--------------------------
> drivers/gpu/drm/i915/i915_reg.h | 13 +------------
> 2 files changed, 2 insertions(+), 39 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/g4x_dp.c b/drivers/gpu/drm/i915/display/g4x_dp.c
> index a50ad0fff57c..920d570f7594 100644
> --- a/drivers/gpu/drm/i915/display/g4x_dp.c
> +++ b/drivers/gpu/drm/i915/display/g4x_dp.c
> @@ -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
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index c1efa655fb68..de58695ad1c0 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -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)
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2023-02-28 18:19 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-21 23:02 [Intel-gfx] [PATCH v3 00/22] drm/i915: Init DDI ports in VBT order Ville Syrjala
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 01/22] drm/i915: Populate dig_port->connected() before connector init Ville Syrjala
2023-02-28 17:58 ` Jani Nikula
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 02/22] drm/i915: Fix SKL DDI A digital port .connected() Ville Syrjala
2023-02-28 18:18 ` Jani Nikula
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 03/22] drm/i915: Get rid of the gm45 HPD live state nonsense Ville Syrjala
2023-02-28 18:19 ` Jani Nikula [this message]
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 04/22] drm/i915: Introduce <platoform>_hotplug_mask() Ville Syrjala
2023-02-28 18:36 ` Jani Nikula
2023-02-28 19:52 ` Ville Syrjälä
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 05/22] drm/i915: Introduce intel_hpd_detection() Ville Syrjala
2023-02-28 12:40 ` Jani Nikula
2023-02-28 12:50 ` Ville Syrjälä
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 06/22] drm/i915: Check HPD live state during eDP probe Ville Syrjala
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 07/22] drm/i915: Sanitize child devices later Ville Syrjala
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 08/22] drm/i915: Split map_aux_ch() into per-platform arrays Ville Syrjala
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 09/22] drm/i915: Flip VBT DDC pin maps around Ville Syrjala
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 10/22] drm/i915: Nuke intel_bios_is_port_dp_dual_mode() Ville Syrjala
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 11/22] drm/i915: Remove bogus DDI-F from hsw/bdw output init Ville Syrjala
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 12/22] drm/i915: Introduce device info port_mask Ville Syrjala
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 13/22] drm/i915: Assert that device info bitmasks have enough bits Ville Syrjala
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 14/22] drm/i915: Assert that the port being initialized is valid Ville Syrjala
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 15/22] drm/i915: Beef up SDVO/HDMI port checks Ville Syrjala
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 16/22] drm/i915: Init DDI outputs based on port_mask on skl+ Ville Syrjala
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 17/22] drm/i915: Try to initialize DDI/ICL+ DSI ports for every VBT child device Ville Syrjala
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 18/22] drm/i915: Convert HSW/BDW to use VBT driven DDI probe Ville Syrjala
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 19/22] drm/i915: Remove DDC pin sanitation Ville Syrjala
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 20/22] drm/i915: Remove AUX CH sanitation Ville Syrjala
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 21/22] drm/i915: Initialize dig_port->aux_ch to NONE to be sure Ville Syrjala
2023-02-21 23:02 ` [Intel-gfx] [PATCH v3 22/22] drm/i915: Only populate aux_ch is really needed Ville Syrjala
2023-02-21 23:35 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Init DDI ports in VBT order (rev3) Patchwork
2023-02-22 3:04 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-02-22 5:11 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-02-22 15:50 ` [Intel-gfx] [PATCH v3 00/22] drm/i915: Init DDI ports in VBT order Ville Syrjälä
2023-05-26 4:48 ` Kai-Heng Feng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875ybly7nu.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.