media_module: fix mpred memory pullution issue [1/1]
authorHui Zhang <hui.zhang@amlogic.com>
Thu, 6 Aug 2020 11:16:21 +0000 (19:16 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Wed, 12 Aug 2020 08:14:52 +0000 (01:14 -0700)
PD#SWPL-30902

Problem:
there is mpred hw memory pollution when poor signal burning

Solution:
add hw address protect in mpred ctrl

Verify:
U215

Change-Id: Ia254a7ba92875f63f3086d8337de99b196333638
Signed-off-by: Hui Zhang <hui.zhang@amlogic.com>
drivers/frame_provider/decoder/h265/vh265.c

index 92b62cb212f7503bb409b65f4255315b2ca4539b..6b7bb106de7a26384559f3df923c6c2858c64168 100644 (file)
@@ -5143,23 +5143,24 @@ static void config_mpred_hw(struct hevc_state_s *hevc)
        WRITE_VREG(HEVC_MPRED_MV_RD_ROW_JUMP, data32);
 
        data32 = READ_VREG(HEVC_MPRED_CTRL0);
-       data32 = (hevc->slice_type |
-                         hevc->new_pic << 2 |
-                         hevc->new_tile << 3 |
-                         hevc->isNextSliceSegment << 4 |
-                         hevc->TMVPFlag << 5 |
-                         hevc->LDCFlag << 6 |
-                         hevc->ColFromL0Flag << 7 |
-                         above_ptr_ctrl << 8 |
-                         above_en << 9 |
-                         mv_wr_en << 10 |
-                         mv_rd_en << 11 |
-                         col_isIntra << 12 |
-                         buffer_linear << 13 |
-                         hevc->LongTerm_Curr << 14 |
-                         hevc->LongTerm_Col << 15 |
-                         hevc->lcu_size_log2 << 16 |
-                         cu_size_log2 << 20 | hevc->plevel << 24);
+       data32 = ((hevc->slice_type & 3) |
+                         (hevc->new_pic & 1) << 2 |
+                         (hevc->new_tile & 1) << 3 |
+                         (hevc->isNextSliceSegment  & 1)<< 4 |
+                         (hevc->TMVPFlag  & 1)<< 5 |
+                         (hevc->LDCFlag & 1) << 6 |
+                         (hevc->ColFromL0Flag & 1)<< 7 |
+                         (above_ptr_ctrl & 1)<< 8 |
+                         (above_en  & 1) << 9 |
+                         (mv_wr_en & 1) << 10 |
+                         (mv_rd_en  & 1)<< 11 |
+                         (col_isIntra & 1)<< 12 |
+                         (buffer_linear & 1)<< 13 |
+                         (hevc->LongTerm_Curr & 1) << 14 |
+                         (hevc->LongTerm_Col & 1) << 15 |
+                         (hevc->lcu_size_log2 & 0xf) << 16 |
+                         (cu_size_log2  & 0xf) << 20 | (hevc->plevel & 0x7) << 24);
+       data32 &=  ~(1<< 28);
        WRITE_VREG(HEVC_MPRED_CTRL0, data32);
 
        data32 = READ_VREG(HEVC_MPRED_CTRL1);