summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
diff options
context:
space:
mode:
authorNian Wu <nian.wu@intel.com>2007-03-12 09:03:27 +0800
committerNian Wu <nian.wu@intel.com>2007-03-12 09:03:27 +0800
commit5a5b55943dfdb7fac77f7556058791302ee8639b (patch)
tree7bcaea81b25884b6e6516d1df47f671247964276 /src/mesa/drivers/dri/nouveau/nouveau_fifo.h
parent1e055089a37bca8bc5e1cec37d5559fcdb0cf21f (diff)
parent61ec23cc63a040a2edf1bc466917e85362514c89 (diff)
Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_fifo.h')
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_fifo.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fifo.h b/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
index 490089f71a..23325dcea5 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_fifo.h
@@ -74,17 +74,33 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef NOUVEAU_RING_DEBUG
+extern int nouveau_fifo_remaining;
+
#define OUT_RINGp(ptr,sz) do { \
uint32_t* p=(uint32_t*)(ptr); \
int i; printf("OUT_RINGp: (size 0x%x dwords)\n",sz); for(i=0;i<sz;i++) printf(" 0x%08x %f\n", *(p+i), *((float*)(p+i))); \
+nouveau_fifo_remaining-=sz; \
}while(0)
#define OUT_RING(n) do { \
printf("OUT_RINGn: 0x%08x (%s)\n", n, __func__); \
+ nouveau_fifo_remaining--; \
}while(0)
#define OUT_RINGf(n) do { \
printf("OUT_RINGf: %.04f (%s)\n", n, __func__); \
+ nouveau_fifo_remaining--; \
+}while(0)
+
+#define BEGIN_RING_SIZE(subchannel,tag,size) do { \
+ if (nouveau_fifo_remaining!=0) \
+ printf("RING ERROR : remaining %d\n",nouveau_fifo_remaining); \
+ nouveau_state_cache_flush(nmesa); \
+ if (nmesa->fifo.free <= (size)) \
+ WAIT_RING(nmesa,(size)); \
+ OUT_RING( ((size)<<18) | ((subchannel) << 13) | (tag)); \
+ nmesa->fifo.free -= ((size) + 1); \
+ nouveau_fifo_remaining=size; \
}while(0)
#else
@@ -110,8 +126,6 @@ if (NOUVEAU_RING_TRACE) \
*((float*)(nmesa->fifo.buffer+nmesa->fifo.current++))=(n); \
}while(0)
-#endif
-
#define BEGIN_RING_SIZE(subchannel,tag,size) do { \
nouveau_state_cache_flush(nmesa); \
if (nmesa->fifo.free <= (size)) \
@@ -120,6 +134,8 @@ if (NOUVEAU_RING_TRACE) \
nmesa->fifo.free -= ((size) + 1); \
}while(0)
+#endif
+
extern void WAIT_RING(nouveauContextPtr nmesa,u_int32_t size);
extern void nouveau_state_cache_flush(nouveauContextPtr nmesa);
extern void nouveau_state_cache_init(nouveauContextPtr nmesa);