iris/perf: implement iris_create_monitor_object
[mesa.git] / src / gallium / drivers / iris / iris_context.h
index e34ea930eae6046ef7b18bd92a6810b11e34057b..2ca496d1d03eca9e4a039fe2035c215ca686ec0b 100644 (file)
@@ -426,6 +426,7 @@ struct iris_vtable {
    void (*rebind_buffer)(struct iris_context *ice,
                          struct iris_resource *res,
                          uint64_t old_address);
+   void (*resolve_conditional_render)(struct iris_context *ice);
    void (*load_register_reg32)(struct iris_batch *batch, uint32_t dst,
                                uint32_t src);
    void (*load_register_reg64)(struct iris_batch *batch, uint32_t dst,
@@ -459,6 +460,11 @@ struct iris_vtable {
                                  struct iris_bo *bo, uint32_t offset,
                                  uint64_t imm);
 
+   void (*emit_mi_report_perf_count)(struct iris_batch *batch,
+                                     struct iris_bo *bo,
+                                     uint32_t offset_in_bytes,
+                                     uint32_t report_id);
+
    unsigned (*derived_program_state_size)(enum iris_program_cache_id id);
    void (*store_derived_program_state)(struct iris_context *ice,
                                        enum iris_program_cache_id cache_id,
@@ -467,18 +473,25 @@ struct iris_vtable {
                                     const struct brw_vue_map *vue_map);
    void (*populate_vs_key)(const struct iris_context *ice,
                            const struct shader_info *info,
+                           gl_shader_stage last_stage,
                            struct brw_vs_prog_key *key);
    void (*populate_tcs_key)(const struct iris_context *ice,
                             struct brw_tcs_prog_key *key);
    void (*populate_tes_key)(const struct iris_context *ice,
+                            const struct shader_info *info,
+                            gl_shader_stage last_stage,
                             struct brw_tes_prog_key *key);
    void (*populate_gs_key)(const struct iris_context *ice,
+                           const struct shader_info *info,
+                           gl_shader_stage last_stage,
                            struct brw_gs_prog_key *key);
    void (*populate_fs_key)(const struct iris_context *ice,
+                           const struct shader_info *info,
                            struct brw_wm_prog_key *key);
    void (*populate_cs_key)(const struct iris_context *ice,
                            struct brw_cs_prog_key *key);
    uint32_t (*mocs)(const struct iris_bo *bo);
+   void (*lost_genx_state)(struct iris_context *ice, struct iris_batch *batch);
 };
 
 /**
@@ -593,6 +606,8 @@ struct iris_context {
       bool condition;
    } condition;
 
+   struct gen_perf_context *perf_ctx;
+
    struct {
       uint64_t dirty;
       uint64_t dirty_for_nos[IRIS_NOS_COUNT];
@@ -623,6 +638,8 @@ struct iris_context {
       bool prim_is_points_or_lines;
       uint8_t vertices_per_patch;
 
+      bool window_space_position;
+
       /** The last compute grid size */
       uint32_t last_grid[3];
       /** Reference to the BO containing the compute grid size */
@@ -688,8 +705,6 @@ struct iris_context {
       struct iris_state_ref null_fb;
 
       struct u_upload_mgr *surface_uploader;
-      // XXX: may want a separate uploader for "hey I made a CSO!" vs
-      // "I'm streaming this out at draw time and never want it again!"
       struct u_upload_mgr *dynamic_uploader;
 
       struct iris_binder binder;
@@ -712,6 +727,8 @@ struct iris_context {
          struct pipe_resource *scissor;
          struct pipe_resource *blend;
          struct pipe_resource *index_buffer;
+         struct pipe_resource *cs_thread_ids;
+         struct pipe_resource *cs_desc;
       } last_res;
 
       /** Records the size of variable-length state for INTEL_DEBUG=bat */
@@ -737,7 +754,6 @@ void iris_init_blit_functions(struct pipe_context *ctx);
 void iris_init_clear_functions(struct pipe_context *ctx);
 void iris_init_program_functions(struct pipe_context *ctx);
 void iris_init_resource_functions(struct pipe_context *ctx);
-void iris_init_query_functions(struct pipe_context *ctx);
 void iris_update_compiled_shaders(struct iris_context *ice);
 void iris_update_compiled_compute_shader(struct iris_context *ice);
 void iris_fill_cs_push_const_buffer(struct brw_cs_prog_data *cs_prog_data,
@@ -778,12 +794,6 @@ void iris_emit_end_of_pipe_sync(struct iris_batch *batch,
 
 void iris_init_flush_functions(struct pipe_context *ctx);
 
-/* iris_blorp.c */
-void gen8_init_blorp(struct iris_context *ice);
-void gen9_init_blorp(struct iris_context *ice);
-void gen10_init_blorp(struct iris_context *ice);
-void gen11_init_blorp(struct iris_context *ice);
-
 /* iris_border_color.c */
 
 void iris_init_border_color_pool(struct iris_context *ice);
@@ -792,28 +802,6 @@ void iris_border_color_pool_reserve(struct iris_context *ice, unsigned count);
 uint32_t iris_upload_border_color(struct iris_context *ice,
                                   union pipe_color_union *color);
 
-/* iris_state.c */
-void gen8_init_state(struct iris_context *ice);
-void gen9_init_state(struct iris_context *ice);
-void gen10_init_state(struct iris_context *ice);
-void gen11_init_state(struct iris_context *ice);
-void gen8_emit_urb_setup(struct iris_context *ice,
-                          struct iris_batch *batch,
-                          const unsigned size[4],
-                          bool tess_present, bool gs_present);
-void gen9_emit_urb_setup(struct iris_context *ice,
-                          struct iris_batch *batch,
-                          const unsigned size[4],
-                          bool tess_present, bool gs_present);
-void gen10_emit_urb_setup(struct iris_context *ice,
-                          struct iris_batch *batch,
-                          const unsigned size[4],
-                          bool tess_present, bool gs_present);
-void gen11_emit_urb_setup(struct iris_context *ice,
-                          struct iris_batch *batch,
-                          const unsigned size[4],
-                          bool tess_present, bool gs_present);
-
 /* iris_program.c */
 void iris_upload_ubo_ssbo_surf_state(struct iris_context *ice,
                                      struct pipe_shader_buffer *buf,
@@ -880,19 +868,6 @@ bool iris_blorp_upload_shader(struct blorp_batch *blorp_batch,
                               uint32_t *kernel_out,
                               void *prog_data_out);
 
-/* iris_query.c */
-
-void iris_math_div32_gpr0(struct iris_context *ice,
-                          struct iris_batch *batch,
-                          uint32_t D);
-void iris_math_add32_gpr0(struct iris_context *ice,
-                          struct iris_batch *batch,
-                          uint32_t x);
-
-uint64_t iris_timebase_scale(const struct gen_device_info *devinfo,
-                             uint64_t gpu_timestamp);
-void iris_resolve_conditional_render(struct iris_context *ice);
-
 /* iris_resolve.c */
 
 void iris_predraw_resolve_inputs(struct iris_context *ice,
@@ -918,9 +893,47 @@ void iris_render_cache_add_bo(struct iris_batch *batch,
                               enum isl_aux_usage aux_usage);
 void iris_cache_flush_for_depth(struct iris_batch *batch, struct iris_bo *bo);
 void iris_depth_cache_add_bo(struct iris_batch *batch, struct iris_bo *bo);
+int iris_get_driver_query_info(struct pipe_screen *pscreen, unsigned index,
+                               struct pipe_driver_query_info *info);
+int iris_get_driver_query_group_info(struct pipe_screen *pscreen,
+                                     unsigned index,
+                                     struct pipe_driver_query_group_info *info);
 
 /* iris_state.c */
 void gen9_toggle_preemption(struct iris_context *ice,
                             struct iris_batch *batch,
                             const struct pipe_draw_info *draw);
+
+#ifdef genX
+#  include "iris_genx_protos.h"
+#else
+#  define genX(x) gen4_##x
+#  include "iris_genx_protos.h"
+#  undef genX
+#  define genX(x) gen5_##x
+#  include "iris_genx_protos.h"
+#  undef genX
+#  define genX(x) gen6_##x
+#  include "iris_genx_protos.h"
+#  undef genX
+#  define genX(x) gen7_##x
+#  include "iris_genx_protos.h"
+#  undef genX
+#  define genX(x) gen75_##x
+#  include "iris_genx_protos.h"
+#  undef genX
+#  define genX(x) gen8_##x
+#  include "iris_genx_protos.h"
+#  undef genX
+#  define genX(x) gen9_##x
+#  include "iris_genx_protos.h"
+#  undef genX
+#  define genX(x) gen10_##x
+#  include "iris_genx_protos.h"
+#  undef genX
+#  define genX(x) gen11_##x
+#  include "iris_genx_protos.h"
+#  undef genX
+#endif
+
 #endif