Re: [Intel-gfx] [PATCH] drm/i915: only hook up hpd pulse for DP setups.

2014-08-01 Thread Chris Wilson
On Sat, Aug 02, 2014 at 06:47:10AM +1000, Dave Airlie wrote:
> From: Dave Airlie 
> 
> On HSW/BDW the VBT can tell us if we need to have DP support for a port,
> if we don't have DP this caused an oops in the hpd handling.
> 
> Don't hook up the DP hpd handling if we don't have a DP port.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81856
> Reported-by: Intel QA Team.
> Signed-off-by: Dave Airlie 
> ---
>  drivers/gpu/drm/i915/intel_ddi.c | 8 +---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c 
> b/drivers/gpu/drm/i915/intel_ddi.c
> index 9b1542f..42d4dce 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -1557,11 +1557,13 @@ void intel_ddi_init(struct drm_device *dev, enum port 
> port)
>   intel_encoder->cloneable = 0;
>   intel_encoder->hot_plug = intel_ddi_hot_plug;
>  
> - intel_dig_port->hpd_pulse = intel_dp_hpd_pulse;
> - dev_priv->hpd_irq_port[port] = intel_dig_port;
> + if (init_dp) {
> + /* only hook up hpd processing for DP */
> + intel_dig_port->hpd_pulse = intel_dp_hpd_pulse;
> + dev_priv->hpd_irq_port[port] = intel_dig_port;
>  
> - if (init_dp)
>   dp_connector = intel_ddi_init_dp_connector(intel_dig_port);
> + }

The (lack of) allocation error handling here will lead to the same oops.

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index a6024de17d34..3634575534b4 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1557,15 +1557,13 @@ void intel_ddi_init(struct drm_device *dev, enum port 
port)
struct intel_digital_port *intel_dig_port;
struct intel_encoder *intel_encoder;
struct drm_encoder *encoder;
-   struct intel_connector *hdmi_connector = NULL;
-   struct intel_connector *dp_connector = NULL;
bool init_hdmi, init_dp;
 
init_hdmi = (dev_priv->vbt.ddi_port_info[port].supports_dvi ||
 dev_priv->vbt.ddi_port_info[port].supports_hdmi);
init_dp = dev_priv->vbt.ddi_port_info[port].supports_dp;
if (!init_dp && !init_hdmi) {
-   DRM_DEBUG_KMS("VBT says port %c is not DVI/HDMI/DP 
compatible\n",
+   DRM_DEBUG_KMS("VBT says port %c is not DVI/HDMI/DP compatible, 
assuming it is\n",
  port_name(port));
init_hdmi = true;
init_dp = true;
@@ -1595,23 +1593,28 @@ void intel_ddi_init(struct drm_device *dev, enum port 
port)
   DDI_A_4_LANES);
 
intel_encoder->type = INTEL_OUTPUT_UNKNOWN;
-   intel_encoder->crtc_mask =  (1 << 0) | (1 << 1) | (1 << 2);
+   intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
intel_encoder->cloneable = 0;
intel_encoder->hot_plug = intel_ddi_hot_plug;
 
-   intel_dig_port->hpd_pulse = intel_dp_hpd_pulse;
-   dev_priv->hpd_irq_port[port] = intel_dig_port;
+   if (init_dp) {
+   if (!intel_ddi_init_dp_connector(intel_dig_port))
+   goto err;
 
-   if (init_dp)
-   dp_connector = intel_ddi_init_dp_connector(intel_dig_port);
+   intel_dig_port->hpd_pulse = intel_dp_hpd_pulse;
+   dev_priv->hpd_irq_port[port] = intel_dig_port;
+   }
 
/* In theory we don't need the encoder->type check, but leave it just in
 * case we have some really bad VBTs... */
-   if (intel_encoder->type != INTEL_OUTPUT_EDP && init_hdmi)
-   hdmi_connector = intel_ddi_init_hdmi_connector(intel_dig_port);
-
-   if (!dp_connector && !hdmi_connector) {
-   drm_encoder_cleanup(encoder);
-   kfree(intel_dig_port);
+   if (intel_encoder->type != INTEL_OUTPUT_EDP && init_hdmi) {
+   if (!intel_ddi_init_hdmi_connector(intel_dig_port))
+   goto err;
}
+
+   return;
+
+err:
+   drm_encoder_cleanup(encoder);
+   kfree(intel_dig_port);


-- 
Chris Wilson, Intel Open Source Technology Centre
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915: only hook up hpd pulse for DP setups.

2014-08-01 Thread Dave Airlie
On 2 August 2014 07:38, Paulo Zanoni  wrote:
> 2014-08-01 17:47 GMT-03:00 Dave Airlie :
>> From: Dave Airlie 
>>
>> On HSW/BDW the VBT can tell us if we need to have DP support for a port,
>> if we don't have DP this caused an oops in the hpd handling.
>>
>> Don't hook up the DP hpd handling if we don't have a DP port.
>>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81856
>> Reported-by: Intel QA Team.
>> Signed-off-by: Dave Airlie 
>
> The patch looks correct, but AFAIK we didn't need it in the past, so I
> am curious about why is it needed now. What changed that caused the
> need for it?

Well the pulse handling is only new and I think we should have hit
this prior to MST, since hpd_pulse called intel_dp_check_link_status.

Prior to the pulse irq, intel_ddi check if the port was eDP or DP
before proceeding.

Dave
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] drm/i915: only hook up hpd pulse for DP setups.

2014-08-01 Thread Paulo Zanoni
2014-08-01 17:47 GMT-03:00 Dave Airlie :
> From: Dave Airlie 
>
> On HSW/BDW the VBT can tell us if we need to have DP support for a port,
> if we don't have DP this caused an oops in the hpd handling.
>
> Don't hook up the DP hpd handling if we don't have a DP port.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81856
> Reported-by: Intel QA Team.
> Signed-off-by: Dave Airlie 

The patch looks correct, but AFAIK we didn't need it in the past, so I
am curious about why is it needed now. What changed that caused the
need for it?

> ---
>  drivers/gpu/drm/i915/intel_ddi.c | 8 +---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c 
> b/drivers/gpu/drm/i915/intel_ddi.c
> index 9b1542f..42d4dce 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -1557,11 +1557,13 @@ void intel_ddi_init(struct drm_device *dev, enum port 
> port)
> intel_encoder->cloneable = 0;
> intel_encoder->hot_plug = intel_ddi_hot_plug;
>
> -   intel_dig_port->hpd_pulse = intel_dp_hpd_pulse;
> -   dev_priv->hpd_irq_port[port] = intel_dig_port;
> +   if (init_dp) {
> +   /* only hook up hpd processing for DP */
> +   intel_dig_port->hpd_pulse = intel_dp_hpd_pulse;
> +   dev_priv->hpd_irq_port[port] = intel_dig_port;
>
> -   if (init_dp)
> dp_connector = intel_ddi_init_dp_connector(intel_dig_port);
> +   }
>
> /* In theory we don't need the encoder->type check, but leave it just 
> in
>  * case we have some really bad VBTs... */
> --
> 1.9.3
>
> ___
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Paulo Zanoni
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] drm/i915: only hook up hpd pulse for DP setups.

2014-08-01 Thread Dave Airlie
From: Dave Airlie 

On HSW/BDW the VBT can tell us if we need to have DP support for a port,
if we don't have DP this caused an oops in the hpd handling.

Don't hook up the DP hpd handling if we don't have a DP port.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81856
Reported-by: Intel QA Team.
Signed-off-by: Dave Airlie 
---
 drivers/gpu/drm/i915/intel_ddi.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 9b1542f..42d4dce 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1557,11 +1557,13 @@ void intel_ddi_init(struct drm_device *dev, enum port 
port)
intel_encoder->cloneable = 0;
intel_encoder->hot_plug = intel_ddi_hot_plug;
 
-   intel_dig_port->hpd_pulse = intel_dp_hpd_pulse;
-   dev_priv->hpd_irq_port[port] = intel_dig_port;
+   if (init_dp) {
+   /* only hook up hpd processing for DP */
+   intel_dig_port->hpd_pulse = intel_dp_hpd_pulse;
+   dev_priv->hpd_irq_port[port] = intel_dig_port;
 
-   if (init_dp)
dp_connector = intel_ddi_init_dp_connector(intel_dig_port);
+   }
 
/* In theory we don't need the encoder->type check, but leave it just in
 * case we have some really bad VBTs... */
-- 
1.9.3

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx