Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp268981lqp; Wed, 22 May 2024 04:16:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWTrjZEeQ9k/cA7WAALFkas+Z+eL4YL31Tj5/4Iz6MgbA9GtitMVPYRDspdkLL2F12mrIC/OiSTaximWL6nUfpqsvHemEvPE8ftdn4fhA== X-Google-Smtp-Source: AGHT+IEkNA+PfM8f6nMGJxNfgisUSauXkDn30vtNk3iCGXPvTHZ1XqKHZ2XFRaSexk2jg+HZ/Ilb X-Received: by 2002:a05:622a:1648:b0:43b:173e:ce1b with SMTP id d75a77b69052e-43f7a30c519mr193350771cf.32.1716376602743; Wed, 22 May 2024 04:16:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716376602; cv=pass; d=google.com; s=arc-20160816; b=LSwKwn0f2D/Mohu+GF+0ttaAOYiavP1RQsGpOu4rNckIviUyKpG5Obz1xUfOl/1L3S 5GEXs7KyUGfWs4qtKIaWiQkPC3kB3Hge+0wGcXjJbkbh62J/cpnfqs615sNNwbWrQacx 1YbNTJx3X2qhoLW5uxaVceERik/gyDlM7j850mQD/2ZTZYw3XVc4VwNZlbB3rXVu/CnP klZ1I5mEC0u5DSSWim977TDHMMCyevyRSom2ew+n4ymwStYqT2YuuiTddbmHfCLBfOBR eBg3Cet6dUpYegYXlxgQL3Tc2kC1OW8U2bAKe/xt5EXLzzp3Snb2Km+xi9dBg13KNzrc bFrg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=b4I1m7xKVTyYsdzU1xyi4ewlcSDXoVx5WsGrUlhqQCQ=; fh=LFIa0wOVTtOr4duwiui4h7tO4TXqm3kMpAvQeXlgqHE=; b=vsEPr3/CVXWf8myiAGbvM3zoaVVeGYTktXVqIlHPOSYiJKCV2guPMNvMjdiu3pTg8h QRWssrZcxRCXIrlmbZVJhn3ooHh7+cONWyhrio9iIJZkIZ+vqb4Rfo/SFLySP+p7gpc+ CQVwfwHmT2SOR1XWPK2plRKpaL7tyl4Lw7kLIZjH3q0H5T1/ZVtSD6YOn5QnwDejQVJR CVvNS6+D0uY34/ezMvn0H4HNnRLBYfrJMq9uIX3OZnFGSh8i6pNxeQwTd4/WsZpncM4T YUllWid0pmmrFM92hda5sbymHboYhvmqQC145azb4aRsmYDk53NtvGozcPLYrsYJHk2y 536g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=YY5D39vj; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-186123-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186123-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43df549f6d7si94759601cf.143.2024.05.22.04.16.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 04:16:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186123-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=YY5D39vj; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-186123-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186123-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 798FD1C21DB3 for ; Wed, 22 May 2024 11:16:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B31E824B9; Wed, 22 May 2024 11:16:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="YY5D39vj" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D881680C07; Wed, 22 May 2024 11:16:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716376595; cv=none; b=funwipJ/ovDwnwi45jUguxxS//GSeORv93HfAbsP5p6KmGSs2th9VhXHTPIbX1y4kWiI1BdCn2ue18Kw+1h7uM92mLr2E8Z1BQGbQF6TfTPMQVD3gWLNWdei/coTQf2M2TfoIiaXCOA8Bx1Q4O4x0uEffifBGubd4rMSrhXHw3c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716376595; c=relaxed/simple; bh=q83AOrxhjHdDtbOcVJNIw+dm8Yj5lnBFmVhmfjLn9IA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sBd+7x1ii0B5Moz/s6bzup7Ud3/unpm5UKl9L2+Edj4QogBDbs9DFshVi8zbq8HN9xk0b6W7JVq8gI1CXmAuBtpCISnUxd49BIPgo8qS47sis9oHWNFIw3yo6pPGRj0Tb6cCi+Z6yIBR+KT2+VcIHAeY96Ts7mG1WKBv8upwiHg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=YY5D39vj; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id ED5DCD49; Wed, 22 May 2024 13:16:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1716376579; bh=q83AOrxhjHdDtbOcVJNIw+dm8Yj5lnBFmVhmfjLn9IA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YY5D39vjYu90YM40AKH7ctfUmXDtAh3vruu9Dqw2jQ0NLNg+p6WrLmo9V7u80L71G ULiTQnW/MDSY/YmaYPNEkMMkY14OWGsTrZo+WvhbojfStattNgZP5ollUYzcsHdSof gSbVh5HKYAenHcnPeB8iJ3mhIXdBV6fvJtxyM+zw= Date: Wed, 22 May 2024 14:16:22 +0300 From: Laurent Pinchart To: Yunfei Dong Cc: Jeffrey Kardatzke , =?utf-8?B?TsOtY29sYXMgRiAuIFIgLiBBIC4=?= Prado , Nathan Hebert , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Sebastian Fricke , Tomasz Figa , Mauro Carvalho Chehab , Marek Szyprowski , Chen-Yu Tsai , Yong Wu , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , Sumit Semwal , Brian Starkey , John Stultz , "T . J . Mercier" , Christian =?utf-8?B?S8O2bmln?= , Matthias Brugger , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Project_Global_Chrome_Upstream_Group@mediatek.com Subject: Re: [PATCH v6,04/24] v4l: add documentation for restricted memory flag Message-ID: <20240522111622.GA31185@pendragon.ideasonboard.com> References: <20240516122102.16379-1-yunfei.dong@mediatek.com> <20240516122102.16379-5-yunfei.dong@mediatek.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240516122102.16379-5-yunfei.dong@mediatek.com> Hi Jefrey, Thank you for the patch. On Thu, May 16, 2024 at 08:20:42PM +0800, Yunfei Dong wrote: > From: Jeffrey Kardatzke > > Adds documentation for V4L2_MEMORY_FLAG_RESTRICTED. > > Signed-off-by: Jeffrey Kardatzke > Signed-off-by: Yunfei Dong > --- > Documentation/userspace-api/media/v4l/buffer.rst | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/Documentation/userspace-api/media/v4l/buffer.rst b/Documentation/userspace-api/media/v4l/buffer.rst > index 52bbee81c080..807e43bfed2b 100644 > --- a/Documentation/userspace-api/media/v4l/buffer.rst > +++ b/Documentation/userspace-api/media/v4l/buffer.rst > @@ -696,7 +696,7 @@ enum v4l2_memory > > .. _memory-flags: > > -Memory Consistency Flags > +Memory Flags > ------------------------ > > .. raw:: latex > @@ -728,6 +728,14 @@ Memory Consistency Flags > only if the buffer is used for :ref:`memory mapping ` I/O and the > queue reports the :ref:`V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS > ` capability. > + * .. _`V4L2-MEMORY-FLAG-RESTRICTED`: > + > + - ``V4L2_MEMORY_FLAG_RESTRICTED`` > + - 0x00000002 > + - The queued buffers are expected to be in restricted memory. If not, an > + error will be returned. This flag can only be used with ``V4L2_MEMORY_DMABUF``. > + Typically restricted buffers are allocated using a restricted dma-heap. This flag > + can only be specified if the ``V4L2_BUF_CAP_SUPPORTS_RESTRICTED_MEM`` is set. Why is this flag needed ? Given that the usage model requires the V4L2 device to be a dma buf importer, why would userspace set the V4L2_BUF_CAP_SUPPORTS_RESTRICTED_MEM flag and pass a non-restricted buffer to the device ? The V4L2_BUF_CAP_SUPPORTS_RESTRICTED_MEM flag also needs to be documented in the relevant section, I don't think that's done in this series. > > .. raw:: latex > -- Regards, Laurent Pinchart