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 | |
| 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>
| -rw-r--r-- | drivers/video/geode/lxfb.h | 4 | ||||
| -rw-r--r-- | drivers/video/geode/lxfb_ops.c | 20 |
2 files changed, 18 insertions, 6 deletions
diff --git a/drivers/video/geode/lxfb.h b/drivers/video/geode/lxfb.h index e4c4d89b786..be8ccb47ebe 100644 --- a/drivers/video/geode/lxfb.h +++ b/drivers/video/geode/lxfb.h | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #define DC_HFILT_COUNT 0x100 | 22 | #define DC_HFILT_COUNT 0x100 |
| 23 | #define DC_VFILT_COUNT 0x100 | 23 | #define DC_VFILT_COUNT 0x100 |
| 24 | #define VP_COEFF_SIZE 0x1000 | 24 | #define VP_COEFF_SIZE 0x1000 |
| 25 | #define VP_PAL_COUNT 0x100 | ||
| 25 | 26 | ||
| 26 | #define OUTPUT_CRT 0x01 | 27 | #define OUTPUT_CRT 0x01 |
| 27 | #define OUTPUT_PANEL 0x02 | 28 | #define OUTPUT_PANEL 0x02 |
| @@ -48,7 +49,8 @@ struct lxfb_par { | |||
| 48 | uint64_t vp[VP_REG_COUNT]; | 49 | uint64_t vp[VP_REG_COUNT]; |
| 49 | uint64_t fp[FP_REG_COUNT]; | 50 | uint64_t fp[FP_REG_COUNT]; |
| 50 | 51 | ||
| 51 | uint32_t pal[DC_PAL_COUNT]; | 52 | uint32_t dc_pal[DC_PAL_COUNT]; |
| 53 | uint32_t vp_pal[VP_PAL_COUNT]; | ||
| 52 | uint32_t hcoeff[DC_HFILT_COUNT * 2]; | 54 | uint32_t hcoeff[DC_HFILT_COUNT * 2]; |
| 53 | uint32_t vcoeff[DC_VFILT_COUNT]; | 55 | uint32_t vcoeff[DC_VFILT_COUNT]; |
| 54 | uint32_t vp_coeff[VP_COEFF_SIZE / 4]; | 56 | uint32_t vp_coeff[VP_COEFF_SIZE / 4]; |
diff --git a/drivers/video/geode/lxfb_ops.c b/drivers/video/geode/lxfb_ops.c index 85ec7f64c42..79e9abc72b8 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 | } |
