MMFMWK-7674: PxP: add YVU420P support
authorGuoniu.Zhou <guoniu.zhou@nxp.com>
Thu, 31 Aug 2017 01:39:12 +0000 (09:39 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:38:23 +0000 (15:38 -0500)
PxP PS engine support YUV420 format, but not YVU420. The difference
between two format is U and V, if we exchange U and V base address,
the PxP driver can also support YVU420 format.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit cbc71da10afe67ae815a97a68e4a1b0dff4693eb)

drivers/dma/pxp/pxp_dma_v3.c

index 775900b..a191c4a 100644 (file)
@@ -1852,6 +1852,7 @@ static bool fmt_ps_support(uint32_t format)
        case PXP_PIX_FMT_NV21:
        case PXP_PIX_FMT_YUV422P:
        case PXP_PIX_FMT_YUV420P:
+       case PXP_PIX_FMT_YVU420P:
        case PXP_PIX_FMT_RGBA32:
        case PXP_PIX_FMT_RGBX32:
        case PXP_PIX_FMT_RGBA555:
@@ -2379,7 +2380,13 @@ static int pxp_ps_config(struct pxp_pixmap *input,
                        pxp_writel(U + (offset >> 2), HW_PXP_PS_UBUF);
                        V = U + (input->width * input->height >> 2);
                        pxp_writel(V + (offset >> 2), HW_PXP_PS_VBUF);
+               } else if (input->format == PXP_PIX_FMT_YVU420P) {
+                       U = input->paddr + input->width * input->height;
+                       V = U + (input->width * input->height >> 2);
+                       pxp_writel(U + (offset >> 2), HW_PXP_PS_VBUF);
+                       pxp_writel(V + (offset >> 2), HW_PXP_PS_UBUF);
                }
+
                break;
        default:
                break;