gallium/radeon: print more info about HTILE
[mesa.git] / src / gallium / drivers / radeon / r600_pipe_common.h
index ebe633b91250385e031ca2266b8b53b273950f7b..cd2dd09d752eb462be5f601535c80cad1cbf70bf 100644 (file)
 #define R600_RESOURCE_FLAG_FLUSHED_DEPTH       (PIPE_RESOURCE_FLAG_DRV_PRIV << 1)
 #define R600_RESOURCE_FLAG_FORCE_TILING                (PIPE_RESOURCE_FLAG_DRV_PRIV << 2)
 
-#define R600_QUERY_DRAW_CALLS          (PIPE_QUERY_DRIVER_SPECIFIC + 0)
-#define R600_QUERY_REQUESTED_VRAM      (PIPE_QUERY_DRIVER_SPECIFIC + 1)
-#define R600_QUERY_REQUESTED_GTT       (PIPE_QUERY_DRIVER_SPECIFIC + 2)
-#define R600_QUERY_BUFFER_WAIT_TIME    (PIPE_QUERY_DRIVER_SPECIFIC + 3)
-#define R600_QUERY_NUM_CS_FLUSHES      (PIPE_QUERY_DRIVER_SPECIFIC + 4)
-#define R600_QUERY_NUM_BYTES_MOVED     (PIPE_QUERY_DRIVER_SPECIFIC + 5)
-#define R600_QUERY_VRAM_USAGE          (PIPE_QUERY_DRIVER_SPECIFIC + 6)
-#define R600_QUERY_GTT_USAGE           (PIPE_QUERY_DRIVER_SPECIFIC + 7)
-#define R600_QUERY_GPU_TEMPERATURE     (PIPE_QUERY_DRIVER_SPECIFIC + 8)
-#define R600_QUERY_CURRENT_GPU_SCLK    (PIPE_QUERY_DRIVER_SPECIFIC + 9)
-#define R600_QUERY_CURRENT_GPU_MCLK    (PIPE_QUERY_DRIVER_SPECIFIC + 10)
-#define R600_QUERY_GPU_LOAD            (PIPE_QUERY_DRIVER_SPECIFIC + 11)
-#define R600_QUERY_NUM_COMPILATIONS    (PIPE_QUERY_DRIVER_SPECIFIC + 12)
-#define R600_QUERY_NUM_SHADERS_CREATED (PIPE_QUERY_DRIVER_SPECIFIC + 13)
-
 #define R600_CONTEXT_STREAMOUT_FLUSH           (1u << 0)
 #define R600_CONTEXT_PRIVATE_FLAG              (1u << 1)
 
@@ -71,7 +56,7 @@
 /* Debug flags. */
 /* logging */
 #define DBG_TEX                        (1 << 0)
-#define DBG_TEXMIP             (1 << 1)
+/* gap - reuse */
 #define DBG_COMPUTE            (1 << 2)
 #define DBG_VM                 (1 << 3)
 #define DBG_TRACE_CS           (1 << 4)
 #define R600_MAP_BUFFER_ALIGNMENT 64
 
 struct r600_common_context;
+struct r600_perfcounters;
 
 struct radeon_shader_reloc {
        char *name;
@@ -186,7 +172,7 @@ struct r600_fmask_info {
        unsigned offset;
        unsigned size;
        unsigned alignment;
-       unsigned pitch;
+       unsigned pitch_in_pixels;
        unsigned bank_height;
        unsigned slice_tile_max;
        unsigned tile_mode_index;
@@ -196,15 +182,25 @@ struct r600_cmask_info {
        unsigned offset;
        unsigned size;
        unsigned alignment;
+       unsigned pitch;
+       unsigned height;
+       unsigned xalign;
+       unsigned yalign;
        unsigned slice_tile_max;
        unsigned base_address_reg;
 };
 
+struct r600_htile_info {
+       unsigned pitch;
+       unsigned height;
+       unsigned xalign;
+       unsigned yalign;
+};
+
 struct r600_texture {
        struct r600_resource            resource;
 
        unsigned                        size;
-       unsigned                        pitch_override;
        bool                            is_depth;
        unsigned                        dirty_level_mask; /* each bit says if that mipmap is compressed */
        unsigned                        stencil_dirty_level_mask; /* each bit says if that mipmap is compressed */
@@ -221,6 +217,7 @@ struct r600_texture {
        unsigned                        color_clear_value[2];
 
        /* Depth buffer compression and fast clear. */
+       struct r600_htile_info          htile;
        struct r600_resource            *htile_buffer;
        bool                            depth_cleared; /* if it was cleared at least once */
        float                           depth_clear_value;
@@ -315,6 +312,9 @@ struct r600_common_screen {
        volatile unsigned               gpu_load_stop_thread; /* bool */
 
        char                            renderer_string[64];
+
+       /* Performance counters. */
+       struct r600_perfcounters        *perfcounters;
 };
 
 /* This encapsulates a state or an operation which can emitted into the GPU
@@ -407,9 +407,8 @@ struct r600_common_context {
        struct list_head                active_nontimer_queries;
        struct list_head                active_timer_queries;
        unsigned                        num_cs_dw_nontimer_queries_suspend;
+       bool                            nontimer_queries_suspended_by_flush;
        unsigned                        num_cs_dw_timer_queries_suspend;
-       /* If queries have been suspended. */
-       bool                            queries_suspended_for_flush;
        /* Additional hardware info. */
        unsigned                        backend_mask;
        unsigned                        max_db; /* for OQ */
@@ -525,7 +524,11 @@ void r600_gpu_load_kill_thread(struct r600_common_screen *rscreen);
 uint64_t r600_gpu_load_begin(struct r600_common_screen *rscreen);
 unsigned r600_gpu_load_end(struct r600_common_screen *rscreen, uint64_t begin);
 
+/* r600_perfcounters.c */
+void r600_perfcounters_destroy(struct r600_common_screen *rscreen);
+
 /* r600_query.c */
+void r600_init_screen_query_functions(struct r600_common_screen *rscreen);
 void r600_query_init(struct r600_common_context *rctx);
 void r600_suspend_nontimer_queries(struct r600_common_context *ctx);
 void r600_resume_nontimer_queries(struct r600_common_context *ctx);