Re: Test patch for sleep on Aluminium PowerBooks
On Wed, 2004-10-27 at 16:59 +0200, Colin Leroy wrote:
> On 27 Oct 2004 at 22h10, Benjamin Herrenschmidt wrote:
>
> Hi,
>
> > Regarding the blanking, try hacking the code to look more like the old
> > one until you find out what change broke it ...
>
> Ok. The following patch fixes it. Last hunk fixed the backlight shutdown
> (screen goes dark as usual), first hunk fixed the backlight restart (with
> only the last hunk, the screen becomes garbled when you reenable it).
>
> I don't know if it would break other radeons, though, so maybe you have to
> give it a test too.
Hrm... what happens if, instead, you just add a delay in that part:
lvds_gen_cntl |= LVDS_DISPLAY_DIS;
OUTREG(LVDS_GEN_CNTL, lvds_gen_cntl);
lvds_gen_cntl &= ~(LVDS_ON | LVDS_BLON /* | LVDS_EN | LVDS_DIGON */);
OUTREG(LVDS_GEN_CNTL, lvds_gen_cntl);
Just before that last outreg ? like mdelay(200); ? If taht helps, then I can use
the async timer stuff to force the backlight to go down...
Ben.
>
> Signed-off-by: Colin Leroy <colin@colino.net>
> --- a/drivers/video/aty/radeon_base.c 2004-10-27 16:51:41.243861048 +0200
> +++ b/drivers/video/aty/radeon_base.c 2004-10-27 16:52:33.000992768 +0200
> @@ -1835,12 +1835,14 @@
> if (on && (level > BACKLIGHT_OFF)) {
> lvds_gen_cntl &= ~LVDS_DISPLAY_DIS;
> if (!(lvds_gen_cntl & LVDS_BLON) || !(lvds_gen_cntl & LVDS_ON)) {
> - lvds_gen_cntl |= LVDS_BLON /* | LVDS_EN | LVDS_DIGON */;
> + lvds_gen_cntl |= (LVDS_ON | LVDS_BLON | LVDS_EN | LVDS_DIGON);
> OUTREG(LVDS_GEN_CNTL, lvds_gen_cntl);
> +
> + lvds_gen_cntl = INREG(LVDS_GEN_CNTL);
> lvds_gen_cntl &= ~LVDS_BL_MOD_LEVEL_MASK;
> lvds_gen_cntl |= (conv_table[level] <<
> LVDS_BL_MOD_LEVEL_SHIFT);
> - lvds_gen_cntl |= LVDS_ON;
> +
> rinfo->pending_lvds_gen_cntl = lvds_gen_cntl;
> mod_timer(&rinfo->lvds_timer,
> jiffies + msecs_to_jiffies(rinfo->panel_info.pwr_delay));
> @@ -1865,7 +1867,7 @@
> LVDS_BL_MOD_LEVEL_SHIFT);
> lvds_gen_cntl |= LVDS_DISPLAY_DIS;
> OUTREG(LVDS_GEN_CNTL, lvds_gen_cntl);
> - lvds_gen_cntl &= ~(LVDS_ON | LVDS_BLON /* | LVDS_EN | LVDS_DIGON */);
> + lvds_gen_cntl &= ~(LVDS_ON | LVDS_BLON | LVDS_EN | LVDS_DIGON);
> OUTREG(LVDS_GEN_CNTL, lvds_gen_cntl);
> if (rinfo->is_mobility || rinfo->is_IGP)
> OUTPLL(PIXCLKS_CNTL, tmpPixclksCntl);
--
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reply to: