X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Flima%2Flima_screen.h;h=9f116df2168ad41deb851a7948b9b0775854607c;hb=16339646f03a5cb527f119ca572c9328fd5d3923;hp=296931688282b829cc4ca8e611c1e7e14fd08048;hpb=e0aeee946004685527dfa0a4f5f141b85ae076dd;p=mesa.git diff --git a/src/gallium/drivers/lima/lima_screen.h b/src/gallium/drivers/lima/lima_screen.h index 29693168828..9f116df2168 100644 --- a/src/gallium/drivers/lima/lima_screen.h +++ b/src/gallium/drivers/lima/lima_screen.h @@ -33,19 +33,28 @@ #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_JOB (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 *