[Intel-gfx] [PATCH] drm/i915: Use symbolic irqreturn for ->hpd_pulse
Ville Syrjälä
ville.syrjala at linux.intel.com
Fri Feb 6 10:49:12 PST 2015
On Fri, Jan 23, 2015 at 06:00:31AM +0100, Daniel Vetter wrote:
> Self-explanatory code is better code.
This causes the VDD off -> HPD -> VDD on -> VDD off -> HPD ... cycle to
make another appearance on my BSW. Looks like you forgot to convert one return
in intel_dp_hpd_pulse():
@@ -4499,7 +4499,7 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
*/
DRM_DEBUG_KMS("ignoring long hpd on eDP port %c\n",
port_name(intel_dig_port->port));
- return false;
+ return IRQ_HANDLED;
}
DRM_DEBUG_KMS("got hpd irq on port %c - %s\n",
>
> Cc: Dave Airlie <airlied at redhat.com>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
> drivers/gpu/drm/i915/i915_irq.c | 8 +++++---
> drivers/gpu/drm/i915/intel_dp.c | 8 +++++---
> drivers/gpu/drm/i915/intel_drv.h | 6 +++---
> 3 files changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index aa3180cf2921..c60e9b39b38e 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -863,7 +863,7 @@ static void i915_digport_work_func(struct work_struct *work)
> container_of(work, struct drm_i915_private, dig_port_work);
> u32 long_port_mask, short_port_mask;
> struct intel_digital_port *intel_dig_port;
> - int i, ret;
> + int i;
> u32 old_bits = 0;
>
> spin_lock_irq(&dev_priv->irq_lock);
> @@ -887,9 +887,11 @@ static void i915_digport_work_func(struct work_struct *work)
> valid = true;
>
> if (valid) {
> + enum irqreturn ret;
> +
> ret = intel_dig_port->hpd_pulse(intel_dig_port, long_hpd);
> - if (ret == true) {
> - /* if we get true fallback to old school hpd */
> + if (ret == IRQ_NONE) {
> + /* fall back to old school hpd */
> old_bits |= (1 << intel_dig_port->base.hpd_pin);
> }
> }
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 88d81a8b0d35..b92baa3a95c5 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -4420,7 +4420,7 @@ intel_dp_hot_plug(struct intel_encoder *intel_encoder)
> return;
> }
>
> -bool
> +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;
> @@ -4428,7 +4428,7 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
> struct drm_device *dev = intel_dig_port->base.base.dev;
> struct drm_i915_private *dev_priv = dev->dev_private;
> enum intel_display_power_domain power_domain;
> - bool ret = true;
> + enum irqreturn ret = IRQ_NONE;
>
> if (intel_dig_port->base.type != INTEL_OUTPUT_EDP)
> intel_dig_port->base.type = INTEL_OUTPUT_DISPLAYPORT;
> @@ -4487,7 +4487,9 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
> drm_modeset_unlock(&dev->mode_config.connection_mutex);
> }
> }
> - ret = false;
> +
> + ret = IRQ_HANDLED;
> +
> goto put_power;
> mst_fail:
> /* if we were in MST mode, and device is not there get out of MST mode */
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 588b618ab668..fdd71e5ad820 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -646,7 +646,7 @@ struct intel_digital_port {
> u32 saved_port_bits;
> struct intel_dp dp;
> struct intel_hdmi hdmi;
> - bool (*hpd_pulse)(struct intel_digital_port *, bool);
> + enum irqreturn (*hpd_pulse)(struct intel_digital_port *, bool);
> };
>
> struct intel_dp_mst_encoder {
> @@ -998,8 +998,8 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc);
> bool intel_dp_compute_config(struct intel_encoder *encoder,
> struct intel_crtc_config *pipe_config);
> bool intel_dp_is_edp(struct drm_device *dev, enum port port);
> -bool intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port,
> - bool long_hpd);
> +enum irqreturn intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port,
> + bool long_hpd);
> void intel_edp_backlight_on(struct intel_dp *intel_dp);
> void intel_edp_backlight_off(struct intel_dp *intel_dp);
> void intel_edp_panel_vdd_on(struct intel_dp *intel_dp);
> --
> 2.1.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
More information about the Intel-gfx
mailing list