Re: [PATCH] drm/nouveau: Wire up dmem cgroups

[email protected]
Newsgroups org.freedesktop.lists.nouveau,org.freedesktop.lists.dri-devel
Message-ID <[email protected]>
Hi! I'm sorry, I have no clue how this patch got overlooked. Thank you
for the contribution.

Reviewed-by: Lyude Paul <[email protected]>

I will push this upstream in just a moment

On Fri, 2026-04-10 at 10:13 +0200, Natalie Vock wrote:
> Userspace can now make use of memory protection via dmem cgroups. Let
> nouveau benefit from this as well by registering the vram region with
> the dmem cgroup controller.
> 
> This patch adapts the approach amdgpu and Xe have taken for enabling
> dmem cgroups.
> 
> Signed-off-by: Natalie Vock <[email protected]>
> ---
>  drivers/gpu/drm/nouveau/nouveau_ttm.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c
> b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> index ad01f922aa86a..860bca7e3ce28 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
> @@ -188,6 +188,11 @@ nouveau_ttm_init_vram(struct nouveau_drm *drm)
>  
>  		man->func = &nouveau_vram_manager;
>  
> +		man->cg = drmm_cgroup_register_region(drm->dev,
> "vram",
> +						      drm-
> >gem.vram_available);
> +		if (IS_ERR(man->cg))
> +			return PTR_ERR(man->cg);
> +
>  		ttm_resource_manager_init(man, &drm->ttm.bdev,
>  					  drm->gem.vram_available >>
> PAGE_SHIFT);
>  		ttm_set_driver_manager(&drm->ttm.bdev, TTM_PL_VRAM,
> man);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.