Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp699454lqp; Wed, 12 Jun 2024 13:33:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUgANUFfG6QCGgdNwhqhuOvyexGqETAu8cLU6PLQKVBecIsq2nHpS0Wk8Lw5FYaCyGjtcLzPWaUA7rK+ADR1+zw1SaJ5W0j0excFLrjRA== X-Google-Smtp-Source: AGHT+IH9J5SMiXTGBwC+NdF2v0jgES7jHe7Ia1HTRmdjECRqj2s63DsSmZ7hH6QKXAxfd/Nur+uZ X-Received: by 2002:a17:902:e551:b0:1f4:a04e:8713 with SMTP id d9443c01a7336-1f84e32be91mr10948265ad.28.1718224399279; Wed, 12 Jun 2024 13:33:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718224399; cv=pass; d=google.com; s=arc-20160816; b=AGvAf8NUuxavzb6YTUgyVT2ZYL6zGrbxBsHsyTtC0Fg1+0KmSFTOPRrWc/g/bpBDvR 3ch3UHfm3yVhFGqC/W8CyQLhKFA52RRnxSiO+WldKhBbL6BmrajWNTGEuqlFUwps+x/y ljyT4rBU0Hubk35od/i8DWPfhrvQ6aTq33oi7w+L603rfFRRekUCp+3+/zpYzu7v5jCe 9Ber6jEeDo+W331/ZQkYmCOB/TPKPTnC/b7Gl6UYW6uhzghqPqPSUY7iXFUUBdFWqHdg U1MF8lffVQ/ueWHnqdT142bLNx5YGsTjkAUXmtzzjJcTnxYd7LgY5bgsq1AbZKc3YZ/n iPNw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PaC74ph2B4sszZqK3hgeEld9ICYHpkTErRTyz8f3NpY=; fh=A50OpsDoeCc3vE99sH/5B4gHw6pvX/JxnDmA/U8joJI=; b=Y2Ga/gJDCJP6EiYttRtgNn+09vTiUqDyQ9QSqoR0X5zUolUv5fIDnjD2t9oWXO5jXy /7cePof87ZVT15ZyfoK3NT5SFg/veogqF6OTY+tN5+mKrCcCPl+Pu6y54WtJJbs1ttHc NF99IKqJLpsBN9eFEvfzzI92RQRGEAnI6AhyzU1wSWuUKzPlPwiRNsGfVYGWBDUeZpcm ABpTMojoVRymPXaYb6dJbMdRq8xosceYXlJUjlUuv+m5SKBAoct6nNq0437hmTg/qcY8 vSR8/HSrn564Sq7iG4Kx7OxB2w/4RGyy2C6irpfOGbJzX4RgvLHelzyE9yp55LVZ+sLN EwKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=i1EJeHyE; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-212220-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212220-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f737b1e033si35491565ad.232.2024.06.12.13.33.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 13:33:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212220-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=i1EJeHyE; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-212220-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212220-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 160F4B235C7 for ; Wed, 12 Jun 2024 20:27:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4A50084DFE; Wed, 12 Jun 2024 20:25:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="i1EJeHyE" 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 1BAEA84D2C; Wed, 12 Jun 2024 20:25:28 +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=1718223930; cv=none; b=ZT6aTDpMXW74o1CLzgOVHfe2Hkn9NpLT7VBqdhDvN4oMmfs+/qWNRenLSq5TPNjo1XHD0DADFl+Lj8IMkNHlHaN1xHozOEHluC7kbRnwDA8jPOPy+ICGA6ks21uPThlmU5uEW+fuI08CAK6pwSnMC+2n47M1lFRgmBnILtOzRjw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718223930; c=relaxed/simple; bh=0Rgb+lTc0MFdKvGyTfrXC3aT7qcl8gWlicq53gT7wlg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Vgfo3SIIYyIRfhywdEJJn/oRFF5oagJyzM/HsDHQDnt57EdKN2ai+UnRv+aIiZCWqHf4zwyvDIj3Ysmax63ep6oGTwSHkF3dw8HzFwqptQRT2pl+IZJZuPFVCIscl210TgWdhaPRDCgkbjauGCmZWLp421ng9ct805wYeJ1vdZU= 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=i1EJeHyE; 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 919A812E4; Wed, 12 Jun 2024 22:25:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1718223913; bh=0Rgb+lTc0MFdKvGyTfrXC3aT7qcl8gWlicq53gT7wlg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=i1EJeHyEyBLVJMaCmD6MMJ/4PaC7EACNJSaWwx5Om1+rzKtu287UiS64ji4v+60wf G7n+RsI6Of8utZV06quo0BpHScZg7/Y4+g0Nou7FhlK5NyDV3nMJoC8DA7bBjpABhk qsbpo6SXUZPHufygXpHW8fK2Yxv8Aa/GvB45uVlA= Date: Wed, 12 Jun 2024 23:25:07 +0300 From: Laurent Pinchart To: Nicolas Dufresne Cc: Tomasz Figa , Yunfei Dong , Jeffrey Kardatzke , =?utf-8?B?TsOtY29sYXMgRiAuIFIgLiBBIC4=?= Prado , Nathan Hebert , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Sebastian Fricke , 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: <20240612202507.GT28989@pendragon.ideasonboard.com> References: <20240516122102.16379-1-yunfei.dong@mediatek.com> <20240516122102.16379-5-yunfei.dong@mediatek.com> <20240522111622.GA31185@pendragon.ideasonboard.com> <33d38919f3f94b6e1848aaee20cf52ac9c1df606.camel@collabora.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 Content-Transfer-Encoding: 8bit In-Reply-To: <33d38919f3f94b6e1848aaee20cf52ac9c1df606.camel@collabora.com> On Wed, Jun 12, 2024 at 03:43:58PM -0400, Nicolas Dufresne wrote: > Le mercredi 12 juin 2024 à 13:37 +0900, Tomasz Figa a écrit : > > > 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 ? > > > > Given that the flag is specified at REQBUF / CREATE_BUFS time, it's > > actually useful to tell the driver the queue is operating in restricted > > (aka secure) mode. > > > > I suppose we could handle that at the time of a first QBUF, but that > > would make the driver initialization and validation quite a bit of pain. > > So I'd say that the design being proposed here makes things simpler and > > more clear, even if it doesn't add any extra functionality. > > There is few more reasons I notice in previous series (haven't read the latest): > > - The driver needs to communicate through the OPTEE rather then SCP and some > communication are needed just to figure-out things like supported profile/level > resolutions etc. > - The driver needs to allocate auxiliary buffers in secure heap too, allocation > at runtime are not the best Will the same driver support both modes on the same system ? > Note that the discussion around this flag already took place in the very first > iteration of the serie, it was originally using a CID and that was a proposed > replacement from Hans. -- Regards, Laurent Pinchart