diff options
author | Fancy Fang <B47543@freescale.com> | 2013-11-19 21:25:45 -0500 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:47:20 -0400 |
commit | 91ed40981c9415c60b488ed6c02be5f36a27155b (patch) | |
tree | 9e9b749e8662156fdd5e7016eff1591a59d9d330 | |
parent | 20f98acbcedb53e9fc71263c7bfc7b9433a7cf1c (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>
-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) | |||
478 | struct pxp_layer_param *olparams_data = &pxp_conf->ol_param[layer_no]; | 478 | struct pxp_layer_param *olparams_data = &pxp_conf->ol_param[layer_no]; |
479 | dma_addr_t phys_addr = olparams_data->paddr; | 479 | dma_addr_t phys_addr = olparams_data->paddr; |
480 | __raw_writel(phys_addr, pxp->base + HW_PXP_AS_BUF); | 480 | __raw_writel(phys_addr, pxp->base + HW_PXP_AS_BUF); |
481 | u32 pitch = olparams_data->stride ? olparams_data->stride : | ||
482 | olparams_data->width; | ||
481 | 483 | ||
482 | /* Fixme */ | 484 | /* Fixme */ |
483 | if (olparams_data->width == 0 && olparams_data->height == 0) { | 485 | if (olparams_data->width == 0 && olparams_data->height == 0) { |
@@ -505,10 +507,10 @@ static void pxp_set_oln(int layer_no, struct pxps *pxp) | |||
505 | 507 | ||
506 | if ((olparams_data->pixel_fmt == PXP_PIX_FMT_BGRA32) | | 508 | if ((olparams_data->pixel_fmt == PXP_PIX_FMT_BGRA32) | |
507 | (olparams_data->pixel_fmt == PXP_PIX_FMT_RGB32)) { | 509 | (olparams_data->pixel_fmt == PXP_PIX_FMT_RGB32)) { |
508 | __raw_writel(olparams_data->width << 2, | 510 | __raw_writel(pitch << 2, |
509 | pxp->base + HW_PXP_AS_PITCH); | 511 | pxp->base + HW_PXP_AS_PITCH); |
510 | } else if (olparams_data->pixel_fmt == PXP_PIX_FMT_RGB565) { | 512 | } else if (olparams_data->pixel_fmt == PXP_PIX_FMT_RGB565) { |
511 | __raw_writel(olparams_data->width << 1, | 513 | __raw_writel(pitch << 1, |
512 | pxp->base + HW_PXP_AS_PITCH); | 514 | pxp->base + HW_PXP_AS_PITCH); |
513 | } else { | 515 | } else { |
514 | __raw_writel(0, pxp->base + HW_PXP_AS_PITCH); | 516 | __raw_writel(0, pxp->base + HW_PXP_AS_PITCH); |
@@ -886,6 +888,8 @@ static void pxp_set_s0buf(struct pxps *pxp) | |||
886 | dma_addr_t Y, U, V; | 888 | dma_addr_t Y, U, V; |
887 | dma_addr_t Y1, U1, V1; | 889 | dma_addr_t Y1, U1, V1; |
888 | u32 offset, bpp = 1; | 890 | u32 offset, bpp = 1; |
891 | u32 pitch = s0_params->stride ? s0_params->stride : | ||
892 | s0_params->width; | ||
889 | 893 | ||
890 | Y = s0_params->paddr; | 894 | Y = s0_params->paddr; |
891 | 895 | ||
@@ -937,22 +941,22 @@ static void pxp_set_s0buf(struct pxps *pxp) | |||
937 | s0_params->pixel_fmt == PXP_PIX_FMT_NV21 || | 941 | s0_params->pixel_fmt == PXP_PIX_FMT_NV21 || |
938 | s0_params->pixel_fmt == PXP_PIX_FMT_NV16 || | 942 | s0_params->pixel_fmt == PXP_PIX_FMT_NV16 || |
939 | s0_params->pixel_fmt == PXP_PIX_FMT_NV61) { | 943 | s0_params->pixel_fmt == PXP_PIX_FMT_NV61) { |
940 | __raw_writel(s0_params->width, pxp->base + HW_PXP_PS_PITCH); | 944 | __raw_writel(pitch, pxp->base + HW_PXP_PS_PITCH); |
941 | } | 945 | } |
942 | else if (s0_params->pixel_fmt == PXP_PIX_FMT_GY04) | 946 | else if (s0_params->pixel_fmt == PXP_PIX_FMT_GY04) |
943 | __raw_writel(s0_params->width >> 1, | 947 | __raw_writel(pitch >> 1, |
944 | pxp->base + HW_PXP_PS_PITCH); | 948 | pxp->base + HW_PXP_PS_PITCH); |
945 | else if (s0_params->pixel_fmt == PXP_PIX_FMT_RGB32) | 949 | else if (s0_params->pixel_fmt == PXP_PIX_FMT_RGB32) |
946 | __raw_writel(s0_params->width << 2, | 950 | __raw_writel(pitch << 2, |
947 | pxp->base + HW_PXP_PS_PITCH); | 951 | pxp->base + HW_PXP_PS_PITCH); |
948 | else if (s0_params->pixel_fmt == PXP_PIX_FMT_UYVY || | 952 | else if (s0_params->pixel_fmt == PXP_PIX_FMT_UYVY || |
949 | s0_params->pixel_fmt == PXP_PIX_FMT_YUYV || | 953 | s0_params->pixel_fmt == PXP_PIX_FMT_YUYV || |
950 | s0_params->pixel_fmt == PXP_PIX_FMT_VYUY || | 954 | s0_params->pixel_fmt == PXP_PIX_FMT_VYUY || |
951 | s0_params->pixel_fmt == PXP_PIX_FMT_YVYU) | 955 | s0_params->pixel_fmt == PXP_PIX_FMT_YVYU) |
952 | __raw_writel(s0_params->width << 1, | 956 | __raw_writel(pitch << 1, |
953 | pxp->base + HW_PXP_PS_PITCH); | 957 | pxp->base + HW_PXP_PS_PITCH); |
954 | else if (s0_params->pixel_fmt == PXP_PIX_FMT_RGB565) | 958 | else if (s0_params->pixel_fmt == PXP_PIX_FMT_RGB565) |
955 | __raw_writel(s0_params->width << 1, | 959 | __raw_writel(pitch << 1, |
956 | pxp->base + HW_PXP_PS_PITCH); | 960 | pxp->base + HW_PXP_PS_PITCH); |
957 | else | 961 | else |
958 | __raw_writel(0, pxp->base + HW_PXP_PS_PITCH); | 962 | __raw_writel(0, pxp->base + HW_PXP_PS_PITCH); |