Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp709379lqp; Wed, 12 Jun 2024 13:59:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVSZl9ZCKNQbA/7EXgiJzp7M0fHmYD+nf070Fu8tPbmskiUdzv2XX3aFb5K5sNlvygJUpWwCMZnQhRqhcCpZkMOnKSE0NmCzA4ZJrGKnw== X-Google-Smtp-Source: AGHT+IHEIldkeVRYeg6szy3n+4XyKBQlku0ph/6B1nEevGHP4T8C8JPYq9nDeG5tXvnYQL0Jw20w X-Received: by 2002:a05:6a00:2d0f:b0:705:b0aa:a6bf with SMTP id d2e1a72fcca58-705bcdd8effmr3607113b3a.2.1718225958036; Wed, 12 Jun 2024 13:59:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718225958; cv=pass; d=google.com; s=arc-20160816; b=Zw1ZxJC0xIRNHhJFhYQqXcfoYtU1q5Lvx/ilBlrQiwI55yAd+fbY/cBNurqBmR2QFv P9s1GVPL3xbtcxayUbIXcADwg2tzWC/0Cu2y8LHQQZllcoXw5oSjdhV8TG2vzUkwaHwO hhL1GYyurAfpVl8fWeqyFdXHWp4JDTjvXYujG4U3YLLF0hQJ674eZKlahathXt4z+Gqv KMjm/5x3yixyypVST5tvTKeaQLpLFtKS+r/XY/Tw4Ln5php4LQi0IBxI8HdVbcDyppEb 9sZipfOvH3AE3fD/QHTxU+w2Y7ye82HT8tY8Lx3ZXH7CLWDYeuy0qhS9UiQjernHz3jT iEGA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=onNKzjgA3bLnrhQ91DOWISsPRYS3ZKDz36/FANmYGs0=; fh=hIadr4++BTHd/5C11Wk63Yji1JyMibdWxX5ccbKez5g=; b=bHDb11MJ9J7PCQjoScTub12KM4tkUREdrPiU/TOWlGYRe6o8ovTy3JeGKojc1clSAt ifyGauKtXEw3uoy7gBtg1A8XV+5N3A4iBk51+BcijOo6DyFG88QovfZ36cNRsJ5GQF7u /yKMAX3HHn1Pxu0qUCkKfP04Vf2XW/xUBlR4Wo2GbP6w8RZbZGhSb0Lq+gIMcupjm3te YwrPDQZOy6vj6FLzrGdhR9ul+ypqn/Tja7PMAhPD0HMKxewXDTH7U61RFRc8cvxL6bol 0u+J6clamJa+AagmhmPmhVTcMOjXVYhAUJDci+RubMEMQpjPUIe/tcpe9bsnXsV7f9mK UnAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Z6SruB8v; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-212250-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212250-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6e67b66c7aesi8959030a12.553.2024.06.12.13.59.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 13:59:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212250-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Z6SruB8v; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-212250-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212250-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2FFC2281BB5 for ; Wed, 12 Jun 2024 20:59:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0387985654; Wed, 12 Jun 2024 20:59:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Z6SruB8v" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 A86D384A56; Wed, 12 Jun 2024 20:59:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718225949; cv=none; b=GJqrVB2he+ZHZd9nltygiG+i4FSzzaRc6w0au9V7XlClVs4tzToSOwjKFxU2ILjXiQTsWnO9K1cqVU7GmAqa4LnAcm6V9bHCk1OMWPfFdqJ5rU1P8gqh3FpbgLupQCXCwMtsDnTxpuGuomU4B0flXi91RyVeugKD9HYdYDmFoMg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718225949; c=relaxed/simple; bh=onNKzjgA3bLnrhQ91DOWISsPRYS3ZKDz36/FANmYGs0=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=Dp+M16EKnEcD99NtEMaXoIzpCxUh2tOX8b5XtEI/QDL9j7oILBne/Mhw4JuNQzTSowUTQzGihSFDrJLvuahPtkUB7dZq8Qi9Ij0H19HFdThPzQNzexV16u9ARye0Qf3sDnEh3exnuMwuYMz6YUpIMlhYsSY7vriLh0VeQK4CeN8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=Z6SruB8v; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1718225945; bh=onNKzjgA3bLnrhQ91DOWISsPRYS3ZKDz36/FANmYGs0=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Z6SruB8vNB2Y/DCbnrkLaXh5mzh2EQttTZ7L0+bm+N+eDH5MSkb20HkUQXyh6LOBI 9cavqK2YXc/0rKjRSMlWHPeBvck/f/qF+hj1iZVV7ekg8fGNMvwlJ+aG84l9aIMBV9 9fDyuaOLcmxPxCQW6mvwp8QUEP+jXIFfYV4TGk4pV5e7XacxMAUzqkwBlU6lPM/rGY 9WV4sfKLkd8js0+YWSMleBhIadlZFtTAUjKROa13xR57DO8TPUzpQaNDVf35WhsTJU 8+0uTUQg8SoOxLR1yp8jCc2B9DcdmvJWaRg3+OovviNW2RjT6XT5y1wU/WY2S+FIaM yqeV0UiHFGt9w== Received: from nicolas-tpx395.localdomain (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nicolas) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 207F4378020D; Wed, 12 Jun 2024 20:59:02 +0000 (UTC) Message-ID: <03aca2439ac31ec01b24233384cc8c8d5179df02.camel@collabora.com> Subject: Re: [PATCH v6,04/24] v4l: add documentation for restricted memory flag From: Nicolas Dufresne To: Laurent Pinchart Cc: Tomasz Figa , Yunfei Dong , Jeffrey Kardatzke , =?ISO-8859-1?Q?N=EDcolas?= "F . R . A . 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 =?ISO-8859-1?Q?K=F6nig?= , 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 Date: Wed, 12 Jun 2024 16:58:58 -0400 In-Reply-To: <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> <20240612202507.GT28989@pendragon.ideasonboard.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.2 (3.52.2-1.fc40) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hi, Le mercredi 12 juin 2024 =C3=A0 23:25 +0300, Laurent Pinchart a =C3=A9crit= =C2=A0: > On Wed, Jun 12, 2024 at 03:43:58PM -0400, Nicolas Dufresne wrote: > > Le mercredi 12 juin 2024 =C3=A0 13:37 +0900, Tomasz Figa a =C3=A9crit= =C2=A0: > > > > Why is this flag needed ? Given that the usage model requires the V= 4L2 > > > > 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 ? > > >=20 > > > Given that the flag is specified at REQBUF / CREATE_BUFS time, it's > > > actually useful to tell the driver the queue is operating in restrict= ed > > > (aka secure) mode. > > >=20 > > > 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 pa= in. > > > So I'd say that the design being proposed here makes things simpler a= nd > > > more clear, even if it doesn't add any extra functionality. > >=20 > > There is few more reasons I notice in previous series (haven't read the= latest): > >=20 > > - The driver needs to communicate through the OPTEE rather then SCP and= some > > communication are needed just to figure-out things like supported profi= le/level > > resolutions etc. > > - The driver needs to allocate auxiliary buffers in secure heap too, al= location > > at runtime are not the best >=20 > Will the same driver support both modes on the same system ? Yes, as per this implementation, it seems you can flip from one mode to ano= ther even on the same instance. Nicolas >=20 > > Note that the discussion around this flag already took place in the ver= y first > > iteration of the serie, it was originally using a CID and that was a pr= oposed > > replacement from Hans. >=20