Skip to content

Commit 67e1e92

Browse files
committed
accel/amdxdna: Fix missing import_attach in amdxdna_gem_prime_import
Set gobj->import_attach in amdxdna_gem_prime_import() so that drm_gem_shmem_vmap_locked() takes the dma-buf import path instead of calling drm_gem_get_pages() on an object with a NULL file pointer. Without this, imported BOs (e.g. from virtio-gpu in QEMU) trigger a WARNING in drm_gem_get_pages and vmap fails with -EINVAL. Signed-off-by: Wendy Liang <wendy.liang@amd.com>
1 parent acbbf9c commit 67e1e92

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/accel/amdxdna/amdxdna_gem.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,7 @@ amdxdna_gem_prime_import(struct drm_device *dev, struct dma_buf *dma_buf)
871871
abo->attach = attach;
872872
abo->dma_buf = dma_buf;
873873
abo->type = AMDXDNA_BO_SHARE;
874+
gobj->import_attach = attach;
874875
gobj->resv = dma_buf->resv;
875876

876877
return gobj;

0 commit comments

Comments
 (0)