Lines Matching refs:vc4_crtc
68 #define CRTC_WRITE(offset, val) writel(val, vc4_crtc->regs + (offset))
69 #define CRTC_READ(offset) readl(vc4_crtc->regs + (offset))
94 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); in vc4_crtc_get_scanoutpos() local
110 val = HVS_READ(SCALER_DISPSTATX(vc4_crtc->channel)); in vc4_crtc_get_scanoutpos()
131 fifo_lines = vc4_crtc->cob_size / mode->crtc_hdisplay; in vc4_crtc_get_scanoutpos()
179 *stime = vc4_crtc->t_vblank; in vc4_crtc_get_scanoutpos()
181 *etime = vc4_crtc->t_vblank; in vc4_crtc_get_scanoutpos()
215 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); in vc4_crtc_lut_load() local
224 (vc4_crtc->channel * 3 * crtc->gamma_size)); in vc4_crtc_lut_load()
227 HVS_WRITE(SCALER_GAMDATA, vc4_crtc->lut_r[i]); in vc4_crtc_lut_load()
229 HVS_WRITE(SCALER_GAMDATA, vc4_crtc->lut_g[i]); in vc4_crtc_lut_load()
231 HVS_WRITE(SCALER_GAMDATA, vc4_crtc->lut_b[i]); in vc4_crtc_lut_load()
237 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); in vc4_crtc_update_gamma_lut() local
243 vc4_crtc->lut_r[i] = drm_color_lut_extract(lut[i].red, 8); in vc4_crtc_update_gamma_lut()
244 vc4_crtc->lut_g[i] = drm_color_lut_extract(lut[i].green, 8); in vc4_crtc_update_gamma_lut()
245 vc4_crtc->lut_b[i] = drm_color_lut_extract(lut[i].blue, 8); in vc4_crtc_update_gamma_lut()
297 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); in vc4_crtc_config_pv() local
386 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); in vc4_crtc_mode_set_nofb() local
393 struct drm_printer p = drm_info_printer(&vc4_crtc->pdev->dev); in vc4_crtc_mode_set_nofb()
394 dev_info(&vc4_crtc->pdev->dev, "CRTC %d regs before:\n", in vc4_crtc_mode_set_nofb()
396 drm_print_regset32(&p, &vc4_crtc->regset); in vc4_crtc_mode_set_nofb()
399 if (vc4_crtc->channel == 2) { in vc4_crtc_mode_set_nofb()
426 HVS_WRITE(SCALER_DISPBKGNDX(vc4_crtc->channel), in vc4_crtc_mode_set_nofb()
437 struct drm_printer p = drm_info_printer(&vc4_crtc->pdev->dev); in vc4_crtc_mode_set_nofb()
438 dev_info(&vc4_crtc->pdev->dev, "CRTC %d regs after:\n", in vc4_crtc_mode_set_nofb()
440 drm_print_regset32(&p, &vc4_crtc->regset); in vc4_crtc_mode_set_nofb()
457 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); in vc4_crtc_atomic_disable() local
458 u32 chan = vc4_crtc->channel; in vc4_crtc_atomic_disable()
518 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); in vc4_crtc_update_dlist() local
531 vc4_crtc->event = crtc->state->event; in vc4_crtc_update_dlist()
535 HVS_WRITE(SCALER_DISPLISTX(vc4_crtc->channel), in vc4_crtc_update_dlist()
540 HVS_WRITE(SCALER_DISPLISTX(vc4_crtc->channel), in vc4_crtc_update_dlist()
550 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); in vc4_crtc_atomic_enable() local
567 HVS_WRITE(SCALER_DISPCTRLX(vc4_crtc->channel), in vc4_crtc_atomic_enable()
687 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); in vc4_crtc_atomic_flush() local
729 HVS_WRITE(SCALER_DISPBKGNDX(vc4_crtc->channel), in vc4_crtc_atomic_flush()
730 HVS_READ(SCALER_DISPBKGNDX(vc4_crtc->channel)) | in vc4_crtc_atomic_flush()
744 u32 dispbkgndx = HVS_READ(SCALER_DISPBKGNDX(vc4_crtc->channel)); in vc4_crtc_atomic_flush()
756 HVS_WRITE(SCALER_DISPBKGNDX(vc4_crtc->channel), dispbkgndx); in vc4_crtc_atomic_flush()
767 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); in vc4_enable_vblank() local
776 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); in vc4_disable_vblank() local
781 static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc) in vc4_crtc_handle_page_flip() argument
783 struct drm_crtc *crtc = &vc4_crtc->base; in vc4_crtc_handle_page_flip()
787 u32 chan = vc4_crtc->channel; in vc4_crtc_handle_page_flip()
791 if (vc4_crtc->event && in vc4_crtc_handle_page_flip()
794 drm_crtc_send_vblank_event(crtc, vc4_crtc->event); in vc4_crtc_handle_page_flip()
795 vc4_crtc->event = NULL; in vc4_crtc_handle_page_flip()
804 vc4_hvs_unmask_underrun(dev, vc4_crtc->channel); in vc4_crtc_handle_page_flip()
809 void vc4_crtc_handle_vblank(struct vc4_crtc *crtc) in vc4_crtc_handle_vblank()
818 struct vc4_crtc *vc4_crtc = data; in vc4_crtc_irq_handler() local
824 vc4_crtc_handle_vblank(vc4_crtc); in vc4_crtc_irq_handler()
1081 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); in vc4_set_crtc_possible_masks() local
1082 const struct vc4_crtc_data *crtc_data = vc4_crtc->data; in vc4_set_crtc_possible_masks()
1109 vc4_crtc_get_cob_allocation(struct vc4_crtc *vc4_crtc) in vc4_crtc_get_cob_allocation() argument
1111 struct drm_device *drm = vc4_crtc->base.dev; in vc4_crtc_get_cob_allocation()
1113 u32 dispbase = HVS_READ(SCALER_DISPBASEX(vc4_crtc->channel)); in vc4_crtc_get_cob_allocation()
1121 vc4_crtc->cob_size = top - base + 4; in vc4_crtc_get_cob_allocation()
1128 struct vc4_crtc *vc4_crtc; in vc4_crtc_bind() local
1134 vc4_crtc = devm_kzalloc(dev, sizeof(*vc4_crtc), GFP_KERNEL); in vc4_crtc_bind()
1135 if (!vc4_crtc) in vc4_crtc_bind()
1137 crtc = &vc4_crtc->base; in vc4_crtc_bind()
1142 vc4_crtc->data = match->data; in vc4_crtc_bind()
1143 vc4_crtc->pdev = pdev; in vc4_crtc_bind()
1145 vc4_crtc->regs = vc4_ioremap_regs(pdev, 0); in vc4_crtc_bind()
1146 if (IS_ERR(vc4_crtc->regs)) in vc4_crtc_bind()
1147 return PTR_ERR(vc4_crtc->regs); in vc4_crtc_bind()
1149 vc4_crtc->regset.base = vc4_crtc->regs; in vc4_crtc_bind()
1150 vc4_crtc->regset.regs = crtc_regs; in vc4_crtc_bind()
1151 vc4_crtc->regset.nregs = ARRAY_SIZE(crtc_regs); in vc4_crtc_bind()
1169 vc4_crtc->channel = vc4_crtc->data->hvs_channel; in vc4_crtc_bind()
1170 drm_mode_crtc_set_gamma_size(crtc, ARRAY_SIZE(vc4_crtc->lut_r)); in vc4_crtc_bind()
1207 vc4_crtc_get_cob_allocation(vc4_crtc); in vc4_crtc_bind()
1212 vc4_crtc_irq_handler, 0, "vc4 crtc", vc4_crtc); in vc4_crtc_bind()
1219 vc4_crtc->lut_r[i] = i; in vc4_crtc_bind()
1220 vc4_crtc->lut_g[i] = i; in vc4_crtc_bind()
1221 vc4_crtc->lut_b[i] = i; in vc4_crtc_bind()
1224 platform_set_drvdata(pdev, vc4_crtc); in vc4_crtc_bind()
1226 vc4_debugfs_add_regset32(drm, vc4_crtc->data->debugfs_name, in vc4_crtc_bind()
1227 &vc4_crtc->regset); in vc4_crtc_bind()
1245 struct vc4_crtc *vc4_crtc = dev_get_drvdata(dev); in vc4_crtc_unbind() local
1247 vc4_crtc_destroy(&vc4_crtc->base); in vc4_crtc_unbind()