X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fr300%2Fr300_cs.h;h=7ae83a8920b8183f7f87fcafca146496c993c97d;hb=2c3f95d6aaab38cd66dd3dee1b089d5c91928eea;hp=c208e672f42194876603293cecf1eadafeaa608d;hpb=fa31b1095eeea97695125ad5770239805bed37da;p=mesa.git diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index c208e672f42..7ae83a8920b 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -46,7 +46,7 @@ #ifdef DEBUG #define BEGIN_CS(size) do { \ - assert(size <= (RADEON_MAX_CMDBUF_DWORDS - cs_copy->cdw)); \ + assert(size <= (cs_copy->max_dw - cs_copy->cdw)); \ cs_count = size; \ } while (0) @@ -96,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->buf + cs_copy->cdw, (values), (count) * 4); \ + cs_copy->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)