diff options
author | Christian König <christian.koenig@amd.com> | 2021-12-17 16:30:16 +0100 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2022-07-11 10:59:27 +0200 |
commit | 64e257f187a5c76ec5766f50204462c0c483e418 (patch) | |
tree | 8d946dd7059614a7b128cab78a754fd272958235 /drivers | |
parent | 63af82cf5e36b6ba3f3ebcdd1edd9f91934bfa59 (diff) | |
download | lwn-64e257f187a5c76ec5766f50204462c0c483e418.tar.gz lwn-64e257f187a5c76ec5766f50204462c0c483e418.zip |
drm/nouveau: audit bo->resource usage
Make sure we can at least move and release BOs without backing store.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220707102453.3633-4-christian.koenig@amd.com
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bo.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 994879d9db74..35bb0bb3fe61 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -1008,7 +1008,8 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, } /* Fake bo copy. */ - if (old_reg->mem_type == TTM_PL_SYSTEM && !bo->ttm) { + if (!old_reg || (old_reg->mem_type == TTM_PL_SYSTEM && + !bo->ttm)) { ttm_bo_move_null(bo, new_reg); goto out; } |