diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2013-01-11 13:36:19 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-02-05 23:28:48 +0400 |
commit | fa8880bece7321d61a7a5e7bf4b67832071ee047 (patch) | |
tree | a7c425b7b3b7a2a69faad5a42ce11f7f22d1636e /drivers/media/platform/s5p-fimc/fimc-capture.c | |
parent | 33133ea7aca7eedf8b1b4cee514c76dce7654a8c (diff) | |
download | linux-fa8880bece7321d61a7a5e7bf4b67832071ee047.tar.xz |
[media] s5p-fimc: Fix bytesperline value for V4L2_PIX_FMT_YUV420M format
Make sure bytesperline for Cb, Cr planes for V4L2_PIX_FMT_YUV420M
format is half of the Y plane value, rather than having same
bytesperline for all planes.
While at it, simplify the bytesperline parameter handling by
storing it when image format is set and returning those values
when getting the format, instead of recalculating bytesperline
from intermediate parameters.
Reported-by: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/platform/s5p-fimc/fimc-capture.c')
-rw-r--r-- | drivers/media/platform/s5p-fimc/fimc-capture.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/media/platform/s5p-fimc/fimc-capture.c b/drivers/media/platform/s5p-fimc/fimc-capture.c index 18a70e4a0b0f..df6fc6c7eecd 100644 --- a/drivers/media/platform/s5p-fimc/fimc-capture.c +++ b/drivers/media/platform/s5p-fimc/fimc-capture.c @@ -950,9 +950,9 @@ static int fimc_cap_g_fmt_mplane(struct file *file, void *fh, struct v4l2_format *f) { struct fimc_dev *fimc = video_drvdata(file); - struct fimc_ctx *ctx = fimc->vid_cap.ctx; - return fimc_fill_format(&ctx->d_frame, f); + __fimc_get_format(&fimc->vid_cap.ctx->d_frame, f); + return 0; } static int fimc_cap_try_fmt_mplane(struct file *file, void *fh, @@ -1074,8 +1074,10 @@ static int __fimc_capture_set_format(struct fimc_dev *fimc, return ret; } - for (i = 0; i < ff->fmt->memplanes; i++) + for (i = 0; i < ff->fmt->memplanes; i++) { + ff->bytesperline[i] = pix->plane_fmt[i].bytesperline; ff->payload[i] = pix->plane_fmt[i].sizeimage; + } set_frame_bounds(ff, pix->width, pix->height); /* Reset the composition rectangle if not yet configured */ |