diff options
author | Oliver Brown <oliver.brown@freescale.com> | 2015-07-08 16:51:05 -0500 |
---|---|---|
committer | Sandor Yu <R01008@freescale.com> | 2015-07-23 17:31:35 +0800 |
commit | f0241a65d5b31f02446b4fb4f6e4826a1dd79309 (patch) | |
tree | 82dd043523896a504f339a3a8e65d56961bf3bfb | |
parent | 1cf1e4a3287c61863cb12352cfa67ac8277d0196 (diff) |
MLK-10452 [iMX6SL/TIC/PXP] - imxv4l2sink incorrect color for 24bpp or 32bpp
The color is incorrect for 24bpp and 32 bpp framebuffer.
Needed to add cases to support 24bpp and 32bpp.
Signed-off-by: Oliver Brown <oliver.brown@freescale.com>
(cherry picked from commit 5c5343f7bfd4ee226cd951af8f58ebae44c0dc38)
-rw-r--r-- | drivers/media/platform/mxc/output/mxc_pxp_v4l2.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c b/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c index 12210df07344..f070e62f1fbd 100644 --- a/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c +++ b/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c @@ -64,7 +64,7 @@ static struct pxp_data_format pxp_s0_formats[] = { .colorspace = V4L2_COLORSPACE_SRGB, }, { .name = "24-bit RGB", - .bpp = 4, + .bpp = 3, .fourcc = V4L2_PIX_FMT_RGB24, .colorspace = V4L2_COLORSPACE_SRGB, }, { @@ -310,6 +310,8 @@ static int pxp_set_fbinfo(struct pxps *pxp) pxp->pxp_conf.out_param.stride = pxp->fbi->var.xres; if (pxp->fbi->var.bits_per_pixel == 16) fb->fmt.pixelformat = V4L2_PIX_FMT_RGB565; + else if (pxp->fbi->var.bits_per_pixel == 32) + fb->fmt.pixelformat = V4L2_PIX_FMT_RGB32; else fb->fmt.pixelformat = V4L2_PIX_FMT_RGB24; @@ -459,9 +461,10 @@ static int pxp_s_output(struct file *file, void *fh, /* Output buffer is same format as fbdev */ if (fmt->pixelformat == V4L2_PIX_FMT_RGB32 || - fmt->pixelformat == V4L2_PIX_FMT_RGB24 || fmt->pixelformat == V4L2_PIX_FMT_YUV32) bpp = 4; + else if (fmt->pixelformat == V4L2_PIX_FMT_RGB24) + bpp = 3; else bpp = 2; |