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 */
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);
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,
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);
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);
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,
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)
cs->cdw += count;
}
+static inline uint64_t radv_buffer_get_va(struct radeon_winsys_bo *bo)
+{
+ return bo->va;
+}
+
#endif /* RADV_RADEON_WINSYS_H */