Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4343108ybl; Tue, 21 Jan 2020 18:19:19 -0800 (PST) X-Google-Smtp-Source: APXvYqwvXg4p81SGwH0whFF+El/N9qU1i0YxPM8GVtNaoFhUok2O+fCekiTmGBpqzfhAitTo0onG X-Received: by 2002:a9d:6c0d:: with SMTP id f13mr5592490otq.354.1579659559630; Tue, 21 Jan 2020 18:19:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579659559; cv=none; d=google.com; s=arc-20160816; b=vWMZGhAh2NeFkpXxv3vrMz8o00KTVYO5vHR/6BdOraCZSj0RnMoNmCSYkdPTb/gJyT gMOwcGle67qgGta1ZiVGpVvvzGbFKLlmyFqHtPWM1mVZ3cujcsb7GSDIs9TLk6G50bjc QPzYs7z+sv7FFrytufAvVcMiz4BVczMqHVXB0scBbe3zhP5X+8aUPx5J0rjz3VTp8dfK /W0fsMVO1zXcMBZ0oR6Myjo9yxbgKl/BE0HlcL4WWvXJGAWdaLMQIV57denwERqz9qr/ 14uJXVoypblOfF44Bo5UeKSBnuv4R1ujuCSNtF4JSgnMNbgWTQrs3us5PeIgxVunyrMA gWbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=enRG0ShwLXeGYHvObL4NGsrxBaYIwIDgQKM6w41JByw=; b=ynRrL8nEA+UkUWICG12Z0RWotXNKw91ZgPDL2uq/NKZvWKxxbJ0SGSw/llsogSJO7M ubCtxpFaSXLi9Sijn+t/eDuWIhVlgKjPkfqOtgJFdp/NEVUomlO3TEmUAMgNEPvwKl7T fKOYTcA5Iz+9bnMTblL/NgjO+dDX2kp4FBe3cvtzd0dIS6oqp/YuoGiT6+aUsFKKT/N0 JpBT7ysSYBScibAnFB6HmLmVl/tH3Rnsab3D2CSOp0v5xUB78OCE0m9EVGlpkqNCTt7Y WGR+072SbjMNpHLTLLcYMeHBXhVm+t9EQB1riZ+AEVaU0Dpi/v1JjVBFSAw8Fw0gK9PT 3bVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KdhuEslf; 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 b24si22948964otf.34.2020.01.21.18.19.04; Tue, 21 Jan 2020 18:19:19 -0800 (PST) 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=KdhuEslf; 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 S1727590AbgAVCSI (ORCPT + 99 others); Tue, 21 Jan 2020 21:18:08 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:42009 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726584AbgAVCSI (ORCPT ); Tue, 21 Jan 2020 21:18:08 -0500 Received: by mail-pg1-f196.google.com with SMTP id s64so2573384pgb.9 for ; Tue, 21 Jan 2020 18:18:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=enRG0ShwLXeGYHvObL4NGsrxBaYIwIDgQKM6w41JByw=; b=KdhuEslf2cFzSS+yxCwoePZczvah0zd5geGuKBIlFckjXudk84+yt7u6yx3+ShP8QK /IIGDER6QVUhsUhsWFeW2Ykq1CZYo94Cxt/+bx9C8Z0WXpn5bxxYTTaZ4ZorMF8a3MAi IW3xmTAtIY7bCz/CVBbqKnjHDyjTwXPHk79Hc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=enRG0ShwLXeGYHvObL4NGsrxBaYIwIDgQKM6w41JByw=; b=d6t2Zai4Q948x+uyLkopYmUQsbypd0MRP7Y6Bd9/Wjz5E/c+0ZarFr/xS5dxwoSl16 CcTbya3KDDd/yx5Bg3fHQcT/BG1wHrAOrrd7YYHw3vGPLUiLYXz8cWCyLTwS6hlJ0nMD 94T/bPj9pjGofnWLFP2Zwf1VKTC0YTQl8V12epWcaxDzbJReNPXw42Xe2TWWunYYiCY8 6SgM84ojUfET00S9I+Q2vFyIkYIghVnG6av1SLPzYA93SwOTP8F0xJYg/I13FYwSprk0 iP2YPHb2wImqYdp602MCP0HAd+XdpejcZrvp/2O261FkJGl0IPcS3LSX3m0oNdB3FqNO Ogwg== X-Gm-Message-State: APjAAAWnN1ysnLh4+X/GJb8bu83cPvgdplWq9tdBIf2d/Tg8GtrE7O5X 4rMRbCjbW1ghtqNGVjeUHMPyKHVkx8a4XQ== X-Received: by 2002:a63:e201:: with SMTP id q1mr8430254pgh.441.1579659487867; Tue, 21 Jan 2020 18:18:07 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:5bbb:c872:f2b1:f53b]) by smtp.gmail.com with ESMTPSA id 17sm45649020pfv.142.2020.01.21.18.18.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2020 18:18:07 -0800 (PST) Date: Wed, 22 Jan 2020 11:18:05 +0900 From: Sergey Senozhatsky To: Hans Verkuil Cc: Sergey Senozhatsky , Hans Verkuil , Tomasz Figa , Mauro Carvalho Chehab , Kyungmin Park , Marek Szyprowski , Sakari Ailus , Laurent Pinchart , Pawel Osciak , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH 05/15] videobuf2: handle V4L2_FLAG_MEMORY_NON_CONSISTENT in REQBUFS Message-ID: <20200122021805.GE149602@google.com> References: <20191217032034.54897-1-senozhatsky@chromium.org> <20191217032034.54897-6-senozhatsky@chromium.org> <8d0c95c3-64a2-ec14-0ac2-204b0430b2b4@xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8d0c95c3-64a2-ec14-0ac2-204b0430b2b4@xs4all.nl> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (20/01/10 10:55), Hans Verkuil wrote: > On 12/17/19 4:20 AM, Sergey Senozhatsky wrote: > > This patch lets user-space to request a non-consistent memory > > allocation during REQBUFS ioctl call. We use one bit of a > > ->reserved[1] member of struct v4l2_requestbuffers, which is > > now renamed to ->flags. > > > > There is just 1 four-byte reserved area in v4l2_requestbuffers > > struct, therefore for backward compatibility ->reserved and > > ->flags were put into anonymous union. > > > > Signed-off-by: Sergey Senozhatsky > > --- > > Documentation/media/uapi/v4l/vidioc-reqbufs.rst | 14 ++++++++++++-- > > drivers/media/common/videobuf2/videobuf2-v4l2.c | 14 ++++++++++++-- > > drivers/media/v4l2-core/v4l2-ioctl.c | 3 --- > > include/uapi/linux/videodev2.h | 5 ++++- > > 4 files changed, 28 insertions(+), 8 deletions(-) > > > > diff --git a/Documentation/media/uapi/v4l/vidioc-reqbufs.rst b/Documentation/media/uapi/v4l/vidioc-reqbufs.rst > > index d0c643db477a..9b69a61d9fd4 100644 > > --- a/Documentation/media/uapi/v4l/vidioc-reqbufs.rst > > +++ b/Documentation/media/uapi/v4l/vidioc-reqbufs.rst > > @@ -112,10 +112,20 @@ aborting or finishing any DMA in progress, an implicit > > ``V4L2_MEMORY_MMAP`` and ``type`` set to the buffer type. This will > > free any previously allocated buffers, so this is typically something > > that will be done at the start of the application. > > - * - __u32 > > + * - union > > + - (anonymous) > > + * - > > + - __u32 > > + - ``flags``\ [1] > > + - Specifies additional buffer management attributes. E.g. when > > + ``V4L2_FLAG_MEMORY_NON_CONSISTENT`` set vb2 backends may be allocated > > + in non-consistent memory. > > This should link to the table with these memory flags, rather than > effectively documenting V4L2_FLAG_MEMORY_NON_CONSISTENT again. OK. > You also probably meant "vb2 buffers" rather than "vb2 backends". Thanks. > > > + * - > > + - __u32 > > - ``reserved``\ [1] > > - A place holder for future extensions. Drivers and applications > > - must set the array to zero. > > + must set the array to zero, unless application wants to specify > > + buffer management ``flags``. > > I think support for this flag should be signaled as a V4L2_BUF_CAP capability. > If the capability is not set, then vb2 should set 'flags' to 0 to preserve the > old 'Drivers and applications must set the array to zero' behavior. The patch set adds V4L2_BUF_CAP_SUPPORTS_CACHE_HINTS towards the end of the series, I guess I can shuffle the patches and change the wording here. > The documentation for 'reserved[1]' should be changed to something like: > > Kept for backwards compatibility. Use ``flags`` instead. OK. -ss