[PATCH xserver (v4) 09/10] Add XSyncAwaitFence() handler

Keith Packard keithp at keithp.com
Mon Dec 6 18:20:11 PST 2010


On Mon, 6 Dec 2010 14:53:23 -0800, James Jones <jajones at nvidia.com> wrote:

> +	    if (pTrigger->test_type != XSyncPositiveTransition &&
> +		pTrigger->test_type != XSyncNegativeTransition &&
> +		pTrigger->test_type != XSyncPositiveComparison &&
> +		pTrigger->test_type != XSyncNegativeComparison)
> +	    {
> +		client->errorValue = pTrigger->test_type;
> +		return BadValue;
> +	    }
> +	    /* select appropriate CheckTrigger function */
> +
> +	    switch (pTrigger->test_type)
> +	    {
> +	    case XSyncPositiveTransition:
> +		pTrigger->CheckTrigger = SyncCheckTriggerPositiveTransition;
> +		break;
> +	    case XSyncNegativeTransition:
> +		pTrigger->CheckTrigger = SyncCheckTriggerNegativeTransition;
> +		break;
> +	    case XSyncPositiveComparison:
> +		pTrigger->CheckTrigger = SyncCheckTriggerPositiveComparison;
> +		break;
> +	    case XSyncNegativeComparison:
> +		pTrigger->CheckTrigger = SyncCheckTriggerNegativeComparison;
> +		break;
> +	    }

Gah! default: would have been too tricky here? I know this is copied
From the original code, but it's horrible.


> +    pAwait = &(pAwaitUnion+1)->await; /* skip over header */
> +    for (i = 0; i < items; i++, pProtocolFences++, pAwait++)
> +    {
> +	if (*pProtocolFences == None) /* XXX protocol change */

Ur? Is this missing from the protocol spec?

Reviewed-by: Keith Packard <keithp at keithp.com>

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101206/592a85f4/attachment.pgp>


More information about the xorg-devel mailing list