Skip to content

Commit

Permalink
drm/nouveau: handle same-fb page flips
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marcin Slusarz authored and Ben Skeggs committed Oct 22, 2012
1 parent 565f571 commit 2c14575
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions drivers/gpu/drm/nouveau/nouveau_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
}
Expand Down

0 comments on commit 2c14575

Please sign in to comment.