Re: [PATCH drm-misc-next v3 4/7] drm/gpuvm: common dma-resv per struct drm_gpuvm

From: Boris Brezillon
Date: Mon Sep 11 2023 - 17:28:52 EST


On Sat, 9 Sep 2023 17:31:11 +0200
Danilo Krummrich <dakr@xxxxxxxxxx> wrote:

> @@ -240,9 +240,22 @@ struct drm_gpuvm {
> * @ops: &drm_gpuvm_ops providing the split/merge steps to drivers
> */
> const struct drm_gpuvm_ops *ops;
> +
> + /**
> + * @d_obj: Dummy GEM object; used internally to pass the GPU VMs
> + * dma-resv to &drm_exec.
> + */
> + struct drm_gem_object d_obj;
> +
> + /**
> + * @resv: the &dma_resv for &drm_gem_objects mapped in this GPU VA
> + * space
> + */
> + struct dma_resv *resv;

Hm, I'd be tempted to drop this field and add a drm_gpuvm_resv() helper
returning vm->d_obj.resv;

> };