diff options
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_display.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 25ea82f8def3..8b757483a107 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c | |||
@@ -603,6 +603,14 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |||
603 | if (!s) | 603 | if (!s) |
604 | return -ENOMEM; | 604 | return -ENOMEM; |
605 | 605 | ||
606 | if (new_bo != old_bo) { | ||
607 | ret = nouveau_bo_pin(new_bo, TTM_PL_FLAG_VRAM); | ||
608 | if (ret) | ||
609 | goto fail_free; | ||
610 | } | ||
611 | |||
612 | mutex_lock(&chan->cli->mutex); | ||
613 | |||
606 | /* synchronise rendering channel with the kernel's channel */ | 614 | /* synchronise rendering channel with the kernel's channel */ |
607 | spin_lock(&new_bo->bo.bdev->fence_lock); | 615 | spin_lock(&new_bo->bo.bdev->fence_lock); |
608 | fence = nouveau_fence_ref(new_bo->bo.sync_obj); | 616 | fence = nouveau_fence_ref(new_bo->bo.sync_obj); |
@@ -612,13 +620,6 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |||
612 | if (ret) | 620 | if (ret) |
613 | goto fail_free; | 621 | goto fail_free; |
614 | 622 | ||
615 | if (new_bo != old_bo) { | ||
616 | ret = nouveau_bo_pin(new_bo, TTM_PL_FLAG_VRAM); | ||
617 | if (ret) | ||
618 | goto fail_free; | ||
619 | } | ||
620 | |||
621 | mutex_lock(&chan->cli->mutex); | ||
622 | ret = ttm_bo_reserve(&old_bo->bo, true, false, false, NULL); | 623 | ret = ttm_bo_reserve(&old_bo->bo, true, false, false, NULL); |
623 | if (ret) | 624 | if (ret) |
624 | goto fail_unpin; | 625 | goto fail_unpin; |