drm/exynos: workaround to change graphic layers priority
authorJoonyoung Shim <jy0922.shim@samsung.com>
Fri, 15 May 2015 07:29:00 +0000 (16:29 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 14 Dec 2016 04:50:22 +0000 (13:50 +0900)
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 <jy0922.shim@samsung.com>
drivers/gpu/drm/exynos/exynos_mixer.c

index 99f8b83..9510ca5 100644 (file)
@@ -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) {
@@ -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);
@@ -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 */