diff mbox series

[1/2] drm/tegra: gem: Open code drm_prime_gem_destroy

Message ID 20240424051335.2872574-1-cyndis@kapsi.fi
State Accepted
Headers show
Series [1/2] drm/tegra: gem: Open code drm_prime_gem_destroy | expand

Commit Message

Mikko Perttunen April 24, 2024, 5:13 a.m. UTC
From: Mikko Perttunen <mperttunen@nvidia.com>

Since we aren't using drm_gem_prime_import(_dev), for clarity don't
use the corresponding destroy function either.

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

Patch

diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
index b4eb030ea961..189861c6c630 100644
--- a/drivers/gpu/drm/tegra/gem.c
+++ b/drivers/gpu/drm/tegra/gem.c
@@ -520,9 +520,12 @@  void tegra_bo_free_object(struct drm_gem_object *gem)
 		tegra_bo_iommu_unmap(tegra, bo);
 
 	if (gem->import_attach) {
+		struct dma_buf *dmabuf = gem->import_attach->dmabuf;
+
 		dma_buf_unmap_attachment_unlocked(gem->import_attach, bo->sgt,
 						  DMA_TO_DEVICE);
-		drm_prime_gem_destroy(gem, NULL);
+		dma_buf_detach(dmabuf, gem->import_attach);
+		dma_buf_put(dmabuf);
 	} else {
 		tegra_bo_free(gem->dev, bo);
 	}