freedreno/ir3: Get tess_use_shared from fd_dev_info
authorRob Clark <robdclark@chromium.org>
Thu, 8 Jul 2021 15:37:55 +0000 (08:37 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 14 Jul 2021 01:58:00 +0000 (01:58 +0000)
A step towards getting rid of checks for gpu_id sprinkled around.
Checking major generation is ok, but checking for == or >= a specific
gpu_id is going to start getting messy as we add more a6xx.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

src/freedreno/common/freedreno_dev_info.h
src/freedreno/common/freedreno_devices.py
src/freedreno/ir3/ir3_compiler.c
src/freedreno/ir3/meson.build

index 8d6fbe2..77756a2 100644 (file)
@@ -64,6 +64,8 @@ struct fd_dev_info {
          bool ccu_cntl_gmem_unk2;
          bool has_z24uint_s8uint;
 
+         bool tess_use_shared;
+
          struct {
             uint32_t RB_UNKNOWN_8E04_blit;
             uint32_t PC_UNKNOWN_9805;
index 248d1d3..8404d4f 100644 (file)
@@ -189,6 +189,7 @@ a6xx_gen3 = dict(
         fibers_per_sp = 128 * 2 * 16,
         supports_multiview_mask = True,
         has_z24uint_s8uint = True,
+        tess_use_shared = True,
     )
 
 add_gpus([
index c37eae7..54fe98b 100644 (file)
@@ -26,6 +26,8 @@
 
 #include "util/ralloc.h"
 
+#include "freedreno_dev_info.h"
+
 #include "ir3_compiler.h"
 
 static const struct debug_named_value shader_debug_options[] = {
@@ -120,8 +122,8 @@ ir3_compiler_create(struct fd_device *dev, uint32_t gpu_id,
       /* TODO: implement private memory on earlier gen's */
       compiler->has_pvtmem = true;
 
-      if (compiler->gpu_id == 650)
-         compiler->tess_use_shared = true;
+      compiler->tess_use_shared =
+            fd_dev_info(compiler->gpu_id)->a6xx.tess_use_shared;
    } else {
       compiler->max_const_pipeline = 512;
       compiler->max_const_geom = 512;
index 312cdbf..7bff85f 100644 (file)
@@ -119,7 +119,7 @@ libfreedreno_ir3 = static_library(
   include_directories : [inc_freedreno, inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
   c_args : [no_override_init_args],
   gnu_symbol_visibility : 'hidden',
-  link_with: [libir3decode, libir3encode],
+  link_with: [libir3decode, libir3encode, libfreedreno_common],
   dependencies : [idep_nir_headers, dep_dl, idep_mesautil],
   build_by_default : false,
 )