Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1899181ima; Mon, 22 Oct 2018 00:04:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV62wWpJVVW16GjWRQuYAZenEuTqv28cZ3cHZakIZ+1ISy1zJz7nY50zAHv7BLZKn5Pi7FGGE X-Received: by 2002:a62:22c7:: with SMTP id p68-v6mr44724291pfj.53.1540191867171; Mon, 22 Oct 2018 00:04:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540191867; cv=none; d=google.com; s=arc-20160816; b=m8lkRyLT7U8Uo9A9CEpgmL5sRbS6TMoP9sK/+nItEtcw171rZ/XegA4BIr1kVLgmd4 9CEGIB1mLUZktds1ypVYkifA5ticBebSiw7+ClKtW0hk9+GpRwdT8u320qqbo0FEraNW 4JTuitmEPJiA1TeBaA01dhHhWRpRoi4l9PsEKNO/GrPkcGNDrvAhOBOuLa3MEvPrYc/g 32SJIXoqzxaDQpDaSonY7L4pNbhOaVyXGVV7JJlj2LtHjnEF6PoxEiKCf9xPhjLP2iW0 31REN8J1Kl4J0BdCSKkes9YtfOcT5p7W8RKIBQQnSJ/TmCU1fvu5wsmjQC4oK1PuEVxL rl1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=3F8uG7cQv6HV6f3mME1KXgtQ+A8wJlAGFyeD27pLYgw=; b=B/b2b+I+PJI15SNSW9JJk1h+Sqr4Y1xMkEfDuDzxh8VCk/5WotgwVOv+/SNEFRqt5l PjWkyhzya8gQSHNBQX3nMff8TzB6+/FkxAjlXTAagxSj3RjVocH+lgK3Gco1kKHgYaaI cj8dMmy3zbTO1dr9e4U6dOtLn23A1hHrw7rLibYMdKoPoqjO9HF0UFYsbN02D/L+oK7b YR7whV66GnjUE2PN24cNu37yz+K5BdtzrNj/LvHJBtF8ONyGtXuaATxTGtO2uPf05fTx MBM7/vn46JQwTL+ijRfOX3gXPHlwdZ7m1jzzRPy1SnGh04sBhc5fz5X9qkJe9FFkJmkD zDKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PeDruz4D; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3-v6si32688997plf.415.2018.10.22.00.04.09; Mon, 22 Oct 2018 00:04:27 -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; dkim=pass header.i=@chromium.org header.s=google header.b=PeDruz4D; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727562AbeJVPIf (ORCPT + 99 others); Mon, 22 Oct 2018 11:08:35 -0400 Received: from mail-yb1-f194.google.com ([209.85.219.194]:45489 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727325AbeJVPIf (ORCPT ); Mon, 22 Oct 2018 11:08:35 -0400 Received: by mail-yb1-f194.google.com with SMTP id 131-v6so948548ybe.12 for ; Sun, 21 Oct 2018 23:51:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3F8uG7cQv6HV6f3mME1KXgtQ+A8wJlAGFyeD27pLYgw=; b=PeDruz4DQQCLc4WfG7OsI5Imc4CpF6CPR6AHu282L1Sl0+2IQAPWPmu9Yo8QYt+308 f93cpeBwUzoPiXG9FAJNq1QgOKT86DHOVa0Tl1t+OSLXPRxsEh3K9gJXVsy+o+ivYvk+ EHYnF6LRLxf8lG9gWGcEQX1aqkodzlY6j8uuY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3F8uG7cQv6HV6f3mME1KXgtQ+A8wJlAGFyeD27pLYgw=; b=qaGBUHf7K0WlG0ONM1MEREo4kwQ3wIjY1KgKp7qnL2SOG/rF852VyKgm6F3uaTbt0G rmIScfH9dV3/xjoZS9cjNk9bSZKvw3ire43L6zxDChNtBjmckuoOc/76Izb2vGopQ2E3 KFXtS6mQxg9lZ4Zuz4pG4FF8C8Tlhf+q1DsWAOVPdseUL4Ws9o1IkzYUkmLgTRRZPhtP MmceJhGEjYksIimQb64c8zaHvPoGhIR43W8w6J6/aJ7R4jAEO1/oSgwX0wEzKGPE4kDi aQ45djOJnaHEyomYbYTFY++gsFINhpiqOd1AaqBWixoXM+x625W10fn8RsNGTmXUMZVk nK3Q== X-Gm-Message-State: ABuFfohLuBDFF4vFaWoKwrVbyReL1qSkONtY6GK8XyamLPacV27LtQpw ViFI5nVUTbi41HrAS/Psy40PaqCKCPc= X-Received: by 2002:a25:ae1e:: with SMTP id a30-v6mr14847617ybj.66.1540191081830; Sun, 21 Oct 2018 23:51:21 -0700 (PDT) Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com. [209.85.219.182]) by smtp.gmail.com with ESMTPSA id p133-v6sm743087ywb.101.2018.10.21.23.51.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Oct 2018 23:51:20 -0700 (PDT) Received: by mail-yb1-f182.google.com with SMTP id k132-v6so4575342ybc.2 for ; Sun, 21 Oct 2018 23:51:20 -0700 (PDT) X-Received: by 2002:a25:103:: with SMTP id 3-v6mr18621505ybb.114.1540191080245; Sun, 21 Oct 2018 23:51:20 -0700 (PDT) MIME-Version: 1.0 References: <20181019080928.208446-1-acourbot@chromium.org> <9375d854-2be5-4f69-2516-a3349fa5b50d@xs4all.nl> In-Reply-To: From: Tomasz Figa Date: Mon, 22 Oct 2018 15:51:08 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v3] media: docs-rst: Document m2m stateless video decoder interface To: Alexandre Courbot Cc: Hans Verkuil , Paul Kocialkowski , Mauro Carvalho Chehab , Pawel Osciak , Linux Media Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 22, 2018 at 3:39 PM Alexandre Courbot wrote: > > On Mon, Oct 22, 2018 at 3:22 PM Tomasz Figa wrote: > > > > On Mon, Oct 22, 2018 at 3:05 PM Alexandre Courbot wrote: > > > > > > On Fri, Oct 19, 2018 at 5:44 PM Hans Verkuil wrote: > > > > > > > > On 10/19/18 10:09, Alexandre Courbot wrote: > > > > > Thanks everyone for the feedback on v2! I have not replied to all the > > > > > individual emails but hope this v3 will address some of the problems > > > > > raised and become a continuation point for the topics still in > > > > > discussion (probably during the ELCE Media Summit). > > > > > > > > > > This patch documents the protocol that user-space should follow when > > > > > communicating with stateless video decoders. It is based on the > > > > > following references: > > > > > > > > > > * The current protocol used by Chromium (converted from config store to > > > > > request API) > > > > > > > > > > * The submitted Cedrus VPU driver > > > > > > > > > > As such, some things may not be entirely consistent with the current > > > > > state of drivers, so it would be great if all stakeholders could point > > > > > out these inconsistencies. :) > > > > > > > > > > This patch is supposed to be applied on top of the Request API V18 as > > > > > well as the memory-to-memory video decoder interface series by Tomasz > > > > > Figa. > > > > > > > > > > Changes since v2: > > > > > > > > > > * Specify that the frame header controls should be set prior to > > > > > enumerating the CAPTURE queue, instead of the profile which as Paul > > > > > and Tomasz pointed out is not enough to know which raw formats will be > > > > > usable. > > > > > * Change V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAM to > > > > > V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS. > > > > > * Various rewording and rephrasing > > > > > > > > > > Two points being currently discussed have not been changed in this > > > > > revision due to lack of better idea. Of course this is open to change: > > > > > > > > > > * The restriction of having to send full frames for each input buffer is > > > > > kept as-is. As Hans pointed, we currently have a hard limit of 32 > > > > > buffers per queue, and it may be non-trivial to lift. Also some codecs > > > > > (at least Venus AFAIK) do have this restriction in hardware, so unless > > > > > we want to do some buffer-rearranging in-kernel, it is probably better > > > > > to keep the default behavior as-is. Finally, relaxing the rule should > > > > > be easy enough if we add one extra control to query whether the > > > > > hardware can work with slice units, as opposed to frame units. > > > > > > > > Makes sense, as long as the restriction can be lifted in the future. > > > > > > Lifting this limitation once we support more than 32 buffers should > > > not be an issue. Just add a new capability control and process things > > > in slice units. Right now we have hardware that can only work with > > > whole frames (venus) > > > > Note that venus is a stateful hardware and the restriction might just > > come from the firmware. > > Right, and it most certainly does indeed. Yet firmwares are not always > easy to get updated by vendors, so we may have to deal with it anyway. > Right. I'm just not convinced that venus is relevant to the stateless interface. I'd use the Rockchip VPU hardware as an example of a hardware that seems to require all the slices in one buffer, tightly packed one after another, since it only accepts one address and size into its registers. > > > > > but I suspect that some slice-only hardware must > > > exist, so it may actually become a necessity at some point (lest > > > drivers do some splitting themselves). > > > > > > > The drivers could do it trivially, because the UAPI will include the > > array of slices, with offsets and sizes. It would just run the same > > OUTPUT buffer multiple time, once for each slice. > > Alignment issues notwithstanding. :) Good point. That could be handled by a memcpy() into a bounce buffer, but it wouldn't be as trivial as I suggested anymore indeed. Best regards, Tomasz