[Mesa-dev] Mesa (master): i965: SNB GT1 has only 32k urb and max 128 urb entries.

Ian Romanick idr at freedesktop.org
Tue Apr 5 20:06:08 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/02/2011 06:31 PM, Nan hai Zou wrote:
> Module: Mesa
> Branch: master
> Commit: 118ecb1a2226494929a87c36b7802b64451ca004
> URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=118ecb1a2226494929a87c36b7802b64451ca004
> 
> Author: Zou Nan hai <nanhai.zou at intel.com>
> Date:   Thu Mar  3 10:30:06 2011 +0800
> 
> i965: SNB GT1 has only 32k urb and max 128 urb entries.
> 
> Signed-off-by: Zou Nan hai <nanhai.zou at intel.com>
> 
> ---
> 
>  src/mesa/drivers/dri/i965/gen6_urb.c       |   19 +++++++++++++++----
>  src/mesa/drivers/dri/intel/intel_chipset.h |    4 ++++
>  2 files changed, 19 insertions(+), 4 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/gen6_urb.c b/src/mesa/drivers/dri/i965/gen6_urb.c
> index 57be50a..c3819f9 100644
> --- a/src/mesa/drivers/dri/i965/gen6_urb.c
> +++ b/src/mesa/drivers/dri/i965/gen6_urb.c
> @@ -34,15 +34,26 @@
>  static void
>  prepare_urb( struct brw_context *brw )
>  {
> -   brw->urb.nr_vs_entries = 256;
> -   brw->urb.nr_gs_entries = 256;
> +   int urb_size, max_urb_entry;
> +   struct intel_context *intel = &brw->intel;
> +
> +   if (IS_GT1(intel->intelScreen->deviceID)) {
> +	urb_size = 32 * 1024;
> +	max_urb_entry = 128;
> +   } else {
> +	urb_size = 64 * 1024;
> +	max_urb_entry = 256;
> +   }
> +
> +   brw->urb.nr_vs_entries = max_urb_entry;
> +   brw->urb.nr_gs_entries = max_urb_entry;
>  
>     /* CACHE_NEW_VS_PROG */
>     brw->urb.vs_size = MAX2(brw->vs.prog_data->urb_entry_size, 1);
>  
> -   if (256 * brw->urb.vs_size > 64 * 1024)
> +   if (2 * brw->urb.vs_size > urb_size)

Shouldn't this be:

	if ((2 * brw->urb.vs_size * brw->urb.nr_vs_entries) > urb_size)

>  	   brw->urb.nr_vs_entries = brw->urb.nr_gs_entries = 
> -		(64 * 1024 ) / brw->urb.vs_size;
> +		(urb_size ) / (2 * brw->urb.vs_size);
>  }
>  
>  static void
> diff --git a/src/mesa/drivers/dri/intel/intel_chipset.h b/src/mesa/drivers/dri/intel/intel_chipset.h
> index 4fecdbe..4ff9140 100644
> --- a/src/mesa/drivers/dri/intel/intel_chipset.h
> +++ b/src/mesa/drivers/dri/intel/intel_chipset.h
> @@ -133,6 +133,10 @@
>  				 devid == PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS || \
>  				 devid == PCI_CHIP_SANDYBRIDGE_S)
>  
> +#define IS_GT1(devid)		(devid == PCI_CHIP_SANDYBRIDGE_GT1 || \
> +				 devid == PCI_CHIP_SANDYBRIDGE_M_GT1 || \
> +				 devid == PCI_CHIP_SANDYBRIDGE_S)
> +
>  #define IS_965(devid)		(IS_GEN4(devid) || \
>  				 IS_G4X(devid) || \
>  				 IS_GEN5(devid) || \
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk2b2KAACgkQX1gOwKyEAw/IjwCePSJRzTgEqn01U9xCXvd6zYbv
0jQAniOM0tnfCf7EHp3Rw/xBiFx6KbMu
=pBHg
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list