From patchwork Fri Aug 11 11:50:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 9895609 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3778760236 for ; Fri, 11 Aug 2017 11:50:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 276C328BEB for ; Fri, 11 Aug 2017 11:50:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C4F928C1E; Fri, 11 Aug 2017 11:50:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B75BC28BEB for ; Fri, 11 Aug 2017 11:50:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752610AbdHKLuW (ORCPT ); Fri, 11 Aug 2017 07:50:22 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:49423 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751995AbdHKLuR (ORCPT ); Fri, 11 Aug 2017 07:50:17 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OUI00EJ4RJPZR30@mailout3.w1.samsung.com>; Fri, 11 Aug 2017 12:50:13 +0100 (BST) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170811115012eucas1p29af64a8f9b476dea16a6d8b24da0a818~ZyFPJ-I2_0926109261eucas1p2o; Fri, 11 Aug 2017 11:50:12 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1.samsung.com (EUCPMTA) with SMTP id 99.13.12576.4F99D895; Fri, 11 Aug 2017 12:50:12 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170811115012eucas1p218b11e4b15ff2eb88910e58619d96a67~ZyFOYo0f40919009190eucas1p2k; Fri, 11 Aug 2017 11:50:12 +0000 (GMT) X-AuditID: cbfec7ef-f79ee6d000003120-4d-598d99f46f61 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 79.58.20118.4F99D895; Fri, 11 Aug 2017 12:50:12 +0100 (BST) Received: from AMDC831.digital.local ([106.116.147.122]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OUI0027SRJH2750@eusync3.samsung.com>; Fri, 11 Aug 2017 12:50:12 +0100 (BST) From: Andrzej Pietrasiewicz To: linux-samsung-soc@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Andrzej Pietrasiewicz , Jacek Anaszewski , Marek Szyprowski , Bartlomiej Zolnierkiewicz , Mauro Carvalho Chehab , Thierry Escande , Krzysztof Kozlowski Subject: [PATCH 2/2] media: s5p-jpeg: set w/h when encoding Date: Fri, 11 Aug 2017 13:50:01 +0200 Message-id: <1502452201-17171-3-git-send-email-andrzej.p@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1502452201-17171-1-git-send-email-andrzej.p@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrIIsWRmVeSWpSXmKPExsWy7djPc7pfZvZGGiy7qW4x62U7i8XGGetZ LW5v3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NtlSJ0fUOClBTKEnNKgTwjAzTg4BzgHqykb5fglnHp/1zGgl/cFUub9BsY/3J2MXJySAiY SNzqvskIYYtJXLi3nq2LkYtDSGAJo8TCeZdZIZwmJontr+YwgVSxCRhL7D3YAdYhIpAlcXj+ LGaQImaBG0wSRz9OBCsSFrCW+HD1BxuIzSKgKnH26ltWEJtXwFVi94MdzBDr5CROHpsMFucU cJO4O/0tC8S2RkaJiWeWME1g5F3AyLCKUSS1tDg3PbfYSK84Mbe4NC9dLzk/dxMjMPi3Hfu5 ZQdj17vgQ4wCHIxKPLweh3oihVgTy4orcw8xSnAwK4nwzprRGynEm5JYWZValB9fVJqTWnyI 0RToqonMUqLJ+cDIzCuJNzQxNLc0NDK2sDA3MlIS51W/3BQpJJCeWJKanZpakFoE08fEwSnV wHhWbMr5f/fubm5nqvrZsJIn34fNQb+1r/DoNnM1nVvvPb95shlM1Jgxzanv+L3FvvKrWA7c 6k56tWXC5Y/T1VfufrXgn8b0H1n6s2Kv7s2JPVmaJn+m9PWbqS6V6gE+cZMeKajLcTqu+LK5 f4dHxoMn8pxVXEXbJis6LItPdPgipf9g74v1C+WVWIozEg21mIuKEwGSTu0LlAIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170811115012eucas1p218b11e4b15ff2eb88910e58619d96a67 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?QW5kcnplaiBQaWV0cmFzaWV3aWN6G1NSUE9MLUtlcm5lbCAo?= =?UTF-8?B?VFApG+yCvOyEseyghOyekBtTZW5pb3IgU29mdHdhcmUgRW5naW5lZXI=?= X-Global-Sender: =?UTF-8?B?QW5kcnplaiBUb21hc3ogUGlldHJhc2lld2ljehtTUlBPTC1L?= =?UTF-8?B?ZXJuZWwgKFRQKRtTYW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2Fy?= =?UTF-8?B?ZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170811115012eucas1p218b11e4b15ff2eb88910e58619d96a67 X-RootMTR: 20170811115012eucas1p218b11e4b15ff2eb88910e58619d96a67 References: <1502191352-11595-1-git-send-email-andrzej.p@samsung.com> <1502452201-17171-1-git-send-email-andrzej.p@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP q_data w/h must be set when encoding. Fixes: 1c84e7f9d5dc596be (media: s5p-jpeg: Add support for resolution change event) Signed-off-by: Andrzej Pietrasiewicz --- drivers/media/platform/s5p-jpeg/jpeg-core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c index c00e3a1..e1babb8 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c @@ -1634,6 +1634,12 @@ static int s5p_jpeg_s_fmt(struct s5p_jpeg_ctx *ct, struct v4l2_format *f) FMT_TYPE_OUTPUT : FMT_TYPE_CAPTURE; q_data->fmt = s5p_jpeg_find_format(ct, pix->pixelformat, f_type); + if (ct->mode == S5P_JPEG_ENCODE || + (ct->mode == S5P_JPEG_DECODE && + q_data->fmt->fourcc != V4L2_PIX_FMT_JPEG)) { + q_data->w = pix->width; + q_data->h = pix->height; + } if (q_data->fmt->fourcc != V4L2_PIX_FMT_JPEG) { /* * During encoding Exynos4x12 SoCs access wider memory area @@ -1641,8 +1647,6 @@ static int s5p_jpeg_s_fmt(struct s5p_jpeg_ctx *ct, struct v4l2_format *f) * the JPEG_IMAGE_SIZE register. In order to avoid sysmmu * page fault calculate proper buffer size in such a case. */ - q_data->w = pix->width; - q_data->h = pix->height; if (ct->jpeg->variant->hw_ex4_compat && f_type == FMT_TYPE_OUTPUT && ct->mode == S5P_JPEG_ENCODE) q_data->size = exynos4_jpeg_get_output_buffer_size(ct,