From da72ec01bbbcb4df75665c1515f49f131eeb088b Mon Sep 17 00:00:00 2001 From: Tvrtko Ursulin Date: Tue, 5 May 2026 10:44:06 +0100 Subject: [PATCH] plugins/amdgpu: Use original fd to export dmabuf There is no need to use the fd libdrm duplicated from the original fd. Just use the original one. Signed-off-by: Tvrtko Ursulin --- plugins/amdgpu/amdgpu_plugin_drm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/amdgpu/amdgpu_plugin_drm.c b/plugins/amdgpu/amdgpu_plugin_drm.c index a570dfd26..dee0a811a 100644 --- a/plugins/amdgpu/amdgpu_plugin_drm.c +++ b/plugins/amdgpu/amdgpu_plugin_drm.c @@ -307,7 +307,6 @@ int amdgpu_plugin_drm_dump_file(int fd, int id, struct stat *drm) union drm_amdgpu_gem_mmap mmap_args = { 0 }; int bo_contents_fd; int dmabuf_fd; - int device_fd; boinfo->size = entry->size; boinfo->alloc_flags = entry->alloc_flags; @@ -391,9 +390,7 @@ int amdgpu_plugin_drm_dump_file(int fd, int id, struct stat *drm) libdrm_initialized = true; } - device_fd = amdgpu_device_get_fd(h_dev); - - ret = drmPrimeHandleToFD(device_fd, boinfo->handle, 0, &dmabuf_fd); + ret = drmPrimeHandleToFD(fd, boinfo->handle, 0, &dmabuf_fd); if (ret) { pr_perror("Failed to get dmabuf fd from handle"); goto exit;