diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2012-10-05 06:26:32 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2012-10-21 22:25:38 -0400 |
commit | 2c14575f99ddd5b8384c5b460687ceba181900d8 (patch) | |
tree | e901da8f9df50c0f4bd6231b2c38e72cbd84405e | |
parent | 565f571c48f01a681243a356e9083f5cf24b432e (diff) |
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>
-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 61f370d000e..53ee3037d30 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 | } |