aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm/ttm_execbuf_util.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2014-12-03 09:46:48 -0500
committerAlex Deucher <alexander.deucher@amd.com>2014-12-03 18:26:52 -0500
commitaa35071c590461f95d0179cc8e730d49d610f773 (patch)
tree72f9c722700be9a265857bff56f3843c7f0e298d /drivers/gpu/drm/ttm/ttm_execbuf_util.c
parent5e5c21cac1001089007260c48b0c89ebaace0e71 (diff)
drm/ttm: optionally move duplicates to a separate list
This patch adds an optional list_head parameter to ttm_eu_reserve_buffers. If specified duplicates in the execbuf list are no longer reported as errors, but moved to this list instead. Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_execbuf_util.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_execbuf_util.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_execbuf_util.c b/drivers/gpu/drm/ttm/ttm_execbuf_util.c
index 8ce508e76208..3820ae97a030 100644
--- a/drivers/gpu/drm/ttm/ttm_execbuf_util.c
+++ b/drivers/gpu/drm/ttm/ttm_execbuf_util.c
@@ -93,7 +93,8 @@ EXPORT_SYMBOL(ttm_eu_backoff_reservation);
93 */ 93 */
94 94
95int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket, 95int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket,
96 struct list_head *list, bool intr) 96 struct list_head *list, bool intr,
97 struct list_head *dups)
97{ 98{
98 struct ttm_bo_global *glob; 99 struct ttm_bo_global *glob;
99 struct ttm_validate_buffer *entry; 100 struct ttm_validate_buffer *entry;
@@ -117,6 +118,13 @@ int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket,
117 __ttm_bo_unreserve(bo); 118 __ttm_bo_unreserve(bo);
118 119
119 ret = -EBUSY; 120 ret = -EBUSY;
121
122 } else if (ret == -EALREADY && dups) {
123 struct ttm_validate_buffer *safe = entry;
124 entry = list_prev_entry(entry, head);
125 list_del(&safe->head);
126 list_add(&safe->head, dups);
127 continue;
120 } 128 }
121 129
122 if (!ret) { 130 if (!ret) {