Lines Matching refs:ipu_crtc

31 struct ipu_crtc {  struct
44 static inline struct ipu_crtc *to_ipu_crtc(struct drm_crtc *crtc) in to_ipu_crtc() argument
46 return container_of(crtc, struct ipu_crtc, base); in to_ipu_crtc()
52 struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); in ipu_crtc_atomic_enable() local
53 struct ipu_soc *ipu = dev_get_drvdata(ipu_crtc->dev->parent); in ipu_crtc_atomic_enable()
57 ipu_dc_enable_channel(ipu_crtc->dc); in ipu_crtc_atomic_enable()
58 ipu_di_enable(ipu_crtc->di); in ipu_crtc_atomic_enable()
61 static void ipu_crtc_disable_planes(struct ipu_crtc *ipu_crtc, in ipu_crtc_disable_planes() argument
69 if (plane == &ipu_crtc->plane[0]->base) in ipu_crtc_disable_planes()
71 if (ipu_crtc->plane[1] && plane == &ipu_crtc->plane[1]->base) in ipu_crtc_disable_planes()
76 ipu_plane_disable(ipu_crtc->plane[1], true); in ipu_crtc_disable_planes()
78 ipu_plane_disable(ipu_crtc->plane[0], true); in ipu_crtc_disable_planes()
86 struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); in ipu_crtc_atomic_disable() local
87 struct ipu_soc *ipu = dev_get_drvdata(ipu_crtc->dev->parent); in ipu_crtc_atomic_disable()
89 ipu_dc_disable_channel(ipu_crtc->dc); in ipu_crtc_atomic_disable()
90 ipu_di_disable(ipu_crtc->di); in ipu_crtc_atomic_disable()
96 ipu_crtc_disable_planes(ipu_crtc, old_crtc_state); in ipu_crtc_atomic_disable()
150 struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); in ipu_enable_vblank() local
152 enable_irq(ipu_crtc->irq); in ipu_enable_vblank()
159 struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); in ipu_disable_vblank() local
161 disable_irq_nosync(ipu_crtc->irq); in ipu_disable_vblank()
176 struct ipu_crtc *ipu_crtc = dev_id; in ipu_irq_handler() local
177 struct drm_crtc *crtc = &ipu_crtc->base; in ipu_irq_handler()
183 if (ipu_crtc->event) { in ipu_irq_handler()
184 for (i = 0; i < ARRAY_SIZE(ipu_crtc->plane); i++) { in ipu_irq_handler()
185 struct ipu_plane *plane = ipu_crtc->plane[i]; in ipu_irq_handler()
194 if (i == ARRAY_SIZE(ipu_crtc->plane)) { in ipu_irq_handler()
196 drm_crtc_send_vblank_event(crtc, ipu_crtc->event); in ipu_irq_handler()
197 ipu_crtc->event = NULL; in ipu_irq_handler()
210 struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); in ipu_crtc_mode_fixup() local
216 ret = ipu_di_adjust_videomode(ipu_crtc->di, &vm); in ipu_crtc_mode_fixup()
252 struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); in ipu_crtc_atomic_flush() local
255 ipu_crtc->event = crtc->state->event; in ipu_crtc_atomic_flush()
265 struct ipu_crtc *ipu_crtc = to_ipu_crtc(crtc); in ipu_crtc_mode_set_nofb() local
271 dev_dbg(ipu_crtc->dev, "%s: mode->hdisplay: %d\n", __func__, in ipu_crtc_mode_set_nofb()
273 dev_dbg(ipu_crtc->dev, "%s: mode->vdisplay: %d\n", __func__, in ipu_crtc_mode_set_nofb()
281 dev_dbg(ipu_crtc->dev, "%s: attached to encoder types 0x%lx\n", in ipu_crtc_mode_set_nofb()
310 dev_warn(ipu_crtc->dev, "8-pixel align hactive %d -> %d\n", in ipu_crtc_mode_set_nofb()
317 ipu_dc_init_sync(ipu_crtc->dc, ipu_crtc->di, in ipu_crtc_mode_set_nofb()
320 ipu_di_init_sync_panel(ipu_crtc->di, &sig_cfg); in ipu_crtc_mode_set_nofb()
335 struct ipu_crtc *ipu_crtc = ptr; in ipu_put_resources() local
337 if (!IS_ERR_OR_NULL(ipu_crtc->dc)) in ipu_put_resources()
338 ipu_dc_put(ipu_crtc->dc); in ipu_put_resources()
339 if (!IS_ERR_OR_NULL(ipu_crtc->di)) in ipu_put_resources()
340 ipu_di_put(ipu_crtc->di); in ipu_put_resources()
343 static int ipu_get_resources(struct drm_device *dev, struct ipu_crtc *ipu_crtc, in ipu_get_resources() argument
346 struct ipu_soc *ipu = dev_get_drvdata(ipu_crtc->dev->parent); in ipu_get_resources()
349 ipu_crtc->dc = ipu_dc_get(ipu, pdata->dc); in ipu_get_resources()
350 if (IS_ERR(ipu_crtc->dc)) in ipu_get_resources()
351 return PTR_ERR(ipu_crtc->dc); in ipu_get_resources()
353 ret = drmm_add_action_or_reset(dev, ipu_put_resources, ipu_crtc); in ipu_get_resources()
357 ipu_crtc->di = ipu_di_get(ipu, pdata->di); in ipu_get_resources()
358 if (IS_ERR(ipu_crtc->di)) in ipu_get_resources()
359 return PTR_ERR(ipu_crtc->di); in ipu_get_resources()
370 struct ipu_crtc *ipu_crtc; in ipu_drm_bind() local
382 ipu_crtc = drmm_crtc_alloc_with_planes(drm, struct ipu_crtc, base, in ipu_drm_bind()
385 if (IS_ERR(ipu_crtc)) in ipu_drm_bind()
386 return PTR_ERR(ipu_crtc); in ipu_drm_bind()
388 ipu_crtc->dev = dev; in ipu_drm_bind()
389 ipu_crtc->plane[0] = primary_plane; in ipu_drm_bind()
391 crtc = &ipu_crtc->base; in ipu_drm_bind()
395 ret = ipu_get_resources(drm, ipu_crtc, pdata); in ipu_drm_bind()
397 dev_err(ipu_crtc->dev, "getting resources failed with %d.\n", in ipu_drm_bind()
404 ipu_crtc->plane[1] = ipu_plane_init(drm, ipu, pdata->dma[1], in ipu_drm_bind()
406 drm_crtc_mask(&ipu_crtc->base), in ipu_drm_bind()
408 if (IS_ERR(ipu_crtc->plane[1])) in ipu_drm_bind()
409 ipu_crtc->plane[1] = NULL; in ipu_drm_bind()
412 ipu_crtc->irq = ipu_plane_irq(ipu_crtc->plane[0]); in ipu_drm_bind()
413 ret = devm_request_irq(ipu_crtc->dev, ipu_crtc->irq, ipu_irq_handler, in ipu_drm_bind()
414 IRQF_NO_AUTOEN, "imx_drm", ipu_crtc); in ipu_drm_bind()
416 dev_err(ipu_crtc->dev, "irq request failed with %d.\n", ret); in ipu_drm_bind()