From patchwork Fri Jul 11 15:19:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Anaszewski X-Patchwork-Id: 4535241 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 DB584BEEAA for ; Fri, 11 Jul 2014 15:29:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 216902021B for ; Fri, 11 Jul 2014 15:29:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2587520256 for ; Fri, 11 Jul 2014 15:29:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753922AbaGKPUG (ORCPT ); Fri, 11 Jul 2014 11:20:06 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:34013 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754421AbaGKPUD (ORCPT ); Fri, 11 Jul 2014 11:20:03 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N8J00EA3ZXDQGA0@mailout3.samsung.com> for linux-media@vger.kernel.org; Sat, 12 Jul 2014 00:20:01 +0900 (KST) X-AuditID: cbfee61a-f79e46d00000134f-1b-53c000a10d6e Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id D9.3D.04943.1A000C35; Sat, 12 Jul 2014 00:20:01 +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 <0N8J00DPYZWYA170@mmp1.samsung.com>; Sat, 12 Jul 2014 00:20:01 +0900 (KST) From: Jacek Anaszewski To: linux-media@vger.kernel.org Cc: s.nawrocki@samsung.com, andrzej.p@samsung.com, Jacek Anaszewski , Kyungmin Park Subject: [PATCH v2 4/9] s5p-jpeg: fix g_selection op Date: Fri, 11 Jul 2014 17:19:45 +0200 Message-id: <1405091990-28567-5-git-send-email-j.anaszewski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1405091990-28567-1-git-send-email-j.anaszewski@samsung.com> References: <1405091990-28567-1-git-send-email-j.anaszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFJMWRmVeSWpSXmKPExsVy+t9jAd2FDAeCDRat0bSY9bKdxaL36nNG i7NNb9gtejZsZbU4/Kad1YHVo2/LKkaPz5vkApiiuGxSUnMyy1KL9O0SuDI+nOxkKZjMXXF8 6na2BsZVnF2MnBwSAiYSOz/cYYWwxSQu3FvP1sXIxSEksIhR4uTXJUwQTjuTxN6/l9lBqtgE DCV+vnjNBGKLCMhLPOm9AdbBLNDLKHHu3y8WkIQwyNhFt8DGsgioSszfvgPI5uDgFfCQuDxT H8SUEFCQmDPJBqSCU8BT4uz1FWCdQkAVP7oXsU9g5F3AyLCKUTS1ILmgOCk911CvODG3uDQv XS85P3cTIzhEnkntYFzZYHGIUYCDUYmHV2H9vmAh1sSy4srcQ4wSHMxKIrxX3+wPFuJNSays Si3Kjy8qzUktPsQozcGiJM57oNU6UEggPbEkNTs1tSC1CCbLxMEp1cDolp1fqha9pL9wTcyG S94tSXa+pYWS/9gCl7zn+T6/K2XTfq7wTe+UZ0yZcXtWYD67jPPHnv7Ozu2hPhMC//AF81nm 9XrNWtH/WGGGzn/nwwvU/CKVmDVXv5K3DHl699bE9qPTzwX2Kqqyn+qZupR34WyW+YJrXh9p 3c6/6fg14aVfXy77sZFFiaU4I9FQi7moOBEAYXXX2Q0CAAA= 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.5 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 V4L2_SEL_TGT_COMPOSE_DEFAULT switch case should select whole available area of the image and V4L2_SEL_TGT_COMPOSE should apply user settings. Signed-off-by: Jacek Anaszewski Signed-off-by: Kyungmin Park --- drivers/media/platform/s5p-jpeg/jpeg-core.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c index 0854f37..09b59d3 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c @@ -1505,21 +1505,23 @@ static int s5p_jpeg_g_selection(struct file *file, void *priv, case V4L2_SEL_TGT_CROP: case V4L2_SEL_TGT_CROP_BOUNDS: case V4L2_SEL_TGT_CROP_DEFAULT: - case V4L2_SEL_TGT_COMPOSE: case V4L2_SEL_TGT_COMPOSE_DEFAULT: s->r.width = ctx->out_q.w; s->r.height = ctx->out_q.h; + s->r.left = 0; + s->r.top = 0; break; + case V4L2_SEL_TGT_COMPOSE: case V4L2_SEL_TGT_COMPOSE_BOUNDS: case V4L2_SEL_TGT_COMPOSE_PADDED: - s->r.width = ctx->cap_q.w; - s->r.height = ctx->cap_q.h; + s->r.width = ctx->crop_rect.width; + s->r.height = ctx->crop_rect.height; + s->r.left = ctx->crop_rect.left; + s->r.top = ctx->crop_rect.top; break; default: return -EINVAL; } - s->r.left = 0; - s->r.top = 0; return 0; }