From patchwork Wed Dec 18 14:49:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Anaszewski X-Patchwork-Id: 3370441 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 458FFC0D4A for ; Wed, 18 Dec 2013 14:50:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8ABF5205E1 for ; Wed, 18 Dec 2013 14:50:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C6662205DC for ; Wed, 18 Dec 2013 14:50:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755046Ab3LROuL (ORCPT ); Wed, 18 Dec 2013 09:50:11 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:45813 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755021Ab3LROuJ (ORCPT ); Wed, 18 Dec 2013 09:50:09 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MY0001SABVKNY70@mailout3.samsung.com> for linux-media@vger.kernel.org; Wed, 18 Dec 2013 23:50:08 +0900 (KST) X-AuditID: cbfee61b-b7fbf6d0000051a3-de-52b1b620fbde Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 29.45.20899.026B1B25; Wed, 18 Dec 2013 23:50:08 +0900 (KST) Received: from AMDC2362.DIGITAL.local ([106.120.53.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MY0003L3BUWKB40@mmp2.samsung.com>; Wed, 18 Dec 2013 23:50:08 +0900 (KST) From: Jacek Anaszewski To: linux-media@vger.kernel.org Cc: kyungmin.park@samsung.com, s.nawrocki@samsung.com, Jacek Anaszewski Subject: [PATCH v3 6/8] s5p-jpeg: Synchronize V4L2_CID_JPEG_CHROMA_SUBSAMPLING control value Date: Wed, 18 Dec 2013 15:49:33 +0100 Message-id: <1387378175-23399-7-git-send-email-j.anaszewski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1387378175-23399-1-git-send-email-j.anaszewski@samsung.com> References: <1387378175-23399-1-git-send-email-j.anaszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMJMWRmVeSWpSXmKPExsVy+t9jQV2FbRuDDJo/81r0Xn3OaHG26Q27 Rc+GrawWh9+0szqwePRtWcXo8XmTXABTFJdNSmpOZllqkb5dAlfGlvO7GQv+cldcPqPbwNjG 1cXIySEhYCJx9sATFghbTOLCvfVsXYxcHEIC0xklVvbvZYVw2pkkFm/rYgSpYhMwlPj54jUT iC0iIC/xpPcGG4jNLJAicfXHUzBbWCBO4uqkpUBTOThYBFQl5n4BW8Ar4CFx5OobZpCwhICC xJxJNiBhTgFPifd/p4BNFwIq+ftuA+MERt4FjAyrGEVTC5ILipPSc430ihNzi0vz0vWS83M3 MYKD4pn0DsZVDRaHGAU4GJV4eD28NgYJsSaWFVfmHmKU4GBWEuEV2goU4k1JrKxKLcqPLyrN SS0+xCjNwaIkznuw1TpQSCA9sSQ1OzW1ILUIJsvEwSnVwCiRnNYnriJjef9wesH/u6Z9eZFL 7q3seXImoYBtaV9oitDdbb8TtRavf61jainasvXLN2OBP5XNGx8vNDhnt1tyVRVnZ+6tDTZ/ Xt7+fOqNxI7keU2nRXp/uqvdSdyxcOt3yQk38quqp6+z2vLUsmD6seXKnsc7WDVEwkzWzzhx ia/YTM/F6I8SS3FGoqEWc1FxIgB2rNgVBgIAAA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Jacek Anaszewski Signed-off-by: Kyungmin Park --- drivers/media/platform/s5p-jpeg/jpeg-core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c index 9195252..fc14bbc 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; }