diff options
-rw-r--r-- | drivers/gpu/drm/gma500/cdv_intel_display.c | 31 | ||||
-rw-r--r-- | drivers/gpu/drm/gma500/oaktrail_device.c | 198 | ||||
-rw-r--r-- | drivers/gpu/drm/gma500/oaktrail_hdmi.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/gma500/psb_device.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/gma500/psb_drv.h | 18 | ||||
-rw-r--r-- | drivers/gpu/drm/gma500/psb_intel_display.c | 31 |
6 files changed, 148 insertions, 138 deletions
diff --git a/drivers/gpu/drm/gma500/cdv_intel_display.c b/drivers/gpu/drm/gma500/cdv_intel_display.c index dc9e246768da..67debf024d9c 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_display.c +++ b/drivers/gpu/drm/gma500/cdv_intel_display.c | |||
@@ -968,7 +968,7 @@ void cdv_intel_crtc_load_lut(struct drm_crtc *crtc) | |||
968 | gma_power_end(dev); | 968 | gma_power_end(dev); |
969 | } else { | 969 | } else { |
970 | for (i = 0; i < 256; i++) { | 970 | for (i = 0; i < 256; i++) { |
971 | dev_priv->regs.save_palette_a[i] = | 971 | dev_priv->regs.psb.save_palette_a[i] = |
972 | ((psb_intel_crtc->lut_r[i] + | 972 | ((psb_intel_crtc->lut_r[i] + |
973 | psb_intel_crtc->lut_adj[i]) << 16) | | 973 | psb_intel_crtc->lut_adj[i]) << 16) | |
974 | ((psb_intel_crtc->lut_g[i] + | 974 | ((psb_intel_crtc->lut_g[i] + |
@@ -1338,19 +1338,20 @@ static int cdv_intel_crtc_clock_get(struct drm_device *dev, | |||
1338 | gma_power_end(dev); | 1338 | gma_power_end(dev); |
1339 | } else { | 1339 | } else { |
1340 | dpll = (pipe == 0) ? | 1340 | dpll = (pipe == 0) ? |
1341 | dev_priv->regs.saveDPLL_A : dev_priv->regs.saveDPLL_B; | 1341 | dev_priv->regs.psb.saveDPLL_A : |
1342 | dev_priv->regs.psb.saveDPLL_B; | ||
1342 | 1343 | ||
1343 | if ((dpll & DISPLAY_RATE_SELECT_FPA1) == 0) | 1344 | if ((dpll & DISPLAY_RATE_SELECT_FPA1) == 0) |
1344 | fp = (pipe == 0) ? | 1345 | fp = (pipe == 0) ? |
1345 | dev_priv->regs.saveFPA0 : | 1346 | dev_priv->regs.psb.saveFPA0 : |
1346 | dev_priv->regs.saveFPB0; | 1347 | dev_priv->regs.psb.saveFPB0; |
1347 | else | 1348 | else |
1348 | fp = (pipe == 0) ? | 1349 | fp = (pipe == 0) ? |
1349 | dev_priv->regs.saveFPA1 : | 1350 | dev_priv->regs.psb.saveFPA1 : |
1350 | dev_priv->regs.saveFPB1; | 1351 | dev_priv->regs.psb.saveFPB1; |
1351 | 1352 | ||
1352 | is_lvds = (pipe == 1) && | 1353 | is_lvds = (pipe == 1) && |
1353 | (dev_priv->regs.saveLVDS & LVDS_PORT_EN); | 1354 | (dev_priv->regs.psb.saveLVDS & LVDS_PORT_EN); |
1354 | } | 1355 | } |
1355 | 1356 | ||
1356 | clock.m1 = (fp & FP_M1_DIV_MASK) >> FP_M1_DIV_SHIFT; | 1357 | clock.m1 = (fp & FP_M1_DIV_MASK) >> FP_M1_DIV_SHIFT; |
@@ -1420,17 +1421,17 @@ struct drm_display_mode *cdv_intel_crtc_mode_get(struct drm_device *dev, | |||
1420 | gma_power_end(dev); | 1421 | gma_power_end(dev); |
1421 | } else { | 1422 | } else { |
1422 | htot = (pipe == 0) ? | 1423 | htot = (pipe == 0) ? |
1423 | dev_priv->regs.saveHTOTAL_A : | 1424 | dev_priv->regs.psb.saveHTOTAL_A : |
1424 | dev_priv->regs.saveHTOTAL_B; | 1425 | dev_priv->regs.psb.saveHTOTAL_B; |
1425 | hsync = (pipe == 0) ? | 1426 | hsync = (pipe == 0) ? |
1426 | dev_priv->regs.saveHSYNC_A : | 1427 | dev_priv->regs.psb.saveHSYNC_A : |
1427 | dev_priv->regs.saveHSYNC_B; | 1428 | dev_priv->regs.psb.saveHSYNC_B; |
1428 | vtot = (pipe == 0) ? | 1429 | vtot = (pipe == 0) ? |
1429 | dev_priv->regs.saveVTOTAL_A : | 1430 | dev_priv->regs.psb.saveVTOTAL_A : |
1430 | dev_priv->regs.saveVTOTAL_B; | 1431 | dev_priv->regs.psb.saveVTOTAL_B; |
1431 | vsync = (pipe == 0) ? | 1432 | vsync = (pipe == 0) ? |
1432 | dev_priv->regs.saveVSYNC_A : | 1433 | dev_priv->regs.psb.saveVSYNC_A : |
1433 | dev_priv->regs.saveVSYNC_B; | 1434 | dev_priv->regs.psb.saveVSYNC_B; |
1434 | } | 1435 | } |
1435 | 1436 | ||
1436 | mode = kzalloc(sizeof(*mode), GFP_KERNEL); | 1437 | mode = kzalloc(sizeof(*mode), GFP_KERNEL); |
diff --git a/drivers/gpu/drm/gma500/oaktrail_device.c b/drivers/gpu/drm/gma500/oaktrail_device.c index 22def104bb4a..2b79fbb0d137 100644 --- a/drivers/gpu/drm/gma500/oaktrail_device.c +++ b/drivers/gpu/drm/gma500/oaktrail_device.c | |||
@@ -186,82 +186,82 @@ int oaktrail_backlight_init(struct drm_device *dev) | |||
186 | static int oaktrail_save_display_registers(struct drm_device *dev) | 186 | static int oaktrail_save_display_registers(struct drm_device *dev) |
187 | { | 187 | { |
188 | struct drm_psb_private *dev_priv = dev->dev_private; | 188 | struct drm_psb_private *dev_priv = dev->dev_private; |
189 | struct psb_state *regs = &dev_priv->regs; | 189 | struct psb_save_area *regs = &dev_priv->regs; |
190 | int i; | 190 | int i; |
191 | u32 pp_stat; | 191 | u32 pp_stat; |
192 | 192 | ||
193 | /* Display arbitration control + watermarks */ | 193 | /* Display arbitration control + watermarks */ |
194 | regs->saveDSPARB = PSB_RVDC32(DSPARB); | 194 | regs->psb.saveDSPARB = PSB_RVDC32(DSPARB); |
195 | regs->saveDSPFW1 = PSB_RVDC32(DSPFW1); | 195 | regs->psb.saveDSPFW1 = PSB_RVDC32(DSPFW1); |
196 | regs->saveDSPFW2 = PSB_RVDC32(DSPFW2); | 196 | regs->psb.saveDSPFW2 = PSB_RVDC32(DSPFW2); |
197 | regs->saveDSPFW3 = PSB_RVDC32(DSPFW3); | 197 | regs->psb.saveDSPFW3 = PSB_RVDC32(DSPFW3); |
198 | regs->saveDSPFW4 = PSB_RVDC32(DSPFW4); | 198 | regs->psb.saveDSPFW4 = PSB_RVDC32(DSPFW4); |
199 | regs->saveDSPFW5 = PSB_RVDC32(DSPFW5); | 199 | regs->psb.saveDSPFW5 = PSB_RVDC32(DSPFW5); |
200 | regs->saveDSPFW6 = PSB_RVDC32(DSPFW6); | 200 | regs->psb.saveDSPFW6 = PSB_RVDC32(DSPFW6); |
201 | regs->saveCHICKENBIT = PSB_RVDC32(DSPCHICKENBIT); | 201 | regs->psb.saveCHICKENBIT = PSB_RVDC32(DSPCHICKENBIT); |
202 | 202 | ||
203 | /* Pipe & plane A info */ | 203 | /* Pipe & plane A info */ |
204 | regs->savePIPEACONF = PSB_RVDC32(PIPEACONF); | 204 | regs->psb.savePIPEACONF = PSB_RVDC32(PIPEACONF); |
205 | regs->savePIPEASRC = PSB_RVDC32(PIPEASRC); | 205 | regs->psb.savePIPEASRC = PSB_RVDC32(PIPEASRC); |
206 | regs->saveFPA0 = PSB_RVDC32(MRST_FPA0); | 206 | regs->psb.saveFPA0 = PSB_RVDC32(MRST_FPA0); |
207 | regs->saveFPA1 = PSB_RVDC32(MRST_FPA1); | 207 | regs->psb.saveFPA1 = PSB_RVDC32(MRST_FPA1); |
208 | regs->saveDPLL_A = PSB_RVDC32(MRST_DPLL_A); | 208 | regs->psb.saveDPLL_A = PSB_RVDC32(MRST_DPLL_A); |
209 | regs->saveHTOTAL_A = PSB_RVDC32(HTOTAL_A); | 209 | regs->psb.saveHTOTAL_A = PSB_RVDC32(HTOTAL_A); |
210 | regs->saveHBLANK_A = PSB_RVDC32(HBLANK_A); | 210 | regs->psb.saveHBLANK_A = PSB_RVDC32(HBLANK_A); |
211 | regs->saveHSYNC_A = PSB_RVDC32(HSYNC_A); | 211 | regs->psb.saveHSYNC_A = PSB_RVDC32(HSYNC_A); |
212 | regs->saveVTOTAL_A = PSB_RVDC32(VTOTAL_A); | 212 | regs->psb.saveVTOTAL_A = PSB_RVDC32(VTOTAL_A); |
213 | regs->saveVBLANK_A = PSB_RVDC32(VBLANK_A); | 213 | regs->psb.saveVBLANK_A = PSB_RVDC32(VBLANK_A); |
214 | regs->saveVSYNC_A = PSB_RVDC32(VSYNC_A); | 214 | regs->psb.saveVSYNC_A = PSB_RVDC32(VSYNC_A); |
215 | regs->saveBCLRPAT_A = PSB_RVDC32(BCLRPAT_A); | 215 | regs->psb.saveBCLRPAT_A = PSB_RVDC32(BCLRPAT_A); |
216 | regs->saveDSPACNTR = PSB_RVDC32(DSPACNTR); | 216 | regs->psb.saveDSPACNTR = PSB_RVDC32(DSPACNTR); |
217 | regs->saveDSPASTRIDE = PSB_RVDC32(DSPASTRIDE); | 217 | regs->psb.saveDSPASTRIDE = PSB_RVDC32(DSPASTRIDE); |
218 | regs->saveDSPAADDR = PSB_RVDC32(DSPABASE); | 218 | regs->psb.saveDSPAADDR = PSB_RVDC32(DSPABASE); |
219 | regs->saveDSPASURF = PSB_RVDC32(DSPASURF); | 219 | regs->psb.saveDSPASURF = PSB_RVDC32(DSPASURF); |
220 | regs->saveDSPALINOFF = PSB_RVDC32(DSPALINOFF); | 220 | regs->psb.saveDSPALINOFF = PSB_RVDC32(DSPALINOFF); |
221 | regs->saveDSPATILEOFF = PSB_RVDC32(DSPATILEOFF); | 221 | regs->psb.saveDSPATILEOFF = PSB_RVDC32(DSPATILEOFF); |
222 | 222 | ||
223 | /* Save cursor regs */ | 223 | /* Save cursor regs */ |
224 | regs->saveDSPACURSOR_CTRL = PSB_RVDC32(CURACNTR); | 224 | regs->psb.saveDSPACURSOR_CTRL = PSB_RVDC32(CURACNTR); |
225 | regs->saveDSPACURSOR_BASE = PSB_RVDC32(CURABASE); | 225 | regs->psb.saveDSPACURSOR_BASE = PSB_RVDC32(CURABASE); |
226 | regs->saveDSPACURSOR_POS = PSB_RVDC32(CURAPOS); | 226 | regs->psb.saveDSPACURSOR_POS = PSB_RVDC32(CURAPOS); |
227 | 227 | ||
228 | /* Save palette (gamma) */ | 228 | /* Save palette (gamma) */ |
229 | for (i = 0; i < 256; i++) | 229 | for (i = 0; i < 256; i++) |
230 | regs->save_palette_a[i] = PSB_RVDC32(PALETTE_A + (i << 2)); | 230 | regs->psb.save_palette_a[i] = PSB_RVDC32(PALETTE_A + (i << 2)); |
231 | 231 | ||
232 | if (dev_priv->hdmi_priv) | 232 | if (dev_priv->hdmi_priv) |
233 | oaktrail_hdmi_save(dev); | 233 | oaktrail_hdmi_save(dev); |
234 | 234 | ||
235 | /* Save performance state */ | 235 | /* Save performance state */ |
236 | regs->savePERF_MODE = PSB_RVDC32(MRST_PERF_MODE); | 236 | regs->psb.savePERF_MODE = PSB_RVDC32(MRST_PERF_MODE); |
237 | 237 | ||
238 | /* LVDS state */ | 238 | /* LVDS state */ |
239 | regs->savePP_CONTROL = PSB_RVDC32(PP_CONTROL); | 239 | regs->psb.savePP_CONTROL = PSB_RVDC32(PP_CONTROL); |
240 | regs->savePFIT_PGM_RATIOS = PSB_RVDC32(PFIT_PGM_RATIOS); | 240 | regs->psb.savePFIT_PGM_RATIOS = PSB_RVDC32(PFIT_PGM_RATIOS); |
241 | regs->savePFIT_AUTO_RATIOS = PSB_RVDC32(PFIT_AUTO_RATIOS); | 241 | regs->psb.savePFIT_AUTO_RATIOS = PSB_RVDC32(PFIT_AUTO_RATIOS); |
242 | regs->saveBLC_PWM_CTL = PSB_RVDC32(BLC_PWM_CTL); | 242 | regs->saveBLC_PWM_CTL = PSB_RVDC32(BLC_PWM_CTL); |
243 | regs->saveBLC_PWM_CTL2 = PSB_RVDC32(BLC_PWM_CTL2); | 243 | regs->saveBLC_PWM_CTL2 = PSB_RVDC32(BLC_PWM_CTL2); |
244 | regs->saveLVDS = PSB_RVDC32(LVDS); | 244 | regs->psb.saveLVDS = PSB_RVDC32(LVDS); |
245 | regs->savePFIT_CONTROL = PSB_RVDC32(PFIT_CONTROL); | 245 | regs->psb.savePFIT_CONTROL = PSB_RVDC32(PFIT_CONTROL); |
246 | regs->savePP_ON_DELAYS = PSB_RVDC32(LVDSPP_ON); | 246 | regs->psb.savePP_ON_DELAYS = PSB_RVDC32(LVDSPP_ON); |
247 | regs->savePP_OFF_DELAYS = PSB_RVDC32(LVDSPP_OFF); | 247 | regs->psb.savePP_OFF_DELAYS = PSB_RVDC32(LVDSPP_OFF); |
248 | regs->savePP_DIVISOR = PSB_RVDC32(PP_CYCLE); | 248 | regs->psb.savePP_DIVISOR = PSB_RVDC32(PP_CYCLE); |
249 | 249 | ||
250 | /* HW overlay */ | 250 | /* HW overlay */ |
251 | regs->saveOV_OVADD = PSB_RVDC32(OV_OVADD); | 251 | regs->psb.saveOV_OVADD = PSB_RVDC32(OV_OVADD); |
252 | regs->saveOV_OGAMC0 = PSB_RVDC32(OV_OGAMC0); | 252 | regs->psb.saveOV_OGAMC0 = PSB_RVDC32(OV_OGAMC0); |
253 | regs->saveOV_OGAMC1 = PSB_RVDC32(OV_OGAMC1); | 253 | regs->psb.saveOV_OGAMC1 = PSB_RVDC32(OV_OGAMC1); |
254 | regs->saveOV_OGAMC2 = PSB_RVDC32(OV_OGAMC2); | 254 | regs->psb.saveOV_OGAMC2 = PSB_RVDC32(OV_OGAMC2); |
255 | regs->saveOV_OGAMC3 = PSB_RVDC32(OV_OGAMC3); | 255 | regs->psb.saveOV_OGAMC3 = PSB_RVDC32(OV_OGAMC3); |
256 | regs->saveOV_OGAMC4 = PSB_RVDC32(OV_OGAMC4); | 256 | regs->psb.saveOV_OGAMC4 = PSB_RVDC32(OV_OGAMC4); |
257 | regs->saveOV_OGAMC5 = PSB_RVDC32(OV_OGAMC5); | 257 | regs->psb.saveOV_OGAMC5 = PSB_RVDC32(OV_OGAMC5); |
258 | 258 | ||
259 | /* DPST registers */ | 259 | /* DPST registers */ |
260 | regs->saveHISTOGRAM_INT_CONTROL_REG = | 260 | regs->psb.saveHISTOGRAM_INT_CONTROL_REG = |
261 | PSB_RVDC32(HISTOGRAM_INT_CONTROL); | 261 | PSB_RVDC32(HISTOGRAM_INT_CONTROL); |
262 | regs->saveHISTOGRAM_LOGIC_CONTROL_REG = | 262 | regs->psb.saveHISTOGRAM_LOGIC_CONTROL_REG = |
263 | PSB_RVDC32(HISTOGRAM_LOGIC_CONTROL); | 263 | PSB_RVDC32(HISTOGRAM_LOGIC_CONTROL); |
264 | regs->savePWM_CONTROL_LOGIC = PSB_RVDC32(PWM_CONTROL_LOGIC); | 264 | regs->psb.savePWM_CONTROL_LOGIC = PSB_RVDC32(PWM_CONTROL_LOGIC); |
265 | 265 | ||
266 | if (dev_priv->iLVDS_enable) { | 266 | if (dev_priv->iLVDS_enable) { |
267 | /* Shut down the panel */ | 267 | /* Shut down the panel */ |
@@ -299,80 +299,80 @@ static int oaktrail_save_display_registers(struct drm_device *dev) | |||
299 | static int oaktrail_restore_display_registers(struct drm_device *dev) | 299 | static int oaktrail_restore_display_registers(struct drm_device *dev) |
300 | { | 300 | { |
301 | struct drm_psb_private *dev_priv = dev->dev_private; | 301 | struct drm_psb_private *dev_priv = dev->dev_private; |
302 | struct psb_state *regs = &dev_priv->regs; | 302 | struct psb_save_area *regs = &dev_priv->regs; |
303 | u32 pp_stat; | 303 | u32 pp_stat; |
304 | int i; | 304 | int i; |
305 | 305 | ||
306 | /* Display arbitration + watermarks */ | 306 | /* Display arbitration + watermarks */ |
307 | PSB_WVDC32(regs->saveDSPARB, DSPARB); | 307 | PSB_WVDC32(regs->psb.saveDSPARB, DSPARB); |
308 | PSB_WVDC32(regs->saveDSPFW1, DSPFW1); | 308 | PSB_WVDC32(regs->psb.saveDSPFW1, DSPFW1); |
309 | PSB_WVDC32(regs->saveDSPFW2, DSPFW2); | 309 | PSB_WVDC32(regs->psb.saveDSPFW2, DSPFW2); |
310 | PSB_WVDC32(regs->saveDSPFW3, DSPFW3); | 310 | PSB_WVDC32(regs->psb.saveDSPFW3, DSPFW3); |
311 | PSB_WVDC32(regs->saveDSPFW4, DSPFW4); | 311 | PSB_WVDC32(regs->psb.saveDSPFW4, DSPFW4); |
312 | PSB_WVDC32(regs->saveDSPFW5, DSPFW5); | 312 | PSB_WVDC32(regs->psb.saveDSPFW5, DSPFW5); |
313 | PSB_WVDC32(regs->saveDSPFW6, DSPFW6); | 313 | PSB_WVDC32(regs->psb.saveDSPFW6, DSPFW6); |
314 | PSB_WVDC32(regs->saveCHICKENBIT, DSPCHICKENBIT); | 314 | PSB_WVDC32(regs->psb.saveCHICKENBIT, DSPCHICKENBIT); |
315 | 315 | ||
316 | /* Make sure VGA plane is off. it initializes to on after reset!*/ | 316 | /* Make sure VGA plane is off. it initializes to on after reset!*/ |
317 | PSB_WVDC32(0x80000000, VGACNTRL); | 317 | PSB_WVDC32(0x80000000, VGACNTRL); |
318 | 318 | ||
319 | /* set the plls */ | 319 | /* set the plls */ |
320 | PSB_WVDC32(regs->saveFPA0, MRST_FPA0); | 320 | PSB_WVDC32(regs->psb.saveFPA0, MRST_FPA0); |
321 | PSB_WVDC32(regs->saveFPA1, MRST_FPA1); | 321 | PSB_WVDC32(regs->psb.saveFPA1, MRST_FPA1); |
322 | 322 | ||
323 | /* Actually enable it */ | 323 | /* Actually enable it */ |
324 | PSB_WVDC32(regs->saveDPLL_A, MRST_DPLL_A); | 324 | PSB_WVDC32(regs->psb.saveDPLL_A, MRST_DPLL_A); |
325 | DRM_UDELAY(150); | 325 | DRM_UDELAY(150); |
326 | 326 | ||
327 | /* Restore mode */ | 327 | /* Restore mode */ |
328 | PSB_WVDC32(regs->saveHTOTAL_A, HTOTAL_A); | 328 | PSB_WVDC32(regs->psb.saveHTOTAL_A, HTOTAL_A); |
329 | PSB_WVDC32(regs->saveHBLANK_A, HBLANK_A); | 329 | PSB_WVDC32(regs->psb.saveHBLANK_A, HBLANK_A); |
330 | PSB_WVDC32(regs->saveHSYNC_A, HSYNC_A); | 330 | PSB_WVDC32(regs->psb.saveHSYNC_A, HSYNC_A); |
331 | PSB_WVDC32(regs->saveVTOTAL_A, VTOTAL_A); | 331 | PSB_WVDC32(regs->psb.saveVTOTAL_A, VTOTAL_A); |
332 | PSB_WVDC32(regs->saveVBLANK_A, VBLANK_A); | 332 | PSB_WVDC32(regs->psb.saveVBLANK_A, VBLANK_A); |
333 | PSB_WVDC32(regs->saveVSYNC_A, VSYNC_A); | 333 | PSB_WVDC32(regs->psb.saveVSYNC_A, VSYNC_A); |
334 | PSB_WVDC32(regs->savePIPEASRC, PIPEASRC); | 334 | PSB_WVDC32(regs->psb.savePIPEASRC, PIPEASRC); |
335 | PSB_WVDC32(regs->saveBCLRPAT_A, BCLRPAT_A); | 335 | PSB_WVDC32(regs->psb.saveBCLRPAT_A, BCLRPAT_A); |
336 | 336 | ||
337 | /* Restore performance mode*/ | 337 | /* Restore performance mode*/ |
338 | PSB_WVDC32(regs->savePERF_MODE, MRST_PERF_MODE); | 338 | PSB_WVDC32(regs->psb.savePERF_MODE, MRST_PERF_MODE); |
339 | 339 | ||
340 | /* Enable the pipe*/ | 340 | /* Enable the pipe*/ |
341 | if (dev_priv->iLVDS_enable) | 341 | if (dev_priv->iLVDS_enable) |
342 | PSB_WVDC32(regs->savePIPEACONF, PIPEACONF); | 342 | PSB_WVDC32(regs->psb.savePIPEACONF, PIPEACONF); |
343 | 343 | ||
344 | /* Set up the plane*/ | 344 | /* Set up the plane*/ |
345 | PSB_WVDC32(regs->saveDSPALINOFF, DSPALINOFF); | 345 | PSB_WVDC32(regs->psb.saveDSPALINOFF, DSPALINOFF); |
346 | PSB_WVDC32(regs->saveDSPASTRIDE, DSPASTRIDE); | 346 | PSB_WVDC32(regs->psb.saveDSPASTRIDE, DSPASTRIDE); |
347 | PSB_WVDC32(regs->saveDSPATILEOFF, DSPATILEOFF); | 347 | PSB_WVDC32(regs->psb.saveDSPATILEOFF, DSPATILEOFF); |
348 | 348 | ||
349 | /* Enable the plane */ | 349 | /* Enable the plane */ |
350 | PSB_WVDC32(regs->saveDSPACNTR, DSPACNTR); | 350 | PSB_WVDC32(regs->psb.saveDSPACNTR, DSPACNTR); |
351 | PSB_WVDC32(regs->saveDSPASURF, DSPASURF); | 351 | PSB_WVDC32(regs->psb.saveDSPASURF, DSPASURF); |
352 | 352 | ||
353 | /* Enable Cursor A */ | 353 | /* Enable Cursor A */ |
354 | PSB_WVDC32(regs->saveDSPACURSOR_CTRL, CURACNTR); | 354 | PSB_WVDC32(regs->psb.saveDSPACURSOR_CTRL, CURACNTR); |
355 | PSB_WVDC32(regs->saveDSPACURSOR_POS, CURAPOS); | 355 | PSB_WVDC32(regs->psb.saveDSPACURSOR_POS, CURAPOS); |
356 | PSB_WVDC32(regs->saveDSPACURSOR_BASE, CURABASE); | 356 | PSB_WVDC32(regs->psb.saveDSPACURSOR_BASE, CURABASE); |
357 | 357 | ||
358 | /* Restore palette (gamma) */ | 358 | /* Restore palette (gamma) */ |
359 | for (i = 0; i < 256; i++) | 359 | for (i = 0; i < 256; i++) |
360 | PSB_WVDC32(regs->save_palette_a[i], PALETTE_A + (i << 2)); | 360 | PSB_WVDC32(regs->psb.save_palette_a[i], PALETTE_A + (i << 2)); |
361 | 361 | ||
362 | if (dev_priv->hdmi_priv) | 362 | if (dev_priv->hdmi_priv) |
363 | oaktrail_hdmi_restore(dev); | 363 | oaktrail_hdmi_restore(dev); |
364 | 364 | ||
365 | if (dev_priv->iLVDS_enable) { | 365 | if (dev_priv->iLVDS_enable) { |
366 | PSB_WVDC32(regs->saveBLC_PWM_CTL2, BLC_PWM_CTL2); | 366 | PSB_WVDC32(regs->saveBLC_PWM_CTL2, BLC_PWM_CTL2); |
367 | PSB_WVDC32(regs->saveLVDS, LVDS); /*port 61180h*/ | 367 | PSB_WVDC32(regs->psb.saveLVDS, LVDS); /*port 61180h*/ |
368 | PSB_WVDC32(regs->savePFIT_CONTROL, PFIT_CONTROL); | 368 | PSB_WVDC32(regs->psb.savePFIT_CONTROL, PFIT_CONTROL); |
369 | PSB_WVDC32(regs->savePFIT_PGM_RATIOS, PFIT_PGM_RATIOS); | 369 | PSB_WVDC32(regs->psb.savePFIT_PGM_RATIOS, PFIT_PGM_RATIOS); |
370 | PSB_WVDC32(regs->savePFIT_AUTO_RATIOS, PFIT_AUTO_RATIOS); | 370 | PSB_WVDC32(regs->psb.savePFIT_AUTO_RATIOS, PFIT_AUTO_RATIOS); |
371 | PSB_WVDC32(regs->saveBLC_PWM_CTL, BLC_PWM_CTL); | 371 | PSB_WVDC32(regs->saveBLC_PWM_CTL, BLC_PWM_CTL); |
372 | PSB_WVDC32(regs->savePP_ON_DELAYS, LVDSPP_ON); | 372 | PSB_WVDC32(regs->psb.savePP_ON_DELAYS, LVDSPP_ON); |
373 | PSB_WVDC32(regs->savePP_OFF_DELAYS, LVDSPP_OFF); | 373 | PSB_WVDC32(regs->psb.savePP_OFF_DELAYS, LVDSPP_OFF); |
374 | PSB_WVDC32(regs->savePP_DIVISOR, PP_CYCLE); | 374 | PSB_WVDC32(regs->psb.savePP_DIVISOR, PP_CYCLE); |
375 | PSB_WVDC32(regs->savePP_CONTROL, PP_CONTROL); | 375 | PSB_WVDC32(regs->psb.savePP_CONTROL, PP_CONTROL); |
376 | } | 376 | } |
377 | 377 | ||
378 | /* Wait for cycle delay */ | 378 | /* Wait for cycle delay */ |
@@ -386,20 +386,20 @@ static int oaktrail_restore_display_registers(struct drm_device *dev) | |||
386 | } while (pp_stat & 0x10000000); | 386 | } while (pp_stat & 0x10000000); |
387 | 387 | ||
388 | /* Restore HW overlay */ | 388 | /* Restore HW overlay */ |
389 | PSB_WVDC32(regs->saveOV_OVADD, OV_OVADD); | 389 | PSB_WVDC32(regs->psb.saveOV_OVADD, OV_OVADD); |
390 | PSB_WVDC32(regs->saveOV_OGAMC0, OV_OGAMC0); | 390 | PSB_WVDC32(regs->psb.saveOV_OGAMC0, OV_OGAMC0); |
391 | PSB_WVDC32(regs->saveOV_OGAMC1, OV_OGAMC1); | 391 | PSB_WVDC32(regs->psb.saveOV_OGAMC1, OV_OGAMC1); |
392 | PSB_WVDC32(regs->saveOV_OGAMC2, OV_OGAMC2); | 392 | PSB_WVDC32(regs->psb.saveOV_OGAMC2, OV_OGAMC2); |
393 | PSB_WVDC32(regs->saveOV_OGAMC3, OV_OGAMC3); | 393 | PSB_WVDC32(regs->psb.saveOV_OGAMC3, OV_OGAMC3); |
394 | PSB_WVDC32(regs->saveOV_OGAMC4, OV_OGAMC4); | 394 | PSB_WVDC32(regs->psb.saveOV_OGAMC4, OV_OGAMC4); |
395 | PSB_WVDC32(regs->saveOV_OGAMC5, OV_OGAMC5); | 395 | PSB_WVDC32(regs->psb.saveOV_OGAMC5, OV_OGAMC5); |
396 | 396 | ||
397 | /* DPST registers */ | 397 | /* DPST registers */ |
398 | PSB_WVDC32(regs->saveHISTOGRAM_INT_CONTROL_REG, | 398 | PSB_WVDC32(regs->psb.saveHISTOGRAM_INT_CONTROL_REG, |
399 | HISTOGRAM_INT_CONTROL); | 399 | HISTOGRAM_INT_CONTROL); |
400 | PSB_WVDC32(regs->saveHISTOGRAM_LOGIC_CONTROL_REG, | 400 | PSB_WVDC32(regs->psb.saveHISTOGRAM_LOGIC_CONTROL_REG, |
401 | HISTOGRAM_LOGIC_CONTROL); | 401 | HISTOGRAM_LOGIC_CONTROL); |
402 | PSB_WVDC32(regs->savePWM_CONTROL_LOGIC, PWM_CONTROL_LOGIC); | 402 | PSB_WVDC32(regs->psb.savePWM_CONTROL_LOGIC, PWM_CONTROL_LOGIC); |
403 | 403 | ||
404 | return 0; | 404 | return 0; |
405 | } | 405 | } |
diff --git a/drivers/gpu/drm/gma500/oaktrail_hdmi.c b/drivers/gpu/drm/gma500/oaktrail_hdmi.c index 5a2de014f237..e4c73c680c99 100644 --- a/drivers/gpu/drm/gma500/oaktrail_hdmi.c +++ b/drivers/gpu/drm/gma500/oaktrail_hdmi.c | |||
@@ -766,7 +766,7 @@ void oaktrail_hdmi_save(struct drm_device *dev) | |||
766 | { | 766 | { |
767 | struct drm_psb_private *dev_priv = dev->dev_private; | 767 | struct drm_psb_private *dev_priv = dev->dev_private; |
768 | struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv; | 768 | struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv; |
769 | struct psb_state *regs = &dev_priv->regs; | 769 | struct psb_state *regs = &dev_priv->regs.psb; |
770 | int i; | 770 | int i; |
771 | 771 | ||
772 | /* dpll */ | 772 | /* dpll */ |
@@ -818,7 +818,7 @@ void oaktrail_hdmi_restore(struct drm_device *dev) | |||
818 | { | 818 | { |
819 | struct drm_psb_private *dev_priv = dev->dev_private; | 819 | struct drm_psb_private *dev_priv = dev->dev_private; |
820 | struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv; | 820 | struct oaktrail_hdmi_dev *hdmi_dev = dev_priv->hdmi_priv; |
821 | struct psb_state *regs = &dev_priv->regs; | 821 | struct psb_state *regs = &dev_priv->regs.psb; |
822 | int i; | 822 | int i; |
823 | 823 | ||
824 | /* dpll */ | 824 | /* dpll */ |
diff --git a/drivers/gpu/drm/gma500/psb_device.c b/drivers/gpu/drm/gma500/psb_device.c index 0d370e7094b8..95d163e4f1f4 100644 --- a/drivers/gpu/drm/gma500/psb_device.c +++ b/drivers/gpu/drm/gma500/psb_device.c | |||
@@ -177,7 +177,7 @@ static int psb_save_display_registers(struct drm_device *dev) | |||
177 | struct drm_psb_private *dev_priv = dev->dev_private; | 177 | struct drm_psb_private *dev_priv = dev->dev_private; |
178 | struct drm_crtc *crtc; | 178 | struct drm_crtc *crtc; |
179 | struct drm_connector *connector; | 179 | struct drm_connector *connector; |
180 | struct psb_state *regs = &dev_priv->regs; | 180 | struct psb_state *regs = &dev_priv->regs.psb; |
181 | 181 | ||
182 | /* Display arbitration control + watermarks */ | 182 | /* Display arbitration control + watermarks */ |
183 | regs->saveDSPARB = PSB_RVDC32(DSPARB); | 183 | regs->saveDSPARB = PSB_RVDC32(DSPARB); |
@@ -214,7 +214,7 @@ static int psb_restore_display_registers(struct drm_device *dev) | |||
214 | struct drm_psb_private *dev_priv = dev->dev_private; | 214 | struct drm_psb_private *dev_priv = dev->dev_private; |
215 | struct drm_crtc *crtc; | 215 | struct drm_crtc *crtc; |
216 | struct drm_connector *connector; | 216 | struct drm_connector *connector; |
217 | struct psb_state *regs = &dev_priv->regs; | 217 | struct psb_state *regs = &dev_priv->regs.psb; |
218 | 218 | ||
219 | /* Display arbitration + watermarks */ | 219 | /* Display arbitration + watermarks */ |
220 | PSB_WVDC32(regs->saveDSPARB, DSPARB); | 220 | PSB_WVDC32(regs->saveDSPARB, DSPARB); |
diff --git a/drivers/gpu/drm/gma500/psb_drv.h b/drivers/gpu/drm/gma500/psb_drv.h index dee07e0d7c39..3c0bf7be2738 100644 --- a/drivers/gpu/drm/gma500/psb_drv.h +++ b/drivers/gpu/drm/gma500/psb_drv.h | |||
@@ -337,8 +337,6 @@ struct psb_state { | |||
337 | uint32_t savePFIT_CONTROL; | 337 | uint32_t savePFIT_CONTROL; |
338 | uint32_t savePaletteA[256]; | 338 | uint32_t savePaletteA[256]; |
339 | uint32_t savePaletteB[256]; | 339 | uint32_t savePaletteB[256]; |
340 | uint32_t saveBLC_PWM_CTL2; | ||
341 | uint32_t saveBLC_PWM_CTL; | ||
342 | uint32_t saveCLOCKGATING; | 340 | uint32_t saveCLOCKGATING; |
343 | uint32_t saveDSPARB; | 341 | uint32_t saveDSPARB; |
344 | uint32_t saveDSPATILEOFF; | 342 | uint32_t saveDSPATILEOFF; |
@@ -350,8 +348,6 @@ struct psb_state { | |||
350 | uint32_t savePP_ON_DELAYS; | 348 | uint32_t savePP_ON_DELAYS; |
351 | uint32_t savePP_OFF_DELAYS; | 349 | uint32_t savePP_OFF_DELAYS; |
352 | uint32_t savePP_DIVISOR; | 350 | uint32_t savePP_DIVISOR; |
353 | uint32_t saveBSM; | ||
354 | uint32_t saveVBT; | ||
355 | uint32_t saveBCLRPAT_A; | 351 | uint32_t saveBCLRPAT_A; |
356 | uint32_t saveBCLRPAT_B; | 352 | uint32_t saveBCLRPAT_B; |
357 | uint32_t saveDSPALINOFF; | 353 | uint32_t saveDSPALINOFF; |
@@ -393,6 +389,16 @@ struct psb_state { | |||
393 | uint32_t savePWM_CONTROL_LOGIC; | 389 | uint32_t savePWM_CONTROL_LOGIC; |
394 | }; | 390 | }; |
395 | 391 | ||
392 | struct psb_save_area { | ||
393 | uint32_t saveBSM; | ||
394 | uint32_t saveVBT; | ||
395 | union { | ||
396 | struct psb_state psb; | ||
397 | }; | ||
398 | uint32_t saveBLC_PWM_CTL2; | ||
399 | uint32_t saveBLC_PWM_CTL; | ||
400 | }; | ||
401 | |||
396 | struct psb_ops; | 402 | struct psb_ops; |
397 | 403 | ||
398 | #define PSB_NUM_PIPE 3 | 404 | #define PSB_NUM_PIPE 3 |
@@ -520,7 +526,9 @@ struct drm_psb_private { | |||
520 | /* | 526 | /* |
521 | * Register state | 527 | * Register state |
522 | */ | 528 | */ |
523 | struct psb_state regs; | 529 | |
530 | struct psb_save_area regs; | ||
531 | |||
524 | /* MSI reg save */ | 532 | /* MSI reg save */ |
525 | uint32_t msi_addr; | 533 | uint32_t msi_addr; |
526 | uint32_t msi_data; | 534 | uint32_t msi_data; |
diff --git a/drivers/gpu/drm/gma500/psb_intel_display.c b/drivers/gpu/drm/gma500/psb_intel_display.c index 4ba1ae8b5e30..eed91fdcf36e 100644 --- a/drivers/gpu/drm/gma500/psb_intel_display.c +++ b/drivers/gpu/drm/gma500/psb_intel_display.c | |||
@@ -845,7 +845,7 @@ void psb_intel_crtc_load_lut(struct drm_crtc *crtc) | |||
845 | gma_power_end(dev); | 845 | gma_power_end(dev); |
846 | } else { | 846 | } else { |
847 | for (i = 0; i < 256; i++) { | 847 | for (i = 0; i < 256; i++) { |
848 | dev_priv->regs.save_palette_a[i] = | 848 | dev_priv->regs.psb.save_palette_a[i] = |
849 | ((psb_intel_crtc->lut_r[i] + | 849 | ((psb_intel_crtc->lut_r[i] + |
850 | psb_intel_crtc->lut_adj[i]) << 16) | | 850 | psb_intel_crtc->lut_adj[i]) << 16) | |
851 | ((psb_intel_crtc->lut_g[i] + | 851 | ((psb_intel_crtc->lut_g[i] + |
@@ -1141,18 +1141,19 @@ static int psb_intel_crtc_clock_get(struct drm_device *dev, | |||
1141 | gma_power_end(dev); | 1141 | gma_power_end(dev); |
1142 | } else { | 1142 | } else { |
1143 | dpll = (pipe == 0) ? | 1143 | dpll = (pipe == 0) ? |
1144 | dev_priv->regs.saveDPLL_A : dev_priv->regs.saveDPLL_B; | 1144 | dev_priv->regs.psb.saveDPLL_A : |
1145 | dev_priv->regs.psb.saveDPLL_B; | ||
1145 | 1146 | ||
1146 | if ((dpll & DISPLAY_RATE_SELECT_FPA1) == 0) | 1147 | if ((dpll & DISPLAY_RATE_SELECT_FPA1) == 0) |
1147 | fp = (pipe == 0) ? | 1148 | fp = (pipe == 0) ? |
1148 | dev_priv->regs.saveFPA0 : | 1149 | dev_priv->regs.psb.saveFPA0 : |
1149 | dev_priv->regs.saveFPB0; | 1150 | dev_priv->regs.psb.saveFPB0; |
1150 | else | 1151 | else |
1151 | fp = (pipe == 0) ? | 1152 | fp = (pipe == 0) ? |
1152 | dev_priv->regs.saveFPA1 : | 1153 | dev_priv->regs.psb.saveFPA1 : |
1153 | dev_priv->regs.saveFPB1; | 1154 | dev_priv->regs.psb.saveFPB1; |
1154 | 1155 | ||
1155 | is_lvds = (pipe == 1) && (dev_priv->regs.saveLVDS & | 1156 | is_lvds = (pipe == 1) && (dev_priv->regs.psb.saveLVDS & |
1156 | LVDS_PORT_EN); | 1157 | LVDS_PORT_EN); |
1157 | } | 1158 | } |
1158 | 1159 | ||
@@ -1219,17 +1220,17 @@ struct drm_display_mode *psb_intel_crtc_mode_get(struct drm_device *dev, | |||
1219 | gma_power_end(dev); | 1220 | gma_power_end(dev); |
1220 | } else { | 1221 | } else { |
1221 | htot = (pipe == 0) ? | 1222 | htot = (pipe == 0) ? |
1222 | dev_priv->regs.saveHTOTAL_A : | 1223 | dev_priv->regs.psb.saveHTOTAL_A : |
1223 | dev_priv->regs.saveHTOTAL_B; | 1224 | dev_priv->regs.psb.saveHTOTAL_B; |
1224 | hsync = (pipe == 0) ? | 1225 | hsync = (pipe == 0) ? |
1225 | dev_priv->regs.saveHSYNC_A : | 1226 | dev_priv->regs.psb.saveHSYNC_A : |
1226 | dev_priv->regs.saveHSYNC_B; | 1227 | dev_priv->regs.psb.saveHSYNC_B; |
1227 | vtot = (pipe == 0) ? | 1228 | vtot = (pipe == 0) ? |
1228 | dev_priv->regs.saveVTOTAL_A : | 1229 | dev_priv->regs.psb.saveVTOTAL_A : |
1229 | dev_priv->regs.saveVTOTAL_B; | 1230 | dev_priv->regs.psb.saveVTOTAL_B; |
1230 | vsync = (pipe == 0) ? | 1231 | vsync = (pipe == 0) ? |
1231 | dev_priv->regs.saveVSYNC_A : | 1232 | dev_priv->regs.psb.saveVSYNC_A : |
1232 | dev_priv->regs.saveVSYNC_B; | 1233 | dev_priv->regs.psb.saveVSYNC_B; |
1233 | } | 1234 | } |
1234 | 1235 | ||
1235 | mode = kzalloc(sizeof(*mode), GFP_KERNEL); | 1236 | mode = kzalloc(sizeof(*mode), GFP_KERNEL); |