Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3723784ybx; Sat, 9 Nov 2019 02:41:46 -0800 (PST) X-Google-Smtp-Source: APXvYqyDZqH8V6yRhjIoD3MyR+YPdtxFJ1rFHtGx3EMBQWRt7CmQzjiZCbJRKicilJOSub3fxK1q X-Received: by 2002:aa7:cb18:: with SMTP id s24mr15532421edt.281.1573296106164; Sat, 09 Nov 2019 02:41:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573296106; cv=none; d=google.com; s=arc-20160816; b=s4QNrZ+T06BwygS5ZGmh8GPWb0+NswxAItgnGbVmhezKB5irasXYMBZ+avEoPaikdk Cv4T2E5V5QSCf+SuDNI2aVdM/mLgsrgImZiTjHO0sQQWlHYFuKg35Ay4dftkbEi8udQQ 0uqahYKttnxNeJi1N8CH9seH2UaNesuHLhSoG+ggyKsiJ/UxkAbjvCBI/2ch7Beh9p+w kQoxpKHkw4r3G7mPhbGwPgyfia62zm7yu8DjWCZeJkltbttbv9bVkrN2zZykE+Pt2mbg 3sgO37Sapr+7HUI+MrChhTGpS+iMK2faC+gEi9Hu22b4QbpiEwFV5OoLrb8p6P2oH4WO ZSqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=vRR34nnh6JJpfSiR+g66WqNZxIbNwo2d9nDCSJiWSoE=; b=Z3r3/EKuIkfJrATF/wJCeuGvfT/v2xqc4plPNmq8meAr3UZ6NuYSMamhZa6w8L0FAN rVO+RA0QBHfMyQV/Btmi+SL/v6vIFCIt5zEIrLpeJLcEw2BA1fI30gBkzz7tFG43fTFb 0QvaSfW745IpLbBe9RGRjI7VGBnl1DeG73W70Pax0I+q3jB1aQcWqsH4DOJgUS2Yvz3N +9BAiNuweijtKNaxloT2a2h3gQ1GeuAYmjMRmpfCdPLKlZPu9+9vacuBLDfG3R+SKGAD KW7szfzxvCmft8grFdzN9YortcobRXCulAaqsv9hytIRRjwCKD5/MM5EF5TrPnI55YnW dfzQ== 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 s46si6847664edd.336.2019.11.09.02.41.23; Sat, 09 Nov 2019 02:41:46 -0800 (PST) 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 S1726289AbfKIKkf (ORCPT + 99 others); Sat, 9 Nov 2019 05:40:35 -0500 Received: from lb3-smtp-cloud7.xs4all.net ([194.109.24.31]:41953 "EHLO lb3-smtp-cloud7.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726143AbfKIKke (ORCPT ); Sat, 9 Nov 2019 05:40:34 -0500 Received: from [192.168.2.10] ([46.9.232.237]) by smtp-cloud7.xs4all.net with ESMTPA id TOAEiwNaYPMT8TOAIiP8zJ; Sat, 09 Nov 2019 11:40:32 +0100 Subject: Re: [PATCH v2 0/4] Enable Hantro G1 post-processor To: Tomasz Figa , Ezequiel Garcia Cc: Linux Media Mailing List , kernel@collabora.com, "open list:ARM/Rockchip SoC..." , Heiko Stuebner , Jonas Karlman , Philipp Zabel , Boris Brezillon , Chris Healy , Linux Kernel Mailing List References: <20191003190833.29046-1-ezequiel@collabora.com> From: Hans Verkuil Message-ID: <0b12f376-385b-0f68-abe1-1a0a21bb5a48@xs4all.nl> Date: Sat, 9 Nov 2019 11:40:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfEJ6CSxksz+D+FP+ZCJyZvVhgJHVZpbXw5vrSx3CeSF4erz7Y7YkVXDkoEOgj8xrSpDO19K39ZuvzaL8n75L72OwcUA7e9evnGA9VRyJUP704ZLzkr7w aFj6qw4Zn+ab3qUDQkvda6pmwxlOQT+9i5CludbEZzNqtwlmxxSemHhDXry2I/4x0Jc2qTq5hyFlzybL+iyyn0C+wJrOPtm30vdjlYZvznJLUl6BxNz7mcR2 uzbUNarRpcyWL41diJI4kvM3Ks2UER7FRIE/Z03VvgBaKQj8QSuGZe74yFniwkV0kqWGLU5tWR2fAqlRj53rUb+EEnbiPdump89TngqWtnxu2EZX4uhimJRu aBkV8K+Wt1tAc3sQxlDOcbijjsWfsAf1WpMcPF5fzfOenNbIlNLVcxLgCs4tP7wT8DPcZXs3OpbJnkgL5kfGv+CRGqzaT+MVveuxkMce8ZMeJen8Hs2gGXHH UD60inxATXPv2uqOqNJrJx8Jmc9LLrqsC/zwWb9owftAHJ/o5kvwRU4wk7U= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/4/19 8:07 AM, Tomasz Figa wrote: > Hi Ezequiel, > > On Fri, Oct 4, 2019 at 4:09 AM Ezequiel Garcia wrote: >> >> Hi all, >> >> The Hantro G1 VPU post-processor block can be pipelined with >> the decoder hardware, allowing to perform operations such as >> color conversion, scaling, rotation, cropping, among others. >> >> When the post-processor is enabled, the decoder hardware >> gets its own set of NV12 buffers (the native decoder format), >> and the post-processor is the owner of the CAPTURE buffers. >> >> This allows the application get processed >> (scaled, converted, etc) buffers, completely transparently. >> >> This feature is implemented by exposing the post-processed pixel >> formats on ENUM_FMT. When the application sets a pixel format >> other than NV12, and if the post-processor is MC-linked, >> the driver will make use of it, transparently. >> >> On this v2, the media controller API is now required >> to "enable" (aka link, in topology jargon) the post-processor. >> Therefore, applications now have to explicitly request this feature. >> >> For instance, the post-processor is enabled using the media-ctl >> tool: >> >> media-ctl -l "'decoder':1 -> 'rockchip,rk3288-vpu-dec':0[0]" >> media-ctl -l "'postproc':1 -> 'rockchip,rk3288-vpu-dec':0[1]" >> >> v4l2-ctl -d 1 --list-formats >> ioctl: VIDIOC_ENUM_FMT >> Type: Video Capture Multiplanar >> >> [0]: 'NV12' (Y/CbCr 4:2:0) >> [1]: 'YUYV' (YUYV 4:2:2) >> >> Patches 1 and 2 are simply cleanups needed to easier integrate the >> post-processor. Patch 2 is a bit invasive, but it's a step >> forward towards merging the implementation for RK3399 and RK3288. >> >> Patch 3 re-works the media-topology, making the decoder >> a v4l2_subdevice, instead of a bare entity. This allows >> to introduce a more accurate of the decoder+post-processor complex. >> >> Patch 4 introduces the post-processing support. >> >> This is tested on RK3288 platforms with MPEG-2, VP8 and >> H264 streams, decoding to YUY2 surfaces. For now, this series >> is only adding support for NV12-to-YUY2 conversion. >> >> The design and implementation is quite different from v1: >> >> * The decoder->post-processor topology is now exposed >> explicitly and applications need to configure the pipeline. >> By default, the decoder is enabled and the post-processor >> is disabled. >> > > First of all, thanks for working on this. While from Chromium point of > view there isn't any practical use case for this feature, it could > possibly be valuable for some other platforms. > > I still see a problem with the current design. Mem-to-mem decoders are > commonly used in a multi-instance fashion, but media topology is > global. That means that when having two applications on the system > decoding their own videos, one might be stepping on the other by > changing the topology. > > I believe that if we want this to be really usable, we would need to > make the media topology per instance, but that's a significant change > to the media subsystem. Maybe we could pursue the other options I > suggested in the previous revision instead, like ordering the formats > returned by enum_fmt by native first and adding format flags that > would tell the userspace that the format can have some performance > and/or power penalty? I discussed this with Ezequiel in Lyon, and my preference is also to not rely on the media controller, but instead order the formats with the native formats first, followed by the formats that need this additional processing step. A format flag can be added, but I feel that it is better to wait with that until it is clear that there is a real need for it. It would be good to document in the ENUM_FMT ioctl that formats that require additional processing are at the end of the format list. Ezequiel, I'm marking this series as "Changes Requested" in patchwork. Regards, Hans > > Best regards, > Tomasz >