From 1cd025d5fa173aa23842f004068c5e5dd0c7c5a7 Mon Sep 17 00:00:00 2001 From: Brian Zhu Date: Wed, 22 May 2019 22:03:43 +0800 Subject: [PATCH] vpp: set default aspect when the ratecontrol is zero [1/1] PD#TV-5266 Problem: Vpp used the wrong aspect ratio in 3D, screen mode = normal and aspect ratio is 0 in ratecontrol variable. Solution: When the aspect ratio is 0, set the default value as (height << 8) / width Verify: Verified by x301 Change-Id: I34f7cd3ce5ed1818d3090ebb4be934225038625e Signed-off-by: Brian Zhu --- drivers/amlogic/media/video_sink/vpp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/amlogic/media/video_sink/vpp.c b/drivers/amlogic/media/video_sink/vpp.c index be2e0e8..63ef98a 100644 --- a/drivers/amlogic/media/video_sink/vpp.c +++ b/drivers/amlogic/media/video_sink/vpp.c @@ -3068,6 +3068,18 @@ int vpp_set_filters( aspect_ratio = (vf->ratio_control & DISP_RATIO_ASPECT_RATIO_MASK) >> DISP_RATIO_ASPECT_RATIO_BIT; + if (!aspect_ratio) { + u32 sar_width, sar_height; + + if (vf->type & VIDTYPE_COMPRESS) { + sar_width = vf->compWidth; + sar_height = vf->compHeight; + } else { + sar_width = vf->width; + sar_height = vf->height; + } + aspect_ratio = (sar_height << 8) / sar_width; + } /* the height from vdin afbc will be half */ /* so need no interlace in */ if ((vf->type & VIDTYPE_INTERLACE) -- 2.7.4