Lines Matching refs:crtc
106 #define to_vop(x) container_of(x, struct vop, crtc)
140 struct drm_crtc crtc; member
604 static int vop_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state) in vop_enable() argument
606 struct vop *vop = to_vop(crtc); in vop_enable()
663 s = to_rockchip_crtc_state(crtc->state); in vop_enable()
682 drm_crtc_vblank_on(crtc); in vop_enable()
695 static void rockchip_drm_set_win_enabled(struct drm_crtc *crtc, bool enabled) in rockchip_drm_set_win_enabled() argument
697 struct vop *vop = to_vop(crtc); in rockchip_drm_set_win_enabled()
714 static void vop_crtc_atomic_disable(struct drm_crtc *crtc, in vop_crtc_atomic_disable() argument
717 struct vop *vop = to_vop(crtc); in vop_crtc_atomic_disable()
721 if (crtc->state->self_refresh_active) in vop_crtc_atomic_disable()
722 rockchip_drm_set_win_enabled(crtc, false); in vop_crtc_atomic_disable()
724 if (crtc->state->self_refresh_active) in vop_crtc_atomic_disable()
729 drm_crtc_vblank_off(crtc); in vop_crtc_atomic_disable()
749 WARN(1, "%s: timed out waiting for DSP hold", crtc->name); in vop_crtc_atomic_disable()
767 if (crtc->state->event && !crtc->state->active) { in vop_crtc_atomic_disable()
768 spin_lock_irq(&crtc->dev->event_lock); in vop_crtc_atomic_disable()
769 drm_crtc_send_vblank_event(crtc, crtc->state->event); in vop_crtc_atomic_disable()
770 spin_unlock_irq(&crtc->dev->event_lock); in vop_crtc_atomic_disable()
772 crtc->state->event = NULL; in vop_crtc_atomic_disable()
806 struct drm_crtc *crtc = new_plane_state->crtc; in vop_plane_atomic_check() local
817 if (!crtc || WARN_ON(!fb)) in vop_plane_atomic_check()
821 crtc); in vop_plane_atomic_check()
853 struct vop *vop = to_vop(crtc); in vop_plane_atomic_check()
888 struct vop *vop = to_vop(old_state->crtc); in vop_plane_atomic_disable()
890 if (!old_state->crtc) in vop_plane_atomic_disable()
905 struct drm_crtc *crtc = new_state->crtc; in vop_plane_atomic_update() local
909 struct vop *vop = to_vop(new_state->crtc); in vop_plane_atomic_update()
930 if (WARN_ON(!crtc)) in vop_plane_atomic_update()
951 dsp_stx = dest->x1 + crtc->mode.htotal - crtc->mode.hsync_start; in vop_plane_atomic_update()
952 dsp_sty = dest->y1 + crtc->mode.vtotal - crtc->mode.vsync_start; in vop_plane_atomic_update()
1070 if (plane != new_plane_state->crtc->cursor) in vop_plane_atomic_async_check()
1081 new_plane_state->crtc); in vop_plane_atomic_async_check()
1083 crtc_state = plane->crtc->state; in vop_plane_atomic_async_check()
1095 struct vop *vop = to_vop(plane->state->crtc); in vop_plane_atomic_async_update()
1124 WARN_ON(drm_crtc_vblank_get(plane->state->crtc) != 0); in vop_plane_atomic_async_update()
1149 static int vop_crtc_enable_vblank(struct drm_crtc *crtc) in vop_crtc_enable_vblank() argument
1151 struct vop *vop = to_vop(crtc); in vop_crtc_enable_vblank()
1167 static void vop_crtc_disable_vblank(struct drm_crtc *crtc) in vop_crtc_disable_vblank() argument
1169 struct vop *vop = to_vop(crtc); in vop_crtc_disable_vblank()
1182 static enum drm_mode_status vop_crtc_mode_valid(struct drm_crtc *crtc, in vop_crtc_mode_valid() argument
1185 struct vop *vop = to_vop(crtc); in vop_crtc_mode_valid()
1193 static bool vop_crtc_mode_fixup(struct drm_crtc *crtc, in vop_crtc_mode_fixup() argument
1197 struct vop *vop = to_vop(crtc); in vop_crtc_mode_fixup()
1245 static void vop_crtc_write_gamma_lut(struct vop *vop, struct drm_crtc *crtc) in vop_crtc_write_gamma_lut() argument
1247 struct drm_color_lut *lut = crtc->state->gamma_lut->data; in vop_crtc_write_gamma_lut()
1250 for (i = 0; i < crtc->gamma_size; i++) { in vop_crtc_write_gamma_lut()
1260 static void vop_crtc_gamma_set(struct vop *vop, struct drm_crtc *crtc, in vop_crtc_gamma_set() argument
1263 struct drm_crtc_state *state = crtc->state; in vop_crtc_gamma_set()
1303 vop_crtc_write_gamma_lut(vop, crtc); in vop_crtc_gamma_set()
1327 static void vop_crtc_atomic_begin(struct drm_crtc *crtc, in vop_crtc_atomic_begin() argument
1331 crtc); in vop_crtc_atomic_begin()
1333 crtc); in vop_crtc_atomic_begin()
1334 struct vop *vop = to_vop(crtc); in vop_crtc_atomic_begin()
1342 vop_crtc_gamma_set(vop, crtc, old_crtc_state); in vop_crtc_atomic_begin()
1345 static void vop_crtc_atomic_enable(struct drm_crtc *crtc, in vop_crtc_atomic_enable() argument
1349 crtc); in vop_crtc_atomic_enable()
1350 struct vop *vop = to_vop(crtc); in vop_crtc_atomic_enable()
1352 struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc->state); in vop_crtc_atomic_enable()
1353 struct drm_display_mode *adjusted_mode = &crtc->state->adjusted_mode; in vop_crtc_atomic_enable()
1369 drm_crtc_vblank_on(crtc); in vop_crtc_atomic_enable()
1370 rockchip_drm_set_win_enabled(crtc, true); in vop_crtc_atomic_enable()
1378 ret = vop_enable(crtc, old_state); in vop_crtc_atomic_enable()
1470 if (crtc->state->gamma_lut) in vop_crtc_atomic_enable()
1471 vop_crtc_gamma_set(vop, crtc, old_state); in vop_crtc_atomic_enable()
1500 static int vop_crtc_atomic_check(struct drm_crtc *crtc, in vop_crtc_atomic_check() argument
1504 crtc); in vop_crtc_atomic_check()
1505 struct vop *vop = to_vop(crtc); in vop_crtc_atomic_check()
1516 if (len != crtc->gamma_size) { in vop_crtc_atomic_check()
1518 len, crtc->gamma_size); in vop_crtc_atomic_check()
1547 static void vop_crtc_atomic_flush(struct drm_crtc *crtc, in vop_crtc_atomic_flush() argument
1551 crtc); in vop_crtc_atomic_flush()
1554 struct vop *vop = to_vop(crtc); in vop_crtc_atomic_flush()
1565 s = to_rockchip_crtc_state(crtc->state); in vop_crtc_atomic_flush()
1582 spin_lock_irq(&crtc->dev->event_lock); in vop_crtc_atomic_flush()
1583 if (crtc->state->event) { in vop_crtc_atomic_flush()
1584 WARN_ON(drm_crtc_vblank_get(crtc) != 0); in vop_crtc_atomic_flush()
1587 vop->event = crtc->state->event; in vop_crtc_atomic_flush()
1588 crtc->state->event = NULL; in vop_crtc_atomic_flush()
1590 spin_unlock_irq(&crtc->dev->event_lock); in vop_crtc_atomic_flush()
1601 WARN_ON(drm_crtc_vblank_get(crtc) != 0); in vop_crtc_atomic_flush()
1617 static void vop_crtc_destroy(struct drm_crtc *crtc) in vop_crtc_destroy() argument
1619 drm_crtc_cleanup(crtc); in vop_crtc_destroy()
1622 static struct drm_crtc_state *vop_crtc_duplicate_state(struct drm_crtc *crtc) in vop_crtc_duplicate_state() argument
1626 if (WARN_ON(!crtc->state)) in vop_crtc_duplicate_state()
1629 rockchip_state = kmemdup(to_rockchip_crtc_state(crtc->state), in vop_crtc_duplicate_state()
1634 __drm_atomic_helper_crtc_duplicate_state(crtc, &rockchip_state->base); in vop_crtc_duplicate_state()
1638 static void vop_crtc_destroy_state(struct drm_crtc *crtc, in vop_crtc_destroy_state() argument
1647 static void vop_crtc_reset(struct drm_crtc *crtc) in vop_crtc_reset() argument
1652 if (crtc->state) in vop_crtc_reset()
1653 vop_crtc_destroy_state(crtc, crtc->state); in vop_crtc_reset()
1656 __drm_atomic_helper_crtc_reset(crtc, &crtc_state->base); in vop_crtc_reset()
1658 __drm_atomic_helper_crtc_reset(crtc, NULL); in vop_crtc_reset()
1679 static int vop_crtc_set_crc_source(struct drm_crtc *crtc, in vop_crtc_set_crc_source() argument
1682 struct vop *vop = to_vop(crtc); in vop_crtc_set_crc_source()
1701 vop_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name, in vop_crtc_verify_crc_source() argument
1712 static int vop_crtc_set_crc_source(struct drm_crtc *crtc, in vop_crtc_set_crc_source() argument
1719 vop_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name, in vop_crtc_verify_crc_source() argument
1744 drm_crtc_vblank_put(&vop->crtc); in vop_fb_unref_worker()
1751 struct drm_crtc *crtc = &vop->crtc; in vop_handle_vblank() local
1755 drm_crtc_send_vblank_event(crtc, vop->event); in vop_handle_vblank()
1756 drm_crtc_vblank_put(crtc); in vop_handle_vblank()
1768 struct drm_crtc *crtc = &vop->crtc; in vop_isr() local
1814 drm_crtc_handle_vblank(crtc); in vop_isr()
1850 struct drm_crtc *crtc = &vop->crtc; in vop_create_crtc() local
1889 ret = drm_crtc_init_with_planes(drm_dev, crtc, primary, cursor, in vop_create_crtc()
1894 drm_crtc_helper_add(crtc, &vop_crtc_helper_funcs); in vop_create_crtc()
1896 drm_mode_crtc_set_gamma_size(crtc, vop_data->lut_size); in vop_create_crtc()
1897 drm_crtc_enable_color_mgmt(crtc, 0, false, vop_data->lut_size); in vop_create_crtc()
1907 unsigned long possible_crtcs = drm_crtc_mask(crtc); in vop_create_crtc()
1941 crtc->port = port; in vop_create_crtc()
1943 ret = drm_self_refresh_helper_init(crtc); in vop_create_crtc()
1947 crtc->name, ret); in vop_create_crtc()
1952 drm_crtc_cleanup(crtc); in vop_create_crtc()
1962 struct drm_crtc *crtc = &vop->crtc; in vop_destroy_crtc() local
1966 drm_self_refresh_helper_cleanup(crtc); in vop_destroy_crtc()
1968 of_node_put(crtc->port); in vop_destroy_crtc()
1986 drm_crtc_cleanup(crtc); in vop_destroy_crtc()
2133 int rockchip_drm_wait_vact_end(struct drm_crtc *crtc, unsigned int mstimeout) in rockchip_drm_wait_vact_end() argument
2135 struct vop *vop = to_vop(crtc); in rockchip_drm_wait_vact_end()
2139 if (!crtc || !vop->is_enabled) in rockchip_drm_wait_vact_end()
2249 vop->rgb = rockchip_rgb_init(dev, &vop->crtc, vop->drm_dev, 0); in vop_bind()