From patchwork Fri Nov 23 13:02:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 10695765 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 1501513AD for ; Fri, 23 Nov 2018 13:02:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 033B72C471 for ; Fri, 23 Nov 2018 13:02:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E84702C482; Fri, 23 Nov 2018 13:02:15 +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 8B33E2C471 for ; Fri, 23 Nov 2018 13:02:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403778AbeKWXqU (ORCPT ); Fri, 23 Nov 2018 18:46:20 -0500 Received: from mail.bootlin.com ([62.4.15.54]:59742 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731971AbeKWXqU (ORCPT ); Fri, 23 Nov 2018 18:46:20 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id B8D8820D29; Fri, 23 Nov 2018 14:02:11 +0100 (CET) Received: from localhost.localdomain (aaubervilliers-681-1-94-205.w90-88.abo.wanadoo.fr [90.88.35.205]) by mail.bootlin.com (Postfix) with ESMTPSA id 5C955207AB; Fri, 23 Nov 2018 14:02:11 +0100 (CET) From: Paul Kocialkowski To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org Cc: Mauro Carvalho Chehab , Maxime Ripard , Paul Kocialkowski , linux-sunxi@googlegroups.com, Randy Li , Hans Verkuil , Ezequiel Garcia , Tomasz Figa , Alexandre Courbot , Thomas Petazzoni Subject: [PATCH v2 0/2] HEVC/H.265 stateless support for V4L2 and Cedrus Date: Fri, 23 Nov 2018 14:02:07 +0100 Message-Id: <20181123130209.11696-1-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.19.1 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 introduces the required bits for supporting HEVC/H.265 both in the V4L2 framework and the Cedrus VPU driver that 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 knowingly 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 * vb2/cedrus: add tag support 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 (2): media: v4l: Add definitions for the HEVC slice format and controls media: cedrus: Add HEVC/H.265 decoding support Documentation/media/uapi/v4l/biblio.rst | 9 + .../media/uapi/v4l/extended-controls.rst | 417 ++++++++++++++ .../media/uapi/v4l/pixfmt-compressed.rst | 15 + .../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 | 22 +- drivers/staging/media/sunxi/cedrus/cedrus.h | 18 + .../staging/media/sunxi/cedrus/cedrus_dec.c | 9 + .../staging/media/sunxi/cedrus/cedrus_h265.c | 543 ++++++++++++++++++ .../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/v4l2-ctrls.h | 6 + include/uapi/linux/v4l2-controls.h | 155 +++++ include/uapi/linux/v4l2-controls.h.rej | 187 ------ include/uapi/linux/videodev2.h | 7 + 19 files changed, 1553 insertions(+), 189 deletions(-) create mode 100644 drivers/staging/media/sunxi/cedrus/cedrus_h265.c delete mode 100644 include/uapi/linux/v4l2-controls.h.rej