Commit 0b9d0416 authored by Fabien Dessenne's avatar Fabien Dessenne Committed by Vincent Abriou

drm/sti: force cursor CLUT fetch

It may happen that the cursor is displayed with wrong colors which can
be explained by a CLUT wrongly fetched at the first display.
Fetching the CLUT at each commit (=move) ensures that the right colors
are used, at least from the first cursor move.
Signed-off-by: default avatarFabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: default avatarBenjamin Gaignard <benjamin.gaignard@linaro.org>
Reviewed-by: default avatarVincent Abriou <vincent.abriou@st.com>
parent 704cb30c
...@@ -127,7 +127,6 @@ static void sti_cursor_atomic_update(struct drm_plane *drm_plane, ...@@ -127,7 +127,6 @@ static void sti_cursor_atomic_update(struct drm_plane *drm_plane,
/* src_x are in 16.16 format */ /* src_x are in 16.16 format */
int src_w = state->src_w >> 16; int src_w = state->src_w >> 16;
int src_h = state->src_h >> 16; int src_h = state->src_h >> 16;
bool first_prepare = plane->status == STI_PLANE_DISABLED ? true : false;
struct drm_gem_cma_object *cma_obj; struct drm_gem_cma_object *cma_obj;
u32 y, x; u32 y, x;
u32 val; u32 val;
...@@ -193,12 +192,6 @@ static void sti_cursor_atomic_update(struct drm_plane *drm_plane, ...@@ -193,12 +192,6 @@ static void sti_cursor_atomic_update(struct drm_plane *drm_plane,
val = y << 16 | x; val = y << 16 | x;
writel(val, cursor->regs + CUR_AWE); writel(val, cursor->regs + CUR_AWE);
if (first_prepare) {
/* Set and fetch CLUT */
writel(cursor->clut_paddr, cursor->regs + CUR_CML);
writel(CUR_CTL_CLUT_UPDATE, cursor->regs + CUR_CTL);
}
/* Set memory location, size, and position */ /* Set memory location, size, and position */
writel(cursor->pixmap.paddr, cursor->regs + CUR_PML); writel(cursor->pixmap.paddr, cursor->regs + CUR_PML);
writel(cursor->width, cursor->regs + CUR_PMP); writel(cursor->width, cursor->regs + CUR_PMP);
...@@ -208,6 +201,10 @@ static void sti_cursor_atomic_update(struct drm_plane *drm_plane, ...@@ -208,6 +201,10 @@ static void sti_cursor_atomic_update(struct drm_plane *drm_plane,
x = sti_vtg_get_pixel_number(*mode, dst_x); x = sti_vtg_get_pixel_number(*mode, dst_x);
writel((y << 16) | x, cursor->regs + CUR_VPO); writel((y << 16) | x, cursor->regs + CUR_VPO);
/* Set and fetch CLUT */
writel(cursor->clut_paddr, cursor->regs + CUR_CML);
writel(CUR_CTL_CLUT_UPDATE, cursor->regs + CUR_CTL);
plane->status = STI_PLANE_UPDATED; plane->status = STI_PLANE_UPDATED;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment