]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00209570 - PxP : Add Y4 output format.
authorFugang Duan <B38611@freescale.com>
Wed, 16 May 2012 11:50:14 +0000 (19:50 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:11:50 +0000 (14:11 +0200)
- Add Y4 output format for SPDC.

Signed-off-by: Fugang Duan <B38611@freescale.com>
drivers/dma/pxp/pxp_dma.c
drivers/dma/pxp/pxp_dma_v2.c
include/linux/pxp_dma.h

index eb5b4fb60306215e06a0a41382b341bd5c97cf7b..ddd1c0cd192dfb5bb2355ea78e31b04675ed15f3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
+ * Copyright (C) 2010-2012 Freescale Semiconductor, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -180,6 +180,7 @@ static bool is_yuv(u32 pix_fmt)
            (pix_fmt == PXP_PIX_FMT_YUV444) |
            (pix_fmt == PXP_PIX_FMT_NV12) |
            (pix_fmt == PXP_PIX_FMT_GREY) |
+           (pix_fmt == PXP_PIX_FMT_GY04) |
            (pix_fmt == PXP_PIX_FMT_YVU410P) |
            (pix_fmt == PXP_PIX_FMT_YUV410P) |
            (pix_fmt == PXP_PIX_FMT_YVU420P) |
@@ -215,6 +216,9 @@ static void pxp_set_ctrl(struct pxps *pxp)
        case PXP_PIX_FMT_GREY:
                fmt_ctrl = BV_PXP_CTRL_S0_FORMAT__YUV420;
                break;
+       case PXP_PIX_FMT_GY04:
+               fmt_ctrl = BV_PXP_CTRL_S0_FORMAT__YUV420;
+               break;
        case PXP_PIX_FMT_YUV422P:
                fmt_ctrl = BV_PXP_CTRL_S0_FORMAT__YUV422;
                break;
@@ -243,6 +247,9 @@ static void pxp_set_ctrl(struct pxps *pxp)
        case PXP_PIX_FMT_GREY:
                fmt_ctrl = BV_PXP_CTRL_OUTBUF_FORMAT__MONOC8;
                break;
+       case PXP_PIX_FMT_GY04:
+               fmt_ctrl = BV_PXP_CTRL_OUTBUF_FORMAT__MONOC4;
+               break;
        default:
                fmt_ctrl = 0;
        }
@@ -620,6 +627,14 @@ static void pxp_set_s0buf(struct pxps *pxp)
                __raw_writel(U, pxp->base + HW_PXP_S0UBUF);
                __raw_writel(V, pxp->base + HW_PXP_S0VBUF);
        }
+
+       /* TODO: only support RGB565, Y8 , Y4 */
+       if (s0_params->pixel_fmt == PXP_PIX_FMT_GREY)
+               __raw_writel(s0_params->width, pxp->base + HW_PXP_PS_PITCH);
+       else if (s0_params->pixel_fmt == PXP_PIX_FMT_GY04)
+                __raw_writel(s0_params->width >> 1, pxp->base + HW_PXP_PS_PITCH);
+       else
+               __raw_writel(s0_params->width * 2, pxp->base + HW_PXP_PS_PITCH);
 }
 
 /**
index 3fadd9a5f7628c6e10150a16b2991ce8247ab596..ceb72edbd39e0d2a80c250af66abd6233abdfbe6 100644 (file)
@@ -220,6 +220,7 @@ static bool is_yuv(u32 pix_fmt)
            (pix_fmt == PXP_PIX_FMT_YUV444) |
            (pix_fmt == PXP_PIX_FMT_NV12) |
            (pix_fmt == PXP_PIX_FMT_GREY) |
+           (pix_fmt == PXP_PIX_FMT_GY04) |
            (pix_fmt == PXP_PIX_FMT_YVU410P) |
            (pix_fmt == PXP_PIX_FMT_YUV410P) |
            (pix_fmt == PXP_PIX_FMT_YVU420P) |
@@ -257,6 +258,9 @@ static void pxp_set_ctrl(struct pxps *pxp)
        case PXP_PIX_FMT_GREY:
                fmt_ctrl = BV_PXP_PS_CTRL_FORMAT__Y8;
                break;
+       case PXP_PIX_FMT_GY04:
+               fmt_ctrl = BV_PXP_PS_CTRL_FORMAT__Y4;
+               break;
        case PXP_PIX_FMT_YUV422P:
                fmt_ctrl = BV_PXP_PS_CTRL_FORMAT__YUV422;
                break;
@@ -287,6 +291,9 @@ static void pxp_set_ctrl(struct pxps *pxp)
        case PXP_PIX_FMT_GREY:
                fmt_ctrl = BV_PXP_OUT_CTRL_FORMAT__Y8;
                break;
+       case PXP_PIX_FMT_GY04:
+               fmt_ctrl = BV_PXP_OUT_CTRL_FORMAT__Y4;
+               break;
        default:
                fmt_ctrl = 0;
        }
@@ -697,9 +704,11 @@ static void pxp_set_s0buf(struct pxps *pxp)
                __raw_writel(V, pxp->base + HW_PXP_PS_VBUF);
        }
 
-       /* TODO: only support RGB565, Y8 */
+       /* TODO: only support RGB565, Y8, Y4 */
        if (s0_params->pixel_fmt == PXP_PIX_FMT_GREY)
                __raw_writel(s0_params->width, pxp->base + HW_PXP_PS_PITCH);
+       else if (s0_params->pixel_fmt == PXP_PIX_FMT_GY04)
+               __raw_writel(s0_params->width >> 1, pxp->base + HW_PXP_PS_PITCH);
        else
                __raw_writel(s0_params->width * 2, pxp->base + HW_PXP_PS_PITCH);
 }
index bf63bf3570e5b2fcb7b5cb15da5c944dbc3be965..1be6e395ec5578ef262751f0fb6afc0f81381bb7 100644 (file)
@@ -66,6 +66,7 @@ typedef unsigned char bool;
 /*! @name YUV Planar Formats */
 /*! @{ */
 #define PXP_PIX_FMT_GREY    fourcc('G', 'R', 'E', 'Y') /*!< 8  Greyscale */
+#define PXP_PIX_FMT_GY04    fourcc('G', 'Y', '0', '4') /*!< 4  Greyscale */
 #define PXP_PIX_FMT_YVU410P fourcc('Y', 'V', 'U', '9') /*!< 9  YVU 4:1:0 */
 #define PXP_PIX_FMT_YUV410P fourcc('Y', 'U', 'V', '9') /*!< 9  YUV 4:1:0 */
 #define PXP_PIX_FMT_YVU420P fourcc('Y', 'V', '1', '2') /*!< 12 YVU 4:2:0 */