diff options
author | Daniel Drake <dsd@laptop.org> | 2010-11-30 15:34:52 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-12-01 04:18:56 -0500 |
commit | 16cdd4336fdca9b50f991b591005b5f6416f82c4 (patch) | |
tree | 45bde2b1c434851bacd657e8fb2c493e2960c7cb /drivers/video/geode/lxfb_ops.c | |
parent | 93c176f39fedaeff854ccb7681d626d65bdffe52 (diff) |
lxfb: Maintain video processor palette through suspend/resume
The Geode X driver uses both of the LX's palettes, one for gamma
correction and one for colormaps.
The kernel driver currently only backs up the one used for colormaps
during suspend/resume. If you mess with gamma settings and do a
suspend/resume, colors go funny.
Fix this by backing up the video proc palette during suspend/resume,
alongside the display controller one which is already handled.
Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video/geode/lxfb_ops.c')
-rw-r--r-- | drivers/video/geode/lxfb_ops.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/video/geode/lxfb_ops.c b/drivers/video/geode/lxfb_ops.c index 85ec7f64c42a..79e9abc72b83 100644 --- a/drivers/video/geode/lxfb_ops.c +++ b/drivers/video/geode/lxfb_ops.c | |||
@@ -610,10 +610,15 @@ static void lx_save_regs(struct lxfb_par *par) | |||
610 | memcpy(par->vp, par->vp_regs, sizeof(par->vp)); | 610 | memcpy(par->vp, par->vp_regs, sizeof(par->vp)); |
611 | memcpy(par->fp, par->vp_regs + VP_FP_START, sizeof(par->fp)); | 611 | memcpy(par->fp, par->vp_regs + VP_FP_START, sizeof(par->fp)); |
612 | 612 | ||
613 | /* save the palette */ | 613 | /* save the display controller palette */ |
614 | write_dc(par, DC_PAL_ADDRESS, 0); | 614 | write_dc(par, DC_PAL_ADDRESS, 0); |
615 | for (i = 0; i < ARRAY_SIZE(par->pal); i++) | 615 | for (i = 0; i < ARRAY_SIZE(par->dc_pal); i++) |
616 | par->pal[i] = read_dc(par, DC_PAL_DATA); | 616 | par->dc_pal[i] = read_dc(par, DC_PAL_DATA); |
617 | |||
618 | /* save the video processor palette */ | ||
619 | write_vp(par, VP_PAR, 0); | ||
620 | for (i = 0; i < ARRAY_SIZE(par->vp_pal); i++) | ||
621 | par->vp_pal[i] = read_vp(par, VP_PDR); | ||
617 | 622 | ||
618 | /* save the horizontal filter coefficients */ | 623 | /* save the horizontal filter coefficients */ |
619 | filt = par->dc[DC_IRQ_FILT_CTL] | DC_IRQ_FILT_CTL_H_FILT_SEL; | 624 | filt = par->dc[DC_IRQ_FILT_CTL] | DC_IRQ_FILT_CTL_H_FILT_SEL; |
@@ -706,8 +711,8 @@ static void lx_restore_display_ctlr(struct lxfb_par *par) | |||
706 | 711 | ||
707 | /* restore the palette */ | 712 | /* restore the palette */ |
708 | write_dc(par, DC_PAL_ADDRESS, 0); | 713 | write_dc(par, DC_PAL_ADDRESS, 0); |
709 | for (i = 0; i < ARRAY_SIZE(par->pal); i++) | 714 | for (i = 0; i < ARRAY_SIZE(par->dc_pal); i++) |
710 | write_dc(par, DC_PAL_DATA, par->pal[i]); | 715 | write_dc(par, DC_PAL_DATA, par->dc_pal[i]); |
711 | 716 | ||
712 | /* restore the horizontal filter coefficients */ | 717 | /* restore the horizontal filter coefficients */ |
713 | filt = par->dc[DC_IRQ_FILT_CTL] | DC_IRQ_FILT_CTL_H_FILT_SEL; | 718 | filt = par->dc[DC_IRQ_FILT_CTL] | DC_IRQ_FILT_CTL_H_FILT_SEL; |
@@ -751,6 +756,11 @@ static void lx_restore_video_proc(struct lxfb_par *par) | |||
751 | } | 756 | } |
752 | } | 757 | } |
753 | 758 | ||
759 | /* restore video processor palette */ | ||
760 | write_vp(par, VP_PAR, 0); | ||
761 | for (i = 0; i < ARRAY_SIZE(par->vp_pal); i++) | ||
762 | write_vp(par, VP_PDR, par->vp_pal[i]); | ||
763 | |||
754 | /* restore video coeff ram */ | 764 | /* restore video coeff ram */ |
755 | memcpy(par->vp_regs + VP_VCR, par->vp_coeff, sizeof(par->vp_coeff)); | 765 | memcpy(par->vp_regs + VP_VCR, par->vp_coeff, sizeof(par->vp_coeff)); |
756 | } | 766 | } |