From 35805abe858f4d21be9979b6b6310e9e602166f8 Mon Sep 17 00:00:00 2001 From: Pengcheng Chen Date: Wed, 2 Jun 2021 09:57:30 +0800 Subject: [PATCH] osd: fix osd dummy alpha set error issue [1/1] PD#SWPL-51971 Problem: osd dummy alpha error in 1080i Solution: fix osd dummy alpha set in 1080i Verify: u212 Change-Id: Iaa7271fd3def8fde3098fb517010f0650fe3c096 Signed-off-by: Pengcheng Chen --- drivers/amlogic/media/osd/osd_hw.c | 65 +++++++++++++++++++----------- 1 file changed, 42 insertions(+), 23 deletions(-) diff --git a/drivers/amlogic/media/osd/osd_hw.c b/drivers/amlogic/media/osd/osd_hw.c index 25c3b4856f0d..e1d73ef6f269 100644 --- a/drivers/amlogic/media/osd/osd_hw.c +++ b/drivers/amlogic/media/osd/osd_hw.c @@ -3377,8 +3377,8 @@ void osd_set_free_scale_enable_hw(u32 index, u32 enable) height_src = osd_hw.free_src_data[index].y_end - osd_hw.free_src_data[index].y_start + 1; if (height_dst != height_src && - osd_hw.free_dst_data[index].y_end < - osd_hw.vinfo_height[index] - 1) + osd_hw.free_dst_data[index].y_end < + osd_hw.vinfo_height[VIU1] - 1) osd_set_dummy_data(index, 0); else osd_set_dummy_data(index, 0xff); @@ -3566,7 +3566,8 @@ void osd_set_window_axis_hw(u32 index, s32 x0, s32 y0, s32 x1, s32 y1) else osd_set_dummy_data(index, 0xff); - if (osd_hw.free_dst_data[index].y_end >= osd_hw.vinfo_height[index] - 1) + if (osd_hw.free_dst_data[index].y_end >= + osd_hw.vinfo_height[output_index] - 1) osd_set_dummy_data(index, 0xff); osd_update_window_axis = true; osd_update_disp_dst_size(index); @@ -4814,11 +4815,10 @@ static bool osd_direct_compose_pan_display(struct osd_fence_map_s *fence_map) &freescale_dst[index], sizeof(struct pandata_s)); freescale_update = true; - - if (((height_dst != height_src) || - (width_dst != width_src)) && - osd_hw.free_dst_data[index].y_end < - osd_hw.vinfo_height[index] - 1) + if ((height_dst != height_src || + width_dst != width_src) && + osd_hw.free_dst_data[index].y_end < + osd_hw.vinfo_height[VIU1] - 1) osd_set_dummy_data(index, 0); else osd_set_dummy_data(index, 0xff); @@ -7403,6 +7403,33 @@ static void vpp_setting_blend(struct hw_osd_blending_s *blending) blend_reg->vpp_osd2_blend_v_scope); } +static void set_osd_dummy_policy(u32 index, u32 src_height, u32 dst_height) +{ + u32 output_index; + + output_index = get_output_device_id(index); + + if (index == OSD1) { + if (osd_hw.osd_meson_dev.cpu_id == + __MESON_CPU_MAJOR_ID_G12A && + dst_height != src_height && + osd_hw.free_dst_data[index].y_end < + osd_hw.vinfo_height[output_index] - 1) + osd_set_dummy_data(index, 0); + else + osd_set_dummy_data(index, 0xff); + } else { + if (osd_hw.osd_meson_dev.cpu_id == + __MESON_CPU_MAJOR_ID_G12A && + osd_hw.free_dst_data[index].y_end < + osd_hw.vinfo_height[output_index] - 1) + osd_set_dummy_data(index, 0); + else + osd_set_dummy_data(index, 0xff); + } +} + +/* input w, h is background */ static void osd_set_freescale(u32 index, struct hw_osd_blending_s *blending) @@ -7542,14 +7569,7 @@ static void osd_set_freescale(u32 index, src_height = osd_hw.free_src_data[index].x_end - osd_hw.free_src_data[index].x_start + 1; - if ((osd_hw.osd_meson_dev.cpu_id == - __MESON_CPU_MAJOR_ID_G12A) && - (height != src_height) && - osd_hw.free_dst_data[index].y_end < - osd_hw.vinfo_height[index] - 1) - osd_set_dummy_data(index, 0); - else - osd_set_dummy_data(index, 0xff); + set_osd_dummy_policy(index, src_height, height); osd_log_dbg2(MODULE_BLEND, "osd%d:free_src_data:%d,%d,%d,%d\n", index, osd_hw.free_src_data[index].x_start, @@ -9370,8 +9390,8 @@ static bool set_old_hwc_freescale(u32 index) height_src = osd_hw.free_src_data[index].y_end - osd_hw.free_src_data[index].y_start + 1; if (height_dst != height_src && - osd_hw.free_dst_data[index].y_end < - osd_hw.vinfo_height[index] - 1) + osd_hw.free_dst_data[index].y_end < + osd_hw.vinfo_height[VIU1] - 1) osd_set_dummy_data(index, 0); else osd_set_dummy_data(index, 0xff); @@ -11547,11 +11567,10 @@ static bool osd_direct_render(struct osd_plane_map_s *plane_map) osd_hw.dst_data[index].h = osd_hw.free_dst_data[index].y_end - osd_hw.free_dst_data[index].y_start + 1; - - if (((height_dst != height_src) || - (width_dst != width_src)) && - osd_hw.free_dst_data[index].y_end < - osd_hw.vinfo_height[index] - 1) + if ((height_dst != height_src || + width_dst != width_src) && + osd_hw.free_dst_data[index].y_end < + osd_hw.vinfo_height[output_index] - 1) osd_set_dummy_data(index, 0); else osd_set_dummy_data(index, 0xff); -- 2.20.1