mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 04:10:10 +01:00
Small cleanup:
* Remove some unused (mostly empty) functions * Added context parameter to WAIT_IDLE_EMPTY[_LOCKED] for consistency * Added debug messages to WAIT_IDLE_EMPTY[_LOCKED] * Don't flush empty command buffers
This commit is contained in:
parent
677d1d07c4
commit
fa15f6c840
6 changed files with 30 additions and 56 deletions
|
|
@ -537,7 +537,7 @@ savageDestroyContext(__DRIcontextPrivate *driContextPriv)
|
|||
savageFlushVertices(imesa);
|
||||
savageReleaseIndexedVerts(imesa);
|
||||
savageFlushCmdBuf(imesa, GL_TRUE); /* release DMA buffer */
|
||||
WAIT_IDLE_EMPTY;
|
||||
WAIT_IDLE_EMPTY(imesa);
|
||||
|
||||
/* update for multi-tex*/
|
||||
{
|
||||
|
|
@ -701,7 +701,7 @@ savageCloseFullScreen(__DRIcontextPrivate *driContextPriv)
|
|||
|
||||
if (driContextPriv) {
|
||||
savageContextPtr imesa = (savageContextPtr) driContextPriv->driverPrivate;
|
||||
WAIT_IDLE_EMPTY;
|
||||
WAIT_IDLE_EMPTY(imesa);
|
||||
imesa->IsFullScreen = GL_FALSE;
|
||||
imesa->savageScreen->frontOffset = imesa->backup_frontOffset;
|
||||
imesa->savageScreen->backOffset = imesa->backup_backOffset;
|
||||
|
|
|
|||
|
|
@ -455,30 +455,6 @@ void savageSwapBuffers( __DRIdrawablePrivate *dPriv )
|
|||
#endif
|
||||
}
|
||||
|
||||
/* This waits for *everybody* to finish rendering -- overkill.
|
||||
*/
|
||||
void savageDmaFinish( savageContextPtr imesa )
|
||||
{
|
||||
savageWaitEvent( imesa, savageEmitEventLocked( imesa, SAVAGE_WAIT_3D ) );
|
||||
}
|
||||
|
||||
|
||||
void savageRegetLockQuiescent( savageContextPtr imesa )
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
void savageWaitAgeLocked( savageContextPtr imesa, int age )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void savageWaitAge( savageContextPtr imesa, int age )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
unsigned int savageEmitEventLocked( savageContextPtr imesa, unsigned int flags )
|
||||
{
|
||||
drm_savage_event_emit_t event;
|
||||
|
|
@ -559,9 +535,15 @@ void savageFlushCmdBufLocked( savageContextPtr imesa, GLboolean discard )
|
|||
drm_savage_cmd_header_t *start;
|
||||
int ret;
|
||||
|
||||
if (!imesa->dmaVtxBuf.total)
|
||||
discard = GL_FALSE;
|
||||
|
||||
/* complete indexed drawing commands */
|
||||
savageFlushElts(imesa);
|
||||
|
||||
if (imesa->cmdBuf.write == imesa->cmdBuf.start && !discard)
|
||||
return;
|
||||
|
||||
/* If we lost the context we must restore the initial state (at
|
||||
* the start of the command buffer). */
|
||||
if (imesa->lostContext) {
|
||||
|
|
@ -570,9 +552,6 @@ void savageFlushCmdBufLocked( savageContextPtr imesa, GLboolean discard )
|
|||
} else
|
||||
start = imesa->cmdBuf.start;
|
||||
|
||||
if (!imesa->dmaVtxBuf.total)
|
||||
discard = GL_FALSE;
|
||||
|
||||
if ((SAVAGE_DEBUG & DEBUG_DMA) && discard)
|
||||
fprintf (stderr, "Discarding DMA buffer, used=%u\n",
|
||||
imesa->dmaVtxBuf.used);
|
||||
|
|
@ -647,9 +626,7 @@ static void savageDDFlush( GLcontext *ctx )
|
|||
fprintf (stderr, "%s\n", __FUNCTION__);
|
||||
savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
|
||||
savageFlushVertices (imesa);
|
||||
LOCK_HARDWARE(imesa);
|
||||
savageFlushCmdBufLocked(imesa, GL_FALSE);
|
||||
UNLOCK_HARDWARE(imesa);
|
||||
savageFlushCmdBuf(imesa, GL_FALSE);
|
||||
}
|
||||
|
||||
static void savageDDFinish( GLcontext *ctx )
|
||||
|
|
@ -658,10 +635,8 @@ static void savageDDFinish( GLcontext *ctx )
|
|||
fprintf (stderr, "%s\n", __FUNCTION__);
|
||||
savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
|
||||
savageFlushVertices (imesa);
|
||||
LOCK_HARDWARE(imesa);
|
||||
savageFlushCmdBufLocked(imesa, GL_FALSE);
|
||||
savageDmaFinish (imesa);
|
||||
UNLOCK_HARDWARE(imesa);
|
||||
savageFlushCmdBuf(imesa, GL_FALSE);
|
||||
WAIT_IDLE_EMPTY(imesa);
|
||||
}
|
||||
|
||||
void savageDDInitIoctlFuncs( GLcontext *ctx )
|
||||
|
|
|
|||
|
|
@ -28,14 +28,8 @@
|
|||
|
||||
#include "savagecontext.h"
|
||||
|
||||
void savageGetGeneralDmaBufferLocked( savageContextPtr mmesa );
|
||||
|
||||
void savageFlushVertices( savageContextPtr mmesa );
|
||||
|
||||
void savageFlushGeneralLocked( savageContextPtr imesa );
|
||||
void savageWaitAgeLocked( savageContextPtr imesa, int age );
|
||||
void savageWaitAge( savageContextPtr imesa, int age );
|
||||
|
||||
unsigned int savageEmitEventLocked( savageContextPtr imesa, unsigned int flags );
|
||||
unsigned int savageEmitEvent( savageContextPtr imesa, unsigned int flags );
|
||||
void savageWaitEvent( savageContextPtr imesa, unsigned int event);
|
||||
|
|
@ -43,17 +37,22 @@ void savageWaitEvent( savageContextPtr imesa, unsigned int event);
|
|||
void savageFlushCmdBufLocked( savageContextPtr imesa, GLboolean discard );
|
||||
void savageFlushCmdBuf( savageContextPtr imesa, GLboolean discard );
|
||||
|
||||
void savageDmaFinish( savageContextPtr imesa );
|
||||
|
||||
void savageRegetLockQuiescent( savageContextPtr imesa );
|
||||
|
||||
void savageDDInitIoctlFuncs( GLcontext *ctx );
|
||||
|
||||
void savageSwapBuffers( __DRIdrawablePrivate *dPriv );
|
||||
|
||||
#define WAIT_IDLE_EMPTY do { \
|
||||
#define WAIT_IDLE_EMPTY(imesa) do { \
|
||||
if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG) \
|
||||
fprintf (stderr, "WAIT_IDLE_EMPTY in %s\n", __FUNCTION__); \
|
||||
savageWaitEvent(imesa, \
|
||||
savageEmitEvent(imesa, SAVAGE_WAIT_3D|SAVAGE_WAIT_2D)); \
|
||||
savageEmitEvent(imesa, SAVAGE_WAIT_2D|SAVAGE_WAIT_3D)); \
|
||||
} while (0)
|
||||
|
||||
#define WAIT_IDLE_EMPTY_LOCKED(imesa) do { \
|
||||
if (SAVAGE_DEBUG & DEBUG_VERBOSE_MSG) \
|
||||
fprintf (stderr, "WAIT_IDLE_EMPTY_LOCKED in %s\n", __FUNCTION__); \
|
||||
savageWaitEvent(imesa, savageEmitEventLocked( \
|
||||
imesa, SAVAGE_WAIT_2D|SAVAGE_WAIT_3D)); \
|
||||
} while (0)
|
||||
|
||||
#define FLUSH_BATCH(imesa) do { \
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ savageCopyPixels( GLcontext *ctx,
|
|||
{
|
||||
savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
|
||||
FLUSH_BATCH(imesa);
|
||||
WAIT_IDLE_EMPTY;
|
||||
WAIT_IDLE_EMPTY(imesa);
|
||||
_swrast_CopyPixels(ctx, srcx, srcy, width, height, destx, desty, type);
|
||||
}
|
||||
static void
|
||||
|
|
@ -272,7 +272,7 @@ savageDrawPixels( GLcontext *ctx,
|
|||
{
|
||||
savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
|
||||
FLUSH_BATCH(imesa);
|
||||
WAIT_IDLE_EMPTY;
|
||||
WAIT_IDLE_EMPTY(imesa);
|
||||
_swrast_DrawPixels(ctx, x, y, width, height, format, type, packing, pixels);
|
||||
}
|
||||
static void
|
||||
|
|
@ -284,7 +284,7 @@ savageReadPixels( GLcontext *ctx,
|
|||
{
|
||||
savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
|
||||
FLUSH_BATCH(imesa);
|
||||
WAIT_IDLE_EMPTY;
|
||||
WAIT_IDLE_EMPTY(imesa);
|
||||
_swrast_ReadPixels(ctx, x, y, width, height, format, type, packing, pixels);
|
||||
}
|
||||
|
||||
|
|
@ -295,7 +295,7 @@ static void savageSpanRenderStart( GLcontext *ctx )
|
|||
{
|
||||
savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
|
||||
FLUSH_BATCH(imesa);
|
||||
WAIT_IDLE_EMPTY;
|
||||
WAIT_IDLE_EMPTY(imesa);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -800,7 +800,7 @@ int savageUploadTexImages( savageContextPtr imesa, savageTextureObjectPtr t )
|
|||
savageFlushVertices (imesa);
|
||||
LOCK_HARDWARE(imesa);
|
||||
savageFlushCmdBufLocked (imesa, GL_FALSE);
|
||||
savageDmaFinish (imesa);
|
||||
WAIT_IDLE_EMPTY_LOCKED(imesa);
|
||||
if (SAVAGE_DEBUG & DEBUG_VERBOSE_LRU)
|
||||
fprintf(stderr, "*");
|
||||
|
||||
|
|
|
|||
|
|
@ -557,7 +557,7 @@ savage_fallback_tri( savageContextPtr imesa,
|
|||
GLcontext *ctx = imesa->glCtx;
|
||||
SWvertex v[3];
|
||||
FLUSH_BATCH(imesa);
|
||||
WAIT_IDLE_EMPTY;
|
||||
WAIT_IDLE_EMPTY(imesa);
|
||||
_swsetup_Translate( ctx, v0, &v[0] );
|
||||
_swsetup_Translate( ctx, v1, &v[1] );
|
||||
_swsetup_Translate( ctx, v2, &v[2] );
|
||||
|
|
@ -573,7 +573,7 @@ savage_fallback_line( savageContextPtr imesa,
|
|||
GLcontext *ctx = imesa->glCtx;
|
||||
SWvertex v[2];
|
||||
FLUSH_BATCH(imesa);
|
||||
WAIT_IDLE_EMPTY;
|
||||
WAIT_IDLE_EMPTY(imesa);
|
||||
_swsetup_Translate( ctx, v0, &v[0] );
|
||||
_swsetup_Translate( ctx, v1, &v[1] );
|
||||
_swrast_Line( ctx, &v[0], &v[1] );
|
||||
|
|
@ -587,7 +587,7 @@ savage_fallback_point( savageContextPtr imesa,
|
|||
GLcontext *ctx = imesa->glCtx;
|
||||
SWvertex v[1];
|
||||
FLUSH_BATCH(imesa);
|
||||
WAIT_IDLE_EMPTY;
|
||||
WAIT_IDLE_EMPTY(imesa);
|
||||
_swsetup_Translate( ctx, v0, &v[0] );
|
||||
_swrast_Point( ctx, &v[0] );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue