Skip to content

Commit e4d42ef

Browse files
committed
Revert "drm/tegra: gem: Don't attach dma-bufs when not needed"
JIRA: https://issues.redhat.com/browse/RHEL-113577 Upstream Status: RHEL only This reverts commit f5b8794. This commit was backported automatically as part of the DRM backport. "bo->dma_buf" is not available in this tree, revert to the previous free function. NOTE: This commit does not compile due to missing RHEL-specific fix-ups, which are split out into separate Git commits following this one. If git bisect selected this commit, run "git bisect skip" and try again. Repeat this until it selects a commit which compiles. Signed-off-by: José Expósito <jexposit@redhat.com>
1 parent f64c133 commit e4d42ef

File tree

1 file changed

+10
-11
lines changed
  • drivers/gpu/drm/tegra

1 file changed

+10
-11
lines changed

drivers/gpu/drm/tegra/gem.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -515,20 +515,19 @@ void tegra_bo_free_object(struct drm_gem_object *gem)
515515
dev_name(mapping->dev));
516516
}
517517

518-
if (tegra->domain) {
518+
if (tegra->domain)
519519
tegra_bo_iommu_unmap(tegra, bo);
520520

521-
if (drm_gem_is_imported(gem)) {
522-
dma_buf_unmap_attachment_unlocked(gem->import_attach, bo->sgt,
523-
DMA_TO_DEVICE);
524-
dma_buf_detach(gem->import_attach->dmabuf, gem->import_attach);
525-
}
526-
}
527-
528-
tegra_bo_free(gem->dev, bo);
521+
if (gem->import_attach) {
522+
struct dma_buf *dmabuf = gem->import_attach->dmabuf;
529523

530-
if (bo->dma_buf)
531-
dma_buf_put(bo->dma_buf);
524+
dma_buf_unmap_attachment_unlocked(gem->import_attach, bo->sgt,
525+
DMA_TO_DEVICE);
526+
dma_buf_detach(dmabuf, gem->import_attach);
527+
dma_buf_put(dmabuf);
528+
} else {
529+
tegra_bo_free(gem->dev, bo);
530+
}
532531

533532
drm_gem_object_release(gem);
534533
kfree(bo);

0 commit comments

Comments
 (0)