mesa: remove the driverCtx parameter to _mesa_create/initialize_context()
[mesa.git] / src / mesa / drivers / dri / radeon / radeon_cmdbuf.h
index abb023c7def9003ddeeca41bd66455b2263ac949..efccc81bde756fcde3eadf4d63d7a01b970b0a9c 100644 (file)
@@ -1,9 +1,7 @@
 #ifndef COMMON_CMDBUF_H
 #define COMMON_CMDBUF_H
 
-#include "radeon_bocs_wrapper.h"
-
-void rcommonEnsureCmdBufSpace(radeonContextPtr rmesa, int dwords, const char *caller);
+GLboolean rcommonEnsureCmdBufSpace(radeonContextPtr rmesa, int dwords, const char *caller);
 int rcommonFlushCmdBuf(radeonContextPtr rmesa, const char *caller);
 int rcommonFlushCmdBufLocked(radeonContextPtr rmesa, const char *caller);
 void rcommonInitCmdBuf(radeonContextPtr rmesa);
@@ -54,15 +52,14 @@ void rcommonBeginBatch(radeonContextPtr rmesa,
  */
 #define OUT_BATCH_RELOC(data, bo, offset, rd, wd, flags)       \
        do {                                                    \
-        if (0 && offset) {                                     \
+       int  __offset = (offset);                               \
+        if (0 && __offset) {                                   \
             fprintf(stderr, "(%s:%s:%d) offset : %d\n",                \
-            __FILE__, __FUNCTION__, __LINE__, offset);         \
+            __FILE__, __FUNCTION__, __LINE__, __offset);       \
         }                                                      \
-        radeon_cs_write_dword(b_l_rmesa->cmdbuf.cs, offset);   \
+        radeon_cs_write_dword(b_l_rmesa->cmdbuf.cs, __offset); \
         radeon_cs_write_reloc(b_l_rmesa->cmdbuf.cs,            \
                               bo, rd, wd, flags);              \
-       if (!b_l_rmesa->radeonScreen->kernel_mm)                \
-               b_l_rmesa->cmdbuf.cs->section_cdw += 2;         \
        } while(0)
 
 
@@ -71,10 +68,7 @@ void rcommonBeginBatch(radeonContextPtr rmesa,
  */
 #define OUT_BATCH_TABLE(ptr,n) \
        do { \
-               int _i; \
-        for (_i=0; _i < n; _i++) {\
-            radeon_cs_write_dword(b_l_rmesa->cmdbuf.cs, ptr[_i]);\
-        }\
+               radeon_cs_write_table(b_l_rmesa->cmdbuf.cs, (ptr), (n));\
        } while(0)
 
 /**
@@ -106,10 +100,6 @@ void rcommonBeginBatch(radeonContextPtr rmesa,
 #define OUT_BATCH_REGSEQ(reg, count) \
        OUT_BATCH(cmdpacket0(b_l_rmesa->radeonScreen, (reg), (count)))
 
-/** Write a 32 bit float to the ring; requires 1 dword. */
-#define OUT_BATCH_FLOAT32(f) \
-       OUT_BATCH(radeonPackFloat32((f)))
-
 /* +r6/r7 : code here moved */
 
 /* Fire the buffered vertices no matter what.
@@ -117,7 +107,7 @@ void rcommonBeginBatch(radeonContextPtr rmesa,
 static INLINE void radeon_firevertices(radeonContextPtr radeon)
 {
    if (radeon->cmdbuf.cs->cdw || radeon->dma.flush )
-      radeon->glCtx->Driver.Flush(radeon->glCtx); /* +r6/r7 */
+      radeon->glCtx.Driver.Flush(&radeon->glCtx); /* +r6/r7 */
 }
 
 #endif