On Tue, Nov 04, 2008 at 12:54:03PM -0800, Eric Anholt wrote:
> When userland detected that this ioctl was supported (by version number 
> check),
> it used it in a racy way -- dispatch delayed swap, wait for vblank, continue
> rendering. As there was no mechanism for it to wait for the swap to finish,
> sometimes it would render before the swap and garbage would be displayed on
> the screen.

Oh my yes...

I've been seein that a lot on openbsd. The drm_lock latency with
userland was quite high, so I would see stuff being half drawn (this was
shown by flickering in glxgears, and things like quake having enemies
and items flickering in and out of view) I've been trying to fix that,
but mostly been considering just removing the interface. Nice to see i'm
not alone :)

> 
> By removing the ioctl and returning -EINVAL, userland returns to its previous,
> correct rendering path of waiting for a vblank then dispatching a swap.  The
> only path that could have used this ioctl correctly was page flipping, which
> relied on only one client running and emitting 
> wait-for-vblank-before-rendering
> in the command stream.  That path also falls back correctly, at the 
> performance
> cost of not being able to queue up rendering before the flip occurs.

I agree. And the patch looks correct.  However, there's more stuff that
can go away here:
- dev_priv->swaps_lock (and spinlock_init/destroy)
- dev_priv->pending_swaps (and initialisation)
- dev_priv->vbl_swaps (and initialisation)
- the definition of vbl_swap_t
- the tasklet interface and assorted locking and function pointers.  -
        Nothing in drm git or the linux kernel would use it after this
        change. making it dead code. the less stuff clogging up the source
        and making it harder to read the better.

Otherwise, looks fine. A similar diff running on openbsd seems to work
well.

Cheers,

-0-
-- 
Utility is when you have one telephone, luxury is when you have two,
opulence is when you have three -- and paradise is when you have none.
                -- Doug Larson

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to