Lines Matching refs:lcdif

161 static void lcdif_set_formats(struct lcdif_drm_private *lcdif,  in lcdif_set_formats()  argument
165 struct drm_device *drm = lcdif->drm; in lcdif_set_formats()
173 lcdif->base + LCDC_V8_DISP_PARA); in lcdif_set_formats()
177 lcdif->base + LCDC_V8_DISP_PARA); in lcdif_set_formats()
181 lcdif->base + LCDC_V8_DISP_PARA); in lcdif_set_formats()
193 lcdif->base + LCDC_V8_CTRLDESCL0_5); in lcdif_set_formats()
197 lcdif->base + LCDC_V8_CTRLDESCL0_5); in lcdif_set_formats()
201 lcdif->base + LCDC_V8_CTRLDESCL0_5); in lcdif_set_formats()
205 lcdif->base + LCDC_V8_CTRLDESCL0_5); in lcdif_set_formats()
209 lcdif->base + LCDC_V8_CTRLDESCL0_5); in lcdif_set_formats()
213 lcdif->base + LCDC_V8_CTRLDESCL0_5); in lcdif_set_formats()
219 lcdif->base + LCDC_V8_CTRLDESCL0_5); in lcdif_set_formats()
224 lcdif->base + LCDC_V8_CTRLDESCL0_5); in lcdif_set_formats()
229 lcdif->base + LCDC_V8_CTRLDESCL0_5); in lcdif_set_formats()
234 lcdif->base + LCDC_V8_CTRLDESCL0_5); in lcdif_set_formats()
253 lcdif->base + LCDC_V8_CSC0_CTRL); in lcdif_set_formats()
263 lcdif->base + LCDC_V8_CSC0_COEF0); in lcdif_set_formats()
265 lcdif->base + LCDC_V8_CSC0_COEF1); in lcdif_set_formats()
267 lcdif->base + LCDC_V8_CSC0_COEF2); in lcdif_set_formats()
269 lcdif->base + LCDC_V8_CSC0_COEF3); in lcdif_set_formats()
271 lcdif->base + LCDC_V8_CSC0_COEF4); in lcdif_set_formats()
273 lcdif->base + LCDC_V8_CSC0_COEF5); in lcdif_set_formats()
281 lcdif->base + LCDC_V8_CSC0_CTRL); in lcdif_set_formats()
283 writel(coeffs[0], lcdif->base + LCDC_V8_CSC0_COEF0); in lcdif_set_formats()
284 writel(coeffs[1], lcdif->base + LCDC_V8_CSC0_COEF1); in lcdif_set_formats()
285 writel(coeffs[2], lcdif->base + LCDC_V8_CSC0_COEF2); in lcdif_set_formats()
286 writel(coeffs[3], lcdif->base + LCDC_V8_CSC0_COEF3); in lcdif_set_formats()
287 writel(coeffs[4], lcdif->base + LCDC_V8_CSC0_COEF4); in lcdif_set_formats()
288 writel(coeffs[5], lcdif->base + LCDC_V8_CSC0_COEF5); in lcdif_set_formats()
291 writel(CSC0_CTRL_BYPASS, lcdif->base + LCDC_V8_CSC0_CTRL); in lcdif_set_formats()
295 static void lcdif_set_mode(struct lcdif_drm_private *lcdif, u32 bus_flags) in lcdif_set_mode() argument
297 struct drm_display_mode *m = &lcdif->crtc.state->adjusted_mode; in lcdif_set_mode()
309 writel(ctrl, lcdif->base + LCDC_V8_CTRL); in lcdif_set_mode()
313 lcdif->base + LCDC_V8_DISP_SIZE); in lcdif_set_mode()
317 lcdif->base + LCDC_V8_HSYN_PARA); in lcdif_set_mode()
321 lcdif->base + LCDC_V8_VSYN_PARA); in lcdif_set_mode()
325 lcdif->base + LCDC_V8_VSYN_HSYN_WIDTH); in lcdif_set_mode()
329 lcdif->base + LCDC_V8_CTRLDESCL0_1); in lcdif_set_mode()
341 CTRLDESCL0_3_PITCH(lcdif->crtc.primary->state->fb->pitches[0]); in lcdif_set_mode()
342 writel(ctrl, lcdif->base + LCDC_V8_CTRLDESCL0_3); in lcdif_set_mode()
345 static void lcdif_enable_controller(struct lcdif_drm_private *lcdif) in lcdif_enable_controller() argument
352 lcdif->base + LCDC_V8_PANIC0_THRES); in lcdif_enable_controller()
359 lcdif->base + LCDC_V8_INT_ENABLE_D1); in lcdif_enable_controller()
361 reg = readl(lcdif->base + LCDC_V8_DISP_PARA); in lcdif_enable_controller()
363 writel(reg, lcdif->base + LCDC_V8_DISP_PARA); in lcdif_enable_controller()
365 reg = readl(lcdif->base + LCDC_V8_CTRLDESCL0_5); in lcdif_enable_controller()
367 writel(reg, lcdif->base + LCDC_V8_CTRLDESCL0_5); in lcdif_enable_controller()
370 static void lcdif_disable_controller(struct lcdif_drm_private *lcdif) in lcdif_disable_controller() argument
375 reg = readl(lcdif->base + LCDC_V8_CTRLDESCL0_5); in lcdif_disable_controller()
377 writel(reg, lcdif->base + LCDC_V8_CTRLDESCL0_5); in lcdif_disable_controller()
379 ret = readl_poll_timeout(lcdif->base + LCDC_V8_CTRLDESCL0_5, in lcdif_disable_controller()
383 drm_err(lcdif->drm, "Failed to disable controller!\n"); in lcdif_disable_controller()
385 reg = readl(lcdif->base + LCDC_V8_DISP_PARA); in lcdif_disable_controller()
387 writel(reg, lcdif->base + LCDC_V8_DISP_PARA); in lcdif_disable_controller()
390 writel(0, lcdif->base + LCDC_V8_INT_ENABLE_D1); in lcdif_disable_controller()
393 static void lcdif_reset_block(struct lcdif_drm_private *lcdif) in lcdif_reset_block() argument
395 writel(CTRL_SW_RESET, lcdif->base + LCDC_V8_CTRL + REG_SET); in lcdif_reset_block()
396 readl(lcdif->base + LCDC_V8_CTRL); in lcdif_reset_block()
397 writel(CTRL_SW_RESET, lcdif->base + LCDC_V8_CTRL + REG_CLR); in lcdif_reset_block()
398 readl(lcdif->base + LCDC_V8_CTRL); in lcdif_reset_block()
406 struct lcdif_drm_private *lcdif = to_lcdif_drm_private(drm); in lcdif_crtc_mode_set_nofb() local
410 m->clock, (int)(clk_get_rate(lcdif->clk) / 1000)); in lcdif_crtc_mode_set_nofb()
416 lcdif_reset_block(lcdif); in lcdif_crtc_mode_set_nofb()
418 lcdif_set_formats(lcdif, plane_state, lcdif_crtc_state->bus_format); in lcdif_crtc_mode_set_nofb()
420 lcdif_set_mode(lcdif, lcdif_crtc_state->bus_flags); in lcdif_crtc_mode_set_nofb()
507 struct lcdif_drm_private *lcdif = to_lcdif_drm_private(crtc->dev); in lcdif_crtc_atomic_flush() local
511 reg = readl(lcdif->base + LCDC_V8_CTRLDESCL0_5); in lcdif_crtc_atomic_flush()
513 writel(reg, lcdif->base + LCDC_V8_CTRLDESCL0_5); in lcdif_crtc_atomic_flush()
532 struct lcdif_drm_private *lcdif = to_lcdif_drm_private(crtc->dev); in lcdif_crtc_atomic_enable() local
536 struct drm_display_mode *m = &lcdif->crtc.state->adjusted_mode; in lcdif_crtc_atomic_enable()
537 struct drm_device *drm = lcdif->drm; in lcdif_crtc_atomic_enable()
540 clk_set_rate(lcdif->clk, m->clock * 1000); in lcdif_crtc_atomic_enable()
550 lcdif->base + LCDC_V8_CTRLDESCL_LOW0_4); in lcdif_crtc_atomic_enable()
552 lcdif->base + LCDC_V8_CTRLDESCL_HIGH0_4); in lcdif_crtc_atomic_enable()
554 lcdif_enable_controller(lcdif); in lcdif_crtc_atomic_enable()
562 struct lcdif_drm_private *lcdif = to_lcdif_drm_private(crtc->dev); in lcdif_crtc_atomic_disable() local
563 struct drm_device *drm = lcdif->drm; in lcdif_crtc_atomic_disable()
568 lcdif_disable_controller(lcdif); in lcdif_crtc_atomic_disable()
625 struct lcdif_drm_private *lcdif = to_lcdif_drm_private(crtc->dev); in lcdif_crtc_enable_vblank() local
628 writel(INT_STATUS_D0_VS_BLANK, lcdif->base + LCDC_V8_INT_STATUS_D0); in lcdif_crtc_enable_vblank()
629 writel(INT_ENABLE_D0_VS_BLANK_EN, lcdif->base + LCDC_V8_INT_ENABLE_D0); in lcdif_crtc_enable_vblank()
636 struct lcdif_drm_private *lcdif = to_lcdif_drm_private(crtc->dev); in lcdif_crtc_disable_vblank() local
639 writel(0, lcdif->base + LCDC_V8_INT_ENABLE_D0); in lcdif_crtc_disable_vblank()
640 writel(INT_STATUS_D0_VS_BLANK, lcdif->base + LCDC_V8_INT_STATUS_D0); in lcdif_crtc_disable_vblank()
670 struct lcdif_drm_private *lcdif = to_lcdif_drm_private(plane->dev); in lcdif_plane_atomic_check() local
674 &lcdif->crtc); in lcdif_plane_atomic_check()
685 struct lcdif_drm_private *lcdif = to_lcdif_drm_private(plane->dev); in lcdif_plane_primary_atomic_update() local
693 lcdif->base + LCDC_V8_CTRLDESCL_LOW0_4); in lcdif_plane_primary_atomic_update()
695 lcdif->base + LCDC_V8_CTRLDESCL_HIGH0_4); in lcdif_plane_primary_atomic_update()
746 int lcdif_kms_init(struct lcdif_drm_private *lcdif) in lcdif_kms_init() argument
753 struct drm_crtc *crtc = &lcdif->crtc; in lcdif_kms_init()
756 drm_plane_helper_add(&lcdif->planes.primary, in lcdif_kms_init()
758 ret = drm_universal_plane_init(lcdif->drm, &lcdif->planes.primary, 1, in lcdif_kms_init()
767 ret = drm_plane_create_color_properties(&lcdif->planes.primary, in lcdif_kms_init()
776 return drm_crtc_init_with_planes(lcdif->drm, crtc, in lcdif_kms_init()
777 &lcdif->planes.primary, NULL, in lcdif_kms_init()