summaryrefslogtreecommitdiff
path: root/xc/lib/GL/mesa/src/drv/r128/r128_cce.h
diff options
context:
space:
mode:
Diffstat (limited to 'xc/lib/GL/mesa/src/drv/r128/r128_cce.h')
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_cce.h67
1 files changed, 50 insertions, 17 deletions
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_cce.h b/xc/lib/GL/mesa/src/drv/r128/r128_cce.h
index a1d426eb8..5da4fd348 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_cce.h
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_cce.h
@@ -37,24 +37,48 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifdef GLX_DIRECT_RENDERING
+#include "r128_dri.h"
+#include "r128_reg.h"
+
typedef union {
float f;
int i;
} floatTOint;
-#define R128_USE_CCE_PIO_MODE
-#ifdef R128_USE_CCE_PIO_MODE
+#if (R128_CCE_MODE == R128_PM4_192PIO) || \
+ (R128_CCE_MODE == R128_PM4_128PIO_64INDBM) || \
+ (R128_CCE_MODE == R128_PM4_64PIO_128INDBM) || \
+ (R128_CCE_MODE == R128_PM4_64PIO_64VCBM_64INDBM) || \
+ (R128_CCE_MODE == R128_PM4_64PIO_64VCPIO_64INDPIO)
+
+/* The ring buffer is in PIO mode */
+/* Start a sequence of CCE commands. This grabs the lock, and wait for
+ `n' entries to be free in the ring buffer. */
#define R128CCE_BEGIN(n) \
do { \
LOCK_HARDWARE(r128ctx); \
R128WaitForFifo(r128ctx->r128Screen, (n)); \
} while (0)
+
+/* End a sequence of CCE commands. This also releases the lock. */
+#define R128CCE_END() \
+ do { \
+ if (r128ctx->r128Screen->CCEFifoAddr != R128_PM4_FIFO_DATA_EVEN) { \
+ OUTREG(r128ctx->r128Screen->CCEFifoAddr, R128_CCE_PACKET2); \
+ r128ctx->r128Screen->CCEFifoAddr ^= 0x0004; \
+ } \
+ UNLOCK_HARDWARE(r128ctx); \
+ } while (0)
+
+/* Insert an integer value into the CCE ring buffer. */
#define R128CCE(v) \
do { \
OUTREG(r128ctx->r128Screen->CCEFifoAddr, (v)); \
r128ctx->r128Screen->CCEFifoAddr ^= 0x0004; \
} while (0)
+
+/* Insert an floating point value into the CCE ring buffer. */
#define R128CCEF(v) \
do { \
floatTOint fTi; \
@@ -62,23 +86,14 @@ typedef union {
OUTREG(r128ctx->r128Screen->CCEFifoAddr, fTi.i); \
r128ctx->r128Screen->CCEFifoAddr ^= 0x0004; \
} while (0)
-#define R128CCE_END() \
- do { \
- if (r128ctx->r128Screen->CCEFifoAddr != R128_PM4_FIFO_DATA_EVEN) { \
- OUTREG(r128ctx->r128Screen->CCEFifoAddr, R128_CCE_PACKET2); \
- r128ctx->r128Screen->CCEFifoAddr ^= 0x0004; \
- } \
- UNLOCK_HARDWARE(r128ctx); \
- } while (0)
-#define R128CCE_BEGIN_LOCKED(n) \
- do { \
- R128WaitForFifo(r128ctx->r128Screen, (n)); \
- } while (0)
+/* Wait for `n' entries to be free in the ring buffer, while locked. */
#define R128CCE_WAIT_LOCKED(n) \
do { \
R128WaitForFifo(r128ctx->r128Screen, (n)); \
} while (0)
+
+/* End a sequence of CCE commands, but do not releases the lock. */
#define R128CCE_END_LOCKED() \
do { \
if (r128ctx->r128Screen->CCEFifoAddr != R128_PM4_FIFO_DATA_EVEN) { \
@@ -89,12 +104,31 @@ typedef union {
#else
+/* The ring buffer is in BM mode */
+/* FIXME: Implement support for the ring buffer */
+
+/* Start a sequence of CCE commands. This grabs the lock, and wait for
+ `n' entries to be free in the ring buffer. */
#define R128CCE_BEGIN(n)
-#define R128CCE(v)
+
+/* End a sequence of CCE commands. This also releases the lock. */
#define R128CCE_END()
+/* Insert an integer value into the CCE ring buffer. */
+#define R128CCE(v)
+
+/* Insert an floating point value into the CCE ring buffer. */
+#define R128CCEF(v)
+
+/* Wait for `n' entries to be free in the ring buffer, while locked. */
+#define R128CCE_WAIT_LOCKED(n)
+
+/* End a sequence of CCE commands, but do not releases the lock. */
+#define R128CCE_END_LOCKED()
+
#endif
+/* Insert a type-[0123] packet header into the ring buffer */
#define R128CCE0(p,r,n) R128CCE((p) | ((n) << 16) | ((r) >> 2))
#define R128CCE1(p,r1,r2) R128CCE((p) | (((r2) >> 2) << 11) | ((r1) >> 2))
#define R128CCE2(p) R128CCE((p))
@@ -125,8 +159,7 @@ extern void R128WaitForIdle(r128ScreenPtr pScrn);
extern void R128CCEWaitForFifoFunction(r128ScreenPtr pScrn, int entries);
extern void R128CCEWaitForIdle(r128ScreenPtr pScrn);
-extern void R128CCEStart(r128ScreenPtr pScrn);
-extern void R128CCEEnd(r128ScreenPtr pScrn);
+extern void R128FlushWCMemory(void);
#endif
#endif /* _R128_CCE_H_ */