Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp710037imm; Wed, 13 Jun 2018 07:10:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLKvr7idX4Gji6cDCDl/t/DvrmsMzR4GQWqOHMFUlQQ8BJtmjdcs7gQLu58mlp/oztdbqZp X-Received: by 2002:a62:9419:: with SMTP id m25-v6mr5138005pfe.120.1528899009897; Wed, 13 Jun 2018 07:10:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528899009; cv=none; d=google.com; s=arc-20160816; b=L5Tu1sbEDb5A/1L6YfX12kUIO4rYNJRvnHrT0yO+TNCd8g6oUlDpBuWM+WTnFWCNqX OjCW23VHexRFV99oN8+4fuZgR0mrUgHBHO/cD57gbCUUwyk/q875fJnCmVwJplEEl4yS sB8u9/R6g7dv8N0zMhmG1Ox63MxmSxmwLUg7aqE+bKK3YovMNeCCPuPwWZGe/gNl6SFB kJRYKmgdav6RMwI4r21Ravm9aup83sdxXSPv+7YGagcu1B7l+BpmRt+K7mXzW7CKdHI4 T8IHgea8au/hoF8ad3ehAJ6PufomOcJb15Y9y9gn7JZLshoIokwAGG0xRcn994T4+oIE 42Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=wxb1mG2+rk+4WVz4Y2riV5222IRqOvmk+nICBmdWW9s=; b=mLWjKMX2WEmP8t95KkpFxjajYMHL0exJRGsxdWY0gVMPlTbudhJ54H8vel3Ag9SYhJ xKEUoQAyFL55/d/qA4tTMouDlRqaq9TbjpVXSjHX8Opwt2nOD46UN5c66Y2C55Pv7sXl CzVYO1okURQZpKOS8QC5+PkT3ENwbnG+ghKf5aOCF5C7SISfwNiEs/aMSaKTxTKyxPZU vP1Fk1PmXioCJ8RFPwCgl3gKh96Tw4uy6jItCx3z5bpSmO+xuRAugEogAlzVCdSC6Zbj p+QVSLnHOpOoQbgWDT77txL6a3Ar8wy0Ic9fpK0NnyTZZGok8yNHnnEXsTJQxn9DqW49 o+kQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o10-v6si2432265pgp.153.2018.06.13.07.09.55; Wed, 13 Jun 2018 07:10:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935822AbeFMOHW (ORCPT + 99 others); Wed, 13 Jun 2018 10:07:22 -0400 Received: from mail.bootlin.com ([62.4.15.54]:52319 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935348AbeFMOHT (ORCPT ); Wed, 13 Jun 2018 10:07:19 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 2DBE02072B; Wed, 13 Jun 2018 16:07:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (AAubervilliers-681-1-37-30.w90-88.abo.wanadoo.fr [90.88.156.30]) by mail.bootlin.com (Postfix) with ESMTPSA id C7B5D203B4; Wed, 13 Jun 2018 16:07:16 +0200 (CEST) From: Maxime Ripard To: hans.verkuil@cisco.com, acourbot@chromium.org, sakari.ailus@linux.intel.com, Laurent Pinchart Cc: tfiga@chromium.org, posciak@chromium.org, Paul Kocialkowski , Chen-Yu Tsai , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, nicolas.dufresne@collabora.com, jenskuske@gmail.com, linux-sunxi@googlegroups.com, Thomas Petazzoni , Maxime Ripard Subject: [PATCH 0/9] media: cedrus: Add H264 decoding support Date: Wed, 13 Jun 2018 16:07:05 +0200 Message-Id: <20180613140714.1686-1-maxime.ripard@bootlin.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Here is a preliminary version of the H264 decoding support in the cedrus driver. As you might already know, the cedrus driver relies on the Request API, and is a reverse engineered driver for the video decoding engine found on the Allwinner SoCs. This work has been possible thanks to the work done by the people behind libvdpau-sunxi found here: https://github.com/linux-sunxi/libvdpau-sunxi/ This driver is based on the last version of the cedrus driver sent by Paul, based on Request API v13 sent by Hans: https://lkml.org/lkml/2018/5/7/316 This driver has been tested only with baseline profile videos, and is missing a few key features to decode videos with higher profiles. This has been tested using our cedrus-frame-test tool, which should be a quite generic v4l2-to-drm decoder using the request API to demonstrate the video decoding: https://github.com/free-electrons/cedrus-frame-test/, branch h264 However, sending this preliminary version, I'd really like to start a discussion and get some feedback on the user-space API for the H264 controls exposed through the request API. I've been using the controls currently integrated into ChromeOS that have a working version of this particular setup. However, these controls have a number of shortcomings and inconsistencies with other decoding API. I've worked with libva so far, but I've noticed already that: - The kernel UAPI expects to have the nal_ref_idc variable, while libva only exposes whether that frame is a reference frame or not. I've looked at the rockchip driver in the ChromeOS tree, and our own driver, and they both need only the information about whether the frame is a reference one or not, so maybe we should change this? - The H264 bitstream exposes the picture default reference list (for both list 0 and list 1), the slice reference list and an override flag. The libva will only pass the reference list to be used (so either the picture default's or the slice's) depending on the override flag. The kernel UAPI wants the picture default reference list and the slice reference list, but doesn't expose the override flag, which prevents us from configuring properly the hardware. Our video decoding engine needs the three information, but we can easily adapt to having only one. However, having two doesn't really work for us. It's pretty much the only one I've noticed so far, but we should probably fix them already. And there's probably other, feel free to step in. Maxime Ripard (8): media: cedrus: Add wrappers around container_of for our buffers media: cedrus: Add a macro to check for the validity of a control media: cedrus: make engine type more generic media: cedrus: Remove MPEG1 support media: cedrus: Add ops structure media: cedrus: Move IRQ maintainance to cedrus_dec_ops media: cedrus: Add start and stop decoder operations media: cedrus: Add H264 decoding support Pawel Osciak (1): CHROMIUM: v4l: Add H264 low-level decoder API compound controls. drivers/media/platform/sunxi/cedrus/Makefile | 2 +- .../platform/sunxi/cedrus/sunxi_cedrus.c | 23 + .../sunxi/cedrus/sunxi_cedrus_common.h | 81 +++- .../platform/sunxi/cedrus/sunxi_cedrus_dec.c | 38 +- .../platform/sunxi/cedrus/sunxi_cedrus_h264.c | 443 ++++++++++++++++++ .../platform/sunxi/cedrus/sunxi_cedrus_hw.c | 35 +- .../platform/sunxi/cedrus/sunxi_cedrus_hw.h | 6 +- .../sunxi/cedrus/sunxi_cedrus_mpeg2.c | 52 +- .../sunxi/cedrus/sunxi_cedrus_mpeg2.h | 33 -- .../platform/sunxi/cedrus/sunxi_cedrus_regs.h | 22 +- .../sunxi/cedrus/sunxi_cedrus_video.c | 37 +- drivers/media/v4l2-core/v4l2-ctrls.c | 42 ++ include/media/v4l2-ctrls.h | 10 + include/uapi/linux/v4l2-controls.h | 164 +++++++ include/uapi/linux/videodev2.h | 11 + 15 files changed, 912 insertions(+), 87 deletions(-) create mode 100644 drivers/media/platform/sunxi/cedrus/sunxi_cedrus_h264.c delete mode 100644 drivers/media/platform/sunxi/cedrus/sunxi_cedrus_mpeg2.h -- 2.17.0