From patchwork Fri Jul 25 14:20:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 4623401 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 4E5E59F36A for ; Fri, 25 Jul 2014 14:21:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 78F8F2020F for ; Fri, 25 Jul 2014 14:21:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A182C2020E for ; Fri, 25 Jul 2014 14:21:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760465AbaGYOVZ (ORCPT ); Fri, 25 Jul 2014 10:21:25 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:61848 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760460AbaGYOVZ (ORCPT ); Fri, 25 Jul 2014 10:21:25 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N9900MO9UJNIA30@mailout4.samsung.com>; Fri, 25 Jul 2014 23:21:23 +0900 (KST) X-AuditID: cbfee61a-f79e46d00000134f-67-53d267e3eaf1 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id F3.1E.04943.3E762D35; Fri, 25 Jul 2014 23:21:23 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N99004WBUIW3L00@mmp2.samsung.com>; Fri, 25 Jul 2014 23:21:23 +0900 (KST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org, j.anaszewski@samsung.com, Sylwester Nawrocki Subject: [PATCH v3 5/9] s5p-jpeg: fix g_selection op Date: Fri, 25 Jul 2014 16:20:49 +0200 Message-id: <1406298053-30184-6-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1406298053-30184-1-git-send-email-s.nawrocki@samsung.com> References: <1406298053-30184-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMJMWRmVeSWpSXmKPExsVy+t9jQd3H6ZeCDSa0GVj0Xn3OaNGzYSur xYzz+5gsDr9pZ3Vg8ejbsorR4/MmuQCmKC6blNSczLLUIn27BK6MO7O+sxWc4K54eWIvSwPj Lc4uRg4OCQETiSWv8rsYOYFMMYkL99azdTFycQgJTGeU+HdhMguE08EksfTfdVaQKjYBQ4ne o32MILaIgLzEk94bbCA2s0CexNdPz5lAbGGgoevPvwazWQRUJSb8WsMMYvMKuEl0LnrOCLFY QWLOJBsQk1PAXeLQNCuQCiGgitVL3zJNYORdwMiwilE0tSC5oDgpPddQrzgxt7g0L10vOT93 EyM4KJ5J7WBc2WBxiFGAg1GJh7ej/mKwEGtiWXFl7iFGCQ5mJRFeo/hLwUK8KYmVValF+fFF pTmpxYcYpTlYlMR5D7RaBwoJpCeWpGanphakFsFkmTg4pRoY7UOeGz0K65OSfZaoeP/YqccL 4n/Wq0hcvHkj91v7CnMO2Rub0ivF1dNrV0z9Vb7d7/G23LSg8Nw9h53Sy+tmlz/v+DC764+G yynro9OWOTtJG4Wz2qWtUfM3UZP2/JpwKrl6IbOEXWb4ApWX8ovnhRpv19+46ETk9kUX52+Y +tx+vfv09d+XKLEUZyQaajEXFScCAPnkGawGAgAA 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 From: Jacek Anaszewski 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: Sylwester Nawrocki --- drivers/media/platform/s5p-jpeg/jpeg-core.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c index 5ef7f5b..d11357f 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; }