summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Kuehling <fxkuehl@gmx.de>2005-03-06 01:28:30 +0000
committerFelix Kuehling <fxkuehl@gmx.de>2005-03-06 01:28:30 +0000
commite6aa21156ace5bea0a8bcc8c58aceacb748e2627 (patch)
treebcccc053a7c90d208c71d2373e4d8ed9d34704ad
parenta30402b56a979a865d445c8bca2ccdfad1a3a114 (diff)
- Fixed two bugs related to DMA buffer handling that showed up with the
new DRM version 2.4 and command DMA. - Flush less. - Bumped the driver date.
-rw-r--r--src/mesa/drivers/dri/savage/savage_xmesa.c16
-rw-r--r--src/mesa/drivers/dri/savage/savagecontext.h2
-rw-r--r--src/mesa/drivers/dri/savage/savagedd.c2
-rw-r--r--src/mesa/drivers/dri/savage/savageioctl.c16
-rw-r--r--src/mesa/drivers/dri/savage/savagetris.c7
5 files changed, 14 insertions, 29 deletions
diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c
index 8d27486637..8e11ef2499 100644
--- a/src/mesa/drivers/dri/savage/savage_xmesa.c
+++ b/src/mesa/drivers/dri/savage/savage_xmesa.c
@@ -247,7 +247,8 @@ savageDestroyScreen(__DRIscreenPrivate *sPriv)
{
savageScreenPrivate *savageScreen = (savageScreenPrivate *)sPriv->private;
- drmUnmapBufs(savageScreen->bufs);
+ if (savageScreen->bufs)
+ drmUnmapBufs(savageScreen->bufs);
/* free all option information */
driDestroyOptionInfo (&savageScreen->optionCache);
@@ -492,16 +493,11 @@ savageCreateContext( const __GLcontextModes *mesaVis,
"version 2.2.\n");
imesa->enable_fastpath = GL_FALSE;
}
-
- imesa->enable_vdma = driQueryOptionb(&imesa->optionCache, "enable_vdma");
- if (imesa->enable_vdma && savageScreen->chipset == S3_SUPERSAVAGE) {
- fprintf (stderr,
- "*** Disabling vertex DMA on SuperSavage. Someone has to "
- "find out, how to make\n*** it work without locking up. "
- "To disable this message set option enable_vdma\n"
- "*** to \"false\" in DRIConf.\n");
+
+ if (!savageScreen->bufs || savageScreen->chipset == S3_SUPERSAVAGE)
imesa->enable_vdma = GL_FALSE;
- }
+ else
+ imesa->enable_vdma = driQueryOptionb(&imesa->optionCache, "enable_vdma");
/* Configure swrast to match hardware characteristics:
*/
diff --git a/src/mesa/drivers/dri/savage/savagecontext.h b/src/mesa/drivers/dri/savage/savagecontext.h
index 2e9671afd9..3bf688ce10 100644
--- a/src/mesa/drivers/dri/savage/savagecontext.h
+++ b/src/mesa/drivers/dri/savage/savagecontext.h
@@ -86,7 +86,6 @@ typedef struct savage_texture_object_t *savageTextureObjectPtr;
/* Don't make it too big. We don't want to buffer up a whole frame
* that would force the application to wait later. */
#define SAVAGE_CMDBUF_SIZE 1024
-#define SAVAGE_MAX_VERTS_PENDING 1024
/* Use the templated vertex formats:
*/
@@ -226,7 +225,6 @@ struct savage_context_t {
GLfloat hw_viewport[16];
/* DRI stuff */
GLuint bufferSize;
- GLuint vertsPending;
GLframebuffer *glBuffer;
diff --git a/src/mesa/drivers/dri/savage/savagedd.c b/src/mesa/drivers/dri/savage/savagedd.c
index b0478169a9..b1fb3955de 100644
--- a/src/mesa/drivers/dri/savage/savagedd.c
+++ b/src/mesa/drivers/dri/savage/savagedd.c
@@ -41,7 +41,7 @@
#include "utils.h"
-#define DRIVER_DATE "20050120"
+#define DRIVER_DATE "20050305"
/***************************************
* Mesa's Driver Functions
diff --git a/src/mesa/drivers/dri/savage/savageioctl.c b/src/mesa/drivers/dri/savage/savageioctl.c
index 3c93255361..5399963cb9 100644
--- a/src/mesa/drivers/dri/savage/savageioctl.c
+++ b/src/mesa/drivers/dri/savage/savageioctl.c
@@ -57,6 +57,8 @@ void savageGetDMABuffer( savageContextPtr imesa )
int retcode;
drmBufPtr buf;
+ assert (imesa->savageScreen->bufs);
+
if (SAVAGE_DEBUG & DEBUG_DMA)
fprintf(stderr, "Getting dma buffer\n");
@@ -422,10 +424,9 @@ static void savageDDClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
}
-/* This is necessary as to prevent annyoing stuttering effects with
- * some games, though it does reduce the frame rate (glxgears)
- * slightly. I believe this is due to texture uploads which do not go
- * through the Savage command pipeline yet. */
+/* This is necessary to avoid very jerky animation on my ProSavageDDR.
+ * Seems to work fine on other Savages though. Make this configurable!
+ */
#define SYNC_FRAMES 1
/*
@@ -530,13 +531,6 @@ void savageFlushVertices( savageContextPtr imesa )
cmd->prim.start = buffer->flushed / imesa->HwVertexSize;
cmd->prim.count = buffer->used / imesa->HwVertexSize - cmd->prim.start;
buffer->flushed = buffer->used;
- /* Make sure we don't buffer too many vertices without
- * telling the hardware. */
- imesa->vertsPending += cmd->prim.count;
- if (imesa->vertsPending > SAVAGE_MAX_VERTS_PENDING) {
- savageFlushCmdBuf(imesa, GL_FALSE);
- imesa->vertsPending = 0;
- }
}
}
diff --git a/src/mesa/drivers/dri/savage/savagetris.c b/src/mesa/drivers/dri/savage/savagetris.c
index 405a58977b..1847040137 100644
--- a/src/mesa/drivers/dri/savage/savagetris.c
+++ b/src/mesa/drivers/dri/savage/savagetris.c
@@ -1192,11 +1192,8 @@ static void savageRenderStart( GLcontext *ctx )
static void savageRenderFinish( GLcontext *ctx )
{
- /* Flush the last primitive now, before any state is changed.
- * Alternatively state could be emitted in all state-changing
- * functions in savagestate.c and when changing the vertex format
- * above. */
- FLUSH_BATCH(SAVAGE_CONTEXT(ctx));
+ /* Flush the last primitive now, before any state is changed. */
+ savageFlushVertices(SAVAGE_CONTEXT(ctx));
if (SAVAGE_CONTEXT(ctx)->RenderIndex & SAVAGE_FALLBACK_BIT)
_swrast_flush( ctx );