vpp: vpp video path vframe support RGB mode [1/1]
authorPengcheng Chen <pengcheng.chen@amlogic.com>
Wed, 6 Nov 2019 06:50:01 +0000 (14:50 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Mon, 9 Dec 2019 12:11:11 +0000 (05:11 -0700)
PD#SWPL-15879

Problem:
video patch not support RGB mode

Solution:
vpp video path vframe support RGB mode

Verify:
TL1

Change-Id: Ic86be3eb9163e7e34a3f18886a5e87e8e1bab6fe
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
(cherry picked from commit 8e7b325aee3ea07c68ee350287eb26f4fc19d41f)

drivers/amlogic/media/video_sink/video.c
drivers/amlogic/media/video_sink/video_hw.c
drivers/amlogic/media/video_sink/vpp.c

index be7c5bb27cef85d13a379c5d0dd6c1f5b10a642a..597912ef6c610c0fd761e1e414b53af97ba21f46 100644 (file)
@@ -3581,7 +3581,9 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id)
                chk_vf = (vf != NULL) ? vf : cur_dispbuf;
                if (chk_vf)
                        force_adjust =
-                               (chk_vf->type & VIDTYPE_VIU_444) ? true : false;
+                               ((chk_vf->type & VIDTYPE_VIU_444) ||
+                               (chk_vf->type & VIDTYPE_RGB_444))
+                               ? true : false;
                if (chk_vf) {
                        if (cur_frame_par &&
                                cur_frame_par->nocomp) {
index b3d09a684ad0f103efd3d4eb52a156f586517734..b0777290ec65e2826618a26195bbc09b2ea4cd0d 100644 (file)
@@ -683,7 +683,8 @@ static void vd1_set_dcu(
 
                r = 0x100;
                if (cpu_after_eq(MESON_CPU_MAJOR_ID_TL1)) {
-                       if (type & VIDTYPE_VIU_444)
+                       if ((type & VIDTYPE_VIU_444) ||
+                           (type & VIDTYPE_RGB_444))
                                r |= 0;
                        else if (type & VIDTYPE_VIU_422)
                                r |= (1 << 12);
@@ -712,7 +713,8 @@ static void vd1_set_dcu(
                        r |= VFORMATTER_RPTLINE0_EN |
                                (0xc << VFORMATTER_INIPHASE_BIT);
                if (cpu_after_eq(MESON_CPU_MAJOR_ID_TL1)) {
-                       if (type & VIDTYPE_VIU_444) {
+                       if ((type & VIDTYPE_VIU_444) ||
+                           (type & VIDTYPE_RGB_444)) {
                                r &= ~HFORMATTER_EN;
                                r &= ~VFORMATTER_EN;
                                r &= ~HFORMATTER_YC_RATIO_2_1;
@@ -757,7 +759,8 @@ static void vd1_set_dcu(
 
        if ((vf->bitdepth & BITDEPTH_Y10) &&
            !frame_par->nocomp) {
-               if (vf->type & VIDTYPE_VIU_444) {
+               if ((vf->type & VIDTYPE_VIU_444) ||
+                   (vf->type & VIDTYPE_RGB_444)) {
                        bit_mode = 2;
                } else {
                        if (vf->bitdepth & FULL_PACK_422_MODE)
@@ -892,7 +895,8 @@ static void vd1_set_dcu(
        }
 
        /* chroma formatter */
-       if (type & VIDTYPE_VIU_444) {
+       if ((type & VIDTYPE_VIU_444) ||
+           (type & VIDTYPE_RGB_444)) {
                r = HFORMATTER_YC_RATIO_1_1;
                if (frame_par->hscale_skip_count)
                        r |= HFORMATTER_EN;
@@ -1125,7 +1129,8 @@ static void vd2_set_dcu(
 
                r = 0x100;
                if (cpu_after_eq(MESON_CPU_MAJOR_ID_TL1)) {
-                       if (type & VIDTYPE_VIU_444)
+                       if ((type & VIDTYPE_VIU_444) ||
+                           (type & VIDTYPE_RGB_444))
                                r |= 0;
                        else if (type & VIDTYPE_VIU_422)
                                r |= (1 << 12);
@@ -1160,7 +1165,8 @@ static void vd2_set_dcu(
                                VFORMATTER_RPTLINE0_EN |
                                (0 << VFORMATTER_INIPHASE_BIT);
                if (cpu_after_eq(MESON_CPU_MAJOR_ID_TL1)) {
-                       if (type & VIDTYPE_VIU_444) {
+                       if ((type & VIDTYPE_VIU_444) ||
+                           (type & VIDTYPE_RGB_444)) {
                                r &= ~HFORMATTER_EN;
                                r &= ~VFORMATTER_EN;
                                r &= ~HFORMATTER_YC_RATIO_2_1;
@@ -1206,7 +1212,8 @@ static void vd2_set_dcu(
 
        if ((vf->bitdepth & BITDEPTH_Y10) &&
            !frame_par->nocomp) {
-               if (vf->type & VIDTYPE_VIU_444) {
+               if ((vf->type & VIDTYPE_VIU_444) ||
+                   (vf->type & VIDTYPE_RGB_444)) {
                        bit_mode = 2;
                } else {
                        if (vf->bitdepth & FULL_PACK_422_MODE)
@@ -1289,7 +1296,8 @@ static void vd2_set_dcu(
                        vd_off, 0, 2, 4);
 
        /* chroma formatter */
-       if (type & VIDTYPE_VIU_444) {
+       if ((type & VIDTYPE_VIU_444) ||
+           (type & VIDTYPE_RGB_444)) {
                r = HFORMATTER_YC_RATIO_1_1;
                if (frame_par->hscale_skip_count)
                        r |= HFORMATTER_EN;
@@ -2620,8 +2628,10 @@ void config_dvel_position(
        setting->vc_skip = 2;
 
        if (cpu_after_eq(MESON_CPU_MAJOR_ID_TL1)) {
-               if (layer->dispbuf->type
-                   & VIDTYPE_VIU_444) {
+               if ((layer->dispbuf->type
+                   & VIDTYPE_VIU_444) ||
+                   (layer->dispbuf->type
+                   & VIDTYPE_RGB_444)) {
                        setting->hc_skip = 1;
                        setting->vc_skip = 1;
                } else if (layer->dispbuf->type
@@ -3199,8 +3209,10 @@ s32 config_vd_position(
        setting->vc_skip = 2;
 
        if (cpu_after_eq(MESON_CPU_MAJOR_ID_TL1)) {
-               if (layer->dispbuf->type
-                       & VIDTYPE_VIU_444) {
+               if ((layer->dispbuf->type
+                       & VIDTYPE_VIU_444) ||
+                       (layer->dispbuf->type
+                       & VIDTYPE_RGB_444)) {
                        setting->hc_skip = 1;
                        setting->vc_skip = 1;
                } else if (layer->dispbuf->type
index ea3b17322f10decfa4b4a1bb1bd9ebf98aa4f156..5eeba878e61e914a5e87d8f8154fbebc5006f4ce 100644 (file)
@@ -728,8 +728,9 @@ static int vpp_process_speed_check(
                        || (height_screen <= 0))
                        return SPEED_CHECK_DONE;
 
-               if ((next_frame_par->vscale_skip_count > 0)
-                       && (vf->type & VIDTYPE_VIU_444))
+               if ((next_frame_par->vscale_skip_count > 0) &&
+                   ((vf->type & VIDTYPE_VIU_444) ||
+                    (vf->type & VIDTYPE_RGB_444)))
                        bpp = 2;
                if (height_in * bpp > height_out) {
                        /*
@@ -749,8 +750,9 @@ static int vpp_process_speed_check(
                                /* di process first, need more a bit of ratio */
                                if (vf->type & VIDTYPE_PRE_INTERLACE)
                                        cur_ratio = (cur_ratio * 105) / 100;
-                               if ((next_frame_par->vscale_skip_count > 0)
-                                       && (vf->type & VIDTYPE_VIU_444))
+                               if ((next_frame_par->vscale_skip_count > 0) &&
+                                   ((vf->type & VIDTYPE_VIU_444) ||
+                                    (vf->type & VIDTYPE_RGB_444)))
                                        cur_ratio = cur_ratio * 2;
 
                                /* store the debug info for legacy */