From 8f241b68b6fa628995bbe9bf7a0686193308606a Mon Sep 17 00:00:00 2001 From: Joy Cho Date: Tue, 14 Jan 2020 21:40:41 +0900 Subject: [PATCH] media: osd: Limit android fb size to 1920x1080 On Android, higher framebuffer over 1920x1080 will be limited to 1920x1080 except 2560x1080 and osd driver needs to scale the size to fit in actual hdmi output resolution. Change-Id: I7ea24fb3f3d162b87a8a5b43af70d9ca7e5442fc --- drivers/amlogic/media/osd/osd_hw.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/amlogic/media/osd/osd_hw.c b/drivers/amlogic/media/osd/osd_hw.c index fa5d35611e96..e95c7f959e45 100644 --- a/drivers/amlogic/media/osd/osd_hw.c +++ b/drivers/amlogic/media/osd/osd_hw.c @@ -6846,15 +6846,21 @@ static void osd_set_freescale(u32 index, dst_height = osd_hw.free_dst_data[index].y_end - osd_hw.free_dst_data[index].y_start + 1; + /* + * On Android, higher framebuffer size over 1920x1080 + * will be limited to 1920x1080 + * and osd driver needs to scale the size + * to fit in actual hdmi output resolution. + */ if (dst_width > 1920) osd_hw.free_scale[index].h_enable = 1; else osd_hw.free_scale[index].h_enable = 0; - if (dst_height < 2160) - osd_hw.free_scale[index].v_enable = 0; - else + if (dst_height > 1080) osd_hw.free_scale[index].v_enable = 1; + else + osd_hw.free_scale[index].v_enable = 0; osd_hw.free_scale_enable[index] = (((osd_hw.free_scale[index].h_enable << 16) & 0xffff0000)