diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2014-10-27 05:11:52 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-12-02 00:43:58 -0500 |
commit | 5be5a15a43642de7e10d17da0c172ea2d28d22c4 (patch) | |
tree | 765677a7baa1b36a35b1be49b8bd04f219b6c62e /drivers/gpu/drm/nouveau/nouveau_bo.c | |
parent | f9895e6dbe92d38f821864b48b135f63bf115dec (diff) |
drm/nouveau: 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>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bo.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bo.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 3d474ac03f88..9a8adeec80cd 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c | |||
@@ -323,8 +323,8 @@ nouveau_bo_pin(struct nouveau_bo *nvbo, uint32_t memtype) | |||
323 | goto out; | 323 | goto out; |
324 | } | 324 | } |
325 | 325 | ||
326 | if (nvbo->pin_refcnt++) | 326 | if (nvbo->pin_refcnt) |
327 | goto out; | 327 | goto ref_inc; |
328 | 328 | ||
329 | nouveau_bo_placement_set(nvbo, memtype, 0); | 329 | nouveau_bo_placement_set(nvbo, memtype, 0); |
330 | 330 | ||
@@ -341,6 +341,10 @@ nouveau_bo_pin(struct nouveau_bo *nvbo, uint32_t memtype) | |||
341 | break; | 341 | break; |
342 | } | 342 | } |
343 | } | 343 | } |
344 | |||
345 | ref_inc: | ||
346 | nvbo->pin_refcnt++; | ||
347 | |||
344 | out: | 348 | out: |
345 | ttm_bo_unreserve(bo); | 349 | ttm_bo_unreserve(bo); |
346 | return ret; | 350 | return ret; |
@@ -1184,6 +1188,9 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, bool intr, | |||
1184 | struct nouveau_drm_tile *new_tile = NULL; | 1188 | struct nouveau_drm_tile *new_tile = NULL; |
1185 | int ret = 0; | 1189 | int ret = 0; |
1186 | 1190 | ||
1191 | if (nvbo->pin_refcnt) | ||
1192 | NV_WARN(drm, "Moving pinned object %p!\n", nvbo); | ||
1193 | |||
1187 | if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) { | 1194 | if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) { |
1188 | ret = nouveau_bo_vm_bind(bo, new_mem, &new_tile); | 1195 | ret = nouveau_bo_vm_bind(bo, new_mem, &new_tile); |
1189 | if (ret) | 1196 | if (ret) |