public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Vidya Srinivas <vidya.srinivas@intel.com>
Subject: Re: [PATCH v2] drm/i915: Parse panel backlight controller from VBT
Date: Mon, 12 Dec 2016 17:25:45 +0200	[thread overview]
Message-ID: <87y3zltbie.fsf@intel.com> (raw)
In-Reply-To: <1481189178-426-1-git-send-email-jani.nikula@intel.com>

On Thu, 08 Dec 2016, Jani Nikula <jani.nikula@intel.com> wrote:
> From: Vidya Srinivas <vidya.srinivas@intel.com>
>
> Currently the backlight controller is taken as 0. It needs to derive
> value from the VBT. Adding the necessary changes.
>
> v2 by Jani:
>  - drop obsolete comments, drop redundant initialization (Bob)
>  - merge debug logging into one
>
> Signed-off-by: Uma Shankar <uma.shankar@intel.com>
> Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> Reviewed-by: Bob Paauwe <bob.j.paauwe@intel.com>
> Tested-by: Bob Paauwe <bob.j.paauwe@intel.com>
> Tested-by: Mika Kahola <mika.kahola@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Pushed to dinq, thanks for the patch.

BR,
Jani.

> ---
>  drivers/gpu/drm/i915/i915_drv.h    |  1 +
>  drivers/gpu/drm/i915/intel_bios.c  |  6 ++++--
>  drivers/gpu/drm/i915/intel_panel.c | 17 +++--------------
>  3 files changed, 8 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 1480e733312a..786e3bb8eecf 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1716,6 +1716,7 @@ struct intel_vbt_data {
>  		bool present;
>  		bool active_low_pwm;
>  		u8 min_brightness;	/* min_brightness/255 of max */
> +		u8 controller;		/* brightness controller number */
>  		enum intel_backlight_type type;
>  	} backlight;
>  
> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> index eaade27af386..1cf2fa6ec28f 100644
> --- a/drivers/gpu/drm/i915/intel_bios.c
> +++ b/drivers/gpu/drm/i915/intel_bios.c
> @@ -330,17 +330,19 @@ parse_lfp_backlight(struct drm_i915_private *dev_priv,
>  
>  		method = &backlight_data->backlight_control[panel_type];
>  		dev_priv->vbt.backlight.type = method->type;
> +		dev_priv->vbt.backlight.controller = method->controller;
>  	}
>  
>  	dev_priv->vbt.backlight.pwm_freq_hz = entry->pwm_freq_hz;
>  	dev_priv->vbt.backlight.active_low_pwm = entry->active_low_pwm;
>  	dev_priv->vbt.backlight.min_brightness = entry->min_brightness;
>  	DRM_DEBUG_KMS("VBT backlight PWM modulation frequency %u Hz, "
> -		      "active %s, min brightness %u, level %u\n",
> +		      "active %s, min brightness %u, level %u, controller %u\n",
>  		      dev_priv->vbt.backlight.pwm_freq_hz,
>  		      dev_priv->vbt.backlight.active_low_pwm ? "low" : "high",
>  		      dev_priv->vbt.backlight.min_brightness,
> -		      backlight_data->level[panel_type]);
> +		      backlight_data->level[panel_type],
> +		      dev_priv->vbt.backlight.controller);
>  }
>  
>  /* Try to find sdvo panel data */
> diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
> index 3578b402d412..b01edceac650 100644
> --- a/drivers/gpu/drm/i915/intel_panel.c
> +++ b/drivers/gpu/drm/i915/intel_panel.c
> @@ -1039,10 +1039,7 @@ static void bxt_enable_backlight(struct intel_connector *connector)
>  	enum pipe pipe = intel_get_pipe_from_connector(connector);
>  	u32 pwm_ctl, val;
>  
> -	/* To use 2nd set of backlight registers, utility pin has to be
> -	 * enabled with PWM mode.
> -	 * The field should only be changed when the utility pin is disabled
> -	 */
> +	/* Controller 1 uses the utility pin. */
>  	if (panel->backlight.controller == 1) {
>  		val = I915_READ(UTIL_PIN_CTL);
>  		if (val & UTIL_PIN_ENABLE) {
> @@ -1608,19 +1605,11 @@ bxt_setup_backlight(struct intel_connector *connector, enum pipe unused)
>  	struct intel_panel *panel = &connector->panel;
>  	u32 pwm_ctl, val;
>  
> -	/*
> -	 * For BXT hard coding the Backlight controller to 0.
> -	 * TODO : Read the controller value from VBT and generalize
> -	 */
> -	panel->backlight.controller = 0;
> +	panel->backlight.controller = dev_priv->vbt.backlight.controller;
>  
>  	pwm_ctl = I915_READ(BXT_BLC_PWM_CTL(panel->backlight.controller));
>  
> -	/* Keeping the check if controller 1 is to be programmed.
> -	 * This will come into affect once the VBT parsing
> -	 * is fixed for controller selection, and controller 1 is used
> -	 * for a prticular display configuration.
> -	 */
> +	/* Controller 1 uses the utility pin. */
>  	if (panel->backlight.controller == 1) {
>  		val = I915_READ(UTIL_PIN_CTL);
>  		panel->backlight.util_pin_active_low =

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

  reply	other threads:[~2016-12-12 15:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07 14:09 [PATCH] FOR_UPSTREAM [VPG]: drm/i915: Parse panel BL controller from VBT Vidya Srinivas
2016-12-07 14:58 ` Vidya Srinivas
2016-12-07 15:02 ` [PATCH] " Vidya Srinivas
2016-12-07 17:44   ` Bob Paauwe
2016-12-08  6:14   ` Mika Kahola
2016-12-07 19:19 ` ✓ Fi.CI.BAT: success for FOR_UPSTREAM [VPG]: drm/i915: Parse panel BL controller from VBT (rev3) Patchwork
2016-12-08  9:26 ` [PATCH v2] drm/i915: Parse panel backlight controller from VBT Jani Nikula
2016-12-12 15:25   ` Jani Nikula [this message]
2016-12-08 10:24 ` ✓ Fi.CI.BAT: success for FOR_UPSTREAM [VPG]: drm/i915: Parse panel BL controller from VBT (rev4) Patchwork

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=87y3zltbie.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=vidya.srinivas@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