Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2159809imm; Thu, 14 Jun 2018 09:38:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKvbx/Yw8AbxT3nj15AM5Jhe1QdNjiT6lzELhmGrfYqWX3is82kDudsNukhlr/1Kv8s31+v X-Received: by 2002:a17:902:748b:: with SMTP id h11-v6mr3833734pll.12.1528994281482; Thu, 14 Jun 2018 09:38:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528994281; cv=none; d=google.com; s=arc-20160816; b=PS2J8jybrLPgjGBwPZ1z77kyKFiAWBrqHt9D5PWBJSo7xx+wmMkTai207ihhTGbIeT hNXP0I3kTrzb+SiSUL3OkiHdY/HbPOXMQ2Mh5LQrgEbrwidlAkT3H15bmE5gqz2wloHn HHACFd57Jb/lXSUIkRy3SQJ8SKI+axm5yLigSZL6gS8yAH/znqo2fhmAVNTUz+B+6uvm TWzmd7HWX/aaFeXP2bhAKDDIn3gRSibvOno3qXYQ57WBxUa7CpbVBZ2W16IQKNajAkFy dE0c3SBDn9z/dw+H+nZcCHrif31llLWNyjHT8hIGvm/65Bwy/3+9oLVC7HBUsQOkIf2Y uqmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=D65Hx4Elhr6CXee8700fDDOgPQ67KbiH08BypNMupQ4=; b=oCorawaHdtQmlr7WpWD1PAJoZG8pGV+LQhEGQfiYO9X6WjuvdYqEQ1sKlSjzeFH65D ure1GJuOf6HxzC42o+MCp3Zjr3jAohMYGlhJ0yuW51wTfPgUfk8xV/GyH736q829KboU wisxlwcxAfYRM+Y3OUqtgFiTNNYooKNlIwRpvZfG5kIMt3oNwnH9Dqg063N3IliZWFHp WHwank1gE0N2G8+AGg4AEgCFusLaLo9k0v9pLggg7CwGIonuKiLrOqLj1HmyFGkK2Z74 91LDHQm3t/kWgp5AJvCk4dZfgmhp6VdunPFeSdwjKNuqfrPA5FcKUAtNRMlLza5Y8pud +JgA== 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 g2-v6si6011128plp.233.2018.06.14.09.37.46; Thu, 14 Jun 2018 09:38:01 -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 S1755288AbeFNQhV convert rfc822-to-8bit (ORCPT + 99 others); Thu, 14 Jun 2018 12:37:21 -0400 Received: from mail.bootlin.com ([62.4.15.54]:56728 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755227AbeFNQhU (ORCPT ); Thu, 14 Jun 2018 12:37:20 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id C15FD206A6; Thu, 14 Jun 2018 18:37:18 +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 (LFbn-TOU-1-32-230.w86-201.abo.wanadoo.fr [86.201.126.230]) by mail.bootlin.com (Postfix) with ESMTPSA id 89AA4203D9; Thu, 14 Jun 2018 18:37:18 +0200 (CEST) Date: Thu, 14 Jun 2018 18:37:17 +0200 From: Maxime Ripard To: Tomasz Figa Cc: Hans Verkuil , Alexandre Courbot , Sakari Ailus , Laurent Pinchart , Pawel Osciak , Paul Kocialkowski , Chen-Yu Tsai , Linux Kernel Mailing List , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Linux Media Mailing List , nicolas.dufresne@collabora.com, jenskuske@gmail.com, linux-sunxi@googlegroups.com, thomas.petazzoni@bootlin.com Subject: Re: [PATCH 0/9] media: cedrus: Add H264 decoding support Message-ID: <20180614163717.hqxeiwn63vvnk5xg@flea> References: <20180613140714.1686-1-maxime.ripard@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: User-Agent: NeoMutt/20180512 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tomasz, On Thu, Jun 14, 2018 at 10:00:43PM +0900, Tomasz Figa wrote: > Hi Maxime, > > On Wed, Jun 13, 2018 at 11:07 PM Maxime Ripard > wrote: > > > > Hi, > > > > Here is a preliminary version of the H264 decoding support in the > > cedrus driver. > > Thanks for the series! Let me reply inline to some of the points raised here. > > > 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 > > Just FYI, there is v15 already. :) Yeah, we know, Paul is currently working on rebasing to that version :) > > 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: > > Note that these controls are supposed to be defined exactly like the > bitstream headers deserialized into C structs in memory. I believe > Pawel (on CC) defined them based on the actual H264 specification. > > > - 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 fact that 2 drivers only need partial information doesn't mean > that we should ignore the data being already in the bitstream. IMHO > this API should to provide all the metadata available in the stream to > the kernel driver, as a replacement for bitstream parsing in firmware > (or in kernel... yuck). The point is more that libva will only pass the result of (nal_ref_idc != 0). So in the libva plugin, you won't be able to fill the proper value to the kernel, since you don't have access to it. > > - 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. > > Where does the override flag come from? If it's in the bitstream, then > I guess it was just missed when creating the structures. It's in the bitstream yeah. I'll add it then. Maxime -- Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com