Skip to content

Commit 5854df5

Browse files
committed
Merge tag 'drm-xe-fixes-2025-03-20' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes
Driver Changes: - Fix for an error if exporting a dma-buf multiple time (Tomasz) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/Z9xalLaCWsNbh0P0@fedora
2 parents d273872 + 50af7ca commit 5854df5

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

drivers/gpu/drm/xe/xe_bo.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,6 @@ static inline unsigned int xe_sg_segment_size(struct device *dev)
341341
return round_down(max / 2, PAGE_SIZE);
342342
}
343343

344-
#if IS_ENABLED(CONFIG_DRM_XE_KUNIT_TEST)
345344
/**
346345
* xe_bo_is_mem_type - Whether the bo currently resides in the given
347346
* TTM memory type
@@ -356,4 +355,3 @@ static inline bool xe_bo_is_mem_type(struct xe_bo *bo, u32 mem_type)
356355
return bo->ttm.resource->mem_type == mem_type;
357356
}
358357
#endif
359-
#endif

drivers/gpu/drm/xe/xe_dma_buf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static int xe_dma_buf_pin(struct dma_buf_attachment *attach)
5858
* 1) Avoid pinning in a placement not accessible to some importers.
5959
* 2) Pinning in VRAM requires PIN accounting which is a to-do.
6060
*/
61-
if (xe_bo_is_pinned(bo) && bo->ttm.resource->placement != XE_PL_TT) {
61+
if (xe_bo_is_pinned(bo) && !xe_bo_is_mem_type(bo, XE_PL_TT)) {
6262
drm_dbg(&xe->drm, "Can't migrate pinned bo for dma-buf pin.\n");
6363
return -EINVAL;
6464
}

0 commit comments

Comments
 (0)