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 <pengcheng.chen@amlogic.com>
This commit is contained in:
Pengcheng Chen
2019-10-10 15:29:34 +08:00
committed by Luke Go
parent 638cbe0239
commit 93f0ecce02
2 changed files with 12 additions and 0 deletions

View 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];

View File

@@ -4934,6 +4934,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;
@@ -8461,6 +8466,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;