From 3984f332e12536deadf55577a6ce33af44938f4c Mon Sep 17 00:00:00 2001 From: Pengcheng Chen Date: Thu, 10 Oct 2019 15:29:34 +0800 Subject: [PATCH] osd: fix osd source crop issue [1/1] 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 --- drivers/amlogic/media/osd/osd.h | 1 + drivers/amlogic/media/osd/osd_hw.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/amlogic/media/osd/osd.h b/drivers/amlogic/media/osd/osd.h index 3e27e49..c379be7 100644 --- a/drivers/amlogic/media/osd/osd.h +++ b/drivers/amlogic/media/osd/osd.h @@ -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]; diff --git a/drivers/amlogic/media/osd/osd_hw.c b/drivers/amlogic/media/osd/osd_hw.c index affbc2f..64b73d62 100644 --- a/drivers/amlogic/media/osd/osd_hw.c +++ b/drivers/amlogic/media/osd/osd_hw.c @@ -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; -- 2.7.4