Received: by 10.213.65.68 with SMTP id h4csp17976imn; Mon, 12 Mar 2018 05:22:41 -0700 (PDT) X-Google-Smtp-Source: AG47ELtZ+WpZVuLhyXYVyV/UdREJVZHVy9rtvpFoUOnBd4XoGolJDlr364Gn6h50TP3KxfeMQmR/ X-Received: by 10.99.119.130 with SMTP id s124mr6427933pgc.337.1520857361355; Mon, 12 Mar 2018 05:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520857361; cv=none; d=google.com; s=arc-20160816; b=ronCerOz/Xu1v2zM6uksxjpS8baMLwHGCbvAP45KeAQvIMwJrJjw0JzENDvY202ry4 oHsJrY+SQ886jBkhw6M/aIL478sWeChlgVSEKipff3bG6WX3Frym0pLbSbp5iddRr3UN 1zbuzq2OQ6F3PXGgPpsZSv2w1/qr6tEW8DDjh523fQ8iGdAyjLRXfAPKbjkVNUa+uL9u 8Fd+oXVsn2YUAbRuC/QcohMMNoVwA0A/5Vu8qOinFJWIl+Vn92wjuCB3+xQIe5GndHjW aNd8ma97ZyDTTCPzK1UTfwtKINkaYvcxJkYF390IwcVR4zj93jclVwDOn2/0Wc1VN4pd C0ZA== 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:dkim-signature :arc-authentication-results; bh=fzUcS0zqb2jGEz41AbJJwyyVNVH6pEXHnfHXxbnyCzw=; b=gqdr8rdZcEQZSmO7amAYseby2lxQAnPA6LeJxBN2MVw85wEczdfsAXxAbpfHEo8+nC n+oLLgZTOW1RSEeccnGfTdE4BRQT16iHIDdCk2JyC0/jgfJwytJF/5cmVpO75yOQzDS1 BbSy3HBgXzn06fJJrtojgo31l7osjQDX5Yp4VsXxgqoLTP3Ea5+XzNzhsJCkK8VycAln 6N1s/OYAhTCqE37zCWdTNY/1peZoVlieRXitaOmy+nUOJgsvty6fPQZxJ5XUkW90d617 vhfOLXSgXJW0M9gsA151Cp3G23HbYurmxOQEavcgu6sqwGEmNzdUbcTFresYJ/TkEeD+ jU2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QDXyqM81; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y23si2085827pge.500.2018.03.12.05.22.26; Mon, 12 Mar 2018 05:22:41 -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=@gmail.com header.s=20161025 header.b=QDXyqM81; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932252AbeCLMVX (ORCPT + 99 others); Mon, 12 Mar 2018 08:21:23 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:45027 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932217AbeCLMVT (ORCPT ); Mon, 12 Mar 2018 08:21:19 -0400 Received: by mail-lf0-f68.google.com with SMTP id v9-v6so22856817lfa.11; Mon, 12 Mar 2018 05:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=fzUcS0zqb2jGEz41AbJJwyyVNVH6pEXHnfHXxbnyCzw=; b=QDXyqM81yanvg7h8yj9QNLU9g96nN6RDz+Uuufw826r447ygOYGB20zd3SjHfMUk0H Y7raSI1iFWr58xQGWrZ8ZtQoySFAiQKUk42QFUkJrL3OW+zWmdtUBQhgSniskD9xEY3s //iwuMmIPU3DE1DyMqMNd8X4L6LfRtKTuijJC8G8C+Dexxu/AFGF5Wz3hCPaLSFwnmAC A9/gq6YMEtfaxn2r7I7dKbo8keCyb2LKv6eXPSHSaADzu5I9C/Cdcxabp45NBW9d1kSp 5xPcuiG6XmoHNB8cm0/t2ALtXzrgSp1CR0ZNV5aGfa6PDY1CjTptkJgpNlHIbprKOsC2 EDyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fzUcS0zqb2jGEz41AbJJwyyVNVH6pEXHnfHXxbnyCzw=; b=eAQWoxQdHpOe/2I8Mv8VGU1UJ7ULYqFqRfMrP6TC1WO4YtSGFzFMoYvNCcOa0G058g 6Mpzn9pY7g4ei+wZniP30Gwk2yCXuRu95OI7aOBYLL3s1mBDpx0yev31sx9zc3merm6h xn+J/lR+ZoZ0H1cLSJH7uq0gWtaT9XfaWqxW1UtBtnJsZe7IOQedrBEQcrNePxzLIvKT RnX8KSFhTx4hookZAc4xFdD8AUGcTwrlUHVBqJT06s1M/Ml9bSDswPH66RHWjqRS/7Bp F7P+ifaXGvyxlmOWhwCHEmeVx7ThaJTw1qAxtYCbwgkkOeoPZjieON95KVsTVKfmx1Iy uWmw== X-Gm-Message-State: AElRT7Ho9z1kPHtJpADx/6FoqMPNm13QfKYn5LH1D+Rj7PMaAavL9rst Jf9nyjeDmwbm6QiuWTl/P0w= X-Received: by 10.46.87.72 with SMTP id r8mr5143932ljd.93.1520857277814; Mon, 12 Mar 2018 05:21:17 -0700 (PDT) Received: from [192.168.1.145] (ppp109-252-55-234.pppoe.spdop.ru. [109.252.55.234]) by smtp.googlemail.com with ESMTPSA id u1-v6sm1450742lff.72.2018.03.12.05.21.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Mar 2018 05:21:16 -0700 (PDT) Subject: Re: [RFCv4,19/21] media: vim2m: add request support To: Tomasz Figa , Paul Kocialkowski Cc: 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 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: Dmitry Osipenko Message-ID: <85a6fdc4-e01c-c6e4-d027-dea161e5b90e@gmail.com> Date: Mon, 12 Mar 2018 15:21:16 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12.03.2018 11:29, Tomasz Figa wrote: > 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. Thank you very much for the answers! The syscalls overhead is miserable in comparison to the rest of decoding, though I wanted to clarify whether there is a way to avoid it. Atomic API sounds like something that would suit well for that.