From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4899C433FF for ; Wed, 14 Aug 2019 19:59:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E6332064A for ; Wed, 14 Aug 2019 19:59:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728581AbfHNT7s (ORCPT ); Wed, 14 Aug 2019 15:59:48 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:57474 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728169AbfHNT7r (ORCPT ); Wed, 14 Aug 2019 15:59:47 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id DA10228CB47 From: Ezequiel Garcia To: linux-media@vger.kernel.org Cc: kernel@collabora.com, Nicolas Dufresne , Tomasz Figa , linux-rockchip@lists.infradead.org, Heiko Stuebner , Jonas Karlman , Philipp Zabel , Boris Brezillon , Paul Kocialkowski , Alexandre Courbot , fbuergisser@chromium.org, linux-kernel@vger.kernel.org, Ezequiel Garcia Subject: [PATCH v6 00/11] media: hantro: Add support for H264 decoding Date: Wed, 14 Aug 2019 16:59:20 -0300 Message-Id: <20190814195931.6587-1-ezequiel@collabora.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Small respin of H264 uAPI review and Hantro G1 H264 decoding support. Compared to previous version, this version does some more improvements on the uAPI spec, addressing feedback from Hans and Paul. I really hope I managed to get this right, and address current concerns. Here's previous cover letter, for reference: This series consolidates the two recent H264 series submitted by Boris [1] [2]. Some patches from [2] have been merged (namely, helpers for the Hantro driver), and so I'm adding the remanining bits required to support H264 on Hantro G1 VPU. * Patch 1 adds support for the sort_r() variant and has been posted separately by Rasmus. It would be good to merge this patch via the media tree, ideally as soon as possible, to avoid the synchronisation burden that might appear if we decide to delay it. * Patch 2 to 4 extends the H264 uAPI, introducing frame-based vs slice-based decoding granularity, and also support for different NALU start codes. Currently, Annex B and no start codes are the supported options. With the introduction of the start code control, the H264 parsed slices pixel format should be renamed, dropping the _RAW suffix, which is now meaningless. * Patch 5 removes the P0/B0/B1 ref lists from the decode_params control. These lists are no longer needed since we build them on the kernel side based on the DPB. * Patch 6 and 7 exposes the proper decoding mode and start code on the cedrus driver. The driver functionality is not changed, and only the Cedrus support is now being properly exposed to userspace. * Patch 8 is needed to properly propagate the OUTPUT buffer timestamp to the CAPTURE buffer one, which is required for intra-frame references. * Patches 9 to 11 adds H264 support for Hantro G1 and then enable H264 decoding on RK3288. This is based on media master and tested on Rockchip RK3288 for Hantro and Allwinner H3 boards for Cedrus. Philipp Zabel tested on i.MX8MQ EVK using [3]. The Ffmpeg branch used to test is based on the great work of Jonas and Boris, and is available in [4]. Instructions to build and run are as follows: ./configure --enable-v4l2-request --enable-libdrm make -j4 (test via framebuffer rendering): ./ffmpeg -loglevel debug -hwaccel drm -hwaccel_device /dev/dri/card0 -i $some_file.avi -pix_fmt bgra -f fbdev /dev/fb0 [1] https://www.mail-archive.com/linux-media@vger.kernel.org/msg148299.html [2] https://lkml.org/lkml/2019/6/19/379 [3] git://git.pengutronix.de/git/pza/linux.git hantro/imx8m-wip [4] https://gitlab.collabora.com/ezequiel/ffmpeg/tree/stateless-mpeg2-vp8-h264-v4 Boris Brezillon (3): media: uapi: h264: Add the concept of decoding mode media: uapi: h264: Get rid of the p0/b0/b1 ref-lists media: hantro: Move copy_metadata() before doing a decode operation Ezequiel Garcia (4): media: uapi: h264: Rename pixel format media: uapi: h264: Add the concept of start code media: cedrus: Cleanup control initialization media: cedrus: Specify H264 startcode and decoding mode Hertz Wong (3): media: hantro: Add core bits to support H264 decoding media: hantro: Add support for H264 decoding on G1 media: hantro: Enable H264 decoding on rk3288 Rasmus Villemoes (1): lib/sort.c: implement sort() variant taking context argument .../media/uapi/v4l/ext-ctrls-codec.rst | 89 ++- .../media/uapi/v4l/pixfmt-compressed.rst | 11 +- drivers/media/v4l2-core/v4l2-ctrls.c | 18 + drivers/media/v4l2-core/v4l2-ioctl.c | 2 +- drivers/staging/media/hantro/Makefile | 2 + drivers/staging/media/hantro/hantro.h | 9 +- drivers/staging/media/hantro/hantro_drv.c | 50 +- .../staging/media/hantro/hantro_g1_h264_dec.c | 292 ++++++++ drivers/staging/media/hantro/hantro_h264.c | 641 ++++++++++++++++++ drivers/staging/media/hantro/hantro_hw.h | 56 ++ drivers/staging/media/hantro/hantro_v4l2.c | 10 + drivers/staging/media/hantro/rk3288_vpu_hw.c | 21 +- drivers/staging/media/sunxi/cedrus/cedrus.c | 65 +- drivers/staging/media/sunxi/cedrus/cedrus.h | 3 +- .../staging/media/sunxi/cedrus/cedrus_dec.c | 2 +- .../staging/media/sunxi/cedrus/cedrus_video.c | 6 +- include/linux/sort.h | 5 + include/media/h264-ctrls.h | 21 +- lib/sort.c | 34 +- 19 files changed, 1281 insertions(+), 56 deletions(-) create mode 100644 drivers/staging/media/hantro/hantro_g1_h264_dec.c create mode 100644 drivers/staging/media/hantro/hantro_h264.c -- 2.22.0