From 150ed2e43d5541556d282cae728cebeec692e07a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 23 Jan 2005 06:27:08 +0000 Subject: [PATCH] add sync debugging to the radeon driver --- src/mesa/drivers/dri/radeon/radeon_context.c | 1 + src/mesa/drivers/dri/radeon/radeon_context.h | 1 + src/mesa/drivers/dri/radeon/radeon_ioctl.c | 10 ++++++++++ src/mesa/drivers/dri/radeon/radeon_texmem.c | 10 ++++++++++ 4 files changed, 22 insertions(+) diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 31ac5f2..4229d5c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -201,6 +201,7 @@ static const struct dri_debug_control debug_control[] = { "dri", DEBUG_DRI }, { "dma", DEBUG_DMA }, { "san", DEBUG_SANITY }, + { "sync", DEBUG_SYNC }, { NULL, 0 } }; diff --git a/src/mesa/drivers/dri/radeon/radeon_context.h b/src/mesa/drivers/dri/radeon/radeon_context.h index b97e58a..c180313 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_context.h @@ -848,6 +848,7 @@ extern int RADEON_DEBUG; #define DEBUG_DRI 0x200 #define DEBUG_DMA 0x400 #define DEBUG_SANITY 0x800 +#define DEBUG_SYNC 0x1000 #endif #endif /* __RADEON_CONTEXT_H__ */ diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.c b/src/mesa/drivers/dri/radeon/radeon_ioctl.c index ee1104d..2378285 100644 --- a/src/mesa/drivers/dri/radeon/radeon_ioctl.c +++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.c @@ -310,6 +310,11 @@ void radeonFlushElts( radeonContextPtr rmesa ) cmd[1] |= (dwords - 3) << 16; cmd[3] |= nr << RADEON_CP_VC_CNTL_NUM_SHIFT; #endif + + if (RADEON_DEBUG & DEBUG_SYNC) { + fprintf(stderr, "%s: Syncing\n", __FUNCTION__); + radeonFinish( rmesa->glCtx ); + } } @@ -580,6 +585,11 @@ static int radeonFlushCmdBufLocked( radeonContextPtr rmesa, if (ret) fprintf(stderr, "drmCommandWrite: %d\n", ret); + if (RADEON_DEBUG & DEBUG_SYNC) { + fprintf(stderr, "\nSyncing in %s\n\n", __FUNCTION__); + radeonWaitForIdleLocked( rmesa ); + } + out: rmesa->store.primnr = 0; rmesa->store.statenr = 0; diff --git a/src/mesa/drivers/dri/radeon/radeon_texmem.c b/src/mesa/drivers/dri/radeon/radeon_texmem.c index 6ac00c2..d910a6c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texmem.c +++ b/src/mesa/drivers/dri/radeon/radeon_texmem.c @@ -322,6 +322,11 @@ int radeonUploadTexImages( radeonContextPtr rmesa, radeonTexObjPtr t, GLuint fac if ( !t || t->base.totalSize == 0 ) return 0; + if (RADEON_DEBUG & DEBUG_SYNC) { + fprintf(stderr, "%s: Syncing\n", __FUNCTION__ ); + radeonFinish( rmesa->glCtx ); + } + LOCK_HARDWARE( rmesa ); if ( t->base.memBlock == NULL ) { @@ -364,5 +369,10 @@ int radeonUploadTexImages( radeonContextPtr rmesa, radeonTexObjPtr t, GLuint fac t->base.dirty_images[face] = 0; } + if (RADEON_DEBUG & DEBUG_SYNC) { + fprintf(stderr, "%s: Syncing\n", __FUNCTION__ ); + radeonFinish( rmesa->glCtx ); + } + return 0; } -- 2.7.4