diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_object.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 5c9ce2beaca3..66a37fb75839 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -261,6 +261,7 @@ struct radeon_bo_list { | |||
261 | unsigned rdomain; | 261 | unsigned rdomain; |
262 | unsigned wdomain; | 262 | unsigned wdomain; |
263 | u32 tiling_flags; | 263 | u32 tiling_flags; |
264 | bool reserved; | ||
264 | }; | 265 | }; |
265 | 266 | ||
266 | /* | 267 | /* |
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index a8d18bcae7db..d5b9373ce06c 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c | |||
@@ -301,6 +301,7 @@ int radeon_bo_list_reserve(struct list_head *head) | |||
301 | r = radeon_bo_reserve(lobj->bo, false); | 301 | r = radeon_bo_reserve(lobj->bo, false); |
302 | if (unlikely(r != 0)) | 302 | if (unlikely(r != 0)) |
303 | return r; | 303 | return r; |
304 | lobj->reserved = true; | ||
304 | } | 305 | } |
305 | return 0; | 306 | return 0; |
306 | } | 307 | } |
@@ -311,7 +312,7 @@ void radeon_bo_list_unreserve(struct list_head *head) | |||
311 | 312 | ||
312 | list_for_each_entry(lobj, head, list) { | 313 | list_for_each_entry(lobj, head, list) { |
313 | /* only unreserve object we successfully reserved */ | 314 | /* only unreserve object we successfully reserved */ |
314 | if (radeon_bo_is_reserved(lobj->bo)) | 315 | if (lobj->reserved && radeon_bo_is_reserved(lobj->bo)) |
315 | radeon_bo_unreserve(lobj->bo); | 316 | radeon_bo_unreserve(lobj->bo); |
316 | } | 317 | } |
317 | } | 318 | } |
@@ -322,6 +323,9 @@ int radeon_bo_list_validate(struct list_head *head) | |||
322 | struct radeon_bo *bo; | 323 | struct radeon_bo *bo; |
323 | int r; | 324 | int r; |
324 | 325 | ||
326 | list_for_each_entry(lobj, head, list) { | ||
327 | lobj->reserved = false; | ||
328 | } | ||
325 | r = radeon_bo_list_reserve(head); | 329 | r = radeon_bo_list_reserve(head); |
326 | if (unlikely(r != 0)) { | 330 | if (unlikely(r != 0)) { |
327 | return r; | 331 | return r; |