From: zhilei.wu Date: Fri, 13 Jul 2018 05:33:15 +0000 (+0800) Subject: osd: debug for osd suspend fail issue X-Git-Tag: khadas-vims-v0.9.6-release~1613 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a6f69500d16a1032beaeb6b794f7bc89a93ac610;p=platform%2Fkernel%2Flinux-amlogic.git osd: debug for osd suspend fail issue PD#164508: osd: debug for osd suspend fail issue Change-Id: Ibd7930c64d102bbe53e1775fa4f52aab0c67d078 Signed-off-by: zhilei.wu --- diff --git a/drivers/amlogic/media/osd/osd.h b/drivers/amlogic/media/osd/osd.h index 21a1769..745eb8c 100644 --- a/drivers/amlogic/media/osd/osd.h +++ b/drivers/amlogic/media/osd/osd.h @@ -655,6 +655,7 @@ struct hw_para_s { u32 reg_status_save1; u32 reg_status_save2; u32 reg_status_save3; + u32 reg_status_save4; #ifdef FIQ_VSYNC bridge_item_t fiq_handle_item; #endif diff --git a/drivers/amlogic/media/osd/osd_hw.c b/drivers/amlogic/media/osd/osd_hw.c index 0d499fc..602a18c 100644 --- a/drivers/amlogic/media/osd/osd_hw.c +++ b/drivers/amlogic/media/osd/osd_hw.c @@ -29,6 +29,7 @@ #include #include #include + /* Android Headers */ /* Amlogic sync headers */ @@ -95,6 +96,7 @@ static bool osd_update_window_axis; static int osd_afbc_dec_enable; static int ext_canvas_id[HW_OSD_COUNT]; static int osd_extra_idx[HW_OSD_COUNT][2]; +static bool suspend_flag; static void osd_clone_pan(u32 index, u32 yoffset, int debug_flag); static void osd_set_dummy_data(u32 index, u32 alpha); @@ -424,6 +426,10 @@ static u32 osd_vpp_misc_mask = OSD_RELATIVE_BITS; module_param(osd_vpp_misc, uint, 0444); MODULE_PARM_DESC(osd_vpp_misc, "osd_vpp_misc"); +static unsigned int rdarb_reqen_slv = 0xff7f; +module_param(rdarb_reqen_slv, uint, 0664); +MODULE_PARM_DESC(rdarb_reqen_slv, "rdarb_reqen_slv"); + static int vsync_enter_line_max; static int vsync_exit_line_max; static int vsync_line_threshold = 950; @@ -3623,7 +3629,8 @@ static void osd_pan_display_single_fence(struct osd_fence_map_s *fence_map) osd_update_window_axis = false; } if ((osd_enable != osd_hw.enable[index]) - && skip == false) { + && (skip == false) + && (suspend_flag == false)) { osd_hw.enable[index] = osd_enable; if (!osd_hw.osd_display_debug) osd_hw.reg[OSD_ENABLE] @@ -3741,7 +3748,8 @@ static void osd_pan_display_single_fence(struct osd_fence_map_s *fence_map) osd_update_window_axis = false; } if ((osd_enable != osd_hw.enable[index]) - && skip == false) { + && (skip == false) + && (suspend_flag == false)) { osd_hw.enable[index] = osd_enable; if (!osd_hw.osd_display_debug) osd_hw.reg[OSD_ENABLE] @@ -3752,7 +3760,8 @@ static void osd_pan_display_single_fence(struct osd_fence_map_s *fence_map) spin_unlock_irqrestore(&osd_lock, lock_flags); osd_wait_vsync_hw(); } else if ((osd_enable != osd_hw.enable[index]) - && skip == false) { + && (skip == false) + && (suspend_flag == false)) { spin_lock_irqsave(&osd_lock, lock_flags); osd_hw.enable[index] = osd_enable; if (!osd_hw.osd_display_debug) @@ -6651,7 +6660,8 @@ static void osd_setting_old_hwc(void) .update_func(index); osd_update_window_axis = false; } - if (!osd_hw.osd_display_debug) + if (!osd_hw.osd_display_debug + && (suspend_flag == false)) osd_hw.reg[OSD_ENABLE] .update_func(index); spin_unlock_irqrestore(&osd_lock, lock_flags); @@ -7728,7 +7738,8 @@ void osd_suspend_hw(void) /* VSYNCOSD_CLR_MPEG_REG_MASK(VPP_MISC, OSD_RELATIVE_BITS); */ } else { int i = 0; - + spin_lock_irqsave(&osd_lock, lock_flags); + suspend_flag = true; for (i = 0; i < osd_hw.osd_meson_dev.osd_count; i++) { if (osd_hw.enable[i]) { osd_hw.enable_save[i] = ENABLE; @@ -7746,11 +7757,15 @@ void osd_suspend_hw(void) osd_reg_read(OSD2_BLEND_SRC_CTRL); osd_hw.reg_status_save3 = osd_reg_read(VPP_RDARB_REQEN_SLV); + osd_hw.reg_status_save4 = + osd_reg_read(VPU_MAFBC_SURFACE_CFG); 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_reg_clr_mask(VPP_RDARB_REQEN_SLV, 0xff7f); - + osd_reg_clr_mask(VPP_RDARB_REQEN_SLV, + rdarb_reqen_slv); + osd_reg_clr_mask(VPU_MAFBC_SURFACE_CFG, 0xffffffff); + spin_unlock_irqrestore(&osd_lock, lock_flags); } osd_log_info("osd_suspended\n"); } @@ -7784,7 +7799,8 @@ void osd_resume_hw(void) notify_to_amvideo(); } else { int i = 0; - + spin_lock_irqsave(&osd_lock, lock_flags); + suspend_flag = false; for (i = 0; i < osd_hw.osd_meson_dev.osd_count; i++) { if (osd_hw.enable_save[i]) { osd_hw.enable[i] = ENABLE; @@ -7800,6 +7816,9 @@ void osd_resume_hw(void) osd_hw.reg_status_save2); osd_reg_set_mask(VPP_RDARB_REQEN_SLV, osd_hw.reg_status_save3); + osd_reg_set_mask(VPU_MAFBC_SURFACE_CFG, + osd_hw.reg_status_save4); + spin_unlock_irqrestore(&osd_lock, lock_flags); } osd_log_info("osd_resumed\n"); } @@ -8438,7 +8457,8 @@ void osd_page_flip(struct osd_plane_map_s *plane_map) osd_update_window_axis = false; } if ((osd_hw.osd_afbcd[index].enable == DISABLE) - && (osd_enable != osd_hw.enable[index])) { + && (osd_enable != osd_hw.enable[index]) + && (suspend_flag == false)) { osd_hw.enable[index] = osd_enable; if (!osd_hw.osd_display_debug) osd_hw.reg[OSD_ENABLE] @@ -8459,7 +8479,8 @@ void osd_page_flip(struct osd_plane_map_s *plane_map) osd_cursor_move(plane_map); osd_hw.reg[OSD_COLOR_MODE].update_func(index); osd_hw.reg[DISP_GEOMETRY].update_func(index); - if (osd_enable != osd_hw.enable[index]) { + if ((osd_enable != osd_hw.enable[index]) + && (suspend_flag == false)) { osd_hw.enable[index] = osd_enable; if (!osd_hw.osd_display_debug) osd_hw.reg[OSD_ENABLE] @@ -8501,7 +8522,8 @@ void osd_page_flip(struct osd_plane_map_s *plane_map) } } if ((osd_hw.osd_afbcd[index].enable == DISABLE) - && (osd_enable != osd_hw.enable[index])) { + && (osd_enable != osd_hw.enable[index]) + && (suspend_flag == false)) { osd_hw.enable[index] = osd_enable; if (!osd_hw.osd_display_debug) osd_hw.reg[OSD_ENABLE]