picdec: fix no scale mode, frame stretch [1/1]
authorCao Jian <jian.cao@amlogic.com>
Thu, 19 Sep 2019 03:38:57 +0000 (11:38 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Mon, 23 Sep 2019 12:57:47 +0000 (05:57 -0700)
PD#SWPL-14477

Problem:
the picture is rotated 90 degrees,
stretching left and right

Solution:
modify conditions for frame width or height
equal to screen width or height

Verify:
verify by g12b-w400

Change-Id: I0ca9cc255b202306562bee69726400c697f3b053
Signed-off-by: Cao Jian <jian.cao@amlogic.com>
drivers/amlogic/media/video_processor/pic_dev/picdec.c

index 2588b25..b061e79 100644 (file)
@@ -278,8 +278,8 @@ static int render_frame(struct ge2d_context_s *context,
        dev->p2p_mode = p2p_mode;
        switch (dev->p2p_mode) {
        case 0:
-               if ((input->frame_width < dev->disp_width) &&
-               (input->frame_height < dev->disp_height)) {
+               if ((input->frame_width <= dev->disp_width) &&
+                   (input->frame_height <= dev->disp_height)) {
                        dev->target_width = input->frame_width;
                        dev->target_height = input->frame_height;
                } else {
@@ -290,8 +290,8 @@ static int render_frame(struct ge2d_context_s *context,
                new_vf->height = dev->target_height;
                break;
        case 1:
-               if ((input->frame_width < dev->disp_width) &&
-               (input->frame_height < dev->disp_height)) {
+               if ((input->frame_width <= dev->disp_width) &&
+                   (input->frame_height <= dev->disp_height)) {
                        dev->target_width = input->frame_width;
                        dev->target_height = input->frame_height;
                } else {
@@ -395,8 +395,8 @@ static int render_frame_block(void)
        dev->p2p_mode = p2p_mode;
        switch (dev->p2p_mode) {
        case 0:
-               if ((input->frame_width < dev->disp_width) &&
-               (input->frame_height < dev->disp_height)) {
+               if ((input->frame_width <= dev->disp_width) &&
+                   (input->frame_height <= dev->disp_height)) {
                        dev->target_width = input->frame_width;
                        dev->target_height = input->frame_height;
                } else {
@@ -407,8 +407,8 @@ static int render_frame_block(void)
                new_vf->height = dev->target_height;
                break;
        case 1:
-               if ((input->frame_width < dev->disp_width) &&
-               (input->frame_height < dev->disp_height)) {
+               if ((input->frame_width <= dev->disp_width) &&
+                   (input->frame_height <= dev->disp_height)) {
                        dev->target_width = input->frame_width;
                        dev->target_height = input->frame_height;
                } else {