Skip to content

Commit 5278ca0

Browse files
author
Thomas Hellström
committed
drm/xe: Fix unexpected backmerge results
The recent backmerge from drm-next to drm-xe-next brought with it some silent unexpected results. One code snippet was added twice and a partial revert had merge errors. Fix that up to reinstate the affected code as it was before the backmerge. v2: - Commit log message rewording (Lucas DeMarchi) Fixes: 79790b6 ("Merge drm/drm-next into drm-xe-next") Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240423121114.39325-1-thomas.hellstrom@linux.intel.com (cherry picked from commit 06e7139) Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
1 parent 4a56c0e commit 5278ca0

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

drivers/gpu/drm/xe/xe_vm.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -863,11 +863,6 @@ static void xe_vma_destroy_late(struct xe_vma *vma)
863863
vma->ufence = NULL;
864864
}
865865

866-
if (vma->ufence) {
867-
xe_sync_ufence_put(vma->ufence);
868-
vma->ufence = NULL;
869-
}
870-
871866
if (xe_vma_is_userptr(vma)) {
872867
struct xe_userptr_vma *uvma = to_userptr_vma(vma);
873868
struct xe_userptr *userptr = &uvma->userptr;
@@ -2100,6 +2095,10 @@ vm_bind_ioctl_ops_create(struct xe_vm *vm, struct xe_bo *bo,
21002095
struct xe_vma_op *op = gpuva_op_to_vma_op(__op);
21012096

21022097
if (__op->op == DRM_GPUVA_OP_MAP) {
2098+
op->map.immediate =
2099+
flags & DRM_XE_VM_BIND_FLAG_IMMEDIATE;
2100+
op->map.read_only =
2101+
flags & DRM_XE_VM_BIND_FLAG_READONLY;
21032102
op->map.is_null = flags & DRM_XE_VM_BIND_FLAG_NULL;
21042103
op->map.dumpable = flags & DRM_XE_VM_BIND_FLAG_DUMPABLE;
21052104
op->map.pat_index = pat_index;
@@ -2294,6 +2293,8 @@ static int vm_bind_ioctl_ops_parse(struct xe_vm *vm, struct xe_exec_queue *q,
22942293
switch (op->base.op) {
22952294
case DRM_GPUVA_OP_MAP:
22962295
{
2296+
flags |= op->map.read_only ?
2297+
VMA_CREATE_FLAG_READ_ONLY : 0;
22972298
flags |= op->map.is_null ?
22982299
VMA_CREATE_FLAG_IS_NULL : 0;
22992300
flags |= op->map.dumpable ?
@@ -2438,7 +2439,7 @@ static int op_execute(struct drm_exec *exec, struct xe_vm *vm,
24382439
case DRM_GPUVA_OP_MAP:
24392440
err = xe_vm_bind(vm, vma, op->q, xe_vma_bo(vma),
24402441
op->syncs, op->num_syncs,
2441-
!xe_vm_in_fault_mode(vm),
2442+
op->map.immediate || !xe_vm_in_fault_mode(vm),
24422443
op->flags & XE_VMA_OP_FIRST,
24432444
op->flags & XE_VMA_OP_LAST);
24442445
break;

drivers/gpu/drm/xe/xe_vm_types.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,10 @@ struct xe_vm {
269269
struct xe_vma_op_map {
270270
/** @vma: VMA to map */
271271
struct xe_vma *vma;
272+
/** @immediate: Immediate bind */
273+
bool immediate;
274+
/** @read_only: Read only */
275+
bool read_only;
272276
/** @is_null: is NULL binding */
273277
bool is_null;
274278
/** @dumpable: whether BO is dumped on GPU hang */

0 commit comments

Comments
 (0)