[PATCH 2/2] DRI2: Add error message when working around driver bug

Mario Kleiner mario.kleiner at tuebingen.mpg.de
Wed Oct 6 15:35:38 PDT 2010


On Oct 6, 2010, at 1:05 PM, Pauli Nieminen wrote:

> There isn't API that allows application atomically query for msc  
> changes
> and schedule swaps. If msc changes dramatically between query and
> scheduling application would schedule swap to happen at wrong time.
>
> Because of API limitations driver has to make msc increment for each
> vblank affecting the drawable.
>

Hi Paul,

this is not a driver bug which should be reported as an error, but  
simply handling of what happens if a drawable is moved by the user  
from one display head to a different display head, which likely has a  
different msc count because it runs at a different refresh rate or  
was enabled later than the first crtc.

Therefore i don't think this error printout should be added. It is  
arguably not perfect, but probably good enough for the most common  
cases. The correct solution would be to virtualize the msc counter  
for each drawable and keep track of crtc changes and compensate for  
those at each change. I have some ideas on how to do this properly,  
just didn't have the time to test them.

best,
-mario

> Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
> ---
>  hw/xfree86/dri2/dri2.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
> index d9b9d57..d70c115 100644
> --- a/hw/xfree86/dri2/dri2.c
> +++ b/hw/xfree86/dri2/dri2.c
> @@ -860,9 +860,12 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr  
> pDraw, CARD64 target_msc,
>  	    if (!(*ds->GetMSC)(pDraw, &ust, &current_msc))
>  		pPriv->last_swap_target = 0;
>
> -	    if (current_msc < pPriv->last_swap_target)
> +	    if (current_msc < pPriv->last_swap_target) {
>  		pPriv->last_swap_target = current_msc;
> -
> +		xf86DrvMsg(pScreen->myNum, X_ERROR,
> +			"[DRI2] %s: GetMSC returned swap count that is in "
> +			"past. Working around driver bug.\n", __func__);
> +	    }
>  	}
>
>  	/*
> -- 
> 1.7.0.4
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel

*********************************************************************
Mario Kleiner
Max Planck Institute for Biological Cybernetics
Spemannstr. 38
72076 Tuebingen
Germany

e-mail: mario.kleiner at tuebingen.mpg.de
office: +49 (0)7071/601-1623
fax:    +49 (0)7071/601-616
www:    http://www.kyb.tuebingen.mpg.de/~kleinerm
*********************************************************************
"For a successful technology, reality must take precedence
over public relations, for Nature cannot be fooled."
(Richard Feynman)



More information about the xorg-devel mailing list