osd: fix osd dummy alpha set error issue [1/1]
authorPengcheng Chen <pengcheng.chen@amlogic.com>
Wed, 2 Jun 2021 01:57:30 +0000 (09:57 +0800)
committerChristian Hoffmann <chrmhoffmann@gmail.com>
Sun, 12 Feb 2023 08:13:11 +0000 (09:13 +0100)
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 <pengcheng.chen@amlogic.com>
drivers/amlogic/media/osd/osd_hw.c

index 25c3b4856f0de7897171f36c552054eeb511db30..e1d73ef6f2697d175e9e82b2b0b9017b64065efa 100644 (file)
@@ -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);