aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index a32fe41e5e24..340dfb11959d 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -458,7 +458,7 @@ static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo)
458 struct ttm_bo_device *bdev = bo->bdev; 458 struct ttm_bo_device *bdev = bo->bdev;
459 struct ttm_bo_global *glob = bo->glob; 459 struct ttm_bo_global *glob = bo->glob;
460 struct ttm_bo_driver *driver; 460 struct ttm_bo_driver *driver;
461 void *sync_obj; 461 void *sync_obj = NULL;
462 void *sync_obj_arg; 462 void *sync_obj_arg;
463 int put_count; 463 int put_count;
464 int ret; 464 int ret;
@@ -493,17 +493,20 @@ static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo)
493 spin_lock(&glob->lru_lock); 493 spin_lock(&glob->lru_lock);
494 } 494 }
495queue: 495queue:
496 sync_obj = bo->sync_obj;
497 sync_obj_arg = bo->sync_obj_arg;
498 driver = bdev->driver; 496 driver = bdev->driver;
497 if (bo->sync_obj)
498 sync_obj = driver->sync_obj_ref(bo->sync_obj);
499 sync_obj_arg = bo->sync_obj_arg;
499 500
500 kref_get(&bo->list_kref); 501 kref_get(&bo->list_kref);
501 list_add_tail(&bo->ddestroy, &bdev->ddestroy); 502 list_add_tail(&bo->ddestroy, &bdev->ddestroy);
502 spin_unlock(&glob->lru_lock); 503 spin_unlock(&glob->lru_lock);
503 spin_unlock(&bo->lock); 504 spin_unlock(&bo->lock);
504 505
505 if (sync_obj) 506 if (sync_obj) {
506 driver->sync_obj_flush(sync_obj, sync_obj_arg); 507 driver->sync_obj_flush(sync_obj, sync_obj_arg);
508 driver->sync_obj_unref(&sync_obj);
509 }
507 schedule_delayed_work(&bdev->wq, 510 schedule_delayed_work(&bdev->wq,
508 ((HZ / 100) < 1) ? 1 : HZ / 100); 511 ((HZ / 100) < 1) ? 1 : HZ / 100);
509} 512}