From patchwork Tue Nov 19 14:27:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Anaszewski X-Patchwork-Id: 3202551 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5874D9F26C for ; Tue, 19 Nov 2013 14:28:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F06FC20318 for ; Tue, 19 Nov 2013 14:28:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9AE920121 for ; Tue, 19 Nov 2013 14:28:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753110Ab3KSO2M (ORCPT ); Tue, 19 Nov 2013 09:28:12 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:19234 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752847Ab3KSO2K (ORCPT ); Tue, 19 Nov 2013 09:28:10 -0500 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MWI006K9LIUBP10@mailout2.samsung.com> for linux-media@vger.kernel.org; Tue, 19 Nov 2013 23:28:09 +0900 (KST) X-AuditID: cbfee61a-b7f836d0000025d7-e6-528b7579205c Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id D1.D8.09687.9757B825; Tue, 19 Nov 2013 23:28:09 +0900 (KST) Received: from AMDC2362.DIGITAL.local ([106.120.53.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MWI00IBKLHFEGB0@mmp1.samsung.com>; Tue, 19 Nov 2013 23:28:09 +0900 (KST) From: Jacek Anaszewski To: linux-media@vger.kernel.org Cc: kyungmin.park@samsung.com, s.nawrocki@samsung.com, sw0312.kim@samsung.com, Jacek Anaszewski Subject: [PATCH 14/16] s5p-jpeg: Synchronize V4L2_CID_JPEG_CHROMA_SUBSAMPLING control value Date: Tue, 19 Nov 2013 15:27:06 +0100 Message-id: <1384871228-6648-15-git-send-email-j.anaszewski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1384871228-6648-1-git-send-email-j.anaszewski@samsung.com> References: <1384871228-6648-1-git-send-email-j.anaszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJJMWRmVeSWpSXmKPExsVy+t9jAd3K0u4ggzUT5Cx6rz5ntDjb9Ibd omfDVlaLw2/aWS1mTH7J5sDq0bdlFaPH501yAUxRXDYpqTmZZalF+nYJXBn3up0K1nFXfLn3 j6mB8QxnFyMnh4SAiUTz5umMELaYxIV769m6GLk4hAQWMUp8e/6ACcJpZ5JY+ekMC0gVm4Ch xM8Xr5lAbBEBeYknvTfYQGxmgRqJKVtvsIPYwgKxEq3NC8FsFgFViVvrLoHV8Ap4SCy7sIe1 i5EDaJuCxJxJNiBhTqDwlIXbwcqFBNwlzm88yT6BkXcBI8MqRtHUguSC4qT0XEO94sTc4tK8 dL3k/NxNjOAAeSa1g3Flg8UhRgEORiUe3gnuXUFCrIllxZW5hxglOJiVRHgb87uDhHhTEiur Uovy44tKc1KLDzFKc7AoifMeaLUOFBJITyxJzU5NLUgtgskycXBKAYOnbc9f5wLV23UVk/9o L2qau4pFNKwrkulJ/I7DhgvnhdnrsNmd2Tr3nFR61SV/u5KL2+dqFPNXerYnTa5Wnjap67ql sleOQfOEox5nldP4jnd8SzTu9i18qG67fnHkxXnZmyp2XXEqmKLkWLSt2H+6K8uP6p+P6u2U rC980feIdrQ/ExS2Q4mlOCPRUIu5qDgRADF282sMAgAA 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c index 319be0c..d4db612 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c @@ -1038,6 +1038,7 @@ static int s5p_jpeg_try_fmt_vid_out(struct file *file, void *priv, { struct s5p_jpeg_ctx *ctx = fh_to_ctx(priv); struct s5p_jpeg_fmt *fmt; + struct v4l2_control ctrl_subs; fmt = s5p_jpeg_find_format(ctx, f->fmt.pix.pixelformat, FMT_TYPE_OUTPUT); @@ -1048,6 +1049,10 @@ static int s5p_jpeg_try_fmt_vid_out(struct file *file, void *priv, return -EINVAL; } + ctrl_subs.id = V4L2_CID_JPEG_CHROMA_SUBSAMPLING; + ctrl_subs.value = fmt->subsampling; + v4l2_s_ctrl(priv, &ctx->ctrl_handler, &ctrl_subs); + return vidioc_try_fmt(f, fmt, ctx, FMT_TYPE_OUTPUT); }