From patchwork Wed Feb 1 06:02:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 13123794 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24006C38142 for ; Wed, 1 Feb 2023 06:04:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=miFx+fylT9WurWS4YuzP9qUQ1Ww5gGZvsMR+8HUfVGg=; b=dgvMkFFHM9Ydtc OvyteZuuKERPQpYnxvXhs/qkWxtSwZi4HS8IG2cwU/IlK/eQnjgmVKvj+6bTgjfhLq1+Vno9UcEJ+ mocTt+M+saK+796PSCNkECngGzvuAkg8Vi4tMzHyNBE/xKf1MlCossqlQLVhT1ZQx6e9DZz5Xb5ZF 1AtTnTQgSe+L//Q/cxhdLtGF9wM7y88CE2z93yOSeJ8yfGDXsSepWCXIAhnxVFrugizAvmhcJ71wX xrsP1bUbaRyrIvNQ7pAI/SmY7VkZ8gnUZ1IWMeRN2INT/pdBsOpwenvSBqa8D3JHqnVCWfgRDpb1r fg2Jg9TBXo2GC/ubHRcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pN6DO-00AM3T-RC; Wed, 01 Feb 2023 06:03:27 +0000 Received: from mail-db5eur02on2050.outbound.protection.outlook.com ([40.107.249.50] helo=EUR02-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pN6DL-00AM2K-I2 for linux-arm-kernel@lists.infradead.org; Wed, 01 Feb 2023 06:03:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G+JnFFYkqc1sNOovT8Q1zcekx9BuurqHcnw3hv8eGXuto0iXZ9jX4wcFwIpVsiCNi4n2k+RaD2iFY8zb7/Tz4IlEiV8O35+vPZQXVZjJ9svUmVzRMP+lHoUZig9N+YYjXLGFkY4mDxISMJ+pUX2roHnOVZvgoP6X0u8lhR4JY712SZoo25tILljC1oTAgswCSLwfj/nc+mW6WBR+80rCmsmHOpiAFaJwA02Je9MUtqRYH/i9sXiC6tQJvtM2J2064cSRPxK/XyzpUcWxWz53FLu4Z44iTbAhWeDofLI8saRL+lOyqQ5686NoRdYrmjFXoFLp1QiOLVmVX7uwny3slw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bvdvpM5dE7xZYJvDkp/k2QjR0vZ4lDiCkOJNMP1oh/k=; b=Exi8LjAoRni4wXE/HwxZmBdeIl8GcO2XdAW+Mn3mbi+eBI1bxJeRf5aHAXiEY+e0MTrbakn4Yu7spBl/fDBPKNRaaHaeyraZ5HAqECv06HjLOLhYglZVJjvl+NEAJ13Jzd65zvwYcYEBSvv7U09iOHNPnmxBNv7df73RAsO25jlKm/xi3T1kXjK4hxdDGN1n2ZmheexnzUPKgObFPooBqWlvZytFErTv0EJoeEK4NYhceHZvnpZ5zNJAQH2HaZcqB+IGiQaAMaJev550Imukrc6ZWDSqL2kLcpl79SxZ70IeXvWeLEA5DF/bWglJm6bk/d84fcPdcQZSq3tWMYPavw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bvdvpM5dE7xZYJvDkp/k2QjR0vZ4lDiCkOJNMP1oh/k=; b=eu7ys2PHgJhFDpNBHUB8EliOeJuJAZTXdm3PPlnoEae4Fdx3XhT4RuzLVgHwY8r79XncOCw9ow3NasvoqKqjwawulbYQRlD8qsJZhPDT2e/5YG6eBWXYkfrPy5TgjoxopTlBvC+6Seo5UzkA/HfeI4PQUZT1vvyNAxrhu6hRHPg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) by DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:242::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Wed, 1 Feb 2023 06:03:17 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::3a82:42b3:f1ed:5c3d]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::3a82:42b3:f1ed:5c3d%7]) with mapi id 15.20.6043.036; Wed, 1 Feb 2023 06:03:17 +0000 From: Ming Qian To: mchehab@kernel.org, mirela.rabulea@oss.nxp.com, hverkuil-cisco@xs4all.nl Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, xiahong.bao@nxp.com, linux-imx@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 00/10] media: imx-jpeg: Add support for 12 bit extended jpeg Date: Wed, 1 Feb 2023 14:02:22 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 X-ClientProxiedBy: SI2PR02CA0012.apcprd02.prod.outlook.com (2603:1096:4:194::7) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB6341:EE_|DB9PR04MB8429:EE_ X-MS-Office365-Filtering-Correlation-Id: f056cf38-5094-49ed-bb66-08db041a0305 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JUWuf8keXgWGfClq1KvqFAG2cSANtCr1Xy12NGRs54IB7Y7g9yrqB+rqcmmaH1kPTHnmwjMlhPVRUYhqGhZaZCzGXVhme3BYcKG++T5lSDfDXl5X50ZZiMjsAPcvlPYXzKPd0UWinGuozc2Kju8ctpwRlUBn78o8i6ZkzpoZ7kao+7ykIt35JhOKjPALk2p1zaHAMPxZHVNpjCiE1du0LaFoJcnP91+5TqSmRI8rlqftQWAXPTFiBogcXymX3BmMndUpbBG/OBQHqCp+0bpFCe8ZycdacZD6rbrTKEzzUIs1y+NeOJ0aceTnSZ3qsWEQatdbEZpNsG7u5ZJpXGOgcfMHlnKVK2XJf6/jwal3SVc+bAr2X0u+XqXzZNNbKVQzGDZXYmKjpzNUmMTaSe4YguPbVKQy/euNi/px85AzGO9GiTr0LaQV80a96v9pMMNmwT0xi+SYTZE0nUMa+xwbPkf/DEy5HTulRAw7pdTtGNNjSfgqljR7JES6392usyxQHr231C7F7KqbuCSUy/TcEmvncTyBvglvy2jNLPpYre3W8maZ/EJZK54H6El9y9d+L5BKjRlG9QQz+npSC3lJDiYiFDHo898zmrsqvEh6VjZ36NgWnbd/A14UZJFDSP6ryUOhM6eUEks8RovieCDT3KqORA9qlgNUgq0F+36BDmT42Uhi3R9aafO5j1omyzoXnQcpfyDWX8lc7uT721WP0A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB6341.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(366004)(39860400002)(136003)(346002)(396003)(376002)(451199018)(38100700002)(52116002)(2616005)(38350700002)(36756003)(7416002)(8936002)(86362001)(5660300002)(44832011)(316002)(41300700001)(2906002)(83380400001)(6506007)(6512007)(8676002)(4326008)(186003)(26005)(478600001)(66476007)(66556008)(6666004)(6486002)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WFQSJbOlq3ja8WunFBDEGaHhpXuy3Fgm0HCkMVx/aFFsyEfffu0dY0A1iH4drBqbld9/Dl7yuIyqlH5wwpWbDFWutzyC6yKz2TJwMtHoYZ8pdCwLbhFIcvofh0Eb0BdpRRqYH28km/VONr3L/qXKm4nAGmLA8x6fei/ax2JQbDzvvOlcryg3E881HIbwg713GnZDLWwlVAmxY49voaMK6tRrBTdVWdk4dNvw4TFKOC9cMWeo1ZDvaOz62jxQHM8SN2c/Xyw3KQYqsyTwfES5gPhaJM3UEYL2JnC3Lt0S6RAbAKZiXeMMtiRFLe9wcFDZCRguYKj+r/q7G/FgFIZO56gaf/SULIf+wwuiEe0cIJiuAegIRQ8ZWm37y6JOVwAzYnM+J7AmZ2uwL7YJxy9qZ5zUCH33/qux+CWFJnqLpXJryiYszxKEcq/Xfv4KCT9Qo4R94wA+Kexu/Zh1F+93zUh841u2JkSSMgi5l9cOgfyI45Zutpm6EeuoT8cMe9TcHfYP9z7QlFPAGZXEJDyn42B85b7oL1NLf6EMlQTWXEMqY+1CNfw7fqn0cRWrzZ9QSsRO09UwWZBzQDHtZbsDNd4G/SfFIX579j53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ange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2023 06:03:17.5831 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MrYksgRGvA3rXfjEBvAphMBuxuVmUAmFm4ZutanIRZMaRxW/Q5g3PWRiMJfNpxi/w5Q2uGG9PZb7o9RuMM4ncw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8429 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230131_220323_864099_4B30131D X-CRM114-Status: UNSURE ( 8.92 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org the imx8 jpeg codec support ISO/IEC 10918-1 Standard Baseline and Extended Sequential DCT modes. it can support 8-bit and 12-bit per color samples. Currently we only enable the 8-bit jpeg, and we can enable the 12-bit extended jpeg with the new defined 12 bit pixel format. v2 - correct the new 12-bit format naming according to Hans's comments Ming Qian (10): media: Add P012 and P012M video format media: Add Y012 video format media: Add YUYV_12 video format media: Add YUV24_12 video format media: Add BGR24_12 video format media: Add ABGR32_12 video format media: imx-jpeg: Refine the function mxc_jpeg_find_format media: imx-jpeg: Clear slot next desc ptr if config error media: imx-jpeg: Decoder add support for 12bit jpeg media: imx-jpeg: Encoder add support for 12bit jpeg .../media/v4l/pixfmt-packed-yuv.rst | 70 ++++ .../userspace-api/media/v4l/pixfmt-rgb.rst | 44 +++ .../media/v4l/pixfmt-yuv-luma.rst | 11 + .../media/v4l/pixfmt-yuv-planar.rst | 94 +++++ .../media/platform/nxp/imx-jpeg/mxc-jpeg-hw.c | 19 +- .../media/platform/nxp/imx-jpeg/mxc-jpeg-hw.h | 5 +- .../media/platform/nxp/imx-jpeg/mxc-jpeg.c | 326 ++++++++++++++++-- drivers/media/v4l2-core/v4l2-common.c | 6 + drivers/media/v4l2-core/v4l2-ioctl.c | 7 + include/uapi/linux/videodev2.h | 9 + 10 files changed, 565 insertions(+), 26 deletions(-)