summaryrefslogtreecommitdiff
path: root/linux-core/drm_bo.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux-core/drm_bo.c')
-rw-r--r--linux-core/drm_bo.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/linux-core/drm_bo.c b/linux-core/drm_bo.c
index 4ce5f480..53fb5afc 100644
--- a/linux-core/drm_bo.c
+++ b/linux-core/drm_bo.c
@@ -1990,8 +1990,8 @@ drm_bo_set_pin(struct drm_device *dev, struct drm_buffer_object *bo,
return ret;
}
- /* Validate the buffer into its pinned location, with no pending
- * fence.
+ /* Validate the buffer into its pinned location, with no
+ * pending fence.
*/
ret = drm_buffer_object_validate(bo, 0, 0, 0);
if (ret) {
@@ -1999,9 +1999,12 @@ drm_bo_set_pin(struct drm_device *dev, struct drm_buffer_object *bo,
return ret;
}
- /* Add our buffer to the pinned list */
+ /* Pull the buffer off of the LRU and add it to the pinned
+ * list
+ */
bo->pinned_mem_type = bo->mem.mem_type;
mutex_lock(&dev->struct_mutex);
+ list_del_init(&bo->lru);
list_del_init(&bo->pinned_lru);
drm_bo_add_to_pinned_lru(bo);
@@ -2011,6 +2014,7 @@ drm_bo_set_pin(struct drm_device *dev, struct drm_buffer_object *bo,
bo->pinned_node = bo->mem.mm_node;
}
+ bo->pinned = pin;
mutex_unlock(&dev->struct_mutex);
} else {
@@ -2022,9 +2026,9 @@ drm_bo_set_pin(struct drm_device *dev, struct drm_buffer_object *bo,
list_del_init(&bo->pinned_lru);
bo->pinned_node = NULL;
+ bo->pinned = pin;
mutex_unlock(&dev->struct_mutex);
}
- bo->pinned = pin;
mutex_unlock(&bo->mutex);
return 0;
}