[PATCH] avoid a potential endless loop.

Xiang, Haihao haihao.xiang at intel.com
Tue Jan 6 17:43:22 PST 2009


On Tue, 2009-01-06 at 10:03 +0800, Xiang, Haihao wrote:
> Previously it is possible that creating rotation data, then cleaning
> up and creating again so that pScreen->BlockHandler and
> xf86_config->BlockHandler all point to xf86RotateBlockHandler.
> See bug #19343.
> ---
>  hw/xfree86/modes/xf86Rotate.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
> index 8e03c6c..21b7aff 100644
> --- a/hw/xfree86/modes/xf86Rotate.c
> +++ b/hw/xfree86/modes/xf86Rotate.c
> @@ -291,6 +291,8 @@ xf86RotateBlockHandler(int screenNum, pointer blockData,
>  	/* Re-wrap if rotation is still happening */
>  	xf86_config->BlockHandler = pScreen->BlockHandler;
>  	pScreen->BlockHandler = xf86RotateBlockHandler;
> +    } else {
> +	xf86_config->BlockHandler = NULL;
>      }
>  }
>  
> @@ -477,8 +479,10 @@ xf86CrtcRotate (xf86CrtcPtr crtc)
>  		goto bail2;
>  	    
>  	    /* Wrap block handler */
> -	    xf86_config->BlockHandler = pScreen->BlockHandler;
> -	    pScreen->BlockHandler = xf86RotateBlockHandler;
> +	    if (!xf86_config->BlockHandler) {
> +		xf86_config->BlockHandler = pScreen->BlockHandler;
> +		pScreen->BlockHandler = xf86RotateBlockHandler;
> +	    }
>  	}
>  #ifdef RANDR_12_INTERFACE
>  	if (transform)
Hi, Keith
   Could you take a look at this patch?

Thanks
Haihao





More information about the xorg mailing list