[Intel-gfx] [PATCH] Fix directRenderingType check

Eric Anholt eric at anholt.net
Thu Dec 11 19:46:55 CET 2008


On Thu, 2008-12-11 at 17:02 +0800, Zhenyu Wang wrote:
> Don't miss classic texture memory allocation in DRI.
> ---
>  src/i830_driver.c |   28 +++++++++++++---------------
>  1 files changed, 13 insertions(+), 15 deletions(-)
> 
> diff --git a/src/i830_driver.c b/src/i830_driver.c
> index 7590257..4ed20f1 100644
> --- a/src/i830_driver.c
> +++ b/src/i830_driver.c
> @@ -1557,21 +1557,14 @@ I830AccelMethodInit(ScrnInfoPtr pScrn)
>  	pI830->directRenderingType = DRI_DISABLED;
>  
>  #ifdef XF86DRI
> -    if (pI830->directRenderingType == DRI_XF86DRI) {
> -	if ((pI830->accel == ACCEL_NONE) || pI830->SWCursor) {
> -	    xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "DRI is disabled because it "
> -		       "needs HW cursor and 2D acceleration.\n");
> -	    pI830->directRenderingType = DRI_DISABLED;
> -	} else if (pScrn->depth != 16 && pScrn->depth != 24) {
> -	    xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "DRI is disabled because it "
> -		       "runs only at depths 16 and 24.\n");
> -	    pI830->directRenderingType = DRI_DISABLED;
> -	}
> -
> -	if (pI830->directRenderingType == DRI_XF86DRI) {
> -	   pI830->allocate_classic_textures =
> -	      xf86ReturnOptValBool(pI830->Options, OPTION_LEGACY3D, TRUE);
> -	}
> +    if ((pI830->accel == ACCEL_NONE) || pI830->SWCursor) {
> +	xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "DRI is disabled because it "
> +		"needs HW cursor and 2D acceleration.\n");
> +	pI830->directRenderingType = DRI_DISABLED;
> +    } else if (pScrn->depth != 16 && pScrn->depth != 24) {
> +	xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "DRI is disabled because it "
> +		"runs only at depths 16 and 24.\n");
> +	pI830->directRenderingType = DRI_DISABLED;
>      }

The swcursor bit certainly should stay under if == XF86DRI, as we no
longer need hw cursor due to the client directly drawing to the
framebuffer.

>  #endif /* XF86DRI */
>  
> @@ -3107,6 +3100,11 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
>      */
>     if (pI830->directRenderingType == DRI_NONE && I830DRIScreenInit(pScreen))
>         pI830->directRenderingType = DRI_XF86DRI;
> +
> +   if (pI830->directRenderingType == DRI_XF86DRI) {
> +       pI830->allocate_classic_textures =
> +	   xf86ReturnOptValBool(pI830->Options, OPTION_LEGACY3D, TRUE);
> +   }
>  #endif
>  
>     /* Enable tiling by default */

Moving this out is definitely good.

-- 
Eric Anholt
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: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20081211/ac25bddc/attachment.sig>


More information about the Intel-gfx mailing list