Lines Matching refs:par
14 static void gx_save_regs(struct gxfb_par *par) in gx_save_regs() argument
20 i = read_gp(par, GP_BLT_STATUS); in gx_save_regs()
24 rdmsrl(MSR_GX_MSR_PADSEL, par->msr.padsel); in gx_save_regs()
25 rdmsrl(MSR_GLCP_DOTPLL, par->msr.dotpll); in gx_save_regs()
27 write_dc(par, DC_UNLOCK, DC_UNLOCK_UNLOCK); in gx_save_regs()
30 memcpy(par->gp, par->gp_regs, sizeof(par->gp)); in gx_save_regs()
31 memcpy(par->dc, par->dc_regs, sizeof(par->dc)); in gx_save_regs()
32 memcpy(par->vp, par->vid_regs, sizeof(par->vp)); in gx_save_regs()
33 memcpy(par->fp, par->vid_regs + VP_FP_START, sizeof(par->fp)); in gx_save_regs()
36 write_dc(par, DC_PAL_ADDRESS, 0); in gx_save_regs()
37 for (i = 0; i < ARRAY_SIZE(par->pal); i++) in gx_save_regs()
38 par->pal[i] = read_dc(par, DC_PAL_DATA); in gx_save_regs()
64 static void gx_restore_gfx_proc(struct gxfb_par *par) in gx_restore_gfx_proc() argument
68 for (i = 0; i < ARRAY_SIZE(par->gp); i++) { in gx_restore_gfx_proc()
77 write_gp(par, i, par->gp[i]); in gx_restore_gfx_proc()
82 static void gx_restore_display_ctlr(struct gxfb_par *par) in gx_restore_display_ctlr() argument
86 for (i = 0; i < ARRAY_SIZE(par->dc); i++) { in gx_restore_display_ctlr()
90 write_dc(par, DC_UNLOCK, DC_UNLOCK_UNLOCK); in gx_restore_display_ctlr()
95 write_dc(par, i, par->dc[i] & ~(DC_GENERAL_CFG_VIDE | in gx_restore_display_ctlr()
103 write_dc(par, i, par->dc[i] & ~(DC_DISPLAY_CFG_VDEN | in gx_restore_display_ctlr()
122 write_dc(par, i, par->dc[i]); in gx_restore_display_ctlr()
127 write_dc(par, DC_PAL_ADDRESS, 0); in gx_restore_display_ctlr()
128 for (i = 0; i < ARRAY_SIZE(par->pal); i++) in gx_restore_display_ctlr()
129 write_dc(par, DC_PAL_DATA, par->pal[i]); in gx_restore_display_ctlr()
132 static void gx_restore_video_proc(struct gxfb_par *par) in gx_restore_video_proc() argument
136 wrmsrl(MSR_GX_MSR_PADSEL, par->msr.padsel); in gx_restore_video_proc()
138 for (i = 0; i < ARRAY_SIZE(par->vp); i++) { in gx_restore_video_proc()
142 write_vp(par, i, par->vp[i] & ~VP_VCFG_VID_EN); in gx_restore_video_proc()
147 write_vp(par, i, par->vp[i] & in gx_restore_video_proc()
164 write_vp(par, i, par->vp[i]); in gx_restore_video_proc()
169 static void gx_restore_regs(struct gxfb_par *par) in gx_restore_regs() argument
173 gx_set_dotpll((uint32_t) (par->msr.dotpll >> 32)); in gx_restore_regs()
174 gx_restore_gfx_proc(par); in gx_restore_regs()
175 gx_restore_display_ctlr(par); in gx_restore_regs()
176 gx_restore_video_proc(par); in gx_restore_regs()
179 for (i = 0; i < ARRAY_SIZE(par->fp); i++) { in gx_restore_regs()
181 write_fp(par, i, par->fp[i]); in gx_restore_regs()
185 static void gx_disable_graphics(struct gxfb_par *par) in gx_disable_graphics() argument
188 write_vp(par, VP_VCFG, par->vp[VP_VCFG] & ~VP_VCFG_VID_EN); in gx_disable_graphics()
189 write_vp(par, VP_DCFG, par->vp[VP_DCFG] & ~(VP_DCFG_DAC_BL_EN | in gx_disable_graphics()
193 write_fp(par, FP_PM, par->fp[FP_PM] & ~FP_PM_P); in gx_disable_graphics()
197 write_dc(par, DC_UNLOCK, DC_UNLOCK_UNLOCK); in gx_disable_graphics()
198 write_dc(par, DC_GENERAL_CFG, par->dc[DC_GENERAL_CFG] & in gx_disable_graphics()
201 write_dc(par, DC_DISPLAY_CFG, par->dc[DC_DISPLAY_CFG] & in gx_disable_graphics()
204 write_dc(par, DC_UNLOCK, DC_UNLOCK_LOCK); in gx_disable_graphics()
207 static void gx_enable_graphics(struct gxfb_par *par) in gx_enable_graphics() argument
211 fp = read_fp(par, FP_PM); in gx_enable_graphics()
212 if (par->fp[FP_PM] & FP_PM_P) { in gx_enable_graphics()
215 write_fp(par, FP_PM, par->fp[FP_PM]); in gx_enable_graphics()
219 write_fp(par, FP_PM, par->fp[FP_PM]); in gx_enable_graphics()
223 write_vp(par, VP_VCFG, par->vp[VP_VCFG]); in gx_enable_graphics()
224 write_vp(par, VP_DCFG, par->vp[VP_DCFG]); in gx_enable_graphics()
225 write_dc(par, DC_DISPLAY_CFG, par->dc[DC_DISPLAY_CFG]); in gx_enable_graphics()
227 write_dc(par, DC_GENERAL_CFG, par->dc[DC_GENERAL_CFG]); in gx_enable_graphics()
230 write_dc(par, DC_UNLOCK, DC_UNLOCK_LOCK); in gx_enable_graphics()
235 struct gxfb_par *par = info->par; in gx_powerdown() local
237 if (par->powered_down) in gx_powerdown()
240 gx_save_regs(par); in gx_powerdown()
241 gx_disable_graphics(par); in gx_powerdown()
243 par->powered_down = 1; in gx_powerdown()
249 struct gxfb_par *par = info->par; in gx_powerup() local
251 if (!par->powered_down) in gx_powerup()
254 gx_restore_regs(par); in gx_powerup()
255 gx_enable_graphics(par); in gx_powerup()
257 par->powered_down = 0; in gx_powerup()