X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fr300%2Fr300_cs.h;h=560b77533cf6be6540be17db5ba8888eedd0a2de;hb=e3b249f1665612cab63795cfee4dd54ec7f513f6;hp=2e52dfa43c6a17e36e1c6ec040f712f2407b141c;hpb=ce9c0d280104c8001a3ee360b07218ad3d260e46;p=mesa.git diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index 2e52dfa43c6..560b77533cf 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -29,7 +29,6 @@ #include "r300_reg.h" #include "r300_context.h" -#include "r300_winsys.h" /* Yes, I know macros are ugly. However, they are much prettier than the code * that they neatly hide away, and don't have the cost of function setup,so @@ -40,14 +39,14 @@ */ #define CS_LOCALS(context) \ - struct r300_winsys_cs *cs_copy = (context)->cs; \ - struct r300_winsys_screen *cs_winsys = (context)->rws; \ + struct radeon_cmdbuf *cs_copy = (context)->cs; \ + struct radeon_winsys *cs_winsys = (context)->rws; \ int cs_count = 0; (void) cs_count; (void) cs_winsys; #ifdef DEBUG #define BEGIN_CS(size) do { \ - assert(size <= (R300_MAX_CMDBUF_DWORDS - cs_copy->cdw)); \ + assert(size <= (cs_copy->current.max_dw - cs_copy->current.cdw)); \ cs_count = size; \ } while (0) @@ -73,7 +72,7 @@ */ #define OUT_CS(value) do { \ - cs_copy->buf[cs_copy->cdw++] = (value); \ + cs_copy->current.buf[cs_copy->current.cdw++] = (value); \ CS_USED_DW(1); \ } while (0) @@ -97,21 +96,21 @@ OUT_CS(CP_PACKET3(op, count)) #define OUT_CS_TABLE(values, count) do { \ - memcpy(cs_copy->buf + cs_copy->cdw, values, count * 4); \ - cs_copy->cdw += count; \ + memcpy(cs_copy->current.buf + cs_copy->current.cdw, (values), (count) * 4); \ + cs_copy->current.cdw += (count); \ CS_USED_DW(count); \ } while (0) /** - * Writing relocations. + * Writing buffers. */ #define OUT_CS_RELOC(r) do { \ assert((r)); \ - assert((r)->cs_buf); \ - cs_winsys->cs_write_reloc(cs_copy, (r)->cs_buf); \ - CS_USED_DW(2); \ + assert((r)->buf); \ + OUT_CS(0xc0001000); /* PKT3_NOP */ \ + OUT_CS(cs_winsys->cs_lookup_buffer(cs_copy, (r)->buf) * 4); \ } while (0) @@ -121,8 +120,8 @@ #define WRITE_CS_TABLE(values, count) do { \ assert(cs_count == 0); \ - memcpy(cs_copy->buf + cs_copy->cdw, (values), (count) * 4); \ - cs_copy->cdw += (count); \ + memcpy(cs_copy->current.buf + cs_copy->current.cdw, (values), (count) * 4); \ + cs_copy->current.cdw += (count); \ } while (0) #endif /* R300_CS_H */