summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacek Anaszewski <j.anaszewski@samsung.com>2013-11-21 16:33:52 (GMT)
committerChanho Park <chanho61.park@samsung.com>2014-11-18 03:01:11 (GMT)
commit473960ed02b1e9ec751be3a467e5a865b61747fc (patch)
tree4a3da259005b5edff3f7a12b9c2233bfc4eb69c8
parent57702f44bfb9fa9ff4078d6326afc1fb2eff6fb9 (diff)
downloadlinux-3.10-473960ed02b1e9ec751be3a467e5a865b61747fc.zip
linux-3.10-473960ed02b1e9ec751be3a467e5a865b61747fc.tar.gz
linux-3.10-473960ed02b1e9ec751be3a467e5a865b61747fc.tar.bz2
[media] s5p-jpeg: Synchronize V4L2_CID_JPEG_CHROMA_SUBSAMPLING control value
When output queue fourcc is set to any flavour of YUV, the V4L2_CID_JPEG_CHROMA_SUBSAMPLING control value as well as its in-driver cached counterpart have to be updated with the subsampling property of the format so as to be able to provide correct information to the user space and preclude setting an illegal subsampling mode for Exynos4x12 encoder. Change-Id: I342638537b57940d411513a5465bf8449a1d1091 Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/platform/s5p-jpeg/jpeg-core.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 1fc96d2..9999c8f 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -1094,6 +1094,7 @@ static int s5p_jpeg_s_fmt(struct s5p_jpeg_ctx *ct, struct v4l2_format *f)
struct vb2_queue *vq;
struct s5p_jpeg_q_data *q_data = NULL;
struct v4l2_pix_format *pix = &f->fmt.pix;
+ struct v4l2_ctrl *ctrl_subs;
unsigned int f_type;
vq = v4l2_m2m_get_vq(ct->fh.m2m_ctx, f->type);
@@ -1119,6 +1120,13 @@ static int s5p_jpeg_s_fmt(struct s5p_jpeg_ctx *ct, struct v4l2_format *f)
else
q_data->size = pix->sizeimage;
+ if (f_type == FMT_TYPE_OUTPUT) {
+ ctrl_subs = v4l2_ctrl_find(&ct->ctrl_handler,
+ V4L2_CID_JPEG_CHROMA_SUBSAMPLING);
+ if (ctrl_subs)
+ v4l2_ctrl_s_ctrl(ctrl_subs, q_data->fmt->subsampling);
+ }
+
return 0;
}