diff options
author | Fugang Duan <B38611@freescale.com> | 2012-05-16 19:50:14 +0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2012-07-20 13:37:36 +0800 |
commit | 8bd174bfb42ac7a23eb49c05f2a93f3ed36c0267 (patch) | |
tree | 713b6de3bfbe180fce336e0c6f68cc688b090898 /drivers/dma | |
parent | 0d244c11d9051613f9b0e1c75eeeaaed56dc835d (diff) |
ENGR00209570 - PxP : Add Y4 output format.
- Add Y4 output format for SPDC.
Signed-off-by: Fugang Duan <B38611@freescale.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/pxp/pxp_dma.c | 17 | ||||
-rw-r--r-- | drivers/dma/pxp/pxp_dma_v2.c | 11 |
2 files changed, 26 insertions, 2 deletions
diff --git a/drivers/dma/pxp/pxp_dma.c b/drivers/dma/pxp/pxp_dma.c index eb5b4fb60306..ddd1c0cd192d 100644 --- a/drivers/dma/pxp/pxp_dma.c +++ b/drivers/dma/pxp/pxp_dma.c @@ -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); } /** diff --git a/drivers/dma/pxp/pxp_dma_v2.c b/drivers/dma/pxp/pxp_dma_v2.c index 3fadd9a5f762..ceb72edbd39e 100644 --- a/drivers/dma/pxp/pxp_dma_v2.c +++ b/drivers/dma/pxp/pxp_dma_v2.c @@ -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); } |