summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorSandor Yu <R01008@freescale.com>2015-06-11 11:15:57 +0800
committerNitin Garg <nitin.garg@freescale.com>2015-09-17 09:23:47 -0500
commit8809603d492cff18c8d29324299e19fb4e2cc433 (patch)
treed5d9bc0be160153b39757daf554c2cea77e06ba1 /drivers/media
parent0224a185542577725061948ac27999ebb081f463 (diff)
MLK-11165: v4l2 pxp: Add RGB32 support to pxp v4l2 output
Add RGB32 support to pxp v4l2 output. Signed-off-by: Sandor Yu <R01008@freescale.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/mxc/output/mxc_pxp_v4l2.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c b/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c
index 9a4bd44b60bd..12210df07344 100644
--- a/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c
+++ b/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c
@@ -58,6 +58,11 @@
static int video_nr = -1; /* -1 ==> auto assign */
static struct pxp_data_format pxp_s0_formats[] = {
{
+ .name = "32-bit RGB",
+ .bpp = 4,
+ .fourcc = V4L2_PIX_FMT_RGB32,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ }, {
.name = "24-bit RGB",
.bpp = 4,
.fourcc = V4L2_PIX_FMT_RGB24,
@@ -104,7 +109,9 @@ static unsigned int v4l2_fmt_to_pxp_fmt(u32 v4l2_pix_fmt)
{
u32 pxp_fmt = 0;
- if (v4l2_pix_fmt == V4L2_PIX_FMT_RGB24)
+ if (v4l2_pix_fmt == V4L2_PIX_FMT_RGB32)
+ pxp_fmt = PXP_PIX_FMT_RGB32;
+ else if (v4l2_pix_fmt == V4L2_PIX_FMT_RGB24)
pxp_fmt = PXP_PIX_FMT_RGB24;
else if (v4l2_pix_fmt == V4L2_PIX_FMT_RGB565)
pxp_fmt = PXP_PIX_FMT_RGB565;
@@ -451,7 +458,8 @@ static int pxp_s_output(struct file *file, void *fh,
return -EINVAL;
/* Output buffer is same format as fbdev */
- if (fmt->pixelformat == V4L2_PIX_FMT_RGB24 ||
+ if (fmt->pixelformat == V4L2_PIX_FMT_RGB32 ||
+ fmt->pixelformat == V4L2_PIX_FMT_RGB24 ||
fmt->pixelformat == V4L2_PIX_FMT_YUV32)
bpp = 4;
else
@@ -470,7 +478,9 @@ static int pxp_s_output(struct file *file, void *fh,
pxp->pxp_conf.out_param.width = fmt->width;
pxp->pxp_conf.out_param.height = fmt->height;
- if (fmt->pixelformat == V4L2_PIX_FMT_RGB24)
+ if (fmt->pixelformat == V4L2_PIX_FMT_RGB32)
+ pxp->pxp_conf.out_param.pixel_fmt = PXP_PIX_FMT_RGB32;
+ else if (fmt->pixelformat == V4L2_PIX_FMT_RGB24)
pxp->pxp_conf.out_param.pixel_fmt = PXP_PIX_FMT_RGB24;
else
pxp->pxp_conf.out_param.pixel_fmt = PXP_PIX_FMT_RGB565;