* [PATCH v2] drm/i915: Re-init lspcon after HPD if lspcon probe failed
@ 2019-12-23 17:13 Kai-Heng Feng
2019-12-23 17:36 ` Jani Nikula
0 siblings, 1 reply; 3+ messages in thread
From: Kai-Heng Feng @ 2019-12-23 17:13 UTC (permalink / raw)
To: jani.nikula, joonas.lahtinen, rodrigo.vivi, airlied, daniel
Cc: ville.syrjala, swati2.sharma, intel-gfx, dri-devel, linux-kernel,
Kai-Heng Feng
On HP 800 G4 DM, if HDMI cable isn't plugged before boot, the HDMI port
becomes useless and never responds to cable hotplugging:
[ 3.031904] [drm:lspcon_init [i915]] *ERROR* Failed to probe lspcon
[ 3.031945] [drm:intel_ddi_init [i915]] *ERROR* LSPCON init failed on port D
Seems like the lspcon chip on the system in question only gets powered
after the cable is plugged.
So let's call lspcon_init() dynamically to properly initialize the
lspcon chip and make HDMI port work.
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
v2:
- Move lspcon_init() inside of intel_dp_hpd_pulse().
drivers/gpu/drm/i915/display/intel_dp.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index fe31bbfd6c62..eb395b45527e 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -6573,6 +6573,7 @@ enum irqreturn
intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
{
struct intel_dp *intel_dp = &intel_dig_port->dp;
+ struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
if (long_hpd && intel_dig_port->base.type == INTEL_OUTPUT_EDP) {
/*
@@ -6592,11 +6593,14 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
intel_dig_port->base.base.name,
long_hpd ? "long" : "short");
- if (long_hpd) {
+ if (long_hpd && intel_dig_port->base.type != INTEL_OUTPUT_DDI) {
intel_dp->reset_link_params = true;
return IRQ_NONE;
}
+ if (long_hpd && HAS_LSPCON(dev_priv) && !intel_dig_port->lspcon.active)
+ lspcon_init(intel_dig_port);
+
if (intel_dp->is_mst) {
if (intel_dp_check_mst_status(intel_dp) == -EINVAL) {
/*
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] drm/i915: Re-init lspcon after HPD if lspcon probe failed
2019-12-23 17:13 [PATCH v2] drm/i915: Re-init lspcon after HPD if lspcon probe failed Kai-Heng Feng
@ 2019-12-23 17:36 ` Jani Nikula
2019-12-23 17:53 ` Kai-Heng Feng
0 siblings, 1 reply; 3+ messages in thread
From: Jani Nikula @ 2019-12-23 17:36 UTC (permalink / raw)
To: Kai-Heng Feng, joonas.lahtinen, rodrigo.vivi, airlied, daniel
Cc: ville.syrjala, swati2.sharma, intel-gfx, dri-devel, linux-kernel,
Kai-Heng Feng
On Tue, 24 Dec 2019, Kai-Heng Feng <kai.heng.feng@canonical.com> wrote:
> On HP 800 G4 DM, if HDMI cable isn't plugged before boot, the HDMI port
> becomes useless and never responds to cable hotplugging:
> [ 3.031904] [drm:lspcon_init [i915]] *ERROR* Failed to probe lspcon
> [ 3.031945] [drm:intel_ddi_init [i915]] *ERROR* LSPCON init failed on port D
>
> Seems like the lspcon chip on the system in question only gets powered
> after the cable is plugged.
>
> So let's call lspcon_init() dynamically to properly initialize the
> lspcon chip and make HDMI port work.
>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
> v2:
> - Move lspcon_init() inside of intel_dp_hpd_pulse().
>
> drivers/gpu/drm/i915/display/intel_dp.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index fe31bbfd6c62..eb395b45527e 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -6573,6 +6573,7 @@ enum irqreturn
> intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
> {
> struct intel_dp *intel_dp = &intel_dig_port->dp;
> + struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
>
> if (long_hpd && intel_dig_port->base.type == INTEL_OUTPUT_EDP) {
> /*
> @@ -6592,11 +6593,14 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
> intel_dig_port->base.base.name,
> long_hpd ? "long" : "short");
>
> - if (long_hpd) {
> + if (long_hpd && intel_dig_port->base.type != INTEL_OUTPUT_DDI) {
With this change, long hpd handling for DDI on platforms that do not
have LSPCON, or has an active LSPCON, falls through to the short hpd
handling. That's not what you're after, is it?
BR,
Jani.
> intel_dp->reset_link_params = true;
> return IRQ_NONE;
> }
>
> + if (long_hpd && HAS_LSPCON(dev_priv) && !intel_dig_port->lspcon.active)
> + lspcon_init(intel_dig_port);
> +
> if (intel_dp->is_mst) {
> if (intel_dp_check_mst_status(intel_dp) == -EINVAL) {
> /*
--
Jani Nikula, Intel Open Source Graphics Center
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] drm/i915: Re-init lspcon after HPD if lspcon probe failed
2019-12-23 17:36 ` Jani Nikula
@ 2019-12-23 17:53 ` Kai-Heng Feng
0 siblings, 0 replies; 3+ messages in thread
From: Kai-Heng Feng @ 2019-12-23 17:53 UTC (permalink / raw)
To: Jani Nikula
Cc: joonas.lahtinen, rodrigo.vivi, airlied, daniel, ville.syrjala,
swati2.sharma, intel-gfx, dri-devel, linux-kernel
> On Dec 24, 2019, at 01:36, Jani Nikula <jani.nikula@linux.intel.com> wrote:
>
> On Tue, 24 Dec 2019, Kai-Heng Feng <kai.heng.feng@canonical.com> wrote:
>> On HP 800 G4 DM, if HDMI cable isn't plugged before boot, the HDMI port
>> becomes useless and never responds to cable hotplugging:
>> [ 3.031904] [drm:lspcon_init [i915]] *ERROR* Failed to probe lspcon
>> [ 3.031945] [drm:intel_ddi_init [i915]] *ERROR* LSPCON init failed on port D
>>
>> Seems like the lspcon chip on the system in question only gets powered
>> after the cable is plugged.
>>
>> So let's call lspcon_init() dynamically to properly initialize the
>> lspcon chip and make HDMI port work.
>>
>> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
>> ---
>> v2:
>> - Move lspcon_init() inside of intel_dp_hpd_pulse().
>>
>> drivers/gpu/drm/i915/display/intel_dp.c | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
>> index fe31bbfd6c62..eb395b45527e 100644
>> --- a/drivers/gpu/drm/i915/display/intel_dp.c
>> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
>> @@ -6573,6 +6573,7 @@ enum irqreturn
>> intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
>> {
>> struct intel_dp *intel_dp = &intel_dig_port->dp;
>> + struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
>>
>> if (long_hpd && intel_dig_port->base.type == INTEL_OUTPUT_EDP) {
>> /*
>> @@ -6592,11 +6593,14 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
>> intel_dig_port->base.base.name,
>> long_hpd ? "long" : "short");
>>
>> - if (long_hpd) {
>> + if (long_hpd && intel_dig_port->base.type != INTEL_OUTPUT_DDI) {
>
> With this change, long hpd handling for DDI on platforms that do not
> have LSPCON, or has an active LSPCON, falls through to the short hpd
> handling. That's not what you're after, is it?
You are right, no :(
I'll send a V3.
Kai-Heng
>
>
> BR,
> Jani.
>
>
>> intel_dp->reset_link_params = true;
>> return IRQ_NONE;
>> }
>>
>> + if (long_hpd && HAS_LSPCON(dev_priv) && !intel_dig_port->lspcon.active)
>> + lspcon_init(intel_dig_port);
>> +
>> if (intel_dp->is_mst) {
>> if (intel_dp_check_mst_status(intel_dp) == -EINVAL) {
>> /*
>
> --
> Jani Nikula, Intel Open Source Graphics Center
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-12-23 17:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-23 17:13 [PATCH v2] drm/i915: Re-init lspcon after HPD if lspcon probe failed Kai-Heng Feng
2019-12-23 17:36 ` Jani Nikula
2019-12-23 17:53 ` Kai-Heng Feng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox