Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751985AbdFTL5z (ORCPT ); Tue, 20 Jun 2017 07:57:55 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:51331 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750957AbdFTL5x (ORCPT ); Tue, 20 Jun 2017 07:57:53 -0400 X-AuditID: cbfec7f1-f796e6d00000116b-c1-59490dbd6816 Subject: Re: [PATCH v2 4/6] [media] s5p-jpeg: Decode 4:1:1 chroma subsampling format To: Thierry Escande , Jacek Anaszewski , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org From: Andrzej Pietrasiewicz Message-id: <460fd251-b0ce-5acc-db94-0d0e5fc9eb04@samsung.com> Date: Tue, 20 Jun 2017 13:57:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-version: 1.0 In-reply-to: <1497287605-20074-5-git-send-email-thierry.escande@collabora.com> Content-type: text/plain; charset=utf-8; format=flowed Content-language: en-US Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFKsWRmVeSWpSXmKPExsWy7djPc7p7eT0jDXp6RSxub93AYnF51xw2 i54NW1ktlm36w2TRf/USmwOrx467Sxg9ds66y+6xaVUnm8fnTXIBLFFcNimpOZllqUX6dglc GXMfTmYtuMNT0TBhNVsD42muLkYODgkBE4k5R/m7GDmBTDGJC/fWs3UxcnEICSxllJj8ahsj hPOZUeJi5wxWiCoTiSmLljGC2EICyxgldr5yhSh6wSjx7dNqNpCEsECYxIwJz5hAEiICExgl DmzbyQ6SYBawleg41MkCYrMJGEvsPdgBNolXwE7iasNMsGYWAVWJvk/3mEBsUYEIiUWTJrJD 1AhK/Jh8jwXkbE4BP4mDv3ggRlpJPPvXygphi0s0t95kgbDlJTavecsMcoOEwDx2iZtdvxkh XpaV2HSAGeI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FGCQ5mJRHeOEbPSCHelMTKqtSi /Pii0pzU4kOMpkC/TWSWEk3OB6aCvJJ4QxNDc0tDI2MLC3MjIyVx3pIPV8KFBNITS1KzU1ML Uotg+pg4OKUaGNvWu7zLXXxG0PKj2s1vabcOOmaXzo1VSd/QYso2M3aJ+2O/G9c4fpbv1dkm v2sHw6o+q2sr7HxPLVH5cKPQrThDpO9v+G/hZNPajL6M+bnRP43XxkuJ8dk/vPs65KwGY1Xn brfgfxdUPocwm52uObNq3QmNO6FvLlYtdf196Hp+wXOO3VU+jkosxRmJhlrMRcWJAHP2Mr3N AgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170620115748eucas1p2d96b1d7b2dbcfaef098edae796902aa4 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 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: 20170612171402epcas2p22a4c2dce550ee9f9fc50b6a504778892 X-RootMTR: 20170612171402epcas2p22a4c2dce550ee9f9fc50b6a504778892 References: <1497287605-20074-1-git-send-email-thierry.escande@collabora.com> <1497287605-20074-5-git-send-email-thierry.escande@collabora.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1587 Lines: 41 Hi Thierry, W dniu 12.06.2017 o 19:13, Thierry Escande pisze: > From: Tony K Nadackal > > This patch adds support for decoding 4:1:1 chroma subsampling in the > jpeg header parsing function. > > Signed-off-by: Tony K Nadackal > Signed-off-by: Thierry Escande > --- > drivers/media/platform/s5p-jpeg/jpeg-core.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c > index 0d935f5..7ef7173 100644 > --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c > +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c > @@ -1236,6 +1236,9 @@ static bool s5p_jpeg_parse_hdr(struct s5p_jpeg_q_data *result, > case 0x33: > ctx->subsampling = V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY; > break; > + case 0x41: > + ctx->subsampling = V4L2_JPEG_CHROMA_SUBSAMPLING_411; > + break; Merely parsing 4:1:1 subsampling is not enough. Now the s5p_jpeg_parse_hdr() sometimes returns false, among others it does so when unsupported subsampling is encountered in the header. As far as I know 4:1:1 is supported only on some variants (3250, 5420, 5433) of the hardware, so the kind of change intended by the patch author must take hardware variants into account. In the above function ctx is available, so accessing hardware variant information is possible. The s5p_jpeg_parse_hdr() is a lengthy function, so probably the switch (subsampling) part should be factored out to a separate function and extended appropriately. Andrzej