Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp360621ybv; Wed, 19 Feb 2020 01:00:10 -0800 (PST) X-Google-Smtp-Source: APXvYqzcMSgl4DqDLrzQJ9ML4+Ucbe1hQwrQ+2NWzGTw2Ta5oW1nCrdiDNILiih87s1mY2Yn6z81 X-Received: by 2002:aca:a857:: with SMTP id r84mr3814307oie.41.1582102810370; Wed, 19 Feb 2020 01:00:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582102810; cv=none; d=google.com; s=arc-20160816; b=HmZoIxKBMjW2hY9zVEjN5f1AQ508n2IIfvSwaABkQ8BfLLl2GSbzkqi0Ah+ugmV0Rt MeepezdG3UMmY7krV6OKgWHXjoO7+UussmRETf5UZB9hWY4fh+vHDHqtByky2KUqKQFX Gh7Fh2WCRKJttD1z2gKQPY59GqMxMMyWhz30JFBp5ngTNPA9GvybL1aOu2pWQQm4PEIl kzhuxREcNMvaHSprW8Z5NUopuDRno+hvmEIiMmny8EUJDeKsXdIUDYMuAvMazJdZe2vQ Ne8bYNiONlWrUkaLJUr8HiL8TOwvwisC56IpKDpD993YMBf3OxI/6+OKhL/Zoo3wQ1Di FJbw== 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=PegpeGKngB9YUd8cnkfdqnMSaOQRzxGEny6Bhf6FmTI=; b=LEADUBvYMluCsCLOgvB9tWL9GfqkWUp/YlK8O5J6PYjnCWNvZV4RfmKWzV94rMeeDV rUYjEOU6WpTWzl/VdgnShycDSNtbMU3ObzZuLM4c1hv8vi9Vd1gpr9SQGX0ZmWpjHDZB H94HsPzDBmu+pT+F+kWoISizxMpIZEF6EzyQ4h7SbYm8l69kCSSdIRgXbceEVsrT15Wc rtrcxqpqKy5MBmVaHCXK6y+4+56siOIa5YSmsUVwpJPwd3DCB7UzSm6pfQgDmYTsvIPF 2L3+m4uCniQ6b2sNVLcom1T4JYazNBJMDUiqTRNuw4HBigOAveZgdjCcgEWkpjy3sM17 6zLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=g0PgV16g; 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 o25si883337otk.28.2020.02.19.00.59.57; Wed, 19 Feb 2020 01:00:10 -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=g0PgV16g; 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 S1726514AbgBSI7t (ORCPT + 99 others); Wed, 19 Feb 2020 03:59:49 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:39237 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726202AbgBSI7t (ORCPT ); Wed, 19 Feb 2020 03:59:49 -0500 Received: by mail-pf1-f196.google.com with SMTP id 84so12173750pfy.6 for ; Wed, 19 Feb 2020 00:59:48 -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=PegpeGKngB9YUd8cnkfdqnMSaOQRzxGEny6Bhf6FmTI=; b=g0PgV16g1w2fq3UEjYLRBNIDmuTcArwJZEwe7WQpYhmo6vp2//2J7D7X0Rl0lKuPcp FBQe3HFw0wFGUVnmN6R7N9vO96IKW/Er/HWCglNp7hrJtysD2Izkytd+3Eaos4Aoxh4j PkuSCytqwBc17EhfGuchB2yjfuMBG6MSB0p6Q= 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=PegpeGKngB9YUd8cnkfdqnMSaOQRzxGEny6Bhf6FmTI=; b=jXmRtMShHGft+UIooiST4MMrTdFxz2F+ITkeq+U1/PIkIn7rOAqEXySzDtBJmi7Q8r REEZQ/JjZya8477TMrio/8O/p02onvGp6MyQGzcMf+wTFsxK1SgS7Acqe1spsA4RKFok x6XyK2nz1Lrgr5+qZ+fYnKy9Y/IgJEi/v1uXzjBY5Ji/xQs699zxF6PxTck+n0ySgO4W bgan+aYaR/v7uxnAomevtZyHpkpc0mIH8iN3lXQ2n0IqWnsdxEk3O5ipYZQ9t3kk1Qkz 1ab2PWOMmmVYOeRyRgqp0mlUSjrvNu/tgFzunQkk9FoomV0Xpkq8r0g6Jrp3wcTx3WeN 57YQ== X-Gm-Message-State: APjAAAWLLcwrpaJkmITUR0sx94GomtfIj++SPCcmmeyEYkGKN0Gh3NjB Rfmlix0e18ML1bgl46i3Ek2+ig== X-Received: by 2002:a63:9c12:: with SMTP id f18mr25412820pge.397.1582102788264; Wed, 19 Feb 2020 00:59:48 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:5bbb:c872:f2b1:f53b]) by smtp.gmail.com with ESMTPSA id b15sm1913686pft.58.2020.02.19.00.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 00:59:47 -0800 (PST) Date: Wed, 19 Feb 2020 17:59:45 +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][PATCHv2 05/12] videobuf2: handle V4L2_FLAG_MEMORY_NON_CONSISTENT flag Message-ID: <20200219085945.GE122464@google.com> References: <20200204025641.218376-1-senozhatsky@chromium.org> <20200204025641.218376-6-senozhatsky@chromium.org> <7f3310f9-8a12-1299-726d-2ca04207b32c@xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7f3310f9-8a12-1299-726d-2ca04207b32c@xs4all.nl> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (20/02/19 09:25), Hans Verkuil wrote: [..] > > diff --git a/Documentation/media/uapi/v4l/vidioc-create-bufs.rst b/Documentation/media/uapi/v4l/vidioc-create-bufs.rst > > index bd08e4f77ae4..68185e94b686 100644 > > --- a/Documentation/media/uapi/v4l/vidioc-create-bufs.rst > > +++ b/Documentation/media/uapi/v4l/vidioc-create-bufs.rst > > @@ -121,7 +121,14 @@ than the number requested. > > other changes, then set ``count`` to 0, ``memory`` to > > ``V4L2_MEMORY_MMAP`` and ``format.type`` to the buffer type. > > * - __u32 > > - - ``reserved``\ [7] > > + - ``flags`` > > + - Specifies additional buffer management attributes. Valid only when > > + queue reports :ref:`V4L2_BUF_CAP_SUPPORTS_CACHE_HINTS` capability. > > + Old drivers and applications must set it to zero. > > Drop the 'Valid only' sentence. The V4L2_FLAG_MEMORY_NON_CONSISTENT depends > on that capability, but other flags added in the future may not. The whole sentence, right? > Inside add a reference to the memory flags section created in patch 3. Sorry. Inside? [..] > > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h > > index 72efc1c544cd..169a8cf345ed 100644 > > --- a/include/uapi/linux/videodev2.h > > +++ b/include/uapi/linux/videodev2.h > > @@ -938,7 +938,10 @@ struct v4l2_requestbuffers { > > __u32 type; /* enum v4l2_buf_type */ > > __u32 memory; /* enum v4l2_memory */ > > __u32 capabilities; > > - __u32 reserved[1]; > > + union { > > + __u32 flags; > > + __u32 reserved[1]; > > + }; > > How about this: > > __u8 flags; > __u8 reserved[3]; > > That avoids the anonymous union and allows some space for future additions. Hmm. This way old apps, which clear out ->reserved, e.g. memset(&x.reserved, 0x00, sizeof(x.reserved)), won't clear out x.flags and can accidentally submit some unintended garbage. It's not the case with anon union. -ss