On Mit, 2011-02-09 at 21:09 +0100, Maarten Maathuis wrote: 
> - It turns out that part of the problem was actually on the driver side.

I did express my suspicion about that during the review...

> - The performance loss is not worth the small visual improvement.
> - This should ensure low latency at low throughput.
> - Performance loss seems less than 10% instead of the previous 33%.

Sounds better indeed.


> @@ -150,12 +150,26 @@ exaDamageReport_mixed(DamagePtr pDamage, RegionPtr 
> pRegion, void *closure)
>      if (!pExaPixmap->use_gpu_copy && exaPixmapHasGpuCopy(pPixmap)) {
>       ExaScreenPriv(pPixmap->drawable.pScreen);
>  
> -     /* Front buffer: Don't wait for the block handler to copy back the data.
> -      * This avoids annoying latency if you encounter a lot of software 
> rendering.
> +     /* Front buffer: Don't wait for the block handler to copy back the 
> data, unless
> +      * it has been moved back in the last 50 ms. This avoids high latency 
> when
> +      * the xserver is busy, while maintaining a decent troughput.
>        */
> -     if (pPixmap == pScreen->GetScreenPixmap(pScreen))
> -             exaMoveInPixmap_mixed(pPixmap);
> -     else {
> +     if (pPixmap == pScreen->GetScreenPixmap(pScreen)) {
> +             CARD32 now = GetTimeInMillis();
> +             if ((now - pExaScr->last_time_front_mixed_pixmap) > 50) {
> +                     pExaScr->last_time_front_mixed_pixmap = now;
> +                     exaMoveInPixmap_mixed(pPixmap);
> +
> +                     if (pExaScr->deferred_mixed_pixmap == pPixmap)
> +                             pExaScr->deferred_mixed_pixmap = NULL;
> +             } else {
> +                     if (pExaScr->deferred_mixed_pixmap &&
> +                         pExaScr->deferred_mixed_pixmap != pPixmap)
> +                         
> exaMoveInPixmap_mixed(pExaScr->deferred_mixed_pixmap);
> +
> +                     pExaScr->deferred_mixed_pixmap = pPixmap;
> +             }
> +     } else {

Please use

        if (pPixmap == pScreen->GetScreenPixmap(pScreen)) {
            CARD32 now = GetTimeInMillis();
            if ((now - pExaScr->last_time_front_mixed_pixmap) > 50) {
                [...]
                return;
            }
        }

        if (pExaScr->deferred_mixed_pixmap &&
            pExaScr->deferred_mixed_pixmap != pPixmap)
    [...]

rather than duplicating the else blocks.

(BTW indentation looks wrong again)


Shouldn't pExaScr->last_time_front_mixed_pixmap be updated in
ExaBlockHandler() as well?


-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to