diff options
author | Fancy Fang <B47543@freescale.com> | 2013-11-20 10:25:45 +0800 |
---|---|---|
committer | Fancy Fang <B47543@freescale.com> | 2013-11-22 18:10:17 +0800 |
commit | 6bab4ac032c98657deba21ca3957a987278b7777 (patch) | |
tree | 622259633189cf3813d30112b94ee67b556a5756 | |
parent | 0dd44787195ce005e92f597244fc7bc9aea53a52 (diff) |
ENGR00285283 PXP: make pxp driver compatible for G2D
Use stride to set AS and PS pitch by default, if stride is 0, then use
width to set AS and PS pitch instead. This will make PXP driver both
work for PXP kernel users and G2D applications.
Signed-off-by: Fancy Fang <B47543@freescale.com>
(cherry picked from commit 559d74c6478818ce8913604f156d8dbdc30d032f)
-rw-r--r-- | drivers/dma/pxp/pxp_dma_v2.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/dma/pxp/pxp_dma_v2.c b/drivers/dma/pxp/pxp_dma_v2.c index e72886ecbf3d..0df4200d2481 100644 --- a/drivers/dma/pxp/pxp_dma_v2.c +++ b/drivers/dma/pxp/pxp_dma_v2.c @@ -478,6 +478,8 @@ static void pxp_set_oln(int layer_no, struct pxps *pxp) struct pxp_layer_param *olparams_data = &pxp_conf->ol_param[layer_no]; dma_addr_t phys_addr = olparams_data->paddr; __raw_writel(phys_addr, pxp->base + HW_PXP_AS_BUF); + u32 pitch = olparams_data->stride ? olparams_data->stride : + olparams_data->width; /* Fixme */ if (olparams_data->width == 0 && olparams_data->height == 0) { @@ -505,10 +507,10 @@ static void pxp_set_oln(int layer_no, struct pxps *pxp) if ((olparams_data->pixel_fmt == PXP_PIX_FMT_BGRA32) | (olparams_data->pixel_fmt == PXP_PIX_FMT_RGB32)) { - __raw_writel(olparams_data->width << 2, + __raw_writel(pitch << 2, pxp->base + HW_PXP_AS_PITCH); } else if (olparams_data->pixel_fmt == PXP_PIX_FMT_RGB565) { - __raw_writel(olparams_data->width << 1, + __raw_writel(pitch << 1, pxp->base + HW_PXP_AS_PITCH); } else { __raw_writel(0, pxp->base + HW_PXP_AS_PITCH); @@ -886,6 +888,8 @@ static void pxp_set_s0buf(struct pxps *pxp) dma_addr_t Y, U, V; dma_addr_t Y1, U1, V1; u32 offset, bpp = 1; + u32 pitch = s0_params->stride ? s0_params->stride : + s0_params->width; Y = s0_params->paddr; @@ -937,22 +941,22 @@ static void pxp_set_s0buf(struct pxps *pxp) s0_params->pixel_fmt == PXP_PIX_FMT_NV21 || s0_params->pixel_fmt == PXP_PIX_FMT_NV16 || s0_params->pixel_fmt == PXP_PIX_FMT_NV61) { - __raw_writel(s0_params->width, pxp->base + HW_PXP_PS_PITCH); + __raw_writel(pitch, pxp->base + HW_PXP_PS_PITCH); } else if (s0_params->pixel_fmt == PXP_PIX_FMT_GY04) - __raw_writel(s0_params->width >> 1, + __raw_writel(pitch >> 1, pxp->base + HW_PXP_PS_PITCH); else if (s0_params->pixel_fmt == PXP_PIX_FMT_RGB32) - __raw_writel(s0_params->width << 2, + __raw_writel(pitch << 2, pxp->base + HW_PXP_PS_PITCH); else if (s0_params->pixel_fmt == PXP_PIX_FMT_UYVY || s0_params->pixel_fmt == PXP_PIX_FMT_YUYV || s0_params->pixel_fmt == PXP_PIX_FMT_VYUY || s0_params->pixel_fmt == PXP_PIX_FMT_YVYU) - __raw_writel(s0_params->width << 1, + __raw_writel(pitch << 1, pxp->base + HW_PXP_PS_PITCH); else if (s0_params->pixel_fmt == PXP_PIX_FMT_RGB565) - __raw_writel(s0_params->width << 1, + __raw_writel(pitch << 1, pxp->base + HW_PXP_PS_PITCH); else __raw_writel(0, pxp->base + HW_PXP_PS_PITCH); |