drm/ttm: use an operation ctx for ttm_tt_populate in ttm_bo_driver (v2)
forward the operation context to ttm_tt_populate as well, and the ultimate goal is swapout enablement for reserved BOs. v2: squash in fix for vboxvideo Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Roger He <Hongbo.He@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -124,13 +124,17 @@ int virtio_gpu_object_get_sg_table(struct virtio_gpu_device *qdev,
|
||||
int ret;
|
||||
struct page **pages = bo->tbo.ttm->pages;
|
||||
int nr_pages = bo->tbo.num_pages;
|
||||
struct ttm_operation_ctx ctx = {
|
||||
.interruptible = false,
|
||||
.no_wait_gpu = false
|
||||
};
|
||||
|
||||
/* wtf swapping */
|
||||
if (bo->pages)
|
||||
return 0;
|
||||
|
||||
if (bo->tbo.ttm->state == tt_unpopulated)
|
||||
bo->tbo.ttm->bdev->driver->ttm_tt_populate(bo->tbo.ttm);
|
||||
bo->tbo.ttm->bdev->driver->ttm_tt_populate(bo->tbo.ttm, &ctx);
|
||||
bo->pages = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
|
||||
if (!bo->pages)
|
||||
goto out;
|
||||
|
Reference in New Issue
Block a user