Commit 4ed09565 authored by Mikko Perttunen's avatar Mikko Perttunen Committed by Thierry Reding
Browse files

drm/tegra: gem: Open code drm_prime_gem_destroy



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

Signed-off-by: default avatarMikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240424051335.2872574-1-cyndis@kapsi.fi
parent 3cb6e7c2
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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);
	}