Lines Matching full:crtc

37 static struct drm_encoder *sun4i_crtc_get_encoder(struct drm_crtc *crtc)  in sun4i_crtc_get_encoder()  argument
41 drm_for_each_encoder(encoder, crtc->dev) in sun4i_crtc_get_encoder()
42 if (encoder->crtc == crtc) in sun4i_crtc_get_encoder()
48 static int sun4i_crtc_atomic_check(struct drm_crtc *crtc, in sun4i_crtc_atomic_check() argument
52 crtc); in sun4i_crtc_atomic_check()
53 struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc); in sun4i_crtc_atomic_check()
63 static void sun4i_crtc_atomic_begin(struct drm_crtc *crtc, in sun4i_crtc_atomic_begin() argument
67 crtc); in sun4i_crtc_atomic_begin()
68 struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc); in sun4i_crtc_atomic_begin()
69 struct drm_device *dev = crtc->dev; in sun4i_crtc_atomic_begin()
73 if (crtc->state->event) { in sun4i_crtc_atomic_begin()
74 WARN_ON(drm_crtc_vblank_get(crtc) != 0); in sun4i_crtc_atomic_begin()
77 scrtc->event = crtc->state->event; in sun4i_crtc_atomic_begin()
79 crtc->state->event = NULL; in sun4i_crtc_atomic_begin()
86 static void sun4i_crtc_atomic_flush(struct drm_crtc *crtc, in sun4i_crtc_atomic_flush() argument
89 struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc); in sun4i_crtc_atomic_flush()
90 struct drm_pending_vblank_event *event = crtc->state->event; in sun4i_crtc_atomic_flush()
97 crtc->state->event = NULL; in sun4i_crtc_atomic_flush()
99 spin_lock_irq(&crtc->dev->event_lock); in sun4i_crtc_atomic_flush()
100 if (drm_crtc_vblank_get(crtc) == 0) in sun4i_crtc_atomic_flush()
101 drm_crtc_arm_vblank_event(crtc, event); in sun4i_crtc_atomic_flush()
103 drm_crtc_send_vblank_event(crtc, event); in sun4i_crtc_atomic_flush()
104 spin_unlock_irq(&crtc->dev->event_lock); in sun4i_crtc_atomic_flush()
108 static void sun4i_crtc_atomic_disable(struct drm_crtc *crtc, in sun4i_crtc_atomic_disable() argument
111 struct drm_encoder *encoder = sun4i_crtc_get_encoder(crtc); in sun4i_crtc_atomic_disable()
112 struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc); in sun4i_crtc_atomic_disable()
114 DRM_DEBUG_DRIVER("Disabling the CRTC\n"); in sun4i_crtc_atomic_disable()
116 drm_crtc_vblank_off(crtc); in sun4i_crtc_atomic_disable()
120 if (crtc->state->event && !crtc->state->active) { in sun4i_crtc_atomic_disable()
121 spin_lock_irq(&crtc->dev->event_lock); in sun4i_crtc_atomic_disable()
122 drm_crtc_send_vblank_event(crtc, crtc->state->event); in sun4i_crtc_atomic_disable()
123 spin_unlock_irq(&crtc->dev->event_lock); in sun4i_crtc_atomic_disable()
125 crtc->state->event = NULL; in sun4i_crtc_atomic_disable()
129 static void sun4i_crtc_atomic_enable(struct drm_crtc *crtc, in sun4i_crtc_atomic_enable() argument
132 struct drm_encoder *encoder = sun4i_crtc_get_encoder(crtc); in sun4i_crtc_atomic_enable()
133 struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc); in sun4i_crtc_atomic_enable()
135 DRM_DEBUG_DRIVER("Enabling the CRTC\n"); in sun4i_crtc_atomic_enable()
139 drm_crtc_vblank_on(crtc); in sun4i_crtc_atomic_enable()
142 static void sun4i_crtc_mode_set_nofb(struct drm_crtc *crtc) in sun4i_crtc_mode_set_nofb() argument
144 struct drm_display_mode *mode = &crtc->state->adjusted_mode; in sun4i_crtc_mode_set_nofb()
145 struct drm_encoder *encoder = sun4i_crtc_get_encoder(crtc); in sun4i_crtc_mode_set_nofb()
146 struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc); in sun4i_crtc_mode_set_nofb()
161 static int sun4i_crtc_enable_vblank(struct drm_crtc *crtc) in sun4i_crtc_enable_vblank() argument
163 struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc); in sun4i_crtc_enable_vblank()
165 DRM_DEBUG_DRIVER("Enabling VBLANK on crtc %p\n", crtc); in sun4i_crtc_enable_vblank()
172 static void sun4i_crtc_disable_vblank(struct drm_crtc *crtc) in sun4i_crtc_disable_vblank() argument
174 struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc); in sun4i_crtc_disable_vblank()
176 DRM_DEBUG_DRIVER("Disabling VBLANK on crtc %p\n", crtc); in sun4i_crtc_disable_vblank()
230 ret = drm_crtc_init_with_planes(drm, &scrtc->crtc, in sun4i_crtc_init()
236 dev_err(drm->dev, "Couldn't init DRM CRTC\n"); in sun4i_crtc_init()
240 drm_crtc_helper_add(&scrtc->crtc, &sun4i_crtc_helper_funcs); in sun4i_crtc_init()
242 /* Set crtc.port to output port node of the tcon */ in sun4i_crtc_init()
243 scrtc->crtc.port = of_graph_get_port_by_id(scrtc->tcon->dev->of_node, in sun4i_crtc_init()
246 /* Set possible_crtcs to this crtc for overlay planes */ in sun4i_crtc_init()
248 uint32_t possible_crtcs = drm_crtc_mask(&scrtc->crtc); in sun4i_crtc_init()