diff options
Diffstat (limited to 'src/gallium/drivers/nouveau/nouveau_screen.h')
-rw-r--r-- | src/gallium/drivers/nouveau/nouveau_screen.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.h b/src/gallium/drivers/nouveau/nouveau_screen.h index d5bc8171bb5..7f15d10e11c 100644 --- a/src/gallium/drivers/nouveau/nouveau_screen.h +++ b/src/gallium/drivers/nouveau/nouveau_screen.h @@ -4,6 +4,10 @@ #include "pipe/p_screen.h" #include "util/u_memory.h" +#ifdef DEBUG +# define NOUVEAU_ENABLE_DRIVER_STATISTICS +#endif + typedef uint32_t u32; typedef uint16_t u16; @@ -44,8 +48,59 @@ struct nouveau_screen { int64_t cpu_gpu_time_delta; boolean hint_buf_keep_sysmem_copy; + +#ifdef NOUVEAU_ENABLE_DRIVER_STATISTICS + union { + uint64_t v[29]; + struct { + uint64_t tex_obj_current_count; + uint64_t tex_obj_current_bytes; + uint64_t buf_obj_current_count; + uint64_t buf_obj_current_bytes_vid; + uint64_t buf_obj_current_bytes_sys; + uint64_t tex_transfers_rd; + uint64_t tex_transfers_wr; + uint64_t tex_copy_count; + uint64_t tex_blit_count; + uint64_t tex_cache_flush_count; + uint64_t buf_transfers_rd; + uint64_t buf_transfers_wr; + uint64_t buf_read_bytes_staging_vid; + uint64_t buf_write_bytes_direct; + uint64_t buf_write_bytes_staging_vid; + uint64_t buf_write_bytes_staging_sys; + uint64_t buf_copy_bytes; + uint64_t buf_non_kernel_fence_sync_count; + uint64_t any_non_kernel_fence_sync_count; + uint64_t query_sync_count; + uint64_t gpu_serialize_count; + uint64_t draw_calls_array; + uint64_t draw_calls_indexed; + uint64_t draw_calls_fallback_count; + uint64_t user_buffer_upload_bytes; + uint64_t constbuf_upload_count; + uint64_t constbuf_upload_bytes; + uint64_t pushbuf_count; + uint64_t resource_validate_count; + } named; + } stats; +#endif }; +#ifdef NOUVEAU_ENABLE_DRIVER_STATISTICS +# define NOUVEAU_DRV_STAT(s, n, v) do { \ + (s)->stats.named.n += (v); \ + } while(0) +# define NOUVEAU_DRV_STAT_RES(r, n, v) do { \ + nouveau_screen((r)->base.screen)->stats.named.n += (v); \ + } while(0) +# define NOUVEAU_DRV_STAT_IFD(x) x +#else +# define NOUVEAU_DRV_STAT(s, n, v) do { } while(0) +# define NOUVEAU_DRV_STAT_RES(r, n, v) do { } while(0) +# define NOUVEAU_DRV_STAT_IFD(x) +#endif + static INLINE struct nouveau_screen * nouveau_screen(struct pipe_screen *pscreen) { |