From patchwork Mon Nov 25 09:58:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Anaszewski X-Patchwork-Id: 3229041 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 BBE4EC045B for ; Mon, 25 Nov 2013 09:59:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9EE5C201FA for ; Mon, 25 Nov 2013 09:59:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF9C22015D for ; Mon, 25 Nov 2013 09:59:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752457Ab3KYJ7T (ORCPT ); Mon, 25 Nov 2013 04:59:19 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:56584 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752326Ab3KYJ7Q (ORCPT ); Mon, 25 Nov 2013 04:59:16 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MWT00AH7D2RW020@mailout1.samsung.com> for linux-media@vger.kernel.org; Mon, 25 Nov 2013 18:59:15 +0900 (KST) X-AuditID: cbfee61b-b7f166d000007a34-0a-52931f73449b Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 18.74.31284.37F13925; Mon, 25 Nov 2013 18:59:15 +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 <0MWT004BMD1ERF40@mmp2.samsung.com>; Mon, 25 Nov 2013 18:59:15 +0900 (KST) From: Jacek Anaszewski To: linux-media@vger.kernel.org Cc: sw0312.kim@samsung.com, andrzej.p@samsung.com, s.nawrocki@samsung.com, Jacek Anaszewski , Kyungmin Park Subject: [PATCH v2 14/16] s5p-jpeg: Synchronize V4L2_CID_JPEG_CHROMA_SUBSAMPLING control value Date: Mon, 25 Nov 2013 10:58:21 +0100 Message-id: <1385373503-1657-15-git-send-email-j.anaszewski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1385373503-1657-1-git-send-email-j.anaszewski@samsung.com> References: <1385373503-1657-1-git-send-email-j.anaszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLJMWRmVeSWpSXmKPExsVy+t9jQd1i+clBBn8mW1nMetnOYtF79Tmj xdmmN+wWPRu2slocftPOajFj8ks2BzaPvi2rGD0+b5ILYIrisklJzcksSy3St0vgynh9t4u1 4C93xfJ5bg2MbVxdjJwcEgImEvffz2eGsMUkLtxbz9bFyMUhJDCdUaLp8DlGCKedSWLH5Ivs IFVsAoYSP1+8ZgKxRQTkJZ703gDrYBZYyihxcdIRsCJhgQSJLT+2AyU4OFgEVCVW3HEBCfMK eEicPLeQGSQsIaAgMWeSDYjJCRSeP4kVpEJIwF1iyY+N7BMYeRcwMqxiFE0tSC4oTkrPNdIr TswtLs1L10vOz93ECA6UZ9I7GFc1WBxiFOBgVOLhnVg9KUiINbGsuDL3EKMEB7OSCO9pyclB QrwpiZVVqUX58UWlOanFhxilOViUxHkPtloHCgmkJ5akZqemFqQWwWSZODilGhi3qKY+vfXR W4CV/brwEYULr9yO7vXhmFClc6tqd596bHTthjDe6szfVamfuZdw3DHYcf1fw0Er72Vqb7ln 2u1pTP4waVLtbk3T3PQMh7m57yQnlfjNaDH6ImF187TLS68Ns3aynL5ruMd9ZuE/gS+5xdGz 2+JaA5tt2i/+/VOqoqe5VTPacIkSS3FGoqEWc1FxIgBho94nEAIAAA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 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 e85ac6a..163ee8d 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c @@ -1091,6 +1091,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); @@ -1116,6 +1117,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; }