[PATCH] Do check that XV is enabled before calling xf86InitFBManagerLinear.

Eric Anholt eric at anholt.net
Tue Apr 17 14:22:49 PDT 2007


On Fri, 2007-04-13 at 22:25 +0800, JM Ibanez wrote:
> The driver segfaults when XV is turned off but LinearAlloc is set in
> xorg.conf, due to the assumption made here. ->xaa_linear is set in
> i830_memory.c only if Xv is enabled; however, this only checks if
> LinearAlloc has been set (and not whether Xv is enabled). This commit
> also checks if XV is enabled before proceeding.
> ---
>  src/i830_driver.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/i830_driver.c b/src/i830_driver.c
> index f0ca973..cddefe9 100644
> --- a/src/i830_driver.c
> +++ b/src/i830_driver.c
> @@ -2545,7 +2545,7 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
>  		       "Failed to init memory manager\n");
>  	 }
>  
> -	 if (pI830->LinearAlloc &&
> +	 if (pI830->XvEnabled && pI830->LinearAlloc &&
>  	     xf86InitFBManagerLinear(pScreen,
>  				     pI830->xaa_linear->offset / pI830->cpp,
>  				     pI830->xaa_linear->size / pI830->cpp))

Thanks.  I committed a variation that should avoid a crash in another
circumstance as well.

-- 
Eric Anholt                             anholt at FreeBSD.org
eric at anholt.net                         eric.anholt at intel.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20070417/3868bf12/attachment.pgp>


More information about the xorg mailing list