public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/6] drm/i915: Warn if trying to poke a VLV	backlight on invalid pipe
Date: Fri, 07 Nov 2014 13:33:29 +0200	[thread overview]
Message-ID: <87tx2b1bzq.fsf@intel.com> (raw)
In-Reply-To: <1415351764-3514-2-git-send-email-ville.syrjala@linux.intel.com>

On Fri, 07 Nov 2014, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> VLV/CHV have backlight controls only on pipes A and B. Bail out
> without touching registers that don't exist, and print a warning.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_panel.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
> index e18b3f4..ef646b1 100644
> --- a/drivers/gpu/drm/i915/intel_panel.c
> +++ b/drivers/gpu/drm/i915/intel_panel.c
> @@ -521,6 +521,9 @@ static u32 _vlv_get_backlight(struct drm_device *dev, enum pipe pipe)
>  {
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  
> +	if (WARN_ON(pipe != PIPE_A && pipe != PIPE_B))
> +		return 0;
> +
>  	return I915_READ(VLV_BLC_PWM_CTL(pipe)) & BACKLIGHT_DUTY_CYCLE_MASK;
>  }
>  
> @@ -602,6 +605,9 @@ static void vlv_set_backlight(struct intel_connector *connector, u32 level)
>  	enum pipe pipe = intel_get_pipe_from_connector(connector);
>  	u32 tmp;
>  
> +	if (WARN_ON(pipe != PIPE_A && pipe != PIPE_B))
> +		return;
> +
>  	tmp = I915_READ(VLV_BLC_PWM_CTL(pipe)) & ~BACKLIGHT_DUTY_CYCLE_MASK;
>  	I915_WRITE(VLV_BLC_PWM_CTL(pipe), tmp | level);
>  }
> @@ -717,6 +723,9 @@ static void vlv_disable_backlight(struct intel_connector *connector)
>  	enum pipe pipe = intel_get_pipe_from_connector(connector);
>  	u32 tmp;
>  
> +	if (WARN_ON(pipe != PIPE_A && pipe != PIPE_B))
> +		return;
> +
>  	intel_panel_actually_set_backlight(connector, 0);
>  
>  	tmp = I915_READ(VLV_BLC_PWM_CTL2(pipe));
> @@ -906,6 +915,9 @@ static void vlv_enable_backlight(struct intel_connector *connector)
>  	enum pipe pipe = intel_get_pipe_from_connector(connector);
>  	u32 ctl, ctl2;
>  
> +	if (WARN_ON(pipe != PIPE_A && pipe != PIPE_B))
> +		return;
> +
>  	ctl2 = I915_READ(VLV_BLC_PWM_CTL2(pipe));
>  	if (ctl2 & BLM_PWM_ENABLE) {
>  		DRM_DEBUG_KMS("backlight already enabled\n");
> -- 
> 2.0.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2014-11-07 11:33 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07  9:15 [PATCH 0/6] drm/i915: VLV/CHV backlight fixes ville.syrjala
2014-11-07  9:15 ` [PATCH 1/6] drm/i915: Warn if trying to poke a VLV backlight on invalid pipe ville.syrjala
2014-11-07 11:33   ` Jani Nikula [this message]
2014-11-07  9:16 ` [PATCH 2/6] drm/i915: Catch INVALID_PIPE in vlv_get_backlight() ville.syrjala
2014-11-07 11:32   ` Jani Nikula
2014-11-07 13:18   ` [PATCH v2 2/6] drm/i915: Skip .get_backlight() when backlight isn't enabled ville.syrjala
2014-11-07 13:24     ` Jani Nikula
2014-11-07  9:16 ` [PATCH 3/6] drm/i915: Don't deref NULL crtc in intel_get_pipe_from_connector() ville.syrjala
2014-11-07 11:32   ` Jani Nikula
2014-11-07  9:16 ` [PATCH 4/6] drm/i915: Pass the current pipe from eDP init to backlight setup ville.syrjala
2014-11-07 12:07   ` Jani Nikula
2014-11-07  9:16 ` [PATCH 5/6] drm/i915: Register the backlight device after the modeset init ville.syrjala
2014-11-07 12:19   ` Jani Nikula
2014-11-07 12:25   ` Jani Nikula
2014-11-07 13:19   ` [PATCH v2 " ville.syrjala
2014-11-07 13:25     ` Jani Nikula
2014-11-07  9:16 ` [PATCH 6/6] drm/i915: Remove most INVALID_PIPE checks from VLV backlight code ville.syrjala
2014-11-07 12:24   ` Jani Nikula
2014-11-07 12:51     ` Ville Syrjälä
2014-11-07 13:20   ` [PATCH v2 6/6] drm/i915: Remove most INVALID_PIPE checks from the " ville.syrjala
2014-11-07 13:26     ` Jani Nikula
2014-11-11 14:39       ` Daniel Vetter

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=87tx2b1bzq.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox