Patchwork UBUNTU: [Karmic SRU] backlight failed after suspend to ram on IBM X40

login
register
mail settings
Submitter AceLan Kao
Date Dec. 10, 2009, 12:46 p.m.
Message ID <91b198a70912100446t409ab1e7k6715b356570493f1@mail.gmail.com>
Download mbox | patch
Permalink /patch/40802/
State Accepted
Delegated to: Stefan Bader
Headers show

Comments

AceLan Kao - Dec. 10, 2009, 12:46 p.m.
Dear Stefan,

My mistake, I re-attach the file.
Indeed, the patch is cherry-picked from the upstream kernel, and it's hash
value is
0eb96d6ed38430b72897adde58f5477a6b71757a

Best regards,
AceLan Kao.

2009/12/10 Stefan Bader <stefan.bader@canonical.com>

> AceLan Kao wrote:
> > Hi,
> >
> > SRU Justification:
> >
> > IMPACT: Turns out some machines, like the ThinkPad X40 don't come back if
> > you don't save/restore this register.
> >
> > FIX: The patch save and restore one more value of the register while
> > suspending and resuming.
> >
> > TEST: User on the launchpad acked the patch works for him.
> >
> > git://kernel.ubuntu.com/acelan/ubuntu-karmic.git lp292256
> >
> > Best regards,
> > AceLan Kao.
> >
> >
> Looks, like you accidentally picked the swapfile. Beside of that, is that
> patch new and if so has it been sent to upstream CC: stable@kernel.org?
>
> -Stefan
>
Leann Ogasawara - Dec. 10, 2009, 9:15 p.m.
On Thu, 2009-12-10 at 20:46 +0800, AceLan Kao wrote:
> Dear Stefan,
> 
> 
> My mistake, I re-attach the file.
> Indeed, the patch is cherry-picked from the upstream kernel, and it's
> hash value is 
> 0eb96d6ed38430b72897adde58f5477a6b71757a
> 

Hi AceLan,

As Stefan mentioned, per our new SRU policy [1], it's preferred if this
goes into upstream stable first (stable@kernel.org).  We'll then get
this patch automatically the next time we rebase with upstream stable.
I believe there is going to be a 2.6.31.8 release so there should be
enough time to get this in.

Thanks,
Leann

[1] https://wiki.ubuntu.com/specs/KernelLucidSruPolicyReview

> 2009/12/10 Stefan Bader <stefan.bader@canonical.com>
>         AceLan Kao wrote:
>         > Hi,
>         >
>         > SRU Justification:
>         >
>         > IMPACT: Turns out some machines, like the ThinkPad X40 don't
>         come back if
>         > you don't save/restore this register.
>         >
>         > FIX: The patch save and restore one more value of the
>         register while
>         > suspending and resuming.
>         >
>         > TEST: User on the launchpad acked the patch works for him.
>         >
>         > git://kernel.ubuntu.com/acelan/ubuntu-karmic.git lp292256
>         >
>         > Best regards,
>         > AceLan Kao.
>         >
>         >
>         
>         Looks, like you accidentally picked the swapfile. Beside of
>         that, is that
>         patch new and if so has it been sent to upstream CC:
>         stable@kernel.org?
>         
>         -Stefan
> 
> 
> 
> -- 
> Chia-Lin Kao(AceLan)
> http://blog.acelan.idv.tw/
> E-Mail: acelan.kaoATcanonical.com (s/AT/@/)
>
Andy Whitcroft - Dec. 16, 2009, 9:12 a.m.
On Thu, Dec 10, 2009 at 08:46:02PM +0800, AceLan Kao wrote:

> From 43644cbe252d555de423202853f4855693e4316a Mon Sep 17 00:00:00 2001
> From: Jesse Barnes <jbarnes@virtuousgeek.org>
> Date: Wed, 14 Oct 2009 12:33:41 -0700
> Subject: [PATCH] UBUNTU: [Karmic SRU] backlight failed after suspend to ram on IBM X40
> 
> BugLink: https://bugs.edge.launchpad.net/ubuntu/+source/linux/+bug/292256
> 
> drm/i915: save/restore BLC histogram control reg across suspend/resume
> 
> Turns out some machines, like the ThinkPad X40 don't come back if you
> don't save/restore this register.
> 
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> Signed-off-by: Eric Anholt <eric@anholt.net>
> (cherry picked from commit 0eb96d6ed38430b72897adde58f5477a6b71757a)
> 
> Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h     |    1 +
>  drivers/gpu/drm/i915/i915_reg.h     |    2 ++
>  drivers/gpu/drm/i915/i915_suspend.c |    2 ++
>  3 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 88b3eff..602dd76 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -264,6 +264,7 @@ typedef struct drm_i915_private {
>  	u32 saveDSPASURF;
>  	u32 saveDSPATILEOFF;
>  	u32 savePFIT_PGM_RATIOS;
> +	u32 saveBLC_HIST_CTL;
>  	u32 saveBLC_PWM_CTL;
>  	u32 saveBLC_PWM_CTL2;
>  	u32 saveFPB0;
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index c017fa1..9917749 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -915,6 +915,8 @@
>  #define   BACKLIGHT_DUTY_CYCLE_SHIFT		(0)
>  #define   BACKLIGHT_DUTY_CYCLE_MASK		(0xffff)
>  
> +#define BLC_HIST_CTL		0x61260
> +
>  /* TV port control */
>  #define TV_CTL			0x68000
>  /** Enables the TV encoder */
> diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
> index 1d04e19..2e4aca6 100644
> --- a/drivers/gpu/drm/i915/i915_suspend.c
> +++ b/drivers/gpu/drm/i915/i915_suspend.c
> @@ -416,6 +416,7 @@ int i915_save_state(struct drm_device *dev)
>  	dev_priv->savePP_CONTROL = I915_READ(PP_CONTROL);
>  	dev_priv->savePFIT_PGM_RATIOS = I915_READ(PFIT_PGM_RATIOS);
>  	dev_priv->saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL);
> +	dev_priv->saveBLC_HIST_CTL = I915_READ(BLC_HIST_CTL);
>  	if (IS_I965G(dev))
>  		dev_priv->saveBLC_PWM_CTL2 = I915_READ(BLC_PWM_CTL2);
>  	if (IS_MOBILE(dev) && !IS_I830(dev))
> @@ -560,6 +561,7 @@ int i915_restore_state(struct drm_device *dev)
>  
>  	I915_WRITE(PFIT_PGM_RATIOS, dev_priv->savePFIT_PGM_RATIOS);
>  	I915_WRITE(BLC_PWM_CTL, dev_priv->saveBLC_PWM_CTL);
> +	I915_WRITE(BLC_HIST_CTL, dev_priv->saveBLC_HIST_CTL);
>  	I915_WRITE(PP_ON_DELAYS, dev_priv->savePP_ON_DELAYS);
>  	I915_WRITE(PP_OFF_DELAYS, dev_priv->savePP_OFF_DELAYS);
>  	I915_WRITE(PP_DIVISOR, dev_priv->savePP_DIVISOR);
> -- 
> 1.6.3.3
> 

Simply saves one additional register across suspend/resume.  Look sane.

Acked-by: Andy Whitcroft <apw@canonical.com>

-apw

Patch

From 43644cbe252d555de423202853f4855693e4316a Mon Sep 17 00:00:00 2001
From: Jesse Barnes <jbarnes@virtuousgeek.org>
Date: Wed, 14 Oct 2009 12:33:41 -0700
Subject: [PATCH] UBUNTU: [Karmic SRU] backlight failed after suspend to ram on IBM X40

BugLink: https://bugs.edge.launchpad.net/ubuntu/+source/linux/+bug/292256

drm/i915: save/restore BLC histogram control reg across suspend/resume

Turns out some machines, like the ThinkPad X40 don't come back if you
don't save/restore this register.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 0eb96d6ed38430b72897adde58f5477a6b71757a)

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
---
 drivers/gpu/drm/i915/i915_drv.h     |    1 +
 drivers/gpu/drm/i915/i915_reg.h     |    2 ++
 drivers/gpu/drm/i915/i915_suspend.c |    2 ++
 3 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 88b3eff..602dd76 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -264,6 +264,7 @@  typedef struct drm_i915_private {
 	u32 saveDSPASURF;
 	u32 saveDSPATILEOFF;
 	u32 savePFIT_PGM_RATIOS;
+	u32 saveBLC_HIST_CTL;
 	u32 saveBLC_PWM_CTL;
 	u32 saveBLC_PWM_CTL2;
 	u32 saveFPB0;
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index c017fa1..9917749 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -915,6 +915,8 @@ 
 #define   BACKLIGHT_DUTY_CYCLE_SHIFT		(0)
 #define   BACKLIGHT_DUTY_CYCLE_MASK		(0xffff)
 
+#define BLC_HIST_CTL		0x61260
+
 /* TV port control */
 #define TV_CTL			0x68000
 /** Enables the TV encoder */
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index 1d04e19..2e4aca6 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -416,6 +416,7 @@  int i915_save_state(struct drm_device *dev)
 	dev_priv->savePP_CONTROL = I915_READ(PP_CONTROL);
 	dev_priv->savePFIT_PGM_RATIOS = I915_READ(PFIT_PGM_RATIOS);
 	dev_priv->saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL);
+	dev_priv->saveBLC_HIST_CTL = I915_READ(BLC_HIST_CTL);
 	if (IS_I965G(dev))
 		dev_priv->saveBLC_PWM_CTL2 = I915_READ(BLC_PWM_CTL2);
 	if (IS_MOBILE(dev) && !IS_I830(dev))
@@ -560,6 +561,7 @@  int i915_restore_state(struct drm_device *dev)
 
 	I915_WRITE(PFIT_PGM_RATIOS, dev_priv->savePFIT_PGM_RATIOS);
 	I915_WRITE(BLC_PWM_CTL, dev_priv->saveBLC_PWM_CTL);
+	I915_WRITE(BLC_HIST_CTL, dev_priv->saveBLC_HIST_CTL);
 	I915_WRITE(PP_ON_DELAYS, dev_priv->savePP_ON_DELAYS);
 	I915_WRITE(PP_OFF_DELAYS, dev_priv->savePP_OFF_DELAYS);
 	I915_WRITE(PP_DIVISOR, dev_priv->savePP_DIVISOR);
-- 
1.6.3.3