ge2d: disable src2 alpha with notsupport src2_alp
authorzhilei.wu <zhilei.wu@amlogic.com>
Wed, 28 Mar 2018 06:59:41 +0000 (14:59 +0800)
committerzhilei.wu <zhilei.wu@amlogic.com>
Wed, 28 Mar 2018 06:59:41 +0000 (14:59 +0800)
PD#162344: ge2d: disable src2 alpha with notsupport src2_alp

Change-Id: I049568f57c328ed6128e95ee83c6974226c36544
Signed-off-by: zhilei.wu <zhilei.wu@amlogic.com>
drivers/amlogic/media/common/ge2d/ge2d_hw.c

index 8e82314..78e141e 100644 (file)
@@ -750,9 +750,11 @@ void ge2d_set_dp_gen(struct ge2d_dp_gen_s *cfg)
        ge2d_reg_set_bits(GE2D_GEN_CTRL2,
                cfg->src1_gb_alpha_en, 29, 1);
 #ifdef CONFIG_GE2D_SRC2
-       ge2d_reg_set_bits(GE2D_GEN_CTRL5, cfg->src2_gb_alpha, 0, 8);
-       ge2d_reg_set_bits(GE2D_GEN_CTRL5,
-               cfg->src2_gb_alpha_en, 8, 1);
+       if (ge2d_meson_dev.src2_alp == 1) {
+               ge2d_reg_set_bits(GE2D_GEN_CTRL5, cfg->src2_gb_alpha, 0, 8);
+               ge2d_reg_set_bits(GE2D_GEN_CTRL5,
+                       cfg->src2_gb_alpha_en, 8, 1);
+       }
 #endif
        ge2d_reg_write(GE2D_ALU_CONST_COLOR, cfg->alu_const_color);
        ge2d_reg_write(GE2D_SRC1_KEY, cfg->src1_key);