From patchwork Mon Jul 7 16:32:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Anaszewski X-Patchwork-Id: 4496301 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 865B5BEEAA for ; Mon, 7 Jul 2014 16:33:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C1E42202F0 for ; Mon, 7 Jul 2014 16:33:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2E64202EC for ; Mon, 7 Jul 2014 16:33:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752391AbaGGQdH (ORCPT ); Mon, 7 Jul 2014 12:33:07 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:57783 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752366AbaGGQdG (ORCPT ); Mon, 7 Jul 2014 12:33:06 -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 <0N8C00D0XON5ZK90@mailout3.samsung.com>; Tue, 08 Jul 2014 01:33:05 +0900 (KST) X-AuditID: cbfee61a-f79e46d00000134f-ca-53bacbc19da9 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id FC.14.04943.1CBCAB35; Tue, 08 Jul 2014 01:33:05 +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 <0N8C00GK8OLKQW00@mmp2.samsung.com>; Tue, 08 Jul 2014 01:33:05 +0900 (KST) From: Jacek Anaszewski To: linux-media@vger.kernel.org Cc: kyungmin.park@samsung.com, b.zolnierkie@samsung.com, linux-samsung-soc@vger.kernel.org, Jacek Anaszewski Subject: [PATCH 4/9] s5p-jpeg: fix g_selection op Date: Mon, 07 Jul 2014 18:32:05 +0200 Message-id: <1404750730-22996-5-git-send-email-j.anaszewski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1404750730-22996-1-git-send-email-j.anaszewski@samsung.com> References: <1404750730-22996-1-git-send-email-j.anaszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFJMWRmVeSWpSXmKPExsVy+t9jQd2Dp3cFG/x8ImCxccZ6Voveq88Z Lc42vWG36NmwldVixvl9TA6sHn1bVjF6fN4kF8AUxWWTkpqTWZZapG+XwJXx4WQnS8Fk7orj U7ezNTCu4uxi5OSQEDCRWHjgDhOELSZx4d56ti5GLg4hgemMElOv9bBCOO1MEp8/nmIHqWIT MJT4+eI1WIeIgLzEk94bYB3MAp2MEgvbN7CCJISBio4cmgjWwCKgKjHn9jowm1fAQ2LPqx9A NgfQOgWJOZNsQMKcAp4Sh5d9ZgUJCwGVHHxtOYGRdwEjwypG0dSC5ILipPRcQ73ixNzi0rx0 veT83E2M4BB5JrWDcWWDxSFGAQ5GJR7eFQd3BQuxJpYVV+YeYpTgYFYS4V2xHCjEm5JYWZVa lB9fVJqTWnyIUZqDRUmc90CrdaCQQHpiSWp2ampBahFMlomDU6qBsWDqq/wvq1buDr05/cuu CdIbs69Z9c/b/obh8OqrfU2Oz9uO9rNH3FnxXzL094I/JhlBRoZTQ48y8+j82HZLSCnwOM++ poMKW1YK8S8+/nSB9KoHxs1bpi60NP97+rXDpNmBU5W+FqR+seefyyJruPD2lzlin56ptX+Z on28VvLUnfr2qH2JKSlKLMUZiYZazEXFiQDJ4Ox0DQIAAA== Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.6 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; }