diff options
author | Christian König <christian.koenig@amd.com> | 2014-09-04 14:01:52 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2014-09-11 10:46:00 -0400 |
commit | ae9c0af2c0ea92e57013ab2dd7271ba7d6b2a833 (patch) | |
tree | b524a3c3960582346b60418d068d96317e79696b /drivers/gpu/drm/ttm | |
parent | c4d922b14544d115232b7448a2ea7640ba901eb6 (diff) |
drm/ttm: allow fence to be added as shared
This patch adds a new flag to the ttm_validate_buffer list to
add the fence as shared to the reservation object.
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')
-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 | } |