Skip to content

Commit

Permalink
drm/exynos: workaround to change graphic layers priority
Browse files Browse the repository at this point in the history
As cannot use video layer, need lower layer than default layer. So make
higher graphic layer 0 priority then graphic layer 1 priority. This is
just workaround, may need to make a interface to change layer priority
for user later.

Change-Id: If63a2f3eef6c164b5b3c3a5c801f9090a6a0a341
Signed-off-by: Joonyoung Shim <[email protected]>
  • Loading branch information
Joonyoung Shim authored and mszyprow committed May 16, 2016
1 parent f1ec044 commit 1e1b093
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions drivers/gpu/drm/exynos/exynos_mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,21 @@ static void mixer_cfg_layer(struct mixer_context *ctx, unsigned int win,
break;
case 1:
mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_GRP1_ENABLE);
/* FIXME: workaround to change default layer priority */
if (ctx->mxr_ver == MXR_VER_128_0_0_184) {
if (enable) {
/* control blending of graphic layer 0 */
mixer_reg_writemask(res, MXR_GRAPHIC_CFG(0),
val,
MXR_GRP_CFG_BLEND_PRE_MUL |
MXR_GRP_CFG_PIXEL_BLEND_EN);
} else {
mixer_reg_writemask(res, MXR_GRAPHIC_CFG(0), 0,
MXR_GRP_CFG_BLEND_PRE_MUL |
MXR_GRP_CFG_PIXEL_BLEND_EN);
}
}

break;
case 2:
if (ctx->vp_enabled) {
Expand Down Expand Up @@ -661,8 +676,16 @@ static void mixer_win_reset(struct mixer_context *ctx)
* layer0 - framebuffer
* video - video overlay
*/
val = MXR_LAYER_CFG_GRP1_VAL(3);
val |= MXR_LAYER_CFG_GRP0_VAL(2);

/* FIXME: workaround to change default layer priority */
if (ctx->mxr_ver == MXR_VER_128_0_0_184) {
val = MXR_LAYER_CFG_GRP1_VAL(2);
val |= MXR_LAYER_CFG_GRP0_VAL(3);
} else {
val = MXR_LAYER_CFG_GRP1_VAL(3);
val |= MXR_LAYER_CFG_GRP0_VAL(2);
}

if (ctx->vp_enabled)
val |= MXR_LAYER_CFG_VP_VAL(1);
mixer_reg_write(res, MXR_LAYER_CFG, val);
Expand All @@ -681,8 +704,11 @@ static void mixer_win_reset(struct mixer_context *ctx)
mixer_reg_write(res, MXR_GRAPHIC_CFG(0), val);

/* Blend layer 1 into layer 0 */
val |= MXR_GRP_CFG_BLEND_PRE_MUL;
val |= MXR_GRP_CFG_PIXEL_BLEND_EN;
/* FIXME: workaround to change default layer as unused video overlay */
if (ctx->mxr_ver != MXR_VER_128_0_0_184) {
val |= MXR_GRP_CFG_BLEND_PRE_MUL;
val |= MXR_GRP_CFG_PIXEL_BLEND_EN;
}
mixer_reg_write(res, MXR_GRAPHIC_CFG(1), val);

/* setting video layers */
Expand Down

0 comments on commit 1e1b093

Please sign in to comment.