Lines Matching refs:crtc
62 static struct mdp4_kms *get_kms(struct drm_crtc *crtc) in get_kms() argument
64 struct msm_drm_private *priv = crtc->dev->dev_private; in get_kms()
68 static void request_pending(struct drm_crtc *crtc, uint32_t pending) in request_pending() argument
70 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in request_pending()
73 mdp_irq_register(&get_kms(crtc)->base, &mdp4_crtc->vblank); in request_pending()
76 static void crtc_flush(struct drm_crtc *crtc) in crtc_flush() argument
78 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in crtc_flush()
79 struct mdp4_kms *mdp4_kms = get_kms(crtc); in crtc_flush()
83 drm_atomic_crtc_for_each_plane(plane, crtc) { in crtc_flush()
98 static void complete_flip(struct drm_crtc *crtc, struct drm_file *file) in complete_flip() argument
100 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in complete_flip()
101 struct drm_device *dev = crtc->dev; in complete_flip()
110 drm_crtc_send_vblank_event(crtc, event); in complete_flip()
126 static void mdp4_crtc_destroy(struct drm_crtc *crtc) in mdp4_crtc_destroy() argument
128 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_destroy()
130 drm_crtc_cleanup(crtc); in mdp4_crtc_destroy()
156 struct drm_crtc *crtc; in setup_mixer() local
162 list_for_each_entry(crtc, &config->crtc_list, head) { in setup_mixer()
163 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in setup_mixer()
166 drm_atomic_crtc_for_each_plane(plane, crtc) { in setup_mixer()
177 static void blend_setup(struct drm_crtc *crtc) in blend_setup() argument
179 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in blend_setup()
180 struct mdp4_kms *mdp4_kms = get_kms(crtc); in blend_setup()
190 drm_atomic_crtc_for_each_plane(plane, crtc) { in blend_setup()
225 static void mdp4_crtc_mode_set_nofb(struct drm_crtc *crtc) in mdp4_crtc_mode_set_nofb() argument
227 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_mode_set_nofb()
228 struct mdp4_kms *mdp4_kms = get_kms(crtc); in mdp4_crtc_mode_set_nofb()
233 if (WARN_ON(!crtc->state)) in mdp4_crtc_mode_set_nofb()
236 mode = &crtc->state->adjusted_mode; in mdp4_crtc_mode_set_nofb()
267 static void mdp4_crtc_atomic_disable(struct drm_crtc *crtc, in mdp4_crtc_atomic_disable() argument
270 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_atomic_disable()
271 struct mdp4_kms *mdp4_kms = get_kms(crtc); in mdp4_crtc_atomic_disable()
280 drm_crtc_vblank_off(crtc); in mdp4_crtc_atomic_disable()
285 if (crtc->state->event && !crtc->state->active) { in mdp4_crtc_atomic_disable()
288 drm_crtc_send_vblank_event(crtc, crtc->state->event); in mdp4_crtc_atomic_disable()
289 crtc->state->event = NULL; in mdp4_crtc_atomic_disable()
296 static void mdp4_crtc_atomic_enable(struct drm_crtc *crtc, in mdp4_crtc_atomic_enable() argument
299 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_atomic_enable()
300 struct mdp4_kms *mdp4_kms = get_kms(crtc); in mdp4_crtc_atomic_enable()
310 drm_crtc_vblank_on(crtc); in mdp4_crtc_atomic_enable()
314 crtc_flush(crtc); in mdp4_crtc_atomic_enable()
319 static int mdp4_crtc_atomic_check(struct drm_crtc *crtc, in mdp4_crtc_atomic_check() argument
322 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_atomic_check()
328 static void mdp4_crtc_atomic_begin(struct drm_crtc *crtc, in mdp4_crtc_atomic_begin() argument
331 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_atomic_begin()
335 static void mdp4_crtc_atomic_flush(struct drm_crtc *crtc, in mdp4_crtc_atomic_flush() argument
338 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_atomic_flush()
339 struct drm_device *dev = crtc->dev; in mdp4_crtc_atomic_flush()
342 DBG("%s: event: %p", mdp4_crtc->name, crtc->state->event); in mdp4_crtc_atomic_flush()
347 mdp4_crtc->event = crtc->state->event; in mdp4_crtc_atomic_flush()
348 crtc->state->event = NULL; in mdp4_crtc_atomic_flush()
351 blend_setup(crtc); in mdp4_crtc_atomic_flush()
352 crtc_flush(crtc); in mdp4_crtc_atomic_flush()
353 request_pending(crtc, PENDING_FLIP); in mdp4_crtc_atomic_flush()
364 static void update_cursor(struct drm_crtc *crtc) in update_cursor() argument
366 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in update_cursor()
367 struct mdp4_kms *mdp4_kms = get_kms(crtc); in update_cursor()
412 static int mdp4_crtc_cursor_set(struct drm_crtc *crtc, in mdp4_crtc_cursor_set() argument
416 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_cursor_set()
417 struct mdp4_kms *mdp4_kms = get_kms(crtc); in mdp4_crtc_cursor_set()
419 struct drm_device *dev = crtc->dev; in mdp4_crtc_cursor_set()
460 request_pending(crtc, PENDING_CURSOR); in mdp4_crtc_cursor_set()
469 static int mdp4_crtc_cursor_move(struct drm_crtc *crtc, int x, int y) in mdp4_crtc_cursor_move() argument
471 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_cursor_move()
479 crtc_flush(crtc); in mdp4_crtc_cursor_move()
480 request_pending(crtc, PENDING_CURSOR); in mdp4_crtc_cursor_move()
510 struct drm_crtc *crtc = &mdp4_crtc->base; in mdp4_crtc_vblank_irq() local
511 struct msm_drm_private *priv = crtc->dev->dev_private; in mdp4_crtc_vblank_irq()
514 mdp_irq_unregister(&get_kms(crtc)->base, &mdp4_crtc->vblank); in mdp4_crtc_vblank_irq()
519 complete_flip(crtc, NULL); in mdp4_crtc_vblank_irq()
523 update_cursor(crtc); in mdp4_crtc_vblank_irq()
531 struct drm_crtc *crtc = &mdp4_crtc->base; in mdp4_crtc_err_irq() local
533 crtc_flush(crtc); in mdp4_crtc_err_irq()
536 static void mdp4_crtc_wait_for_flush_done(struct drm_crtc *crtc) in mdp4_crtc_wait_for_flush_done() argument
538 struct drm_device *dev = crtc->dev; in mdp4_crtc_wait_for_flush_done()
539 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_wait_for_flush_done()
540 struct mdp4_kms *mdp4_kms = get_kms(crtc); in mdp4_crtc_wait_for_flush_done()
543 ret = drm_crtc_vblank_get(crtc); in mdp4_crtc_wait_for_flush_done()
547 ret = wait_event_timeout(dev->vblank[drm_crtc_index(crtc)].queue, in mdp4_crtc_wait_for_flush_done()
556 drm_crtc_vblank_put(crtc); in mdp4_crtc_wait_for_flush_done()
559 uint32_t mdp4_crtc_vblank(struct drm_crtc *crtc) in mdp4_crtc_vblank() argument
561 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_vblank()
566 void mdp4_crtc_set_config(struct drm_crtc *crtc, uint32_t config) in mdp4_crtc_set_config() argument
568 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_set_config()
569 struct mdp4_kms *mdp4_kms = get_kms(crtc); in mdp4_crtc_set_config()
575 void mdp4_crtc_set_intf(struct drm_crtc *crtc, enum mdp4_intf intf, int mixer) in mdp4_crtc_set_intf() argument
577 struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc); in mdp4_crtc_set_intf()
578 struct mdp4_kms *mdp4_kms = get_kms(crtc); in mdp4_crtc_set_intf()
608 blend_setup(crtc); in mdp4_crtc_set_intf()
615 void mdp4_crtc_wait_for_commit_done(struct drm_crtc *crtc) in mdp4_crtc_wait_for_commit_done() argument
621 mdp4_crtc_wait_for_flush_done(crtc); in mdp4_crtc_wait_for_commit_done()
633 struct drm_crtc *crtc = NULL; in mdp4_crtc_init() local
640 crtc = &mdp4_crtc->base; in mdp4_crtc_init()
661 drm_crtc_init_with_planes(dev, crtc, plane, NULL, &mdp4_crtc_funcs, in mdp4_crtc_init()
663 drm_crtc_helper_add(crtc, &mdp4_crtc_helper_funcs); in mdp4_crtc_init()
665 return crtc; in mdp4_crtc_init()