summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/radeon/radeon_ioctl.h
diff options
context:
space:
mode:
authorEric Anholt <anholt@FreeBSD.org>2004-09-25 07:00:15 +0000
committerEric Anholt <anholt@FreeBSD.org>2004-09-25 07:00:15 +0000
commit5562fe653cf88454bbf2c50f77a8b56b0dafe01b (patch)
tree159ffb9f519e550e45fc9442c9f21e557e19c681 /src/mesa/drivers/dri/radeon/radeon_ioctl.h
parent4010481ba3bce98d95a20e9a061fb62922bdcb83 (diff)
The previous code would emit a full set of state during the first EmitState on
a new cmdbuf, to ensure that state wasn't lost across UNLOCK/LOCK pairs (in the case of context switching). This was rather inefficient. Instead, after flushing a cmdbuf, mark the state as needing to be saved on unlock. Then, at the beginning of flushing a cmdbuf, if we actually have lost the context, go back and emit a new cmdbuf with the full set of state, before continuing with the cmdbuf flush. Provides a 10-15% improvement in ipers performance in my tests, along with other apps. Tested with: ipers, glxgears, quake3
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_ioctl.h')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_ioctl.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.h b/src/mesa/drivers/dri/radeon/radeon_ioctl.h
index 695eb5770b..7ad4f3a932 100644
--- a/src/mesa/drivers/dri/radeon/radeon_ioctl.h
+++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.h
@@ -104,6 +104,9 @@ extern void radeonWaitForVBlank( radeonContextPtr rmesa );
extern void radeonInitIoctlFuncs( GLcontext *ctx );
extern void radeonGetAllParams( radeonContextPtr rmesa );
+extern void radeonSaveHwState( radeonContextPtr rmesa );
+extern void radeonSetUpAtomList( radeonContextPtr rmesa );
+
/* radeon_compat.c:
*/
extern void radeonCompatEmitPrimitive( radeonContextPtr rmesa,
@@ -111,7 +114,6 @@ extern void radeonCompatEmitPrimitive( radeonContextPtr rmesa,
GLuint hw_primitive,
GLuint nrverts );
-
/* ================================================================
* Helper macros:
*/
@@ -130,7 +132,8 @@ do { \
#define RADEON_STATECHANGE( rmesa, ATOM ) \
do { \
RADEON_NEWPRIM( rmesa ); \
- move_to_head( &(rmesa->hw.dirty), &(rmesa->hw.ATOM)); \
+ rmesa->hw.ATOM.dirty = GL_TRUE; \
+ rmesa->hw.is_dirty = GL_TRUE; \
} while (0)
#define RADEON_DB_STATE( ATOM ) \
@@ -144,7 +147,8 @@ static __inline int RADEON_DB_STATECHANGE(
if (memcmp(atom->cmd, atom->lastcmd, atom->cmd_size*4)) {
int *tmp;
RADEON_NEWPRIM( rmesa );
- move_to_head( &(rmesa->hw.dirty), atom );
+ atom->dirty = GL_TRUE;
+ rmesa->hw.is_dirty = GL_TRUE;
tmp = atom->cmd;
atom->cmd = atom->lastcmd;
atom->lastcmd = tmp;