diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_display.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_display.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 8f98e5a8c488..d2f8ffeed742 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c | |||
@@ -530,9 +530,11 @@ nouveau_page_flip_reserve(struct nouveau_bo *old_bo, | |||
530 | if (ret) | 530 | if (ret) |
531 | goto fail; | 531 | goto fail; |
532 | 532 | ||
533 | ret = ttm_bo_reserve(&old_bo->bo, false, false, false, 0); | 533 | if (likely(old_bo != new_bo)) { |
534 | if (ret) | 534 | ret = ttm_bo_reserve(&old_bo->bo, false, false, false, 0); |
535 | goto fail_unreserve; | 535 | if (ret) |
536 | goto fail_unreserve; | ||
537 | } | ||
536 | 538 | ||
537 | return 0; | 539 | return 0; |
538 | 540 | ||
@@ -551,8 +553,10 @@ nouveau_page_flip_unreserve(struct nouveau_bo *old_bo, | |||
551 | nouveau_bo_fence(new_bo, fence); | 553 | nouveau_bo_fence(new_bo, fence); |
552 | ttm_bo_unreserve(&new_bo->bo); | 554 | ttm_bo_unreserve(&new_bo->bo); |
553 | 555 | ||
554 | nouveau_bo_fence(old_bo, fence); | 556 | if (likely(old_bo != new_bo)) { |
555 | ttm_bo_unreserve(&old_bo->bo); | 557 | nouveau_bo_fence(old_bo, fence); |
558 | ttm_bo_unreserve(&old_bo->bo); | ||
559 | } | ||
556 | 560 | ||
557 | nouveau_bo_unpin(old_bo); | 561 | nouveau_bo_unpin(old_bo); |
558 | } | 562 | } |