summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2012-10-05 12:26:32 +0200
committerBen Skeggs <bskeggs@redhat.com>2012-10-22 12:25:38 +1000
commit2c14575f99ddd5b8384c5b460687ceba181900d8 (patch)
treee901da8f9df50c0f4bd6231b2c38e72cbd84405e /drivers/gpu
parent565f571c48f01a681243a356e9083f5cf24b432e (diff)
downloadlinux-stable-2c14575f99ddd5b8384c5b460687ceba181900d8.tar.gz
linux-stable-2c14575f99ddd5b8384c5b460687ceba181900d8.tar.bz2
linux-stable-2c14575f99ddd5b8384c5b460687ceba181900d8.zip
drm/nouveau: handle same-fb page flips
It's questionable use case, but weston/wayland already relies on this behaviour, and other drivers don't care about it, so it's a matter of compatibility. Without it, process invoking such page flip hangs in unkillable state, trying to reserve the same buffer twice. Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_display.c14
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 61f370d000e9..53ee3037d309 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,
if (ret)
goto fail;
- ret = ttm_bo_reserve(&old_bo->bo, false, false, false, 0);
- if (ret)
- goto fail_unreserve;
+ if (likely(old_bo != new_bo)) {
+ ret = ttm_bo_reserve(&old_bo->bo, false, false, false, 0);
+ if (ret)
+ goto fail_unreserve;
+ }
return 0;
@@ -551,8 +553,10 @@ nouveau_page_flip_unreserve(struct nouveau_bo *old_bo,
nouveau_bo_fence(new_bo, fence);
ttm_bo_unreserve(&new_bo->bo);
- nouveau_bo_fence(old_bo, fence);
- ttm_bo_unreserve(&old_bo->bo);
+ if (likely(old_bo != new_bo)) {
+ nouveau_bo_fence(old_bo, fence);
+ ttm_bo_unreserve(&old_bo->bo);
+ }
nouveau_bo_unpin(old_bo);
}