Commit 81d11b9d authored by Matthew Brost's avatar Matthew Brost Committed by Rodrigo Vivi

drm/xe: Adjust tile_present mask when skipping rebinds

If a rebind is skipped the tile_present mask needs to be updated for the
newly created vma to properly reflect the state of the vma.

Reported-by: <christoph.manszewski@intel.com>
Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent ebb00b28
...@@ -2340,6 +2340,10 @@ static int xe_vma_op_commit(struct xe_vm *vm, struct xe_vma_op *op) ...@@ -2340,6 +2340,10 @@ static int xe_vma_op_commit(struct xe_vm *vm, struct xe_vma_op *op)
op->flags |= XE_VMA_OP_COMMITTED; op->flags |= XE_VMA_OP_COMMITTED;
break; break;
case DRM_GPUVA_OP_REMAP: case DRM_GPUVA_OP_REMAP:
{
u8 tile_present =
gpuva_to_vma(op->base.remap.unmap->va)->tile_present;
prep_vma_destroy(vm, gpuva_to_vma(op->base.remap.unmap->va), prep_vma_destroy(vm, gpuva_to_vma(op->base.remap.unmap->va),
true); true);
op->flags |= XE_VMA_OP_COMMITTED; op->flags |= XE_VMA_OP_COMMITTED;
...@@ -2348,16 +2352,22 @@ static int xe_vma_op_commit(struct xe_vm *vm, struct xe_vma_op *op) ...@@ -2348,16 +2352,22 @@ static int xe_vma_op_commit(struct xe_vm *vm, struct xe_vma_op *op)
err |= xe_vm_insert_vma(vm, op->remap.prev); err |= xe_vm_insert_vma(vm, op->remap.prev);
if (!err) if (!err)
op->flags |= XE_VMA_OP_PREV_COMMITTED; op->flags |= XE_VMA_OP_PREV_COMMITTED;
if (!err && op->remap.skip_prev) if (!err && op->remap.skip_prev) {
op->remap.prev->tile_present =
tile_present;
op->remap.prev = NULL; op->remap.prev = NULL;
} }
}
if (op->remap.next) { if (op->remap.next) {
err |= xe_vm_insert_vma(vm, op->remap.next); err |= xe_vm_insert_vma(vm, op->remap.next);
if (!err) if (!err)
op->flags |= XE_VMA_OP_NEXT_COMMITTED; op->flags |= XE_VMA_OP_NEXT_COMMITTED;
if (!err && op->remap.skip_next) if (!err && op->remap.skip_next) {
op->remap.next->tile_present =
tile_present;
op->remap.next = NULL; op->remap.next = NULL;
} }
}
/* Adjust for partial unbind after removin VMA from VM */ /* Adjust for partial unbind after removin VMA from VM */
if (!err) { if (!err) {
...@@ -2365,6 +2375,7 @@ static int xe_vma_op_commit(struct xe_vm *vm, struct xe_vma_op *op) ...@@ -2365,6 +2375,7 @@ static int xe_vma_op_commit(struct xe_vm *vm, struct xe_vma_op *op)
op->base.remap.unmap->va->va.range = op->remap.range; op->base.remap.unmap->va->va.range = op->remap.range;
} }
break; break;
}
case DRM_GPUVA_OP_UNMAP: case DRM_GPUVA_OP_UNMAP:
prep_vma_destroy(vm, gpuva_to_vma(op->base.unmap.va), true); prep_vma_destroy(vm, gpuva_to_vma(op->base.unmap.va), true);
op->flags |= XE_VMA_OP_COMMITTED; op->flags |= XE_VMA_OP_COMMITTED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment