diff options
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_execbuf_util.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_execbuf_util.c b/drivers/gpu/drm/ttm/ttm_execbuf_util.c index adafc0f8ec06..8ce508e76208 100644 --- a/drivers/gpu/drm/ttm/ttm_execbuf_util.c +++ b/drivers/gpu/drm/ttm/ttm_execbuf_util.c | |||
@@ -119,8 +119,14 @@ int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket, | |||
119 | ret = -EBUSY; | 119 | ret = -EBUSY; |
120 | } | 120 | } |
121 | 121 | ||
122 | if (!ret) | 122 | if (!ret) { |
123 | continue; | 123 | if (!entry->shared) |
124 | continue; | ||
125 | |||
126 | ret = reservation_object_reserve_shared(bo->resv); | ||
127 | if (!ret) | ||
128 | continue; | ||
129 | } | ||
124 | 130 | ||
125 | /* uh oh, we lost out, drop every reservation and try | 131 | /* uh oh, we lost out, drop every reservation and try |
126 | * to only reserve this buffer, then start over if | 132 | * to only reserve this buffer, then start over if |
@@ -136,6 +142,9 @@ int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket, | |||
136 | ret = 0; | 142 | ret = 0; |
137 | } | 143 | } |
138 | 144 | ||
145 | if (!ret && entry->shared) | ||
146 | ret = reservation_object_reserve_shared(bo->resv); | ||
147 | |||
139 | if (unlikely(ret != 0)) { | 148 | if (unlikely(ret != 0)) { |
140 | if (ret == -EINTR) | 149 | if (ret == -EINTR) |
141 | ret = -ERESTARTSYS; | 150 | ret = -ERESTARTSYS; |
@@ -183,7 +192,10 @@ void ttm_eu_fence_buffer_objects(struct ww_acquire_ctx *ticket, | |||
183 | 192 | ||
184 | list_for_each_entry(entry, list, head) { | 193 | list_for_each_entry(entry, list, head) { |
185 | bo = entry->bo; | 194 | bo = entry->bo; |
186 | reservation_object_add_excl_fence(bo->resv, fence); | 195 | if (entry->shared) |
196 | reservation_object_add_shared_fence(bo->resv, fence); | ||
197 | else | ||
198 | reservation_object_add_excl_fence(bo->resv, fence); | ||
187 | ttm_bo_add_to_lru(bo); | 199 | ttm_bo_add_to_lru(bo); |
188 | __ttm_bo_unreserve(bo); | 200 | __ttm_bo_unreserve(bo); |
189 | } | 201 | } |