]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/tegra: gem: Open code drm_prime_gem_destroy
authorMikko Perttunen <mperttunen@nvidia.com>
Wed, 24 Apr 2024 05:13:34 +0000 (08:13 +0300)
committerThierry Reding <treding@nvidia.com>
Thu, 29 Aug 2024 18:14:29 +0000 (20:14 +0200)
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>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240424051335.2872574-1-cyndis@kapsi.fi
drivers/gpu/drm/tegra/gem.c

index b4eb030ea961443c914258dc51d55660f4bc8fee..189861c6c630b5cc753ed5a8230e64735cf1dc11 100644 (file)
@@ -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);
        }