<p><br>
17 paź 2012 06:31, "Ben Skeggs" <<a href="mailto:skeggsb@gmail.com">skeggsb@gmail.com</a>> napisał(a):<br>
><br>
> On Fri, Oct 05, 2012 at 09:37:59PM +0200, Marcin Slusarz wrote:<br>
> > It's questionable use case, but weston/wayland already relies on this behaviour,<br>
> > and other drivers don't care about it, so it's a matter of compatibility.<br>
> > Without it, process invoking such page flip hangs in unkillable state, trying<br>
> > to reserve the same buffer twice.<br>
> ><br>
> > Signed-off-by: Marcin Slusarz <<a href="mailto:marcin.slusarz@gmail.com">marcin.slusarz@gmail.com</a>><br>
> > ---<br>
> > drivers/gpu/drm/nouveau/nouveau_display.c | 20 +++++++++++++++-----<br>
> > 1 file changed, 15 insertions(+), 5 deletions(-)<br>
> ><br>
> > diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c<br>
> > index 61f370d..a52cfd3 100644<br>
> > --- a/drivers/gpu/drm/nouveau/nouveau_display.c<br>
> > +++ b/drivers/gpu/drm/nouveau/nouveau_display.c<br>
> > @@ -530,9 +530,11 @@ nouveau_page_flip_reserve(struct nouveau_bo *old_bo,<br>
> > if (ret)<br>
> > goto fail;<br>
> ><br>
> > - ret = ttm_bo_reserve(&old_bo->bo, false, false, false, 0);<br>
> > - if (ret)<br>
> > - goto fail_unreserve;<br>
> > + if (likely(old_bo != new_bo)) {<br>
> > + ret = ttm_bo_reserve(&old_bo->bo, false, false, false, 0);<br>
> > + if (ret)<br>
> > + goto fail_unreserve;<br>
> > + }<br>
> ><br>
> > return 0;<br>
> ><br>
> > @@ -551,8 +553,10 @@ nouveau_page_flip_unreserve(struct nouveau_bo *old_bo,<br>
> > nouveau_bo_fence(new_bo, fence);<br>
> > ttm_bo_unreserve(&new_bo->bo);<br>
> ><br>
> > - nouveau_bo_fence(old_bo, fence);<br>
> > - ttm_bo_unreserve(&old_bo->bo);<br>
> > + if (likely(old_bo != new_bo)) {<br>
> > + nouveau_bo_fence(old_bo, fence);<br>
> > + ttm_bo_unreserve(&old_bo->bo);<br>
> > + }<br>
> ><br>
> > nouveau_bo_unpin(old_bo);<br>
> > }<br>
> > @@ -624,6 +628,12 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,<br>
> > if (!drm->channel)<br>
> > return -ENODEV;<br>
> ><br>
> > + if (unlikely(old_bo == new_bo)) {<br>
> > + char name[sizeof(current->comm)];<br>
> > + pr_debug_ratelimited("'%s': useless page flip invoked\n",<br>
> > + get_task_comm(name, current));<br>
> > + }<br>
> > +<br>
> The patch looks alright, except I think we should just drop this hunk,<br>
> no other driver reports it either.<br>
><br>
> Thoughts?</p>
<p>It will be easier to debug buggy clients with this code in. With multiple wayland compositors it's possible some of them might be buggy... But I don't feel strongly about it. You can delete this hunk when applying.</p>
<p>Marcin <br>
</p>