Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1839489imm; Thu, 7 Jun 2018 00:56:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJYp+w7tM5sDn9NddsHh+zEce7gueIZnpW2tTb8sSvs0/g0BDj23fhUq12AYhHqv8kvEn1L X-Received: by 2002:aa7:8051:: with SMTP id y17-v6mr820803pfm.148.1528358185749; Thu, 07 Jun 2018 00:56:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528358185; cv=none; d=google.com; s=arc-20160816; b=NYhc7rZMiHsNoSUX7WDrgn6CU/M9a+PUaK8VrlkzH5MfzbCJoymOMbQhuF9fYMWWvs 7aoNzNfPCNcUJ0EHBc8m7+Xkx/LD0N2/qbV2sAqLjxR27B/mUDZCFRRjNGrIcydeQfES ssQT1rhIjgINTwj9lQ8mn1v5eoUYTi3pkNOHGuIcxzm75S6h4Y/sBHG9jrCNJbaDwFLG HH4VyUsyf5Zf0/UY2KGEWWan1szZO1t5eZpF2RR/DAgN03Xj76xgJqO6jwA6MjbAky3C 0mSCH3DFUXwlnJeAbnmbYZ3YC4ino0wWtoqtJbCfygQX1Kv+f5vY7EJqXcr5gfSMd5NA flXQ== 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:arc-authentication-results; bh=JiA06QoRzA1+NCouJMvIhp6mazAId9DJ5CIlBzwJf/w=; b=e6/eIsknHpSD3Y8CE1b2ahVaGwDFOMLdmwrcWhAi9aFn/ko4Aw/RRlon1b9VKcvqjB ewVzArruumDUBKYVAlB/ZEJSYaNj0Rbq5i7CrSYkwLgDiud8CshnGEiDIYjCkYQ8hUqV vXZnF7Jkzh5jwKIW0ca2E34s7xcLEOwCBdt5ZK43Kqs/7bdIboIVnQl+XsYB0579eijB QUm4VPbDTD34n5330ULl3Xvz8v8vsBMMEd72TemtFK41gU7D7Wr8GqCxakXpZs3X1Ys9 ZLU9rSeeplYiCugp9Xy3szklzDcwmUT5rvxTXuazstS3Q6xDhy+zO6cQyu54+dkws6EU U9qQ== 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 u10-v6si25362984plz.153.2018.06.07.00.56.10; Thu, 07 Jun 2018 00:56:25 -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 S1753265AbeFGHWB (ORCPT + 99 others); Thu, 7 Jun 2018 03:22:01 -0400 Received: from lb2-smtp-cloud8.xs4all.net ([194.109.24.25]:51328 "EHLO lb2-smtp-cloud8.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752880AbeFGHWA (ORCPT ); Thu, 7 Jun 2018 03:22:00 -0400 Received: from [192.168.2.10] ([212.251.195.8]) by smtp-cloud8.xs4all.net with ESMTPA id QpEzfDH5adJgZQpF3fSw70; Thu, 07 Jun 2018 09:21:58 +0200 Subject: Re: [RFC PATCH 1/2] media: docs-rst: Add decoder UAPI specification to Codec Interfaces To: Dave Stevenson , Tomasz Figa Cc: LMML , linux-kernel@vger.kernel.org, Mauro Carvalho Chehab , =?UTF-8?B?UGF3ZcWCIE/Fm2NpYWs=?= , Alexandre Courbot , Kamil Debski , Andrzej Hajda , Kyungmin Park , Jeongtae Park , Philipp Zabel , Tiffany Lin , Andrew-CT Chen , Stanimir Varbanov , Todor Tomov , Nicolas Dufresne , Paul Kocialkowski , Laurent Pinchart References: <20180605103328.176255-1-tfiga@chromium.org> <20180605103328.176255-2-tfiga@chromium.org> From: Hans Verkuil Message-ID: Date: Thu, 7 Jun 2018 09:21:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfMrRA2iiMrb1xQaKfc9dH9VT/lQXFUiptkUaK8WR9auPcR9RudJo5j98uo0R0f9H1SqYcWJjRdH/Bp/2Y5AaF8T1mSnylE+Re0VOiSp7AwtwMcbPGrhB RF1v+jeM4+pqt74Yf1uknSIvZ8cQSmR1kROOU4RSMYkV9JTary0GnK1w0A1DWhwy8zM9dV97h1OtxgpwJ55keBn3efgiQfq1RWcAsJN6340MxzKSSztqNNCn eAiRGRGPAJu/WcI4KnNT+xOVvCEmuvmepKtNZSBFrJSSMEYWZraTGZFRJNHu1tsiAkyaDcXkZe2F04BWd8yljtJru0bZJp8GpCpiiEg223ktNOpadeX0AKvu 4Orgkjbtlo+1O9EIYKoVezRUegGyAokq4kSaS6MyHj/UwX/pc4RMqn1fsoeKzaFYCoAdS5Mc3Ec0xX/y0rK/WvVdTDgZEuQQn0VHtYqyF3cacOZay2w2//HU R13XudZq3SSbOAsiwvo4LUqsAJQZzFDgh9p7/9/SWOXova8gjXr9a6l8VP0JdiE4EPbvEPLWuuXaSeL/ozOIaqY0qgYtSzi67yKaCGHWzHqrAROo3RZ/z5Zj l4RyJHodRVdCzJ0PMCinv1v7lHMjB9OIIdCw665do9JSaDHh48YwB42dNBo2j2YhxZA/83bHpxK6pGDEO6iFI40Rp3wNPjTiuuCm6wBqg+qjkN7HkYzpYfdw zjAd2Q1KXcDOkx5pOkM5+BlyD/X54wLNYqMtuAYV2TDjfREM0WbQnfX6LdeZy4lw2EnetOOeYkobDLEe4RNlNZ1/Frf9ZQkT+FVbc7U6Nu2yosJXnjVqoxCC 6F4o/psNTBp5GdvnPgIdyTNY3RdEA9Ru8dfY1xx0u9AZdGGVqD4Sju/P0KO2VtePw4iujwk/1GZdXIr8HNozsZ6a9aFfs1pJJIQzMcn4ombuFQX0XnEdV3SX vlo1eBiqiUReoPY4s7+ClvIusSQi7ifka8XHPCisFMaxFkrW Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/05/2018 03:10 PM, Dave Stevenson wrote: > Hi Tomasz. > > Thanks for formalising this. > I'm working on a stateful V4L2 codec driver on the Raspberry Pi and > was having to deduce various implementation details from other > drivers. I know how much we all tend to hate having to write > documentation, but it is useful to have. > > On 5 June 2018 at 11:33, Tomasz Figa wrote: >> Due to complexity of the video decoding process, the V4L2 drivers of >> stateful decoder hardware require specific sequencies of V4L2 API calls >> to be followed. These include capability enumeration, initialization, >> decoding, seek, pause, dynamic resolution change, flush and end of >> stream. >> >> Specifics of the above have been discussed during Media Workshops at >> LinuxCon Europe 2012 in Barcelona and then later Embedded Linux >> Conference Europe 2014 in Düsseldorf. The de facto Codec API that >> originated at those events was later implemented by the drivers we already >> have merged in mainline, such as s5p-mfc or mtk-vcodec. >> >> The only thing missing was the real specification included as a part of >> Linux Media documentation. Fix it now and document the decoder part of >> the Codec API. >> >> Signed-off-by: Tomasz Figa >> --- >> Documentation/media/uapi/v4l/dev-codec.rst | 771 +++++++++++++++++++++ >> Documentation/media/uapi/v4l/v4l2.rst | 14 +- >> 2 files changed, 784 insertions(+), 1 deletion(-) >> >> diff --git a/Documentation/media/uapi/v4l/dev-codec.rst b/Documentation/media/uapi/v4l/dev-codec.rst >> index c61e938bd8dc..0483b10c205e 100644 >> --- a/Documentation/media/uapi/v4l/dev-codec.rst >> +++ b/Documentation/media/uapi/v4l/dev-codec.rst >> @@ -34,3 +34,774 @@ the codec and reprogram it whenever another file handler gets access. >> This is different from the usual video node behavior where the video >> properties are global to the device (i.e. changing something through one >> file handle is visible through another file handle). > > I know this isn't part of the changes, but raises a question in > v4l2-compliance (so probably one for Hans). > testUnlimitedOpens tries opening the device 100 times. On a normal > device this isn't a significant overhead, but when you're allocating > resources on a per instance basis it quickly adds up. > Internally I have state that has a limit of 64 codec instances (either > encode or decode), so either I allocate at start_streaming and fail on > the 65th one, or I fail on open. I generally take the view that > failing early is a good thing. > Opinions? Is 100 instances of an M2M device really sensible? Resources should not be allocated by the driver until needed (i.e. the queue_setup op is a good place for that). It is perfectly legal to open a video node just to call QUERYCAP to see what it is, and I don't expect that to allocate any hardware resources. And if I want to open it 100 times, then that should just work. It is *always* wrong to limit the number of open arbitrarily. Regards, Hans