From patchwork Fri May 24 09:36:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 10959599 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AA92713AD for ; Fri, 24 May 2019 09:36:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93F222882A for ; Fri, 24 May 2019 09:36:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84C922886B; Fri, 24 May 2019 09:36:56 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 640CD2882A for ; Fri, 24 May 2019 09:36:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389883AbfEXJgv (ORCPT ); Fri, 24 May 2019 05:36:51 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:48781 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389869AbfEXJgu (ORCPT ); Fri, 24 May 2019 05:36:50 -0400 X-Originating-IP: 90.88.147.134 Received: from localhost.localdomain (aaubervilliers-681-1-27-134.w90-88.abo.wanadoo.fr [90.88.147.134]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 66CB0FF813; Fri, 24 May 2019 09:36:43 +0000 (UTC) From: Paul Kocialkowski To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com Cc: Mauro Carvalho Chehab , Maxime Ripard , Paul Kocialkowski , Greg Kroah-Hartman , Chen-Yu Tsai , Hans Verkuil , Ezequiel Garcia , Tomasz Figa , Alexandre Courbot , Nicolas Dufresne , Boris Brezillon , Jernej Skrabec , Thomas Petazzoni Subject: [PATCH v5 0/4] HEVC/H.265 stateless support for V4L2 and Cedrus Date: Fri, 24 May 2019 11:36:31 +0200 Message-Id: <20190524093635.1832-1-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is early support for HEVC/H.265 stateless decoding in V4L2, including both definitions and driver support for the Cedrus VPU driver, which concerns Allwinner devices. A specific pixel format is introduced for the HEVC slice format and controls are provided to pass the bitstream metadata to the decoder. Some bitstream extensions are intentionally not supported at this point. Since this is the first proposal for stateless HEVC/H.265 support in V4L2, reviews and comments about the controls definitions are particularly welcome. On the Cedrus side, the H.265 implementation covers frame pictures with both uni-directional and bi-direction prediction modes (P/B slices). Field pictures (interleaved), scaling lists and 10-bit output are not supported at this point. This series is based upon the following series: * media: cedrus: Add H264 decoding support Changes since v4: * Rebased atop latest H.254 series. Changes since v3: * Updated commit messages; * Updated CID base to avoid conflicts; * Used cpu_to_le32 for packed le32 data; * Fixed misc minor issues in the drive code; * Made it clear in the docs that the API will evolve; * Made the pixfmt private and split commits about it. Changes since v2: * Moved headers to non-public API; * Added H265 capability for A64 and H5; * Moved docs to ext-ctrls-codec.rst; * Mentionned sections of the spec in the docs; * Added padding to control structures for 32-bit alignment; * Made write function use void/size in bytes; * Reduced the number of arguments to helpers when possible; * Removed PHYS_OFFSET since we already set PFN_OFFSET; * Added comments where suggested; * Moved to timestamp for references instead of index; * Fixed some style issues reported by checkpatch. Changes since v1: * Added a H.265 capability to whitelist relevant platforms; * Switched over to tags instead of buffer indices in the DPB * Declared variable in their reduced scope as suggested; * Added the H.265/HEVC spec to the biblio; * Used in-doc references to the spec and the required APIs; * Removed debugging leftovers. Cheers! Paul Kocialkowski (4): media: v4l: Add definitions for the HEVC slice controls media: pixfmt: Add HEVC slice pixel format media: pixfmt: Document the HEVC slice pixel format media: cedrus: Add HEVC/H.265 decoding support Documentation/media/uapi/v4l/biblio.rst | 9 + .../media/uapi/v4l/ext-ctrls-codec.rst | 429 +++++++++++++- .../media/uapi/v4l/pixfmt-compressed.rst | 21 + .../media/uapi/v4l/vidioc-queryctrl.rst | 18 + .../media/videodev2.h.rst.exceptions | 3 + drivers/media/v4l2-core/v4l2-ctrls.c | 26 + drivers/media/v4l2-core/v4l2-ioctl.c | 1 + drivers/staging/media/sunxi/cedrus/Makefile | 2 +- drivers/staging/media/sunxi/cedrus/cedrus.c | 31 +- drivers/staging/media/sunxi/cedrus/cedrus.h | 18 + .../staging/media/sunxi/cedrus/cedrus_dec.c | 9 + .../staging/media/sunxi/cedrus/cedrus_h265.c | 532 ++++++++++++++++++ .../staging/media/sunxi/cedrus/cedrus_hw.c | 4 + .../staging/media/sunxi/cedrus/cedrus_regs.h | 290 ++++++++++ .../staging/media/sunxi/cedrus/cedrus_video.c | 10 + include/media/hevc-ctrls.h | 185 ++++++ include/media/v4l2-ctrls.h | 7 + 17 files changed, 1587 insertions(+), 8 deletions(-) create mode 100644 drivers/staging/media/sunxi/cedrus/cedrus_h265.c create mode 100644 include/media/hevc-ctrls.h