summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby Cai <R63905@freescale.com>2010-09-02 17:43:30 +0800
committerRobby Cai <R63905@freescale.com>2010-09-02 17:58:43 +0800
commit6ffce08bb9c029a5d4ae4cd63c8033b33ba5e4e7 (patch)
treeabda4d60c2a3582825368ba2d4dfdee0075bf56d
parent8bd68c30daf4ce4d80da0b01a5e597d70d3c3747 (diff)
ENGR00127032 MX50 make PxP rotation workable both with epdc and v4l2
In rotation case, we need to swap width and height in HW_PXP_OUTSIZE. It can be done in PxP driver. However, since EPDC driver did this swap itself. Here, just do so for V4L2 to make things easy to go. Signed-off-by: Robby Cai <R63905@freescale.com>
-rw-r--r--drivers/dma/pxp/pxp_dma.c11
-rw-r--r--drivers/media/video/mxc/output/mxc_pxp_v4l2.c15
2 files changed, 17 insertions, 9 deletions
diff --git a/drivers/dma/pxp/pxp_dma.c b/drivers/dma/pxp/pxp_dma.c
index 05f1bd4ada03..b8648049de89 100644
--- a/drivers/dma/pxp/pxp_dma.c
+++ b/drivers/dma/pxp/pxp_dma.c
@@ -273,14 +273,9 @@ static void pxp_set_outbuf(struct pxps *pxp)
__raw_writel(out_params->paddr, pxp->base + HW_PXP_OUTBUF);
- if (proc_data->rotate % 180)
- __raw_writel(BF_PXP_OUTSIZE_WIDTH(out_params->height) |
- BF_PXP_OUTSIZE_HEIGHT(out_params->width),
- pxp->base + HW_PXP_OUTSIZE);
- else
- __raw_writel(BF_PXP_OUTSIZE_WIDTH(out_params->width) |
- BF_PXP_OUTSIZE_HEIGHT(out_params->height),
- pxp->base + HW_PXP_OUTSIZE);
+ __raw_writel(BF_PXP_OUTSIZE_WIDTH(out_params->width) |
+ BF_PXP_OUTSIZE_HEIGHT(out_params->height),
+ pxp->base + HW_PXP_OUTSIZE);
}
static void pxp_set_s0colorkey(struct pxps *pxp)
diff --git a/drivers/media/video/mxc/output/mxc_pxp_v4l2.c b/drivers/media/video/mxc/output/mxc_pxp_v4l2.c
index 493d8131bbd6..2855bb675d1d 100644
--- a/drivers/media/video/mxc/output/mxc_pxp_v4l2.c
+++ b/drivers/media/video/mxc/output/mxc_pxp_v4l2.c
@@ -748,6 +748,18 @@ static int pxp_buf_prepare(struct videobuf_queue *q,
&pxp_conf->s0_param,
sizeof(struct pxp_layer_param));
} else if (i == 1) { /* Output */
+ if (proc_data->rotate % 180) {
+ pxp_conf->out_param.width =
+ pxp->fb.fmt.height;
+ pxp_conf->out_param.height =
+ pxp->fb.fmt.width;
+ } else {
+ pxp_conf->out_param.width =
+ pxp->fb.fmt.width;
+ pxp_conf->out_param.height =
+ pxp->fb.fmt.height;
+ }
+
pxp_conf->out_param.paddr = pxp->outb_phys;
memcpy(&desc->layer_param.out_param,
&pxp_conf->out_param,
@@ -1056,6 +1068,8 @@ static int pxp_close(struct file *file)
videobuf_stop(&pxp->s0_vbq);
videobuf_mmap_free(&pxp->s0_vbq);
pxp->active = NULL;
+ kfree(pxp->outb);
+ pxp->outb = NULL;
mutex_lock(&pxp->mutex);
pxp->users--;
@@ -1191,7 +1205,6 @@ static int __devexit pxp_remove(struct platform_device *pdev)
video_unregister_device(pxp->vdev);
video_device_release(pxp->vdev);
- kfree(pxp->outb);
kfree(pxp);
return 0;