* Re: [drm/i915/3.17] panic in i915_digport_work_func
@ 2014-09-01 7:02 ` Dave Airlie
0 siblings, 0 replies; 14+ messages in thread
From: Dave Airlie @ 2014-09-01 7:02 UTC (permalink / raw)
To: Mike Galbraith; +Cc: LKML, Daniel Vetter, Jani Nikula, intel-gfx, Dave Airlie
[-- Attachment #1: Type: text/plain, Size: 184 bytes --]
> drm/i915: add DP 1.2 MST support (v0.7)
>
> This adds DP 1.2 MST support on Haswell systems.
>
I've attached a patch that might fix this, please test and let me know.
Dave.
[-- Attachment #2: 0001-drm-i915-handle-G45-GM45-pulse-detection-connected-s.patch --]
[-- Type: text/x-patch, Size: 3664 bytes --]
From d407c946fbf5c48f30160591f5bd71fbe158aeb4 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Mon, 1 Sep 2014 16:58:12 +1000
Subject: [PATCH] drm/i915: handle G45/GM45 pulse detection connected state.
In the HPD pulse handler we check for long pulses if the port is actually
connected, however we do that for IBX, but we use the pulse handling code on
GM45 systems as well, so we need to use a diffent check.
This patch refactors the digital port connected check out of the g4x detection
path and reuses it in the hpd pulse path.
Should fix:
Message-ID: <1409382202.5141.36.camel@marge.simpson.net>
Reported-by: Mike Galbraith <umgwanakikbuti@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/drm/i915/intel_dp.c | 55 +++++++++++++++++++++++++++--------------
1 file changed, 37 insertions(+), 18 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 67cfed6..81d7681 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3661,24 +3661,12 @@ ironlake_dp_detect(struct intel_dp *intel_dp)
return intel_dp_detect_dpcd(intel_dp);
}
-static enum drm_connector_status
-g4x_dp_detect(struct intel_dp *intel_dp)
+static int g4x_digital_port_connected(struct drm_device *dev,
+ struct intel_digital_port *intel_dig_port)
{
- struct drm_device *dev = intel_dp_to_dev(intel_dp);
struct drm_i915_private *dev_priv = dev->dev_private;
- struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
uint32_t bit;
- /* Can't disconnect eDP, but you can close the lid... */
- if (is_edp(intel_dp)) {
- enum drm_connector_status status;
-
- status = intel_panel_detect(dev);
- if (status == connector_status_unknown)
- status = connector_status_connected;
- return status;
- }
-
if (IS_VALLEYVIEW(dev)) {
switch (intel_dig_port->port) {
case PORT_B:
@@ -3691,7 +3679,7 @@ g4x_dp_detect(struct intel_dp *intel_dp)
bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
break;
default:
- return connector_status_unknown;
+ return -EINVAL;
}
} else {
switch (intel_dig_port->port) {
@@ -3705,11 +3693,36 @@ g4x_dp_detect(struct intel_dp *intel_dp)
bit = PORTD_HOTPLUG_LIVE_STATUS_G4X;
break;
default:
- return connector_status_unknown;
+ return -EINVAL;
}
}
if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)
+ return 0;
+ return 1;
+}
+
+static enum drm_connector_status
+g4x_dp_detect(struct intel_dp *intel_dp)
+{
+ struct drm_device *dev = intel_dp_to_dev(intel_dp);
+ struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
+ int ret;
+
+ /* Can't disconnect eDP, but you can close the lid... */
+ if (is_edp(intel_dp)) {
+ enum drm_connector_status status;
+
+ status = intel_panel_detect(dev);
+ if (status == connector_status_unknown)
+ status = connector_status_connected;
+ return status;
+ }
+
+ ret = g4x_digital_port_connected(dev, intel_dig_port);
+ if (ret == -EINVAL)
+ return connector_status_unknown;
+ else if (ret == 0)
return connector_status_disconnected;
return intel_dp_detect_dpcd(intel_dp);
@@ -4066,8 +4079,14 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
intel_display_power_get(dev_priv, power_domain);
if (long_hpd) {
- if (!ibx_digital_port_connected(dev_priv, intel_dig_port))
- goto mst_fail;
+
+ if (HAS_PCH_SPLIT(dev)) {
+ if (!ibx_digital_port_connected(dev_priv, intel_dig_port))
+ goto mst_fail;
+ } else {
+ if (g4x_digital_port_connected(dev, intel_dig_port) != 1)
+ goto mst_fail;
+ }
if (!intel_dp_get_dpcd(intel_dp)) {
goto mst_fail;
--
1.9.3
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [drm/i915/3.17] panic in i915_digport_work_func
2014-09-01 7:02 ` Dave Airlie
@ 2014-09-01 7:52 ` Mike Galbraith
-1 siblings, 0 replies; 14+ messages in thread
From: Mike Galbraith @ 2014-09-01 7:52 UTC (permalink / raw)
To: Dave Airlie; +Cc: Daniel Vetter, intel-gfx, LKML, Dave Airlie
On Mon, 2014-09-01 at 17:02 +1000, Dave Airlie wrote:
> > drm/i915: add DP 1.2 MST support (v0.7)
> >
> > This adds DP 1.2 MST support on Haswell systems.
> >
> I've attached a patch that might fix this, please test and let me know.
Lappy hasn't exploded in 20 boot cycles, which judging by previous
behavior should mean all is well (knocks anti-deterministic wood).
Thanks.
-Mike
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [drm/i915/3.17] panic in i915_digport_work_func
@ 2014-09-01 7:52 ` Mike Galbraith
0 siblings, 0 replies; 14+ messages in thread
From: Mike Galbraith @ 2014-09-01 7:52 UTC (permalink / raw)
To: Dave Airlie; +Cc: LKML, Daniel Vetter, Jani Nikula, intel-gfx, Dave Airlie
On Mon, 2014-09-01 at 17:02 +1000, Dave Airlie wrote:
> > drm/i915: add DP 1.2 MST support (v0.7)
> >
> > This adds DP 1.2 MST support on Haswell systems.
> >
> I've attached a patch that might fix this, please test and let me know.
Lappy hasn't exploded in 20 boot cycles, which judging by previous
behavior should mean all is well (knocks anti-deterministic wood).
Thanks.
-Mike
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [drm/i915/3.17] panic in i915_digport_work_func
2014-09-01 7:02 ` Dave Airlie
@ 2014-09-01 9:14 ` Daniel Vetter
-1 siblings, 0 replies; 14+ messages in thread
From: Daniel Vetter @ 2014-09-01 9:14 UTC (permalink / raw)
To: Dave Airlie; +Cc: Daniel Vetter, intel-gfx, LKML, Mike Galbraith, Dave Airlie
On Mon, Sep 01, 2014 at 05:02:51PM +1000, Dave Airlie wrote:
> > drm/i915: add DP 1.2 MST support (v0.7)
> >
> > This adds DP 1.2 MST support on Haswell systems.
> >
> I've attached a patch that might fix this, please test and let me know.
>
> Dave.
> From d407c946fbf5c48f30160591f5bd71fbe158aeb4 Mon Sep 17 00:00:00 2001
> From: Dave Airlie <airlied@redhat.com>
> Date: Mon, 1 Sep 2014 16:58:12 +1000
> Subject: [PATCH] drm/i915: handle G45/GM45 pulse detection connected state.
>
> In the HPD pulse handler we check for long pulses if the port is actually
> connected, however we do that for IBX, but we use the pulse handling code on
> GM45 systems as well, so we need to use a diffent check.
>
> This patch refactors the digital port connected check out of the g4x detection
> path and reuses it in the hpd pulse path.
>
> Should fix:
> Message-ID: <1409382202.5141.36.camel@marge.simpson.net>
>
> Reported-by: Mike Galbraith <umgwanakikbuti@gmail.com>
> Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/i915/intel_dp.c | 55 +++++++++++++++++++++++++++--------------
> 1 file changed, 37 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 67cfed6..81d7681 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -3661,24 +3661,12 @@ ironlake_dp_detect(struct intel_dp *intel_dp)
> return intel_dp_detect_dpcd(intel_dp);
> }
>
> -static enum drm_connector_status
> -g4x_dp_detect(struct intel_dp *intel_dp)
> +static int g4x_digital_port_connected(struct drm_device *dev,
> + struct intel_digital_port *intel_dig_port)
> {
> - struct drm_device *dev = intel_dp_to_dev(intel_dp);
> struct drm_i915_private *dev_priv = dev->dev_private;
> - struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
> uint32_t bit;
>
> - /* Can't disconnect eDP, but you can close the lid... */
> - if (is_edp(intel_dp)) {
> - enum drm_connector_status status;
> -
> - status = intel_panel_detect(dev);
> - if (status == connector_status_unknown)
> - status = connector_status_connected;
> - return status;
> - }
> -
> if (IS_VALLEYVIEW(dev)) {
> switch (intel_dig_port->port) {
> case PORT_B:
> @@ -3691,7 +3679,7 @@ g4x_dp_detect(struct intel_dp *intel_dp)
> bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
> break;
> default:
> - return connector_status_unknown;
> + return -EINVAL;
> }
> } else {
> switch (intel_dig_port->port) {
> @@ -3705,11 +3693,36 @@ g4x_dp_detect(struct intel_dp *intel_dp)
> bit = PORTD_HOTPLUG_LIVE_STATUS_G4X;
> break;
> default:
> - return connector_status_unknown;
> + return -EINVAL;
> }
> }
>
> if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)
> + return 0;
> + return 1;
> +}
> +
> +static enum drm_connector_status
> +g4x_dp_detect(struct intel_dp *intel_dp)
> +{
> + struct drm_device *dev = intel_dp_to_dev(intel_dp);
> + struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
> + int ret;
> +
> + /* Can't disconnect eDP, but you can close the lid... */
> + if (is_edp(intel_dp)) {
> + enum drm_connector_status status;
> +
> + status = intel_panel_detect(dev);
> + if (status == connector_status_unknown)
> + status = connector_status_connected;
> + return status;
> + }
> +
> + ret = g4x_digital_port_connected(dev, intel_dig_port);
> + if (ret == -EINVAL)
> + return connector_status_unknown;
> + else if (ret == 0)
> return connector_status_disconnected;
>
> return intel_dp_detect_dpcd(intel_dp);
> @@ -4066,8 +4079,14 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
> intel_display_power_get(dev_priv, power_domain);
>
> if (long_hpd) {
> - if (!ibx_digital_port_connected(dev_priv, intel_dig_port))
> - goto mst_fail;
> +
> + if (HAS_PCH_SPLIT(dev)) {
> + if (!ibx_digital_port_connected(dev_priv, intel_dig_port))
> + goto mst_fail;
> + } else {
> + if (g4x_digital_port_connected(dev, intel_dig_port) != 1)
> + goto mst_fail;
> + }
>
> if (!intel_dp_get_dpcd(intel_dp)) {
> goto mst_fail;
> --
> 1.9.3
>
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [drm/i915/3.17] panic in i915_digport_work_func
@ 2014-09-01 9:14 ` Daniel Vetter
0 siblings, 0 replies; 14+ messages in thread
From: Daniel Vetter @ 2014-09-01 9:14 UTC (permalink / raw)
To: Dave Airlie
Cc: Mike Galbraith, LKML, Daniel Vetter, Jani Nikula, intel-gfx,
Dave Airlie
On Mon, Sep 01, 2014 at 05:02:51PM +1000, Dave Airlie wrote:
> > drm/i915: add DP 1.2 MST support (v0.7)
> >
> > This adds DP 1.2 MST support on Haswell systems.
> >
> I've attached a patch that might fix this, please test and let me know.
>
> Dave.
> From d407c946fbf5c48f30160591f5bd71fbe158aeb4 Mon Sep 17 00:00:00 2001
> From: Dave Airlie <airlied@redhat.com>
> Date: Mon, 1 Sep 2014 16:58:12 +1000
> Subject: [PATCH] drm/i915: handle G45/GM45 pulse detection connected state.
>
> In the HPD pulse handler we check for long pulses if the port is actually
> connected, however we do that for IBX, but we use the pulse handling code on
> GM45 systems as well, so we need to use a diffent check.
>
> This patch refactors the digital port connected check out of the g4x detection
> path and reuses it in the hpd pulse path.
>
> Should fix:
> Message-ID: <1409382202.5141.36.camel@marge.simpson.net>
>
> Reported-by: Mike Galbraith <umgwanakikbuti@gmail.com>
> Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/i915/intel_dp.c | 55 +++++++++++++++++++++++++++--------------
> 1 file changed, 37 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 67cfed6..81d7681 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -3661,24 +3661,12 @@ ironlake_dp_detect(struct intel_dp *intel_dp)
> return intel_dp_detect_dpcd(intel_dp);
> }
>
> -static enum drm_connector_status
> -g4x_dp_detect(struct intel_dp *intel_dp)
> +static int g4x_digital_port_connected(struct drm_device *dev,
> + struct intel_digital_port *intel_dig_port)
> {
> - struct drm_device *dev = intel_dp_to_dev(intel_dp);
> struct drm_i915_private *dev_priv = dev->dev_private;
> - struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
> uint32_t bit;
>
> - /* Can't disconnect eDP, but you can close the lid... */
> - if (is_edp(intel_dp)) {
> - enum drm_connector_status status;
> -
> - status = intel_panel_detect(dev);
> - if (status == connector_status_unknown)
> - status = connector_status_connected;
> - return status;
> - }
> -
> if (IS_VALLEYVIEW(dev)) {
> switch (intel_dig_port->port) {
> case PORT_B:
> @@ -3691,7 +3679,7 @@ g4x_dp_detect(struct intel_dp *intel_dp)
> bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
> break;
> default:
> - return connector_status_unknown;
> + return -EINVAL;
> }
> } else {
> switch (intel_dig_port->port) {
> @@ -3705,11 +3693,36 @@ g4x_dp_detect(struct intel_dp *intel_dp)
> bit = PORTD_HOTPLUG_LIVE_STATUS_G4X;
> break;
> default:
> - return connector_status_unknown;
> + return -EINVAL;
> }
> }
>
> if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)
> + return 0;
> + return 1;
> +}
> +
> +static enum drm_connector_status
> +g4x_dp_detect(struct intel_dp *intel_dp)
> +{
> + struct drm_device *dev = intel_dp_to_dev(intel_dp);
> + struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
> + int ret;
> +
> + /* Can't disconnect eDP, but you can close the lid... */
> + if (is_edp(intel_dp)) {
> + enum drm_connector_status status;
> +
> + status = intel_panel_detect(dev);
> + if (status == connector_status_unknown)
> + status = connector_status_connected;
> + return status;
> + }
> +
> + ret = g4x_digital_port_connected(dev, intel_dig_port);
> + if (ret == -EINVAL)
> + return connector_status_unknown;
> + else if (ret == 0)
> return connector_status_disconnected;
>
> return intel_dp_detect_dpcd(intel_dp);
> @@ -4066,8 +4079,14 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
> intel_display_power_get(dev_priv, power_domain);
>
> if (long_hpd) {
> - if (!ibx_digital_port_connected(dev_priv, intel_dig_port))
> - goto mst_fail;
> +
> + if (HAS_PCH_SPLIT(dev)) {
> + if (!ibx_digital_port_connected(dev_priv, intel_dig_port))
> + goto mst_fail;
> + } else {
> + if (g4x_digital_port_connected(dev, intel_dig_port) != 1)
> + goto mst_fail;
> + }
>
> if (!intel_dp_get_dpcd(intel_dp)) {
> goto mst_fail;
> --
> 1.9.3
>
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [drm/i915/3.17] panic in i915_digport_work_func
2014-09-01 9:14 ` Daniel Vetter
@ 2014-09-03 8:08 ` Jiri Kosina
-1 siblings, 0 replies; 14+ messages in thread
From: Jiri Kosina @ 2014-09-03 8:08 UTC (permalink / raw)
To: Daniel Vetter; +Cc: Daniel Vetter, intel-gfx, LKML, Mike Galbraith, Dave Airlie
On Mon, 1 Sep 2014, Daniel Vetter wrote:
> > From d407c946fbf5c48f30160591f5bd71fbe158aeb4 Mon Sep 17 00:00:00 2001
> > From: Dave Airlie <airlied@redhat.com>
> > Date: Mon, 1 Sep 2014 16:58:12 +1000
> > Subject: [PATCH] drm/i915: handle G45/GM45 pulse detection connected state.
> >
> > In the HPD pulse handler we check for long pulses if the port is actually
> > connected, however we do that for IBX, but we use the pulse handling code on
> > GM45 systems as well, so we need to use a diffent check.
> >
> > This patch refactors the digital port connected check out of the g4x detection
> > path and reuses it in the hpd pulse path.
> >
> > Should fix:
> > Message-ID: <1409382202.5141.36.camel@marge.simpson.net>
> >
> > Reported-by: Mike Galbraith <umgwanakikbuti@gmail.com>
> > Signed-off-by: Dave Airlie <airlied@redhat.com>
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
I was just about to start bisecting, as my thinkpad x200s with Gen4 chip
wouldn't ocassionally boot with -rc3, but this patch seems to be the cure
for me as well.
FWIW
Tested-by: Jiri Kosina <jkosina@suse.cz>
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [drm/i915/3.17] panic in i915_digport_work_func
@ 2014-09-03 8:08 ` Jiri Kosina
0 siblings, 0 replies; 14+ messages in thread
From: Jiri Kosina @ 2014-09-03 8:08 UTC (permalink / raw)
To: Daniel Vetter
Cc: Dave Airlie, Mike Galbraith, LKML, Daniel Vetter, Jani Nikula,
intel-gfx, Dave Airlie
On Mon, 1 Sep 2014, Daniel Vetter wrote:
> > From d407c946fbf5c48f30160591f5bd71fbe158aeb4 Mon Sep 17 00:00:00 2001
> > From: Dave Airlie <airlied@redhat.com>
> > Date: Mon, 1 Sep 2014 16:58:12 +1000
> > Subject: [PATCH] drm/i915: handle G45/GM45 pulse detection connected state.
> >
> > In the HPD pulse handler we check for long pulses if the port is actually
> > connected, however we do that for IBX, but we use the pulse handling code on
> > GM45 systems as well, so we need to use a diffent check.
> >
> > This patch refactors the digital port connected check out of the g4x detection
> > path and reuses it in the hpd pulse path.
> >
> > Should fix:
> > Message-ID: <1409382202.5141.36.camel@marge.simpson.net>
> >
> > Reported-by: Mike Galbraith <umgwanakikbuti@gmail.com>
> > Signed-off-by: Dave Airlie <airlied@redhat.com>
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
I was just about to start bisecting, as my thinkpad x200s with Gen4 chip
wouldn't ocassionally boot with -rc3, but this patch seems to be the cure
for me as well.
FWIW
Tested-by: Jiri Kosina <jkosina@suse.cz>
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [drm/i915/3.17] panic in i915_digport_work_func
2014-09-01 7:02 ` Dave Airlie
@ 2014-09-01 13:28 ` Imre Deak
-1 siblings, 0 replies; 14+ messages in thread
From: Imre Deak @ 2014-09-01 13:28 UTC (permalink / raw)
To: Dave Airlie
Cc: Nikula, Jani, Daniel Vetter, intel-gfx, LKML, Mike Galbraith,
Dave Airlie
[-- Attachment #1.1: Type: text/plain, Size: 5117 bytes --]
On Mon, 2014-09-01 at 17:02 +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied@redhat.com>
> Date: Mon, 1 Sep 2014 16:58:12 +1000
> Subject: [PATCH] drm/i915: handle G45/GM45 pulse detection connected
> state.
>
> In the HPD pulse handler we check for long pulses if the port is
> actually
> connected, however we do that for IBX, but we use the pulse handling
> code on
> GM45 systems as well, so we need to use a diffent check.
>
> This patch refactors the digital port connected check out of the g4x
> detection
> path and reuses it in the hpd pulse path.
>
> Should fix:
> Message-ID: <1409382202.5141.36.camel@marge.simpson.net>
>
> Reported-by: Mike Galbraith <umgwanakikbuti@gmail.com>
> Signed-off-by: Dave Airlie <airlied@redhat.com>
Daniel reviewed this already, but Jani asked me to take a look, so:
Acked-by: Imre Deak <imre.deak@intel.com>
One thing for the future is to move ibx_digital_port_connected() to
intel_dp.c too and make its return value match that of
g4x_digital_port_connected().
--Imre
> ---
> drivers/gpu/drm/i915/intel_dp.c | 55
> +++++++++++++++++++++++++++--------------
> 1 file changed, 37 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c
> b/drivers/gpu/drm/i915/intel_dp.c
> index 67cfed6..81d7681 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -3661,24 +3661,12 @@ ironlake_dp_detect(struct intel_dp *intel_dp)
> return intel_dp_detect_dpcd(intel_dp);
> }
>
> -static enum drm_connector_status
> -g4x_dp_detect(struct intel_dp *intel_dp)
> +static int g4x_digital_port_connected(struct drm_device *dev,
> + struct intel_digital_port
> *intel_dig_port)
> {
> - struct drm_device *dev = intel_dp_to_dev(intel_dp);
> struct drm_i915_private *dev_priv = dev->dev_private;
> - struct intel_digital_port *intel_dig_port =
> dp_to_dig_port(intel_dp);
> uint32_t bit;
>
> - /* Can't disconnect eDP, but you can close the lid... */
> - if (is_edp(intel_dp)) {
> - enum drm_connector_status status;
> -
> - status = intel_panel_detect(dev);
> - if (status == connector_status_unknown)
> - status = connector_status_connected;
> - return status;
> - }
> -
> if (IS_VALLEYVIEW(dev)) {
> switch (intel_dig_port->port) {
> case PORT_B:
> @@ -3691,7 +3679,7 @@ g4x_dp_detect(struct intel_dp *intel_dp)
> bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
> break;
> default:
> - return connector_status_unknown;
> + return -EINVAL;
> }
> } else {
> switch (intel_dig_port->port) {
> @@ -3705,11 +3693,36 @@ g4x_dp_detect(struct intel_dp *intel_dp)
> bit = PORTD_HOTPLUG_LIVE_STATUS_G4X;
> break;
> default:
> - return connector_status_unknown;
> + return -EINVAL;
> }
> }
>
> if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)
> + return 0;
> + return 1;
> +}
> +
> +static enum drm_connector_status
> +g4x_dp_detect(struct intel_dp *intel_dp)
> +{
> + struct drm_device *dev = intel_dp_to_dev(intel_dp);
> + struct intel_digital_port *intel_dig_port =
> dp_to_dig_port(intel_dp);
> + int ret;
> +
> + /* Can't disconnect eDP, but you can close the lid... */
> + if (is_edp(intel_dp)) {
> + enum drm_connector_status status;
> +
> + status = intel_panel_detect(dev);
> + if (status == connector_status_unknown)
> + status = connector_status_connected;
> + return status;
> + }
> +
> + ret = g4x_digital_port_connected(dev, intel_dig_port);
> + if (ret == -EINVAL)
> + return connector_status_unknown;
> + else if (ret == 0)
> return connector_status_disconnected;
>
> return intel_dp_detect_dpcd(intel_dp);
> @@ -4066,8 +4079,14 @@ intel_dp_hpd_pulse(struct intel_digital_port
> *intel_dig_port, bool long_hpd)
> intel_display_power_get(dev_priv, power_domain);
>
> if (long_hpd) {
> - if (!ibx_digital_port_connected(dev_priv,
> intel_dig_port))
> - goto mst_fail;
> +
> + if (HAS_PCH_SPLIT(dev)) {
> + if (!ibx_digital_port_connected(dev_priv,
> intel_dig_port))
> + goto mst_fail;
> + } else {
> + if (g4x_digital_port_connected(dev,
> intel_dig_port) != 1)
> + goto mst_fail;
> + }
>
> if (!intel_dp_get_dpcd(intel_dp)) {
> goto mst_fail;
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [Intel-gfx] [drm/i915/3.17] panic in i915_digport_work_func
@ 2014-09-01 13:28 ` Imre Deak
0 siblings, 0 replies; 14+ messages in thread
From: Imre Deak @ 2014-09-01 13:28 UTC (permalink / raw)
To: Dave Airlie
Cc: Mike Galbraith, Daniel Vetter, intel-gfx, LKML, Dave Airlie,
Nikula, Jani
[-- Attachment #1: Type: text/plain, Size: 5117 bytes --]
On Mon, 2014-09-01 at 17:02 +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied@redhat.com>
> Date: Mon, 1 Sep 2014 16:58:12 +1000
> Subject: [PATCH] drm/i915: handle G45/GM45 pulse detection connected
> state.
>
> In the HPD pulse handler we check for long pulses if the port is
> actually
> connected, however we do that for IBX, but we use the pulse handling
> code on
> GM45 systems as well, so we need to use a diffent check.
>
> This patch refactors the digital port connected check out of the g4x
> detection
> path and reuses it in the hpd pulse path.
>
> Should fix:
> Message-ID: <1409382202.5141.36.camel@marge.simpson.net>
>
> Reported-by: Mike Galbraith <umgwanakikbuti@gmail.com>
> Signed-off-by: Dave Airlie <airlied@redhat.com>
Daniel reviewed this already, but Jani asked me to take a look, so:
Acked-by: Imre Deak <imre.deak@intel.com>
One thing for the future is to move ibx_digital_port_connected() to
intel_dp.c too and make its return value match that of
g4x_digital_port_connected().
--Imre
> ---
> drivers/gpu/drm/i915/intel_dp.c | 55
> +++++++++++++++++++++++++++--------------
> 1 file changed, 37 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c
> b/drivers/gpu/drm/i915/intel_dp.c
> index 67cfed6..81d7681 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -3661,24 +3661,12 @@ ironlake_dp_detect(struct intel_dp *intel_dp)
> return intel_dp_detect_dpcd(intel_dp);
> }
>
> -static enum drm_connector_status
> -g4x_dp_detect(struct intel_dp *intel_dp)
> +static int g4x_digital_port_connected(struct drm_device *dev,
> + struct intel_digital_port
> *intel_dig_port)
> {
> - struct drm_device *dev = intel_dp_to_dev(intel_dp);
> struct drm_i915_private *dev_priv = dev->dev_private;
> - struct intel_digital_port *intel_dig_port =
> dp_to_dig_port(intel_dp);
> uint32_t bit;
>
> - /* Can't disconnect eDP, but you can close the lid... */
> - if (is_edp(intel_dp)) {
> - enum drm_connector_status status;
> -
> - status = intel_panel_detect(dev);
> - if (status == connector_status_unknown)
> - status = connector_status_connected;
> - return status;
> - }
> -
> if (IS_VALLEYVIEW(dev)) {
> switch (intel_dig_port->port) {
> case PORT_B:
> @@ -3691,7 +3679,7 @@ g4x_dp_detect(struct intel_dp *intel_dp)
> bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
> break;
> default:
> - return connector_status_unknown;
> + return -EINVAL;
> }
> } else {
> switch (intel_dig_port->port) {
> @@ -3705,11 +3693,36 @@ g4x_dp_detect(struct intel_dp *intel_dp)
> bit = PORTD_HOTPLUG_LIVE_STATUS_G4X;
> break;
> default:
> - return connector_status_unknown;
> + return -EINVAL;
> }
> }
>
> if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)
> + return 0;
> + return 1;
> +}
> +
> +static enum drm_connector_status
> +g4x_dp_detect(struct intel_dp *intel_dp)
> +{
> + struct drm_device *dev = intel_dp_to_dev(intel_dp);
> + struct intel_digital_port *intel_dig_port =
> dp_to_dig_port(intel_dp);
> + int ret;
> +
> + /* Can't disconnect eDP, but you can close the lid... */
> + if (is_edp(intel_dp)) {
> + enum drm_connector_status status;
> +
> + status = intel_panel_detect(dev);
> + if (status == connector_status_unknown)
> + status = connector_status_connected;
> + return status;
> + }
> +
> + ret = g4x_digital_port_connected(dev, intel_dig_port);
> + if (ret == -EINVAL)
> + return connector_status_unknown;
> + else if (ret == 0)
> return connector_status_disconnected;
>
> return intel_dp_detect_dpcd(intel_dp);
> @@ -4066,8 +4079,14 @@ intel_dp_hpd_pulse(struct intel_digital_port
> *intel_dig_port, bool long_hpd)
> intel_display_power_get(dev_priv, power_domain);
>
> if (long_hpd) {
> - if (!ibx_digital_port_connected(dev_priv,
> intel_dig_port))
> - goto mst_fail;
> +
> + if (HAS_PCH_SPLIT(dev)) {
> + if (!ibx_digital_port_connected(dev_priv,
> intel_dig_port))
> + goto mst_fail;
> + } else {
> + if (g4x_digital_port_connected(dev,
> intel_dig_port) != 1)
> + goto mst_fail;
> + }
>
> if (!intel_dp_get_dpcd(intel_dp)) {
> goto mst_fail;
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [drm/i915/3.17] panic in i915_digport_work_func
2014-09-01 13:28 ` [Intel-gfx] " Imre Deak
@ 2014-09-01 14:11 ` Jani Nikula
-1 siblings, 0 replies; 14+ messages in thread
From: Jani Nikula @ 2014-09-01 14:11 UTC (permalink / raw)
To: imre.deak, Dave Airlie
Cc: Daniel Vetter, intel-gfx, Mike Galbraith, LKML, Dave Airlie
On Mon, 01 Sep 2014, Imre Deak <imre.deak@intel.com> wrote:
> On Mon, 2014-09-01 at 17:02 +1000, Dave Airlie wrote:
>> From: Dave Airlie <airlied@redhat.com>
>> Date: Mon, 1 Sep 2014 16:58:12 +1000
>> Subject: [PATCH] drm/i915: handle G45/GM45 pulse detection connected
>> state.
>>
>> In the HPD pulse handler we check for long pulses if the port is
>> actually
>> connected, however we do that for IBX, but we use the pulse handling
>> code on
>> GM45 systems as well, so we need to use a diffent check.
>>
>> This patch refactors the digital port connected check out of the g4x
>> detection
>> path and reuses it in the hpd pulse path.
>>
>> Should fix:
>> Message-ID: <1409382202.5141.36.camel@marge.simpson.net>
>>
>> Reported-by: Mike Galbraith <umgwanakikbuti@gmail.com>
>> Signed-off-by: Dave Airlie <airlied@redhat.com>
>
> Daniel reviewed this already, but Jani asked me to take a look, so:
> Acked-by: Imre Deak <imre.deak@intel.com>
Pushed to drm-intel-fixes, thanks for the patch, review, and testing.
BR,
Jani.
>
> One thing for the future is to move ibx_digital_port_connected() to
> intel_dp.c too and make its return value match that of
> g4x_digital_port_connected().
>
> --Imre
>
>> ---
>> drivers/gpu/drm/i915/intel_dp.c | 55
>> +++++++++++++++++++++++++++--------------
>> 1 file changed, 37 insertions(+), 18 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_dp.c
>> b/drivers/gpu/drm/i915/intel_dp.c
>> index 67cfed6..81d7681 100644
>> --- a/drivers/gpu/drm/i915/intel_dp.c
>> +++ b/drivers/gpu/drm/i915/intel_dp.c
>> @@ -3661,24 +3661,12 @@ ironlake_dp_detect(struct intel_dp *intel_dp)
>> return intel_dp_detect_dpcd(intel_dp);
>> }
>>
>> -static enum drm_connector_status
>> -g4x_dp_detect(struct intel_dp *intel_dp)
>> +static int g4x_digital_port_connected(struct drm_device *dev,
>> + struct intel_digital_port
>> *intel_dig_port)
>> {
>> - struct drm_device *dev = intel_dp_to_dev(intel_dp);
>> struct drm_i915_private *dev_priv = dev->dev_private;
>> - struct intel_digital_port *intel_dig_port =
>> dp_to_dig_port(intel_dp);
>> uint32_t bit;
>>
>> - /* Can't disconnect eDP, but you can close the lid... */
>> - if (is_edp(intel_dp)) {
>> - enum drm_connector_status status;
>> -
>> - status = intel_panel_detect(dev);
>> - if (status == connector_status_unknown)
>> - status = connector_status_connected;
>> - return status;
>> - }
>> -
>> if (IS_VALLEYVIEW(dev)) {
>> switch (intel_dig_port->port) {
>> case PORT_B:
>> @@ -3691,7 +3679,7 @@ g4x_dp_detect(struct intel_dp *intel_dp)
>> bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
>> break;
>> default:
>> - return connector_status_unknown;
>> + return -EINVAL;
>> }
>> } else {
>> switch (intel_dig_port->port) {
>> @@ -3705,11 +3693,36 @@ g4x_dp_detect(struct intel_dp *intel_dp)
>> bit = PORTD_HOTPLUG_LIVE_STATUS_G4X;
>> break;
>> default:
>> - return connector_status_unknown;
>> + return -EINVAL;
>> }
>> }
>>
>> if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)
>> + return 0;
>> + return 1;
>> +}
>> +
>> +static enum drm_connector_status
>> +g4x_dp_detect(struct intel_dp *intel_dp)
>> +{
>> + struct drm_device *dev = intel_dp_to_dev(intel_dp);
>> + struct intel_digital_port *intel_dig_port =
>> dp_to_dig_port(intel_dp);
>> + int ret;
>> +
>> + /* Can't disconnect eDP, but you can close the lid... */
>> + if (is_edp(intel_dp)) {
>> + enum drm_connector_status status;
>> +
>> + status = intel_panel_detect(dev);
>> + if (status == connector_status_unknown)
>> + status = connector_status_connected;
>> + return status;
>> + }
>> +
>> + ret = g4x_digital_port_connected(dev, intel_dig_port);
>> + if (ret == -EINVAL)
>> + return connector_status_unknown;
>> + else if (ret == 0)
>> return connector_status_disconnected;
>>
>> return intel_dp_detect_dpcd(intel_dp);
>> @@ -4066,8 +4079,14 @@ intel_dp_hpd_pulse(struct intel_digital_port
>> *intel_dig_port, bool long_hpd)
>> intel_display_power_get(dev_priv, power_domain);
>>
>> if (long_hpd) {
>> - if (!ibx_digital_port_connected(dev_priv,
>> intel_dig_port))
>> - goto mst_fail;
>> +
>> + if (HAS_PCH_SPLIT(dev)) {
>> + if (!ibx_digital_port_connected(dev_priv,
>> intel_dig_port))
>> + goto mst_fail;
>> + } else {
>> + if (g4x_digital_port_connected(dev,
>> intel_dig_port) != 1)
>> + goto mst_fail;
>> + }
>>
>> if (!intel_dp_get_dpcd(intel_dp)) {
>> goto mst_fail;
>
--
Jani Nikula, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [Intel-gfx] [drm/i915/3.17] panic in i915_digport_work_func
@ 2014-09-01 14:11 ` Jani Nikula
0 siblings, 0 replies; 14+ messages in thread
From: Jani Nikula @ 2014-09-01 14:11 UTC (permalink / raw)
To: imre.deak, Dave Airlie
Cc: Mike Galbraith, Daniel Vetter, intel-gfx, LKML, Dave Airlie
On Mon, 01 Sep 2014, Imre Deak <imre.deak@intel.com> wrote:
> On Mon, 2014-09-01 at 17:02 +1000, Dave Airlie wrote:
>> From: Dave Airlie <airlied@redhat.com>
>> Date: Mon, 1 Sep 2014 16:58:12 +1000
>> Subject: [PATCH] drm/i915: handle G45/GM45 pulse detection connected
>> state.
>>
>> In the HPD pulse handler we check for long pulses if the port is
>> actually
>> connected, however we do that for IBX, but we use the pulse handling
>> code on
>> GM45 systems as well, so we need to use a diffent check.
>>
>> This patch refactors the digital port connected check out of the g4x
>> detection
>> path and reuses it in the hpd pulse path.
>>
>> Should fix:
>> Message-ID: <1409382202.5141.36.camel@marge.simpson.net>
>>
>> Reported-by: Mike Galbraith <umgwanakikbuti@gmail.com>
>> Signed-off-by: Dave Airlie <airlied@redhat.com>
>
> Daniel reviewed this already, but Jani asked me to take a look, so:
> Acked-by: Imre Deak <imre.deak@intel.com>
Pushed to drm-intel-fixes, thanks for the patch, review, and testing.
BR,
Jani.
>
> One thing for the future is to move ibx_digital_port_connected() to
> intel_dp.c too and make its return value match that of
> g4x_digital_port_connected().
>
> --Imre
>
>> ---
>> drivers/gpu/drm/i915/intel_dp.c | 55
>> +++++++++++++++++++++++++++--------------
>> 1 file changed, 37 insertions(+), 18 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_dp.c
>> b/drivers/gpu/drm/i915/intel_dp.c
>> index 67cfed6..81d7681 100644
>> --- a/drivers/gpu/drm/i915/intel_dp.c
>> +++ b/drivers/gpu/drm/i915/intel_dp.c
>> @@ -3661,24 +3661,12 @@ ironlake_dp_detect(struct intel_dp *intel_dp)
>> return intel_dp_detect_dpcd(intel_dp);
>> }
>>
>> -static enum drm_connector_status
>> -g4x_dp_detect(struct intel_dp *intel_dp)
>> +static int g4x_digital_port_connected(struct drm_device *dev,
>> + struct intel_digital_port
>> *intel_dig_port)
>> {
>> - struct drm_device *dev = intel_dp_to_dev(intel_dp);
>> struct drm_i915_private *dev_priv = dev->dev_private;
>> - struct intel_digital_port *intel_dig_port =
>> dp_to_dig_port(intel_dp);
>> uint32_t bit;
>>
>> - /* Can't disconnect eDP, but you can close the lid... */
>> - if (is_edp(intel_dp)) {
>> - enum drm_connector_status status;
>> -
>> - status = intel_panel_detect(dev);
>> - if (status == connector_status_unknown)
>> - status = connector_status_connected;
>> - return status;
>> - }
>> -
>> if (IS_VALLEYVIEW(dev)) {
>> switch (intel_dig_port->port) {
>> case PORT_B:
>> @@ -3691,7 +3679,7 @@ g4x_dp_detect(struct intel_dp *intel_dp)
>> bit = PORTD_HOTPLUG_LIVE_STATUS_VLV;
>> break;
>> default:
>> - return connector_status_unknown;
>> + return -EINVAL;
>> }
>> } else {
>> switch (intel_dig_port->port) {
>> @@ -3705,11 +3693,36 @@ g4x_dp_detect(struct intel_dp *intel_dp)
>> bit = PORTD_HOTPLUG_LIVE_STATUS_G4X;
>> break;
>> default:
>> - return connector_status_unknown;
>> + return -EINVAL;
>> }
>> }
>>
>> if ((I915_READ(PORT_HOTPLUG_STAT) & bit) == 0)
>> + return 0;
>> + return 1;
>> +}
>> +
>> +static enum drm_connector_status
>> +g4x_dp_detect(struct intel_dp *intel_dp)
>> +{
>> + struct drm_device *dev = intel_dp_to_dev(intel_dp);
>> + struct intel_digital_port *intel_dig_port =
>> dp_to_dig_port(intel_dp);
>> + int ret;
>> +
>> + /* Can't disconnect eDP, but you can close the lid... */
>> + if (is_edp(intel_dp)) {
>> + enum drm_connector_status status;
>> +
>> + status = intel_panel_detect(dev);
>> + if (status == connector_status_unknown)
>> + status = connector_status_connected;
>> + return status;
>> + }
>> +
>> + ret = g4x_digital_port_connected(dev, intel_dig_port);
>> + if (ret == -EINVAL)
>> + return connector_status_unknown;
>> + else if (ret == 0)
>> return connector_status_disconnected;
>>
>> return intel_dp_detect_dpcd(intel_dp);
>> @@ -4066,8 +4079,14 @@ intel_dp_hpd_pulse(struct intel_digital_port
>> *intel_dig_port, bool long_hpd)
>> intel_display_power_get(dev_priv, power_domain);
>>
>> if (long_hpd) {
>> - if (!ibx_digital_port_connected(dev_priv,
>> intel_dig_port))
>> - goto mst_fail;
>> +
>> + if (HAS_PCH_SPLIT(dev)) {
>> + if (!ibx_digital_port_connected(dev_priv,
>> intel_dig_port))
>> + goto mst_fail;
>> + } else {
>> + if (g4x_digital_port_connected(dev,
>> intel_dig_port) != 1)
>> + goto mst_fail;
>> + }
>>
>> if (!intel_dp_get_dpcd(intel_dp)) {
>> goto mst_fail;
>
--
Jani Nikula, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 14+ messages in thread