Lines Matching refs:scrtc
60 static void shmob_drm_crtc_setup_geometry(struct shmob_drm_crtc *scrtc) in shmob_drm_crtc_setup_geometry() argument
62 struct drm_crtc *crtc = &scrtc->crtc; in shmob_drm_crtc_setup_geometry()
118 static void shmob_drm_crtc_start_stop(struct shmob_drm_crtc *scrtc, bool start) in shmob_drm_crtc_start_stop() argument
120 struct shmob_drm_device *sdev = scrtc->crtc.dev->dev_private; in shmob_drm_crtc_start_stop()
151 static void shmob_drm_crtc_start(struct shmob_drm_crtc *scrtc) in shmob_drm_crtc_start() argument
153 struct drm_crtc *crtc = &scrtc->crtc; in shmob_drm_crtc_start()
162 if (scrtc->started) in shmob_drm_crtc_start()
180 shmob_drm_crtc_start_stop(scrtc, false); in shmob_drm_crtc_start()
207 shmob_drm_crtc_setup_geometry(scrtc); in shmob_drm_crtc_start()
211 lcdc_write(sdev, LDMLSR, scrtc->line_size); in shmob_drm_crtc_start()
212 lcdc_write(sdev, LDSA1R, scrtc->dma[0]); in shmob_drm_crtc_start()
214 lcdc_write(sdev, LDSA2R, scrtc->dma[1]); in shmob_drm_crtc_start()
247 shmob_drm_crtc_start_stop(scrtc, true); in shmob_drm_crtc_start()
249 scrtc->started = true; in shmob_drm_crtc_start()
252 static void shmob_drm_crtc_stop(struct shmob_drm_crtc *scrtc) in shmob_drm_crtc_stop() argument
254 struct drm_crtc *crtc = &scrtc->crtc; in shmob_drm_crtc_stop()
257 if (!scrtc->started) in shmob_drm_crtc_stop()
261 shmob_drm_crtc_start_stop(scrtc, false); in shmob_drm_crtc_stop()
269 scrtc->started = false; in shmob_drm_crtc_stop()
272 void shmob_drm_crtc_suspend(struct shmob_drm_crtc *scrtc) in shmob_drm_crtc_suspend() argument
274 shmob_drm_crtc_stop(scrtc); in shmob_drm_crtc_suspend()
277 void shmob_drm_crtc_resume(struct shmob_drm_crtc *scrtc) in shmob_drm_crtc_resume() argument
279 if (scrtc->dpms != DRM_MODE_DPMS_ON) in shmob_drm_crtc_resume()
282 shmob_drm_crtc_start(scrtc); in shmob_drm_crtc_resume()
285 static void shmob_drm_crtc_compute_base(struct shmob_drm_crtc *scrtc, in shmob_drm_crtc_compute_base() argument
288 struct drm_crtc *crtc = &scrtc->crtc; in shmob_drm_crtc_compute_base()
293 bpp = scrtc->format->yuv ? 8 : scrtc->format->bpp; in shmob_drm_crtc_compute_base()
295 scrtc->dma[0] = gem->paddr + fb->offsets[0] in shmob_drm_crtc_compute_base()
298 if (scrtc->format->yuv) { in shmob_drm_crtc_compute_base()
299 bpp = scrtc->format->bpp - 8; in shmob_drm_crtc_compute_base()
301 scrtc->dma[1] = gem->paddr + fb->offsets[1] in shmob_drm_crtc_compute_base()
307 static void shmob_drm_crtc_update_base(struct shmob_drm_crtc *scrtc) in shmob_drm_crtc_update_base() argument
309 struct drm_crtc *crtc = &scrtc->crtc; in shmob_drm_crtc_update_base()
312 shmob_drm_crtc_compute_base(scrtc, crtc->x, crtc->y); in shmob_drm_crtc_update_base()
314 lcdc_write_mirror(sdev, LDSA1R, scrtc->dma[0]); in shmob_drm_crtc_update_base()
315 if (scrtc->format->yuv) in shmob_drm_crtc_update_base()
316 lcdc_write_mirror(sdev, LDSA2R, scrtc->dma[1]); in shmob_drm_crtc_update_base()
325 struct shmob_drm_crtc *scrtc = to_shmob_crtc(crtc); in shmob_drm_crtc_dpms() local
327 if (scrtc->dpms == mode) in shmob_drm_crtc_dpms()
331 shmob_drm_crtc_start(scrtc); in shmob_drm_crtc_dpms()
333 shmob_drm_crtc_stop(scrtc); in shmob_drm_crtc_dpms()
335 scrtc->dpms = mode; in shmob_drm_crtc_dpms()
349 struct shmob_drm_crtc *scrtc = to_shmob_crtc(crtc); in shmob_drm_crtc_mode_set() local
360 scrtc->format = format; in shmob_drm_crtc_mode_set()
361 scrtc->line_size = crtc->primary->fb->pitches[0]; in shmob_drm_crtc_mode_set()
363 shmob_drm_crtc_compute_base(scrtc, x, y); in shmob_drm_crtc_mode_set()
389 void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc) in shmob_drm_crtc_finish_page_flip() argument
392 struct drm_device *dev = scrtc->crtc.dev; in shmob_drm_crtc_finish_page_flip()
396 event = scrtc->event; in shmob_drm_crtc_finish_page_flip()
397 scrtc->event = NULL; in shmob_drm_crtc_finish_page_flip()
399 drm_crtc_send_vblank_event(&scrtc->crtc, event); in shmob_drm_crtc_finish_page_flip()
400 drm_crtc_vblank_put(&scrtc->crtc); in shmob_drm_crtc_finish_page_flip()
411 struct shmob_drm_crtc *scrtc = to_shmob_crtc(crtc); in shmob_drm_crtc_page_flip() local
412 struct drm_device *dev = scrtc->crtc.dev; in shmob_drm_crtc_page_flip()
416 if (scrtc->event != NULL) { in shmob_drm_crtc_page_flip()
423 shmob_drm_crtc_update_base(scrtc); in shmob_drm_crtc_page_flip()
427 drm_crtc_vblank_get(&scrtc->crtc); in shmob_drm_crtc_page_flip()
429 scrtc->event = event; in shmob_drm_crtc_page_flip()