Commit 2c14575f authored by Marcin Slusarz's avatar Marcin Slusarz Committed by Ben Skeggs

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: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 565f571c
...@@ -530,9 +530,11 @@ nouveau_page_flip_reserve(struct nouveau_bo *old_bo, ...@@ -530,9 +530,11 @@ nouveau_page_flip_reserve(struct nouveau_bo *old_bo,
if (ret) if (ret)
goto fail; goto fail;
if (likely(old_bo != new_bo)) {
ret = ttm_bo_reserve(&old_bo->bo, false, false, false, 0); ret = ttm_bo_reserve(&old_bo->bo, false, false, false, 0);
if (ret) if (ret)
goto fail_unreserve; goto fail_unreserve;
}
return 0; return 0;
...@@ -551,8 +553,10 @@ nouveau_page_flip_unreserve(struct nouveau_bo *old_bo, ...@@ -551,8 +553,10 @@ nouveau_page_flip_unreserve(struct nouveau_bo *old_bo,
nouveau_bo_fence(new_bo, fence); nouveau_bo_fence(new_bo, fence);
ttm_bo_unreserve(&new_bo->bo); ttm_bo_unreserve(&new_bo->bo);
if (likely(old_bo != new_bo)) {
nouveau_bo_fence(old_bo, fence); nouveau_bo_fence(old_bo, fence);
ttm_bo_unreserve(&old_bo->bo); ttm_bo_unreserve(&old_bo->bo);
}
nouveau_bo_unpin(old_bo); nouveau_bo_unpin(old_bo);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment