radv: add has_clear_state and enable it on CIK+ only
[mesa.git] / src / amd / vulkan / radv_radeon_winsys.h
index cdcaeca46eca6ac922e4af3918641d77cae2e971..52b55c38e697c72d77e42a3ef8854364b4338a3c 100644 (file)
@@ -51,7 +51,8 @@ enum radeon_bo_flag { /* bitfield */
        RADEON_FLAG_GTT_WC =        (1 << 0),
        RADEON_FLAG_CPU_ACCESS =    (1 << 1),
        RADEON_FLAG_NO_CPU_ACCESS = (1 << 2),
-       RADEON_FLAG_VIRTUAL =       (1 << 3)
+       RADEON_FLAG_VIRTUAL =       (1 << 3),
+       RADEON_FLAG_VA_UNCACHED =   (1 << 4),
 };
 
 enum radeon_bo_usage { /* bitfield */
@@ -131,9 +132,25 @@ struct radeon_bo_metadata {
        uint32_t                metadata[64];
 };
 
-struct radeon_winsys_bo;
+uint32_t syncobj_handle;
 struct radeon_winsys_fence;
-struct radeon_winsys_sem;
+
+struct radeon_winsys_bo {
+       uint64_t va;
+};
+struct radv_winsys_sem_counts {
+       uint32_t syncobj_count;
+       uint32_t sem_count;
+       uint32_t *syncobj;
+       struct radeon_winsys_sem **sem;
+};
+
+struct radv_winsys_sem_info {
+       bool cs_emit_signal;
+       bool cs_emit_wait;
+       struct radv_winsys_sem_counts wait;
+       struct radv_winsys_sem_counts signal;
+};
 
 struct radeon_winsys {
        void (*destroy)(struct radeon_winsys *ws);
@@ -141,6 +158,11 @@ struct radeon_winsys {
        void (*query_info)(struct radeon_winsys *ws,
                           struct radeon_info *info);
 
+       bool (*read_registers)(struct radeon_winsys *ws, unsigned reg_offset,
+                              unsigned num_registers, uint32_t *out);
+
+       const char *(*get_chip_name)(struct radeon_winsys *ws);
+
        struct radeon_winsys_bo *(*buffer_create)(struct radeon_winsys *ws,
                                                  uint64_t size,
                                                  unsigned alignment,
@@ -160,8 +182,6 @@ struct radeon_winsys {
 
        void (*buffer_unmap)(struct radeon_winsys_bo *bo);
 
-       uint64_t (*buffer_get_va)(struct radeon_winsys_bo *bo);
-
        void (*buffer_set_metadata)(struct radeon_winsys_bo *bo,
                                    struct radeon_bo_metadata *md);
 
@@ -191,10 +211,7 @@ struct radeon_winsys {
                         unsigned cs_count,
                         struct radeon_winsys_cs *initial_preamble_cs,
                         struct radeon_winsys_cs *continue_preamble_cs,
-                        struct radeon_winsys_sem **wait_sem,
-                        unsigned wait_sem_count,
-                        struct radeon_winsys_sem **signal_sem,
-                        unsigned signal_sem_count,
+                        struct radv_winsys_sem_info *sem_info,
                         bool can_patch,
                         struct radeon_winsys_fence *fence);
 
@@ -205,7 +222,7 @@ struct radeon_winsys {
        void (*cs_execute_secondary)(struct radeon_winsys_cs *parent,
                                    struct radeon_winsys_cs *child);
 
-       void (*cs_dump)(struct radeon_winsys_cs *cs, FILE* file, uint32_t trace_id);
+       void (*cs_dump)(struct radeon_winsys_cs *cs, FILE* file, const int *trace_ids, int trace_id_count);
 
        int (*surface_init)(struct radeon_winsys *ws,
                            const struct ac_surf_info *surf_info,
@@ -221,9 +238,17 @@ struct radeon_winsys {
                           bool absolute,
                           uint64_t timeout);
 
+       /* old semaphores - non shareable */
        struct radeon_winsys_sem *(*create_sem)(struct radeon_winsys *ws);
        void (*destroy_sem)(struct radeon_winsys_sem *sem);
 
+       /* new shareable sync objects */
+       int (*create_syncobj)(struct radeon_winsys *ws, uint32_t *handle);
+       void (*destroy_syncobj)(struct radeon_winsys *ws, uint32_t handle);
+
+       int (*export_syncobj)(struct radeon_winsys *ws, uint32_t syncobj, int *fd);
+       int (*import_syncobj)(struct radeon_winsys *ws, int fd, uint32_t *syncobj);
+
 };
 
 static inline void radeon_emit(struct radeon_winsys_cs *cs, uint32_t value)
@@ -238,4 +263,9 @@ static inline void radeon_emit_array(struct radeon_winsys_cs *cs,
        cs->cdw += count;
 }
 
+static inline uint64_t radv_buffer_get_va(struct radeon_winsys_bo *bo)
+{
+       return bo->va;
+}
+
 #endif /* RADV_RADEON_WINSYS_H */