diff options
author | Christian König <christian.koenig@amd.com> | 2020-09-29 14:21:26 +0300 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2020-09-29 17:05:52 +0300 |
commit | 369a7210c12775afec57769efbe462f0feda2c60 (patch) | |
tree | 3ef7edd81b74022fdaff3bc5ad6d617378456e9d | |
parent | ccc22d41bd9acec58cdc7c3b012e1887aba40af4 (diff) | |
download | linux-369a7210c12775afec57769efbe462f0feda2c60.tar.xz |
drm/qxl: fix usage of ttm_bo_init
We need to use ttm_bo_init_reserved here to make sure
that the BO is pinned before it becomes visible on the LRU.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Gerd Hoffmann <kraxel@redhat.com>
Link: https://patchwork.freedesktop.org/patch/392561/?series=82199&rev=1
-rw-r--r-- | drivers/gpu/drm/qxl/qxl_object.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_object.c index d3635e3e3267..c8b67e7a3f02 100644 --- a/drivers/gpu/drm/qxl/qxl_object.c +++ b/drivers/gpu/drm/qxl/qxl_object.c @@ -106,6 +106,7 @@ int qxl_bo_create(struct qxl_device *qdev, struct qxl_surface *surf, struct qxl_bo **bo_ptr) { + struct ttm_operation_ctx ctx = { !kernel, false }; struct qxl_bo *bo; enum ttm_bo_type type; int r; @@ -134,9 +135,9 @@ int qxl_bo_create(struct qxl_device *qdev, qxl_ttm_placement_from_domain(bo, domain); - r = ttm_bo_init(&qdev->mman.bdev, &bo->tbo, size, type, - &bo->placement, 0, !kernel, size, - NULL, NULL, &qxl_ttm_bo_destroy); + r = ttm_bo_init_reserved(&qdev->mman.bdev, &bo->tbo, size, type, + &bo->placement, 0, &ctx, size, + NULL, NULL, &qxl_ttm_bo_destroy); if (unlikely(r != 0)) { if (r != -ERESTARTSYS) dev_err(qdev->ddev.dev, @@ -146,6 +147,7 @@ int qxl_bo_create(struct qxl_device *qdev, } if (pinned) ttm_bo_pin(&bo->tbo); + ttm_bo_unreserve(&bo->tbo); *bo_ptr = bo; return 0; } |