From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Cooper Chiou <cooper.chiou@intel.com>,
stable@vger.kernel.org, Wei Shun Chen <wei.shun.chang@intel.com>
Subject: Re: [PATCH v2 2/2] drm/i915/backlight: setup backlight pwm alternate increment on backlight enable
Date: Mon, 19 Sep 2016 11:32:17 +0300 [thread overview]
Message-ID: <87mvj4nvce.fsf@intel.com> (raw)
In-Reply-To: <1474273457-31680-2-git-send-email-jani.nikula@intel.com>
On Mon, 19 Sep 2016, Jani Nikula <jani.nikula@intel.com> wrote:
> From: Shawn Lee <shawn.c.lee@intel.com>
>
> Backlight enable is supposed to do a full setup of the backlight. We
> were missing the PWM alternate increment bit in the south chicken
> registers on lpt+ pch. This potentially caused a PWM frequency change
> when the chicken register value was lost e.g. on suspend.
>
> v2 by Jani, rebase on the patch caching alt increment
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97486
There's a good chance this'll also fix a bug long ago deemed
NOTOURBUG...
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67454
> Cc: Cooper Chiou <cooper.chiou@intel.com>
> Cc: Wei Shun Chen <wei.shun.chang@intel.com>
> Cc: Gary C Wang <gary.c.wang@intel.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Shawn Lee <shawn.c.lee@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/intel_panel.c | 18 +++++++++++++++++-
> 1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
> index 8bc43205d6a0..be4b4d546fd9 100644
> --- a/drivers/gpu/drm/i915/intel_panel.c
> +++ b/drivers/gpu/drm/i915/intel_panel.c
> @@ -841,7 +841,7 @@ static void lpt_enable_backlight(struct intel_connector *connector)
> {
> struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
> struct intel_panel *panel = &connector->panel;
> - u32 pch_ctl1, pch_ctl2;
> + u32 pch_ctl1, pch_ctl2, schicken;
>
> pch_ctl1 = I915_READ(BLC_PWM_PCH_CTL1);
> if (pch_ctl1 & BLM_PCH_PWM_ENABLE) {
> @@ -850,6 +850,22 @@ static void lpt_enable_backlight(struct intel_connector *connector)
> I915_WRITE(BLC_PWM_PCH_CTL1, pch_ctl1);
> }
>
> + if (HAS_PCH_LPT(dev_priv)) {
> + schicken = I915_READ(SOUTH_CHICKEN2);
> + if (panel->backlight.alternate_pwm_increment)
> + schicken |= LPT_PWM_GRANULARITY;
> + else
> + schicken &= ~LPT_PWM_GRANULARITY;
> + I915_WRITE(SOUTH_CHICKEN2, schicken);
> + } else {
> + schicken = I915_READ(SOUTH_CHICKEN1);
> + if (panel->backlight.alternate_pwm_increment)
> + schicken |= SPT_PWM_GRANULARITY;
> + else
> + schicken &= ~SPT_PWM_GRANULARITY;
> + I915_WRITE(SOUTH_CHICKEN1, schicken);
> + }
> +
> pch_ctl2 = panel->backlight.max << 16;
> I915_WRITE(BLC_PWM_PCH_CTL2, pch_ctl2);
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Shawn Lee <shawn.c.lee@intel.com>,
Cooper Chiou <cooper.chiou@intel.com>,
Wei Shun Chen <wei.shun.chang@intel.com>,
Gary C Wang <gary.c.wang@intel.com>,
stable@vger.kernel.org
Subject: Re: [PATCH v2 2/2] drm/i915/backlight: setup backlight pwm alternate increment on backlight enable
Date: Mon, 19 Sep 2016 11:32:17 +0300 [thread overview]
Message-ID: <87mvj4nvce.fsf@intel.com> (raw)
In-Reply-To: <1474273457-31680-2-git-send-email-jani.nikula@intel.com>
On Mon, 19 Sep 2016, Jani Nikula <jani.nikula@intel.com> wrote:
> From: Shawn Lee <shawn.c.lee@intel.com>
>
> Backlight enable is supposed to do a full setup of the backlight. We
> were missing the PWM alternate increment bit in the south chicken
> registers on lpt+ pch. This potentially caused a PWM frequency change
> when the chicken register value was lost e.g. on suspend.
>
> v2 by Jani, rebase on the patch caching alt increment
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97486
There's a good chance this'll also fix a bug long ago deemed
NOTOURBUG...
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67454
> Cc: Cooper Chiou <cooper.chiou@intel.com>
> Cc: Wei Shun Chen <wei.shun.chang@intel.com>
> Cc: Gary C Wang <gary.c.wang@intel.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Shawn Lee <shawn.c.lee@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/intel_panel.c | 18 +++++++++++++++++-
> 1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
> index 8bc43205d6a0..be4b4d546fd9 100644
> --- a/drivers/gpu/drm/i915/intel_panel.c
> +++ b/drivers/gpu/drm/i915/intel_panel.c
> @@ -841,7 +841,7 @@ static void lpt_enable_backlight(struct intel_connector *connector)
> {
> struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
> struct intel_panel *panel = &connector->panel;
> - u32 pch_ctl1, pch_ctl2;
> + u32 pch_ctl1, pch_ctl2, schicken;
>
> pch_ctl1 = I915_READ(BLC_PWM_PCH_CTL1);
> if (pch_ctl1 & BLM_PCH_PWM_ENABLE) {
> @@ -850,6 +850,22 @@ static void lpt_enable_backlight(struct intel_connector *connector)
> I915_WRITE(BLC_PWM_PCH_CTL1, pch_ctl1);
> }
>
> + if (HAS_PCH_LPT(dev_priv)) {
> + schicken = I915_READ(SOUTH_CHICKEN2);
> + if (panel->backlight.alternate_pwm_increment)
> + schicken |= LPT_PWM_GRANULARITY;
> + else
> + schicken &= ~LPT_PWM_GRANULARITY;
> + I915_WRITE(SOUTH_CHICKEN2, schicken);
> + } else {
> + schicken = I915_READ(SOUTH_CHICKEN1);
> + if (panel->backlight.alternate_pwm_increment)
> + schicken |= SPT_PWM_GRANULARITY;
> + else
> + schicken &= ~SPT_PWM_GRANULARITY;
> + I915_WRITE(SOUTH_CHICKEN1, schicken);
> + }
> +
> pch_ctl2 = panel->backlight.max << 16;
> I915_WRITE(BLC_PWM_PCH_CTL2, pch_ctl2);
--
Jani Nikula, Intel Open Source Technology Center
next prev parent reply other threads:[~2016-09-19 8:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-19 8:23 [PATCH] drm/i915/backlight: setup backlight pwm alternate increment on backlight enable Jani Nikula
2016-09-19 8:23 ` Jani Nikula
2016-09-19 8:24 ` [PATCH v2 1/2] drm/i915/backlight: setup and cache pwm alternate increment value Jani Nikula
2016-09-19 8:24 ` [PATCH v2 2/2] drm/i915/backlight: setup backlight pwm alternate increment on backlight enable Jani Nikula
2016-09-19 8:24 ` Jani Nikula
2016-09-19 8:32 ` Jani Nikula [this message]
2016-09-19 8:32 ` Jani Nikula
2016-09-19 9:18 ` [PATCH v2 1/2] drm/i915/backlight: setup and cache pwm alternate increment value Lee, Shawn C
2016-09-19 9:20 ` Jani Nikula
2016-09-19 8:25 ` [PATCH] drm/i915/backlight: setup backlight pwm alternate increment on backlight enable Jani Nikula
2016-09-19 10:48 ` [Intel-gfx] " kbuild test robot
2016-09-19 10:48 ` kbuild test robot
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=87mvj4nvce.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=cooper.chiou@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=stable@vger.kernel.org \
--cc=wei.shun.chang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.