diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2014-10-16 14:52:43 +0900 |
---|---|---|
committer | Alexandre Courbot <acourbot@nvidia.com> | 2014-10-31 11:47:40 +0900 |
commit | 8bdeeef30a51cef4b028b2d5c89cc558988bfb61 (patch) | |
tree | f881810deec296277f09dd6189e0b079e4a5f3c0 | |
parent | 6847d0a8e5d2acac68d7795d1b92f083550f40b8 (diff) | |
download | nouveau-8bdeeef30a51cef4b028b2d5c89cc558988bfb61.tar.gz |
drm: warn when moving a pinned object
Pinned BOs are supposed to remain in their current location until
unpinned. Display a warning for the supposedly-erroneous case where we
are trying to move such objects.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
-rw-r--r-- | drm/nouveau_bo.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drm/nouveau_bo.c b/drm/nouveau_bo.c index 3d474ac03..9a8adeec8 100644 --- a/drm/nouveau_bo.c +++ b/drm/nouveau_bo.c @@ -323,8 +323,8 @@ nouveau_bo_pin(struct nouveau_bo *nvbo, uint32_t memtype) goto out; } - if (nvbo->pin_refcnt++) - goto out; + if (nvbo->pin_refcnt) + goto ref_inc; nouveau_bo_placement_set(nvbo, memtype, 0); @@ -341,6 +341,10 @@ nouveau_bo_pin(struct nouveau_bo *nvbo, uint32_t memtype) break; } } + +ref_inc: + nvbo->pin_refcnt++; + out: ttm_bo_unreserve(bo); return ret; @@ -1184,6 +1188,9 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, bool intr, struct nouveau_drm_tile *new_tile = NULL; int ret = 0; + if (nvbo->pin_refcnt) + NV_WARN(drm, "Moving pinned object %p!\n", nvbo); + if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) { ret = nouveau_bo_vm_bind(bo, new_mem, &new_tile); if (ret) |