ge2d: fix strechblit issue for GE2D [1/2]
authorJian Cao <jian.cao@amlogic.com>
Thu, 10 Jan 2019 08:55:53 +0000 (16:55 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Tue, 15 Jan 2019 10:43:28 +0000 (02:43 -0800)
PD#SWPL-4075

Problem:
dst data is not normal by using strechblit function
such as 1920x1080 --> 640x360

Solution:
add bit width restriction for
horizontal scaler initial phase

Verify:
verified on g12b-w400

Change-Id: Ibcd85cc08f49254e90100beb952e711736531134
Signed-off-by: Jian Cao <jian.cao@amlogic.com>
drivers/amlogic/media/common/ge2d/ge2d_hw.c

index 85d5657..497fbf8 100644 (file)
@@ -977,7 +977,7 @@ void ge2d_set_cmd(struct ge2d_cmd_s *cfg)
        ge2d_reg_write(GE2D_HSC_INI_CTRL,
                        (cfg->hsc_rpt_p0_num << 29) |
                        (cfg->hsc_adv_num << 24) |
-                       (cfg->hsc_ini_phase << 0)
+                       ((cfg->hsc_ini_phase & 0xffffff) << 0)
                       );
 #else
        ge2d_reg_write(GE2D_HSC_ADV_CTRL,
@@ -986,7 +986,7 @@ void ge2d_set_cmd(struct ge2d_cmd_s *cfg)
                       );
        ge2d_reg_write(GE2D_HSC_INI_CTRL,
                        (cfg->hsc_rpt_p0_num << 29) |
-                       (cfg->hsc_ini_phase << 0)
+                       ((cfg->hsc_ini_phase & 0xffffff) << 0)
                       );
 #endif