Lines Matching refs:crtc

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