osd: fix osd source crop issue [1/1]
authorPengcheng Chen <pengcheng.chen@amlogic.com>
Thu, 10 Oct 2019 07:29:34 +0000 (15:29 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Wed, 16 Oct 2019 02:59:27 +0000 (19:59 -0700)
PD#SWPL-14906

Problem:
osd source crop setting error.

Solution:
if source crop adjust blending out data.

Verify:
franklin

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

index 3e27e49d570c7aee0eb909506af7cb05f974f23a..c379be7be8b9b9e8b9dea6ce829b514a9fe04ac7 100644 (file)
@@ -700,6 +700,7 @@ struct hw_para_s {
        struct pandata_s cursor_dispdata[HW_OSD_COUNT];
        struct dispdata_s src_data[HW_OSD_COUNT];
        struct dispdata_s dst_data[HW_OSD_COUNT];
+       u32 src_crop[HW_OSD_COUNT];
        u32 buffer_alloc[HW_OSD_COUNT];
        u32 gbl_alpha[HW_OSD_COUNT];
        u32 color_key[HW_OSD_COUNT];
index affbc2f48d3c8f85b840efbd173d6f80167ccb63..64b73d6288cde80020c7b6b7caa45e895081f5fd 100644 (file)
@@ -4935,6 +4935,11 @@ static void osd_pan_display_update_info(struct layer_fence_map_s *layer_map)
                osd_hw.dst_data[index].y = layer_map->dst_y;
                osd_hw.dst_data[index].w = layer_map->dst_w;
                osd_hw.dst_data[index].h = layer_map->dst_h;
+               if ((layer_map->fb_height != layer_map->src_h) ||
+                   (layer_map->fb_width != layer_map->src_w))
+                       osd_hw.src_crop[index] = 1;
+               else
+                       osd_hw.src_crop[index] = 0;
                if (osd_hw.osd_meson_dev.osd_ver <= OSD_NORMAL) {
                        osd_hw.free_src_data[index].x_start = layer_map->src_x;
                        osd_hw.free_src_data[index].y_start = layer_map->src_y;
@@ -8419,6 +8424,12 @@ static void set_blend_reg(struct layer_blend_reg_s *blend_reg)
 static void uniformization_fb(u32 index,
        struct hw_osd_blending_s *blending)
 {
+       if ((index == OSD1) && osd_hw.src_crop[index]) {
+               blending->screen_ratio_w_den =
+                       osd_hw.src_data[index].w;
+               blending->screen_ratio_h_den =
+                       osd_hw.src_data[index].h;
+       }
        blending->dst_data.x = osd_hw.dst_data[index].x *
                blending->screen_ratio_w_den /
                blending->screen_ratio_w_num;