Lines Matching refs:zcrtc
218 struct zx_crtc *zcrtc = to_zx_crtc(crtc); in crtc_to_vou() local
220 return zcrtc->vou; in crtc_to_vou()
226 struct zx_crtc *zcrtc = to_zx_crtc(crtc); in vou_inf_hdmi_audio_sel() local
227 struct zx_vou_hw *vou = zcrtc->vou; in vou_inf_hdmi_audio_sel()
234 struct zx_crtc *zcrtc = to_zx_crtc(crtc); in vou_inf_enable() local
235 struct zx_vou_hw *vou = zcrtc->vou; in vou_inf_enable()
237 void __iomem *dither = zcrtc->dither; in vou_inf_enable()
238 void __iomem *csc = zcrtc->chncsc; in vou_inf_enable()
239 bool is_main = zcrtc->chn_type == VOU_CHN_MAIN; in vou_inf_enable()
263 zcrtc->chn_type << id); in vou_inf_enable()
292 struct zx_crtc *zcrtc = to_zx_crtc(crtc); in zx_vou_config_dividers() local
293 struct zx_vou_hw *vou = zcrtc->vou; in zx_vou_config_dividers()
294 const struct zx_crtc_bits *bits = zcrtc->bits; in zx_vou_config_dividers()
347 static inline void vou_chn_set_update(struct zx_crtc *zcrtc) in vou_chn_set_update() argument
349 zx_writel(zcrtc->chnreg + CHN_UPDATE, 1); in vou_chn_set_update()
357 struct zx_crtc *zcrtc = to_zx_crtc(crtc); in zx_crtc_atomic_enable() local
358 struct zx_vou_hw *vou = zcrtc->vou; in zx_crtc_atomic_enable()
359 const struct zx_crtc_regs *regs = zcrtc->regs; in zx_crtc_atomic_enable()
360 const struct zx_crtc_bits *bits = zcrtc->bits; in zx_crtc_atomic_enable()
429 zx_writel_mask(zcrtc->chnreg + CHN_CTRL1, CHN_SCREEN_W_MASK, in zx_crtc_atomic_enable()
431 zx_writel_mask(zcrtc->chnreg + CHN_CTRL1, CHN_SCREEN_H_MASK, in zx_crtc_atomic_enable()
435 zx_writel_mask(zcrtc->chnreg + CHN_INTERLACE_BUF_CTRL, CHN_INTERLACE_EN, in zx_crtc_atomic_enable()
439 vou_chn_set_update(zcrtc); in zx_crtc_atomic_enable()
442 zx_writel_mask(zcrtc->chnreg + CHN_CTRL0, CHN_ENABLE, CHN_ENABLE); in zx_crtc_atomic_enable()
446 ret = clk_set_rate(zcrtc->pixclk, mode->clock * 1000); in zx_crtc_atomic_enable()
452 ret = clk_prepare_enable(zcrtc->pixclk); in zx_crtc_atomic_enable()
460 struct zx_crtc *zcrtc = to_zx_crtc(crtc); in zx_crtc_atomic_disable() local
461 const struct zx_crtc_bits *bits = zcrtc->bits; in zx_crtc_atomic_disable()
462 struct zx_vou_hw *vou = zcrtc->vou; in zx_crtc_atomic_disable()
464 clk_disable_unprepare(zcrtc->pixclk); in zx_crtc_atomic_disable()
469 zx_writel_mask(zcrtc->chnreg + CHN_CTRL0, CHN_ENABLE, 0); in zx_crtc_atomic_disable()
501 struct zx_crtc *zcrtc = to_zx_crtc(crtc); in zx_vou_enable_vblank() local
503 u32 int_frame_mask = zcrtc->bits->int_frame_mask; in zx_vou_enable_vblank()
513 struct zx_crtc *zcrtc = to_zx_crtc(crtc); in zx_vou_disable_vblank() local
517 zcrtc->bits->int_frame_mask, 0); in zx_vou_disable_vblank()
536 struct zx_crtc *zcrtc; in zx_crtc_init() local
539 zcrtc = devm_kzalloc(dev, sizeof(*zcrtc), GFP_KERNEL); in zx_crtc_init()
540 if (!zcrtc) in zx_crtc_init()
543 zcrtc->vou = vou; in zx_crtc_init()
544 zcrtc->chn_type = chn_type; in zx_crtc_init()
558 zcrtc->chnreg = vou->osd + OSD_MAIN_CHN; in zx_crtc_init()
559 zcrtc->chncsc = vou->osd + MAIN_CHN_CSC_OFFSET; in zx_crtc_init()
560 zcrtc->dither = vou->osd + MAIN_DITHER_OFFSET; in zx_crtc_init()
561 zcrtc->regs = &main_crtc_regs; in zx_crtc_init()
562 zcrtc->bits = &main_crtc_bits; in zx_crtc_init()
569 zcrtc->chnreg = vou->osd + OSD_AUX_CHN; in zx_crtc_init()
570 zcrtc->chncsc = vou->osd + AUX_CHN_CSC_OFFSET; in zx_crtc_init()
571 zcrtc->dither = vou->osd + AUX_DITHER_OFFSET; in zx_crtc_init()
572 zcrtc->regs = &aux_crtc_regs; in zx_crtc_init()
573 zcrtc->bits = &aux_crtc_bits; in zx_crtc_init()
576 zcrtc->pixclk = devm_clk_get(dev, (chn_type == VOU_CHN_MAIN) ? in zx_crtc_init()
578 if (IS_ERR(zcrtc->pixclk)) { in zx_crtc_init()
579 ret = PTR_ERR(zcrtc->pixclk); in zx_crtc_init()
590 zcrtc->primary = &zplane->plane; in zx_crtc_init()
592 ret = drm_crtc_init_with_planes(drm, &zcrtc->crtc, zcrtc->primary, NULL, in zx_crtc_init()
599 drm_crtc_helper_add(&zcrtc->crtc, &zx_crtc_helper_funcs); in zx_crtc_init()
602 vou->main_crtc = zcrtc; in zx_crtc_init()
604 vou->aux_crtc = zcrtc; in zx_crtc_init()
611 struct zx_crtc *zcrtc = to_zx_crtc(plane->state->crtc); in zx_vou_layer_enable() local
612 struct zx_vou_hw *vou = zcrtc->vou; in zx_vou_layer_enable()
616 if (zcrtc->chn_type == VOU_CHN_MAIN) { in zx_vou_layer_enable()
632 struct zx_crtc *zcrtc = to_zx_crtc(old_state->crtc); in zx_vou_layer_disable() local
633 struct zx_vou_hw *vou = zcrtc->vou; in zx_vou_layer_disable()
671 static inline void zx_osd_int_update(struct zx_crtc *zcrtc) in zx_osd_int_update() argument
673 struct drm_crtc *crtc = &zcrtc->crtc; in zx_osd_int_update()
676 vou_chn_set_update(zcrtc); in zx_osd_int_update()