[PATCH v5 17/21] drm/tegra: Set resv fields when importing/exporting GEMs

Mikko Perttunen
2021-01-11T13:02:14Z

To allow sharing of implicit fences when exporting/importing dma_buf
objects, set the 'resv' fields when importing or exporting GEM
objects.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
---
drivers/gpu/drm/tegra/gem.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
index 26af8daa9a16..731e6bdc01b4 100644
--- a/drivers/gpu/drm/tegra/gem.c
+++ b/drivers/gpu/drm/tegra/gem.c
@@ -431,6 +431,7 @@ static struct tegra_bo *tegra_bo_import(struct drm_device *drm,
}

bo->gem.import_attach = attach;
+ bo->gem.resv = buf->resv;

return bo;

@@ -683,6 +684,7 @@ struct dma_buf *tegra_gem_prime_export(struct drm_gem_object *gem,
exp_info.size = gem->size;
exp_info.flags = flags;
exp_info.priv = gem;
+ exp_info.resv = gem->resv;

return drm_gem_dmabuf_export(gem->dev, &exp_info);
}
--
2.30.0