1
0
Fork 0

MLK-24002-1 drm/imx: lcdifv3: enable shadow load for plane update

After the atomic plane update, the shadow load should be
enabled to make sure its update can take effect on next
frame in any cases. And this enable is better to be done
in CRTC's atomic_flush() which is called after plane's
atomic_update() is called.

Besides, the shadow load enable in controller enable is
unnecessary, so remove it.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Fancy Fang 2020-05-13 17:21:17 +08:00
parent 2ff28a22ad
commit bfa7236c84
3 changed files with 17 additions and 5 deletions

View File

@ -133,7 +133,11 @@ static void lcdifv3_crtc_atomic_begin(struct drm_crtc *crtc,
static void lcdifv3_crtc_atomic_flush(struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state)
{
/* LCDIFV3 doesn't have command buffer */
struct lcdifv3_crtc *lcdifv3_crtc = to_lcdifv3_crtc(crtc);
struct lcdifv3_soc *lcdifv3 = dev_get_drvdata(lcdifv3_crtc->dev->parent);
/* kick shadow load for plane config */
lcdifv3_en_shadow_load(lcdifv3);
}
static void lcdifv3_crtc_atomic_enable(struct drm_crtc *crtc,

View File

@ -450,6 +450,17 @@ void lcdifv3_set_mode(struct lcdifv3_soc *lcdifv3, struct videomode *vmode)
}
EXPORT_SYMBOL(lcdifv3_set_mode);
void lcdifv3_en_shadow_load(struct lcdifv3_soc *lcdifv3)
{
u32 ctrldescl0_5;
ctrldescl0_5 = readl(lcdifv3->base + LCDIFV3_CTRLDESCL0_5);
ctrldescl0_5 |= CTRLDESCL0_5_SHADOW_LOAD_EN;
writel(ctrldescl0_5, lcdifv3->base + LCDIFV3_CTRLDESCL0_5);
}
EXPORT_SYMBOL(lcdifv3_en_shadow_load);
void lcdifv3_enable_controller(struct lcdifv3_soc *lcdifv3)
{
u32 disp_para, ctrldescl0_5;
@ -461,10 +472,6 @@ void lcdifv3_enable_controller(struct lcdifv3_soc *lcdifv3)
disp_para |= DISP_PARA_DISP_ON;
writel(disp_para, lcdifv3->base + LCDIFV3_DISP_PARA);
/* enable shadow load */
ctrldescl0_5 |= CTRLDESCL0_5_SHADOW_LOAD_EN;
writel(ctrldescl0_5, lcdifv3->base + LCDIFV3_CTRLDESCL0_5);
/* enable layer dma */
ctrldescl0_5 |= CTRLDESCL0_5_EN;
writel(ctrldescl0_5, lcdifv3->base + LCDIFV3_CTRLDESCL0_5);

View File

@ -26,6 +26,7 @@ void lcdifv3_set_fb_addr(struct lcdifv3_soc *lcdifv3, int id, u32 addr);
void lcdifv3_set_mode(struct lcdifv3_soc *lcdifv3, struct videomode *vmode);
void lcdifv3_set_fb_hcrop(struct lcdifv3_soc *lcdifv3, u32 src_w,
u32 fb_w, bool crop);
void lcdifv3_en_shadow_load(struct lcdifv3_soc *lcdifv3);
void lcdifv3_enable_controller(struct lcdifv3_soc *lcdifv3);
void lcdifv3_disable_controller(struct lcdifv3_soc *lcdifv3);
void lcdifv3_dump_registers(struct lcdifv3_soc *lcdifv3);