#define BEGIN_CS(size) do { \
assert(r300_check_cs(cs_context_copy, (size))); \
- cs_winsys->begin_cs(cs_winsys, (size), \
- __FILE__, __FUNCTION__, __LINE__); \
CS_DEBUG(cs_count = size;) \
} while (0)
#define END_CS do { \
CS_DEBUG(if (cs_count != 0) \
debug_printf("r300: Warning: cs_count off by %d\n", cs_count);) \
- cs_winsys->end_cs(cs_winsys, __FILE__, __FUNCTION__, __LINE__); \
CS_DEBUG(cs_count = 0;) \
} while (0)
* Command buffer emission.
*/
-/* It's recommended not to call begin_cs/end_cs before/after this macro. */
#define WRITE_CS_TABLE(values, count) do { \
CS_DEBUG(assert(cs_count == 0);) \
cs_winsys->write_cs_table(cs_winsys, values, count); \
/* Return the number of free dwords in CS. */
unsigned (*get_cs_free_dwords)(struct r300_winsys_screen *winsys);
- /* Start a command emit. */
- void (*begin_cs)(struct r300_winsys_screen* winsys,
- int size,
- const char* file,
- const char* function,
- int line);
-
/* Write a dword to the command buffer. */
void (*write_cs_dword)(struct r300_winsys_screen* winsys, uint32_t dword);
enum r300_buffer_domain wd,
uint32_t flags);
- /* Finish a command emit. */
- void (*end_cs)(struct r300_winsys_screen* winsys,
- const char* file,
- const char* function,
- int line);
-
/* Flush the CS. */
void (*flush_cs)(struct r300_winsys_screen* winsys);
return cs->ndw - cs->cdw;
}
-static void radeon_begin_cs(struct r300_winsys_screen *rws,
- int size,
- const char* file,
- const char* function,
- int line)
-{
- struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws);
- radeon_cs_begin(ws->cs, size, file, function, line);
-}
-
static void radeon_write_cs_dword(struct r300_winsys_screen *rws,
uint32_t dword)
{
radeon_cs_space_reset_bos(ws->cs);
}
-static void radeon_end_cs(struct r300_winsys_screen *rws,
- const char* file,
- const char* function,
- int line)
-{
- struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws);
- radeon_cs_end(ws->cs, file, function, line);
-}
-
static void radeon_flush_cs(struct r300_winsys_screen *rws)
{
struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws);
ws->base.validate = radeon_validate;
ws->base.destroy = radeon_winsys_destroy;
ws->base.get_cs_free_dwords = radeon_get_cs_free_dwords;
- ws->base.begin_cs = radeon_begin_cs;
ws->base.write_cs_dword = radeon_write_cs_dword;
ws->base.write_cs_table = radeon_write_cs_table;
ws->base.write_cs_reloc = radeon_write_cs_reloc;
- ws->base.end_cs = radeon_end_cs;
ws->base.flush_cs = radeon_flush_cs;
ws->base.reset_bos = radeon_reset_bos;
ws->base.set_flush_cb = radeon_set_flush_cb;