lima: enable multi submit optimization
[mesa.git] / src / gallium / drivers / lima / lima_screen.h
index 296931688282b829cc4ca8e611c1e7e14fd08048..e3cd40112c4978faa8d5968272266812b83346f4 100644 (file)
 
 #include "pipe/p_screen.h"
 
-#define LIMA_DEBUG_GP      (1 << 0)
-#define LIMA_DEBUG_PP      (1 << 1)
-#define LIMA_DEBUG_DUMP    (1 << 2)
-#define LIMA_DEBUG_SHADERDB (1 << 3)
+#define LIMA_DEBUG_GP             (1 << 0)
+#define LIMA_DEBUG_PP             (1 << 1)
+#define LIMA_DEBUG_DUMP           (1 << 2)
+#define LIMA_DEBUG_SHADERDB       (1 << 3)
+#define LIMA_DEBUG_NO_BO_CACHE    (1 << 4)
+#define LIMA_DEBUG_BO_CACHE       (1 << 5)
+#define LIMA_DEBUG_NO_TILING      (1 << 6)
+#define LIMA_DEBUG_NO_GROW_HEAP   (1 << 7)
+#define LIMA_DEBUG_SINGLE_SUBMIT  (1 << 8)
 
 extern uint32_t lima_debug;
-extern FILE *lima_dump_command_stream;
 extern int lima_ctx_num_plb;
 extern int lima_plb_max_blk;
 extern int lima_ppir_force_spilling;
 
 struct ra_regs;
 
+#define MIN_BO_CACHE_BUCKET (12) /* 2^12 = 4KB */
+#define MAX_BO_CACHE_BUCKET (22) /* 2^22 = 4MB */
+
+#define NR_BO_CACHE_BUCKETS (MAX_BO_CACHE_BUCKET - MIN_BO_CACHE_BUCKET + 1)
+
 struct lima_screen {
    struct pipe_screen base;
    struct renderonly *ro;
@@ -60,8 +69,11 @@ struct lima_screen {
 
    /* bo table */
    mtx_t bo_table_lock;
+   mtx_t bo_cache_lock;
    struct util_hash_table *bo_handles;
    struct util_hash_table *bo_flink_names;
+   struct list_head bo_cache_buckets[NR_BO_CACHE_BUCKETS];
+   struct list_head bo_cache_time;
 
    struct slab_parent_pool transfer_pool;
 
@@ -73,11 +85,9 @@ struct lima_screen {
    #define pp_reload_program_offset  0x0080
    #define pp_shared_index_offset    0x00c0
    #define pp_clear_gl_pos_offset    0x0100
-   #define pp_stack_offset           0x1000
-   #define pp_stack_pp_size           0x400 /* per pp, up to 8 pp */
-   #define pp_stack_offset_end       0x3000
-   #define pp_buffer_size            0x3000
+   #define pp_buffer_size            0x1000
 
+   bool has_growable_heap_buffer;
 };
 
 static inline struct lima_screen *