Lines Matching refs:scrtc
64 static void shmob_drm_crtc_setup_geometry(struct shmob_drm_crtc *scrtc) in shmob_drm_crtc_setup_geometry() argument
66 struct drm_crtc *crtc = &scrtc->crtc; in shmob_drm_crtc_setup_geometry()
122 static void shmob_drm_crtc_start_stop(struct shmob_drm_crtc *scrtc, bool start) in shmob_drm_crtc_start_stop() argument
124 struct shmob_drm_device *sdev = scrtc->crtc.dev->dev_private; in shmob_drm_crtc_start_stop()
155 static void shmob_drm_crtc_start(struct shmob_drm_crtc *scrtc) in shmob_drm_crtc_start() argument
157 struct drm_crtc *crtc = &scrtc->crtc; in shmob_drm_crtc_start()
166 if (scrtc->started) in shmob_drm_crtc_start()
184 shmob_drm_crtc_start_stop(scrtc, false); in shmob_drm_crtc_start()
211 shmob_drm_crtc_setup_geometry(scrtc); in shmob_drm_crtc_start()
215 lcdc_write(sdev, LDMLSR, scrtc->line_size); in shmob_drm_crtc_start()
216 lcdc_write(sdev, LDSA1R, scrtc->dma[0]); in shmob_drm_crtc_start()
218 lcdc_write(sdev, LDSA2R, scrtc->dma[1]); in shmob_drm_crtc_start()
252 shmob_drm_crtc_start_stop(scrtc, true); in shmob_drm_crtc_start()
254 scrtc->started = true; in shmob_drm_crtc_start()
257 static void shmob_drm_crtc_stop(struct shmob_drm_crtc *scrtc) in shmob_drm_crtc_stop() argument
259 struct drm_crtc *crtc = &scrtc->crtc; in shmob_drm_crtc_stop()
262 if (!scrtc->started) in shmob_drm_crtc_stop()
266 shmob_drm_crtc_start_stop(scrtc, false); in shmob_drm_crtc_stop()
274 scrtc->started = false; in shmob_drm_crtc_stop()
277 void shmob_drm_crtc_suspend(struct shmob_drm_crtc *scrtc) in shmob_drm_crtc_suspend() argument
279 shmob_drm_crtc_stop(scrtc); in shmob_drm_crtc_suspend()
282 void shmob_drm_crtc_resume(struct shmob_drm_crtc *scrtc) in shmob_drm_crtc_resume() argument
284 if (scrtc->dpms != DRM_MODE_DPMS_ON) in shmob_drm_crtc_resume()
287 shmob_drm_crtc_start(scrtc); in shmob_drm_crtc_resume()
290 static void shmob_drm_crtc_compute_base(struct shmob_drm_crtc *scrtc, in shmob_drm_crtc_compute_base() argument
293 struct drm_crtc *crtc = &scrtc->crtc; in shmob_drm_crtc_compute_base()
298 bpp = scrtc->format->yuv ? 8 : scrtc->format->bpp; in shmob_drm_crtc_compute_base()
300 scrtc->dma[0] = gem->dma_addr + fb->offsets[0] in shmob_drm_crtc_compute_base()
303 if (scrtc->format->yuv) { in shmob_drm_crtc_compute_base()
304 bpp = scrtc->format->bpp - 8; in shmob_drm_crtc_compute_base()
306 scrtc->dma[1] = gem->dma_addr + fb->offsets[1] in shmob_drm_crtc_compute_base()
312 static void shmob_drm_crtc_update_base(struct shmob_drm_crtc *scrtc) in shmob_drm_crtc_update_base() argument
314 struct drm_crtc *crtc = &scrtc->crtc; in shmob_drm_crtc_update_base()
317 shmob_drm_crtc_compute_base(scrtc, crtc->x, crtc->y); in shmob_drm_crtc_update_base()
319 lcdc_write_mirror(sdev, LDSA1R, scrtc->dma[0]); in shmob_drm_crtc_update_base()
320 if (scrtc->format->yuv) in shmob_drm_crtc_update_base()
321 lcdc_write_mirror(sdev, LDSA2R, scrtc->dma[1]); in shmob_drm_crtc_update_base()
330 struct shmob_drm_crtc *scrtc = to_shmob_crtc(crtc); in shmob_drm_crtc_dpms() local
332 if (scrtc->dpms == mode) in shmob_drm_crtc_dpms()
336 shmob_drm_crtc_start(scrtc); in shmob_drm_crtc_dpms()
338 shmob_drm_crtc_stop(scrtc); in shmob_drm_crtc_dpms()
340 scrtc->dpms = mode; in shmob_drm_crtc_dpms()
354 struct shmob_drm_crtc *scrtc = to_shmob_crtc(crtc); in shmob_drm_crtc_mode_set() local
365 scrtc->format = format; in shmob_drm_crtc_mode_set()
366 scrtc->line_size = crtc->primary->fb->pitches[0]; in shmob_drm_crtc_mode_set()
368 shmob_drm_crtc_compute_base(scrtc, x, y); in shmob_drm_crtc_mode_set()
394 void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc) in shmob_drm_crtc_finish_page_flip() argument
397 struct drm_device *dev = scrtc->crtc.dev; in shmob_drm_crtc_finish_page_flip()
401 event = scrtc->event; in shmob_drm_crtc_finish_page_flip()
402 scrtc->event = NULL; in shmob_drm_crtc_finish_page_flip()
404 drm_crtc_send_vblank_event(&scrtc->crtc, event); in shmob_drm_crtc_finish_page_flip()
405 drm_crtc_vblank_put(&scrtc->crtc); in shmob_drm_crtc_finish_page_flip()
416 struct shmob_drm_crtc *scrtc = to_shmob_crtc(crtc); in shmob_drm_crtc_page_flip() local
417 struct drm_device *dev = scrtc->crtc.dev; in shmob_drm_crtc_page_flip()
421 if (scrtc->event != NULL) { in shmob_drm_crtc_page_flip()
428 shmob_drm_crtc_update_base(scrtc); in shmob_drm_crtc_page_flip()
432 drm_crtc_vblank_get(&scrtc->crtc); in shmob_drm_crtc_page_flip()
434 scrtc->event = event; in shmob_drm_crtc_page_flip()