Received: by 10.213.65.16 with SMTP id m16csp226499imf; Mon, 12 Mar 2018 01:17:32 -0700 (PDT) X-Google-Smtp-Source: AG47ELu1O2nAUjAvM8emvO38ZbyTgeHRgFRyeaokalWmrI2evDW+4VYU0Q7CyQ4hQP2FtrmKDc5d X-Received: by 10.101.101.138 with SMTP id u10mr5761891pgv.299.1520842652278; Mon, 12 Mar 2018 01:17:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520842652; cv=none; d=google.com; s=arc-20160816; b=IqXzsYkEIDcr8mUOm3LUnvG5XNlZj1jb0qQ+sIblZQem8tfNUNxptxLHXmhXOYKetr 1dFokxtHxYOAFz+XBLtRBwWiwmjxYrJDWtI+JfUoDfwVAm2d2oPnjbuGJov9Wbn2DgF7 i+s3jpWsrv3a0fJDxDJIVM3idfuHbHbDmp/4ZWM5GV2J3YOYwqLrlk/QfWlYdgbvjpF1 pc34oicFjSXFQns3oN7aCg7Kc8BKlh1oKHE4ALoASBjb4mTqiRL3esvEDG+UCsjorl1J oYK/SOS4cBkVqvP/b4uC/YQNGDFJNm8coHONUshDnL8WCoUzmh9W0a3TaQafE6Em+STl lSZw== 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=hTbL9/RHEtGohggq7uDNUl/3ymumgnIL9xC9+oSmlu4=; b=dbvE1dsxKIUl2QRWHYij6hDoN0fd34y7iPkDcHnE09nQAkYrxKEc3ELJZ8+r7ijXjA DcZzTQdw81znW+e8jCO81IVgzty4i/dwSH/H6T92zQILvfk8ayzjUtEVWaQxdokSFU3l ZCzpoFpVsnI+3Sm6KM4ixV0gQx9aq10x0E0b5Mz79xJkKuldhVOVBm/Yj6ZNXn/PSwDn Y3LGRsRxOZWGnvPYde2gneOc3stp6gpxc0BGIaUEdzwAQHQAdtOLn0AemnNOQyXyYQo+ W217bTuJEt+n69+CtQLErmFasrtrfUNSise40uiIV4uiVx0cMHIAcsDr4JZik5CY1ji3 /iKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YSoqe+8Q; 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 x9-v6si5561461pln.571.2018.03.12.01.17.17; Mon, 12 Mar 2018 01:17:32 -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=YSoqe+8Q; 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 S1752075AbeCLIQL (ORCPT + 99 others); Mon, 12 Mar 2018 04:16:11 -0400 Received: from mail-vk0-f52.google.com ([209.85.213.52]:43659 "EHLO mail-vk0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750752AbeCLIQI (ORCPT ); Mon, 12 Mar 2018 04:16:08 -0400 Received: by mail-vk0-f52.google.com with SMTP id p189so5678292vkd.10 for ; Mon, 12 Mar 2018 01:16:08 -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=hTbL9/RHEtGohggq7uDNUl/3ymumgnIL9xC9+oSmlu4=; b=YSoqe+8QY6ADIr3hYAhltCwQmqtBIf43tG7/b//qkrhXzxL2Ks3Wipg5W1n/iLUHNi m8dVMyf34AXpsdQH1i+xWv7fBCI5vI73frm0AbC/daYq9UWRJzJ3pNEaOUhR6YL+g4uQ muYEcX3xigdhKt5ZqBpOaDQUE5qNUdWKG7tIs= 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=hTbL9/RHEtGohggq7uDNUl/3ymumgnIL9xC9+oSmlu4=; b=KGZM06G4GeD28OAHGF2fC1DignTUmQqRMy3a7rTDLXAwb6Xg3Bwp5f+WALwbpMRAM0 f68AaxkuOIzKSUrnZdPwzN2mwm3bismKWQE94aDbY75h4SyEgg8k2Mn0Is/pP/RQ9tRY StWtuhOb94D1j+tSdcOsJC+PO3GvioHwaAEnNJ0wJhOL/Szm/uQRPuTZU3wg5AnkYPXS tvRcrLvFCMbuPXoQdwQU2tKdYbvRPBkgwVuVKg3EkupVdPLONyDDdIWWSwuI8vsOvolS mw5VTt64xqwQL/YFHvLSdRQAgSi7FRIb33BlBIT4KytLwAblkpbctWj+8MIpKi8KkRhl yrTw== X-Gm-Message-State: AElRT7FA1RaqtV4/H2F9O8X53uRljQZsM2+KPkb70/i3SLrDmZb6/WXx l1D5NQlb+cPylmwoQoW8mH68sH0LZaI= X-Received: by 10.31.219.2 with SMTP id s2mr4314069vkg.89.1520842567380; Mon, 12 Mar 2018 01:16:07 -0700 (PDT) Received: from mail-ua0-f170.google.com (mail-ua0-f170.google.com. [209.85.217.170]) by smtp.gmail.com with ESMTPSA id b38sm1409643uad.21.2018.03.12.01.16.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Mar 2018 01:16:05 -0700 (PDT) Received: by mail-ua0-f170.google.com with SMTP id n24so6188149ual.12 for ; Mon, 12 Mar 2018 01:16:05 -0700 (PDT) X-Received: by 10.159.60.143 with SMTP id s15mr4907384uai.56.1520842564623; Mon, 12 Mar 2018 01:16:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.0.99 with HTTP; Mon, 12 Mar 2018 01:15:44 -0700 (PDT) In-Reply-To: <1520842245.1513.5.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> From: Tomasz Figa Date: Mon, 12 Mar 2018 17:15:44 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFCv4,19/21] media: vim2m: add request support To: Paul Kocialkowski , Dmitry Osipenko 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 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 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. :) Hans and Alex can correct me if I'm wrong, but I believe there is a more atomic-like API being planned, which would only need one IOCTL to do everything. However, that would be a more serious change to the V4L2 interfaces, so should be decoupled from Request API itself. Best regards, Tomasz