osd: fix osd suspend fail issue
authorpengcheng chen <pengcheng.chen@amlogic.com>
Wed, 18 Apr 2018 07:53:37 +0000 (15:53 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Thu, 19 Apr 2018 02:23:32 +0000 (19:23 -0700)
PD#164508: osd: fix osd suspend fail issue

Change-Id: I30c9efd77748a795b341ad4bedafa5f379ae52f1
Signed-off-by: pengcheng chen <pengcheng.chen@amlogic.com>
drivers/amlogic/media/osd/osd.h
drivers/amlogic/media/osd/osd_hw.c

index e8c903c..bad8b45 100644 (file)
@@ -504,6 +504,8 @@ struct hw_para_s {
        u32 enable[HW_OSD_COUNT];
        u32 powered[HW_OSD_COUNT];
        u32 reg_status_save;
+       u32 reg_status_save1;
+       u32 reg_status_save2;
 #ifdef FIQ_VSYNC
        bridge_item_t fiq_handle_item;
 #endif
index d3297b0..d335076 100644 (file)
@@ -6239,6 +6239,17 @@ void  osd_suspend_hw(void)
                notify_to_amvideo();
                osd_reg_clr_mask(VPP_MISC, OSD_RELATIVE_BITS);
                /* VSYNCOSD_CLR_MPEG_REG_MASK(VPP_MISC, OSD_RELATIVE_BITS); */
+       } else {
+               osd_hw.reg_status_save =
+                       osd_reg_read(VIU_OSD_BLEND_CTRL);
+               osd_hw.reg_status_save1 =
+                       osd_reg_read(OSD1_BLEND_SRC_CTRL);
+               osd_hw.reg_status_save2 =
+                       osd_reg_read(OSD2_BLEND_SRC_CTRL);
+               osd_reg_clr_mask(VIU_OSD_BLEND_CTRL, 0xf0000);
+               osd_reg_clr_mask(OSD1_BLEND_SRC_CTRL, 0xf0f);
+               osd_reg_clr_mask(OSD2_BLEND_SRC_CTRL, 0xf0f);
+
        }
        osd_log_info("osd_suspended\n");
 }
@@ -6270,6 +6281,13 @@ void osd_resume_hw(void)
                                1 << 0);
                }
                notify_to_amvideo();
+       } else {
+               osd_reg_set_mask(VIU_OSD_BLEND_CTRL,
+                       osd_hw.reg_status_save);
+               osd_reg_set_mask(OSD1_BLEND_SRC_CTRL,
+                       osd_hw.reg_status_save1);
+               osd_reg_set_mask(OSD2_BLEND_SRC_CTRL,
+                       osd_hw.reg_status_save2);
        }
        osd_log_info("osd_resumed\n");
 }