Received: by 10.213.65.16 with SMTP id m16csp230941imf; Mon, 12 Mar 2018 01:30:56 -0700 (PDT) X-Google-Smtp-Source: AG47ELtZ0hNOxg8E45T+aEPvYEthqKVqPlJdXV5DNq/7daBcQHU8688uhKjlgKl/sCEUjNTVu9JP X-Received: by 2002:a17:902:4103:: with SMTP id e3-v6mr7391445pld.172.1520843456159; Mon, 12 Mar 2018 01:30:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520843456; cv=none; d=google.com; s=arc-20160816; b=jAt2K5bZOgpznpA8eK8eGeVZ94TxIOpB66pXOwAgep56Ifz29KyiFvzsWTa2JblGoC +ZNhW7JZXSUi9rkEAP5k0S26p5DcCMxKkgQZ72K7zyPsX/RbU8ZgBIBU+0UH5oVGZD7a ShV4Bbf14/d9OOKxOY4p4ejsKj2TB286z3hYGbk/vHSZqqTWTD2ITms6alQYxXr9eXkX xlMz65nYz7y6TQt2zs19bPPm38277cX7SvMpv/6/0tyJrPyB/y71copkDDV9ys/Uj9lV 3QfjZccPL4e346kFStTQ42fNspJILHbJXWDqCWly3alKt5Xr2EGwrtN8FWUFhJMmKSVT HSSg== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=O8aqIbn7SnK2iGJCfb3Fd8mK3QxxEqEIb+Sg5buhE9M=; b=q1sYZowrU5O4tZuC+o9fEGyAvdIIJlY9JXhQfPODLs38jZOG7MwllFQNLCKex7+jKn 6q5VZPjXeLC2L2tDPQMTO6sPBIbNVqf9BfZF/sswQqW+SsSVgD67scG0KLQ0ntSH2Ud5 65uKLRLg1gBgogqlkDz/ZzBo663xRbaBs5nzodA8BYV+G+DN5CNAsuTkYvtYZfoNJt+e lrsa3Wd7L/pSheNDj5bQ7uCDaYKxaXu5r8uhu4oGqPUbpNOsTr3xX8VmFFpEItApHPwk sjggpiGFUcHIAZK9SK/prAbvW7k5U9R9p2W+/Ooe1fPFNFNxFwSoZAovvn9qc9W3ZV8A Nhtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HS1eJ0oy; 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 q11si5446553pfi.35.2018.03.12.01.30.41; Mon, 12 Mar 2018 01:30:56 -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=HS1eJ0oy; 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 S1752075AbeCLI3c (ORCPT + 99 others); Mon, 12 Mar 2018 04:29:32 -0400 Received: from mail-vk0-f52.google.com ([209.85.213.52]:40263 "EHLO mail-vk0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750811AbeCLI3a (ORCPT ); Mon, 12 Mar 2018 04:29:30 -0400 Received: by mail-vk0-f52.google.com with SMTP id n82so5693331vkf.7 for ; Mon, 12 Mar 2018 01:29:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=O8aqIbn7SnK2iGJCfb3Fd8mK3QxxEqEIb+Sg5buhE9M=; b=HS1eJ0oyNE59KJvK6PMlmYtEChslOTjA/9NyGZYqO7xcO7pJ92Lw3rqYZ/0agWWitS fr6oPJwBBOGReASUyyIr5sgbrDtX0aueQp1sSYXe1osih7h7ChyQnQTlVMIGhZE1ikWu HBKHAiqxPshgOTnwYVuYhjXZYIJkAfafEtUuc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=O8aqIbn7SnK2iGJCfb3Fd8mK3QxxEqEIb+Sg5buhE9M=; b=Dz6GaLQxkP3Th/0Ojt34fc00uupotYBs4F6wgprSldJSIY26LiEZf3Hp6BUe2w+pUI xUMyvnbeiLsosr7wbMOc4960QtiixFLdzg3tBrhKTR0130z19Hav8Az0Up+w/O/sHHB+ QHLrSMhnSRJG5LkwFa6CVWkAoJjA9+hTpT/8uOWVdHs+ruEuyEy8hkBVb24+1u8UZID1 lYJrbJTRcgFU5DrrN8YXWxqgDgONkwn32F2Y/EtySpBSjUqWKmOihPXxwhOK/R4M07gB Jlh5qcxdQbp+MpIOaqZZ1SopoW/p7DhG31wLkv4yQub6JQpp0f4tzp3AXVKZQcREbFD+ MgBA== X-Gm-Message-State: AElRT7H4syzPIxjDJsQvWihTN2YTUpR/Vl3AzYXBKBdHEdtzbVaIHOcm cUOHmWv16onxs4A1o+o+6zAJxI7XogM= X-Received: by 10.31.9.144 with SMTP id 138mr4386600vkj.83.1520843369432; Mon, 12 Mar 2018 01:29:29 -0700 (PDT) Received: from mail-vk0-f52.google.com (mail-vk0-f52.google.com. [209.85.213.52]) by smtp.gmail.com with ESMTPSA id y12sm2847269uad.8.2018.03.12.01.29.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Mar 2018 01:29:27 -0700 (PDT) Received: by mail-vk0-f52.google.com with SMTP id s1so5684649vke.5 for ; Mon, 12 Mar 2018 01:29:26 -0700 (PDT) X-Received: by 10.31.1.70 with SMTP id 67mr4610353vkb.97.1520843366373; Mon, 12 Mar 2018 01:29:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.0.99 with HTTP; Mon, 12 Mar 2018 01:29:06 -0700 (PDT) In-Reply-To: <1520843103.1513.8.camel@bootlin.com> References: <20180220044425.169493-20-acourbot@chromium.org> <1520440654.1092.15.camel@bootlin.com> <6470b45d-e9dc-0a22-febc-cd18ae1092be@gmail.com> <1520842245.1513.5.camel@bootlin.com> <1520843103.1513.8.camel@bootlin.com> From: Tomasz Figa Date: Mon, 12 Mar 2018 17:29:06 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFCv4,19/21] media: vim2m: add request support To: Paul Kocialkowski Cc: Dmitry Osipenko , Alexandre Courbot , Mauro Carvalho Chehab , Hans Verkuil , Laurent Pinchart , Pawel Osciak , Marek Szyprowski , Sakari Ailus , Gustavo Padovan , Linux Media Mailing List , Linux Kernel Mailing List , Maxime Ripard 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, Mar 12, 2018 at 5:25 PM, Paul Kocialkowski wrote: > Hi, > > On Mon, 2018-03-12 at 17:15 +0900, Tomasz Figa wrote: >> Hi Paul, Dmitry, >> >> On Mon, Mar 12, 2018 at 5:10 PM, Paul Kocialkowski >> wrote: >> > Hi, >> > >> > On Sun, 2018-03-11 at 22:42 +0300, Dmitry Osipenko wrote: >> > > Hello, >> > > >> > > On 07.03.2018 19:37, Paul Kocialkowski wrote: >> > > > Hi, >> > > > >> > > > First off, I'd like to take the occasion to say thank-you for >> > > > your >> > > > work. >> > > > This is a major piece of plumbing that is required for me to add >> > > > support >> > > > for the Allwinner CedarX VPU hardware in upstream Linux. Other >> > > > drivers, >> > > > such as tegra-vde (that was recently merged in staging) are also >> > > > badly >> > > > in need of this API. >> > > >> > > Certainly it would be good to have a common UAPI. Yet I haven't >> > > got my >> > > hands on >> > > trying to implement the V4L interface for the tegra-vde driver, >> > > but >> > > I've taken a >> > > look at Cedrus driver and for now I've one question: >> > > >> > > Would it be possible (or maybe already is) to have a single IOCTL >> > > that >> > > takes input/output buffers with codec parameters, processes the >> > > request(s) and returns to userspace when everything is done? >> > > Having 5 >> > > context switches for a single frame decode (like Cedrus VAAPI >> > > driver >> > > does) looks like a bit of overhead. >> > >> > The V4L2 interface exposes ioctls for differents actions and I don't >> > think there's a combined ioctl for this. The request API was >> > introduced >> > precisely because we need to have consistency between the various >> > ioctls >> > needed for each frame. Maybe one single (atomic) ioctl would have >> > worked >> > too, but that's apparently not how the V4L2 API was designed. >> > >> > I don't think there is any particular overhead caused by having n >> > ioctls >> > instead of a single one. At least that would be very surprising >> > IMHO. >> >> Well, there is small syscall overhead, which normally shouldn't be >> very painful, although with all the speculative execution hardening, >> can't be sure of anything anymore. :) > > Oh, my mistake then, I had it in mind that it is not really something > noticeable. Hopefully, it won't be a limiting factor in our cases. With typical frame rates achievable by hardware codecs, I doubt that it would be a limiting factor. We're using a similar API (a WiP version of pre-Request API prototype from long ago) in Chrome OS already without any performance issues.