mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
r100: Use shared debug code.
Converted r100 to use shared debug code with sed and fast compile check. New code has compability layer so old debugging code doesn't have to be changed all immidiatly.
This commit is contained in:
parent
f9a4a0a971
commit
4e0d99a635
24 changed files with 127 additions and 224 deletions
|
|
@ -15,17 +15,18 @@ CS_SOURCES = radeon_cs_space_drm.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
RADEON_COMMON_SOURCES = \
|
RADEON_COMMON_SOURCES = \
|
||||||
radeon_texture.c \
|
radeon_bo_legacy.c \
|
||||||
radeon_common_context.c \
|
radeon_common_context.c \
|
||||||
radeon_common.c \
|
radeon_common.c \
|
||||||
radeon_dma.c \
|
|
||||||
radeon_lock.c \
|
|
||||||
radeon_bo_legacy.c \
|
|
||||||
radeon_cs_legacy.c \
|
radeon_cs_legacy.c \
|
||||||
radeon_mipmap_tree.c \
|
radeon_dma.c \
|
||||||
radeon_span.c \
|
radeon_debug.c \
|
||||||
radeon_fbo.c \
|
radeon_fbo.c \
|
||||||
radeon_queryobj.c
|
radeon_lock.c \
|
||||||
|
radeon_mipmap_tree.c \
|
||||||
|
radeon_queryobj.c \
|
||||||
|
radeon_span.c \
|
||||||
|
radeon_texture.c
|
||||||
|
|
||||||
DRIVER_SOURCES = \
|
DRIVER_SOURCES = \
|
||||||
radeon_context.c \
|
radeon_context.c \
|
||||||
|
|
|
||||||
|
|
@ -640,7 +640,7 @@ static int bo_vram_validate(struct radeon_bo *bo,
|
||||||
&tex,
|
&tex,
|
||||||
sizeof(drm_radeon_texture_t));
|
sizeof(drm_radeon_texture_t));
|
||||||
if (ret) {
|
if (ret) {
|
||||||
if (RADEON_DEBUG & DEBUG_IOCTL)
|
if (RADEON_DEBUG & RADEON_IOCTL)
|
||||||
fprintf(stderr, "DRM_RADEON_TEXTURE: again!\n");
|
fprintf(stderr, "DRM_RADEON_TEXTURE: again!\n");
|
||||||
usleep(1);
|
usleep(1);
|
||||||
}
|
}
|
||||||
|
|
@ -677,7 +677,7 @@ static int bo_vram_validate(struct radeon_bo *bo,
|
||||||
&tex,
|
&tex,
|
||||||
sizeof(drm_radeon_texture_t));
|
sizeof(drm_radeon_texture_t));
|
||||||
if (ret) {
|
if (ret) {
|
||||||
if (RADEON_DEBUG & DEBUG_IOCTL)
|
if (RADEON_DEBUG & RADEON_IOCTL)
|
||||||
fprintf(stderr, "DRM_RADEON_TEXTURE: again!\n");
|
fprintf(stderr, "DRM_RADEON_TEXTURE: again!\n");
|
||||||
usleep(1);
|
usleep(1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
* 1 most output
|
* 1 most output
|
||||||
* 2 also print state alues
|
* 2 also print state alues
|
||||||
*/
|
*/
|
||||||
#define DEBUG_CMDBUF 0
|
#define RADEON_CMDBUF 0
|
||||||
|
|
||||||
/* =============================================================
|
/* =============================================================
|
||||||
* Scissoring
|
* Scissoring
|
||||||
|
|
@ -521,7 +521,7 @@ void radeonCopyBuffer( __DRIdrawablePrivate *dPriv,
|
||||||
|
|
||||||
rfb = dPriv->driverPrivate;
|
rfb = dPriv->driverPrivate;
|
||||||
|
|
||||||
if ( RADEON_DEBUG & DEBUG_IOCTL ) {
|
if ( RADEON_DEBUG & RADEON_IOCTL ) {
|
||||||
fprintf( stderr, "\n%s( %p )\n\n", __FUNCTION__, (void *) rmesa->glCtx );
|
fprintf( stderr, "\n%s( %p )\n\n", __FUNCTION__, (void *) rmesa->glCtx );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -615,7 +615,7 @@ static GLboolean radeonPageFlip( __DRIdrawablePrivate *dPriv )
|
||||||
|
|
||||||
LOCK_HARDWARE(radeon);
|
LOCK_HARDWARE(radeon);
|
||||||
|
|
||||||
if ( RADEON_DEBUG & DEBUG_IOCTL ) {
|
if ( RADEON_DEBUG & RADEON_IOCTL ) {
|
||||||
fprintf(stderr, "%s: pfCurrentPage: %d %d\n", __FUNCTION__,
|
fprintf(stderr, "%s: pfCurrentPage: %d %d\n", __FUNCTION__,
|
||||||
radeon->sarea->pfCurrentPage, radeon->sarea->pfState);
|
radeon->sarea->pfCurrentPage, radeon->sarea->pfState);
|
||||||
}
|
}
|
||||||
|
|
@ -875,7 +875,7 @@ void radeon_draw_buffer(GLcontext *ctx, struct gl_framebuffer *fb)
|
||||||
*/
|
*/
|
||||||
void radeonDrawBuffer( GLcontext *ctx, GLenum mode )
|
void radeonDrawBuffer( GLcontext *ctx, GLenum mode )
|
||||||
{
|
{
|
||||||
if (RADEON_DEBUG & DEBUG_DRI)
|
if (RADEON_DEBUG & RADEON_DRI)
|
||||||
fprintf(stderr, "%s %s\n", __FUNCTION__,
|
fprintf(stderr, "%s %s\n", __FUNCTION__,
|
||||||
_mesa_lookup_enum_by_nr( mode ));
|
_mesa_lookup_enum_by_nr( mode ));
|
||||||
|
|
||||||
|
|
@ -981,7 +981,7 @@ static void radeon_print_state_atom_prekmm(radeonContextPtr radeon, struct radeo
|
||||||
|
|
||||||
fprintf(stderr, " emit %s %d/%d\n", state->name, dwords, state->cmd_size);
|
fprintf(stderr, " emit %s %d/%d\n", state->name, dwords, state->cmd_size);
|
||||||
|
|
||||||
if (DEBUG_CMDBUF > 1 && RADEON_DEBUG & DEBUG_VERBOSE) {
|
if (radeon_is_debug_enabled(RADEON_STATE, RADEON_TRACE)) {
|
||||||
if (dwords > state->cmd_size)
|
if (dwords > state->cmd_size)
|
||||||
dwords = state->cmd_size;
|
dwords = state->cmd_size;
|
||||||
|
|
||||||
|
|
@ -1006,7 +1006,7 @@ static void radeon_print_state_atom(radeonContextPtr radeon, struct radeon_state
|
||||||
int i, j, reg, count;
|
int i, j, reg, count;
|
||||||
int dwords;
|
int dwords;
|
||||||
uint32_t packet0;
|
uint32_t packet0;
|
||||||
if (! (DEBUG_CMDBUF && RADEON_DEBUG & DEBUG_STATE) )
|
if (!radeon_is_debug_enabled(RADEON_STATE, RADEON_VERBOSE) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!radeon->radeonScreen->kernel_mm) {
|
if (!radeon->radeonScreen->kernel_mm) {
|
||||||
|
|
@ -1018,7 +1018,7 @@ static void radeon_print_state_atom(radeonContextPtr radeon, struct radeon_state
|
||||||
|
|
||||||
fprintf(stderr, " emit %s %d/%d\n", state->name, dwords, state->cmd_size);
|
fprintf(stderr, " emit %s %d/%d\n", state->name, dwords, state->cmd_size);
|
||||||
|
|
||||||
if (DEBUG_CMDBUF > 1 && RADEON_DEBUG & DEBUG_VERBOSE) {
|
if (radeon_is_debug_enabled(RADEON_STATE, RADEON_TRACE)) {
|
||||||
if (dwords > state->cmd_size)
|
if (dwords > state->cmd_size)
|
||||||
dwords = state->cmd_size;
|
dwords = state->cmd_size;
|
||||||
for (i = 0; i < dwords;) {
|
for (i = 0; i < dwords;) {
|
||||||
|
|
@ -1046,17 +1046,15 @@ GLuint radeonCountStateEmitSize(radeonContextPtr radeon)
|
||||||
struct radeon_state_atom *atom;
|
struct radeon_state_atom *atom;
|
||||||
GLuint dwords = 0;
|
GLuint dwords = 0;
|
||||||
/* check if we are going to emit full state */
|
/* check if we are going to emit full state */
|
||||||
if (DEBUG_CMDBUF && RADEON_DEBUG & DEBUG_VERBOSE)
|
|
||||||
fprintf(stderr, "%s\n", __func__);
|
|
||||||
|
|
||||||
if (radeon->cmdbuf.cs->cdw && !radeon->hw.all_dirty) {
|
if (radeon->cmdbuf.cs->cdw && !radeon->hw.all_dirty) {
|
||||||
if (!radeon->hw.is_dirty)
|
if (!radeon->hw.is_dirty)
|
||||||
return dwords;
|
goto out;
|
||||||
foreach(atom, &radeon->hw.atomlist) {
|
foreach(atom, &radeon->hw.atomlist) {
|
||||||
if (atom->dirty) {
|
if (atom->dirty) {
|
||||||
const GLuint atom_size = atom->check(radeon->glCtx, atom);
|
const GLuint atom_size = atom->check(radeon->glCtx, atom);
|
||||||
dwords += atom_size;
|
dwords += atom_size;
|
||||||
if (DEBUG_CMDBUF && atom_size) {
|
if (RADEON_CMDBUF && atom_size) {
|
||||||
radeon_print_state_atom(radeon, atom);
|
radeon_print_state_atom(radeon, atom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1065,12 +1063,14 @@ GLuint radeonCountStateEmitSize(radeonContextPtr radeon)
|
||||||
foreach(atom, &radeon->hw.atomlist) {
|
foreach(atom, &radeon->hw.atomlist) {
|
||||||
const GLuint atom_size = atom->check(radeon->glCtx, atom);
|
const GLuint atom_size = atom->check(radeon->glCtx, atom);
|
||||||
dwords += atom_size;
|
dwords += atom_size;
|
||||||
if (DEBUG_CMDBUF && atom_size) {
|
if (RADEON_CMDBUF && atom_size) {
|
||||||
radeon_print_state_atom(radeon, atom);
|
radeon_print_state_atom(radeon, atom);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
out:
|
||||||
|
radeon_print(RADEON_STATE, RADEON_NORMAL, "%s %u\n", __func__, dwords);
|
||||||
return dwords;
|
return dwords;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1092,10 +1092,7 @@ static INLINE void radeon_emit_atom(radeonContextPtr radeon, struct radeon_state
|
||||||
END_BATCH();
|
END_BATCH();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (DEBUG_CMDBUF && RADEON_DEBUG & DEBUG_STATE) {
|
radeon_print(RADEON_STATE, RADEON_VERBOSE, " skip state %s\n", atom->name);
|
||||||
fprintf(stderr, " skip state %s\n",
|
|
||||||
atom->name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
atom->dirty = GL_FALSE;
|
atom->dirty = GL_FALSE;
|
||||||
|
|
||||||
|
|
@ -1135,8 +1132,7 @@ static GLboolean radeon_revalidate_bos(GLcontext *ctx)
|
||||||
|
|
||||||
void radeonEmitState(radeonContextPtr radeon)
|
void radeonEmitState(radeonContextPtr radeon)
|
||||||
{
|
{
|
||||||
if (RADEON_DEBUG & (DEBUG_STATE|DEBUG_PRIMS))
|
radeon_print(RADEON_STATE, RADEON_NORMAL, "%s\n", __FUNCTION__);
|
||||||
fprintf(stderr, "%s\n", __FUNCTION__);
|
|
||||||
|
|
||||||
if (radeon->vtbl.pre_emit_state)
|
if (radeon->vtbl.pre_emit_state)
|
||||||
radeon->vtbl.pre_emit_state(radeon);
|
radeon->vtbl.pre_emit_state(radeon);
|
||||||
|
|
@ -1146,13 +1142,13 @@ void radeonEmitState(radeonContextPtr radeon)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!radeon->cmdbuf.cs->cdw) {
|
if (!radeon->cmdbuf.cs->cdw) {
|
||||||
if (RADEON_DEBUG & DEBUG_STATE)
|
if (RADEON_DEBUG & RADEON_STATE)
|
||||||
fprintf(stderr, "Begin reemit state\n");
|
fprintf(stderr, "Begin reemit state\n");
|
||||||
|
|
||||||
radeonEmitAtoms(radeon, GL_TRUE);
|
radeonEmitAtoms(radeon, GL_TRUE);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_STATE)
|
if (RADEON_DEBUG & RADEON_STATE)
|
||||||
fprintf(stderr, "Begin dirty state\n");
|
fprintf(stderr, "Begin dirty state\n");
|
||||||
|
|
||||||
radeonEmitAtoms(radeon, GL_FALSE);
|
radeonEmitAtoms(radeon, GL_FALSE);
|
||||||
|
|
@ -1166,7 +1162,7 @@ void radeonEmitState(radeonContextPtr radeon)
|
||||||
void radeonFlush(GLcontext *ctx)
|
void radeonFlush(GLcontext *ctx)
|
||||||
{
|
{
|
||||||
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
|
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
|
||||||
if (RADEON_DEBUG & DEBUG_IOCTL)
|
if (RADEON_DEBUG & RADEON_IOCTL)
|
||||||
fprintf(stderr, "%s %d\n", __FUNCTION__, radeon->cmdbuf.cs->cdw);
|
fprintf(stderr, "%s %d\n", __FUNCTION__, radeon->cmdbuf.cs->cdw);
|
||||||
|
|
||||||
/* okay if we have no cmds in the buffer &&
|
/* okay if we have no cmds in the buffer &&
|
||||||
|
|
@ -1258,7 +1254,7 @@ int rcommonFlushCmdBufLocked(radeonContextPtr rmesa, const char *caller)
|
||||||
}
|
}
|
||||||
rmesa->cmdbuf.flushing = 1;
|
rmesa->cmdbuf.flushing = 1;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_IOCTL) {
|
if (RADEON_DEBUG & RADEON_IOCTL) {
|
||||||
fprintf(stderr, "%s from %s - %i cliprects\n",
|
fprintf(stderr, "%s from %s - %i cliprects\n",
|
||||||
__FUNCTION__, caller, rmesa->numClipRects);
|
__FUNCTION__, caller, rmesa->numClipRects);
|
||||||
}
|
}
|
||||||
|
|
@ -1327,15 +1323,13 @@ void rcommonInitCmdBuf(radeonContextPtr rmesa)
|
||||||
if (size > 64 * 256)
|
if (size > 64 * 256)
|
||||||
size = 64 * 256;
|
size = 64 * 256;
|
||||||
|
|
||||||
if (RADEON_DEBUG & (DEBUG_IOCTL | DEBUG_DMA)) {
|
radeon_print(RADEON_CS, RADEON_VERBOSE,
|
||||||
fprintf(stderr, "sizeof(drm_r300_cmd_header_t)=%zd\n",
|
"sizeof(drm_r300_cmd_header_t)=%zd\n", sizeof(drm_r300_cmd_header_t));
|
||||||
sizeof(drm_r300_cmd_header_t));
|
radeon_print(RADEON_CS, RADEON_VERBOSE,
|
||||||
fprintf(stderr, "sizeof(drm_radeon_cmd_buffer_t)=%zd\n",
|
"sizeof(drm_radeon_cmd_buffer_t)=%zd\n", sizeof(drm_radeon_cmd_buffer_t));
|
||||||
sizeof(drm_radeon_cmd_buffer_t));
|
radeon_print(RADEON_CS, RADEON_VERBOSE,
|
||||||
fprintf(stderr,
|
|
||||||
"Allocating %d bytes command buffer (max state is %d bytes)\n",
|
"Allocating %d bytes command buffer (max state is %d bytes)\n",
|
||||||
size * 4, rmesa->hw.max_state_size * 4);
|
size * 4, rmesa->hw.max_state_size * 4);
|
||||||
}
|
|
||||||
|
|
||||||
if (rmesa->radeonScreen->kernel_mm) {
|
if (rmesa->radeonScreen->kernel_mm) {
|
||||||
int fd = rmesa->radeonScreen->driScreen->fd;
|
int fd = rmesa->radeonScreen->driScreen->fd;
|
||||||
|
|
@ -1388,14 +1382,13 @@ void rcommonBeginBatch(radeonContextPtr rmesa, int n,
|
||||||
int line)
|
int line)
|
||||||
{
|
{
|
||||||
if (!rmesa->cmdbuf.cs->cdw && dostate) {
|
if (!rmesa->cmdbuf.cs->cdw && dostate) {
|
||||||
if (RADEON_DEBUG & DEBUG_IOCTL)
|
radeon_print(RADEON_STATE, RADEON_NORMAL,
|
||||||
fprintf(stderr, "Reemit state after flush (from %s)\n", function);
|
"Reemit state after flush (from %s)\n", function);
|
||||||
radeonEmitState(rmesa);
|
radeonEmitState(rmesa);
|
||||||
}
|
}
|
||||||
radeon_cs_begin(rmesa->cmdbuf.cs, n, file, function, line);
|
radeon_cs_begin(rmesa->cmdbuf.cs, n, file, function, line);
|
||||||
|
|
||||||
if (DEBUG_CMDBUF && RADEON_DEBUG & DEBUG_IOCTL)
|
radeon_print(RADEON_CS, RADEON_VERBOSE, "BEGIN_BATCH(%d) at %d, from %s:%i\n",
|
||||||
fprintf(stderr, "BEGIN_BATCH(%d) at %d, from %s:%i\n",
|
|
||||||
n, rmesa->cmdbuf.cs->cdw, function, line);
|
n, rmesa->cmdbuf.cs->cdw, function, line);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -363,7 +363,7 @@ GLboolean radeonUnbindContext(__DRIcontextPrivate * driContextPriv)
|
||||||
{
|
{
|
||||||
radeonContextPtr radeon = (radeonContextPtr) driContextPriv->driverPrivate;
|
radeonContextPtr radeon = (radeonContextPtr) driContextPriv->driverPrivate;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_DRI)
|
if (RADEON_DEBUG & RADEON_DRI)
|
||||||
fprintf(stderr, "%s ctx %p\n", __FUNCTION__,
|
fprintf(stderr, "%s ctx %p\n", __FUNCTION__,
|
||||||
radeon->glCtx);
|
radeon->glCtx);
|
||||||
|
|
||||||
|
|
@ -527,7 +527,7 @@ radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
|
||||||
char *regname;
|
char *regname;
|
||||||
struct radeon_bo *depth_bo = NULL, *bo;
|
struct radeon_bo *depth_bo = NULL, *bo;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_DRI)
|
if (RADEON_DEBUG & RADEON_DRI)
|
||||||
fprintf(stderr, "enter %s, drawable %p\n", __func__, drawable);
|
fprintf(stderr, "enter %s, drawable %p\n", __func__, drawable);
|
||||||
|
|
||||||
draw = drawable->driverPrivate;
|
draw = drawable->driverPrivate;
|
||||||
|
|
@ -654,7 +654,7 @@ radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_DRI)
|
if (RADEON_DEBUG & RADEON_DRI)
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"attaching buffer %s, %d, at %d, cpp %d, pitch %d\n",
|
"attaching buffer %s, %d, at %d, cpp %d, pitch %d\n",
|
||||||
regname, buffers[i].name, buffers[i].attachment,
|
regname, buffers[i].name, buffers[i].attachment,
|
||||||
|
|
@ -667,7 +667,7 @@ radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
|
||||||
rb->has_surface = 0;
|
rb->has_surface = 0;
|
||||||
|
|
||||||
if (buffers[i].attachment == __DRI_BUFFER_STENCIL && depth_bo) {
|
if (buffers[i].attachment == __DRI_BUFFER_STENCIL && depth_bo) {
|
||||||
if (RADEON_DEBUG & DEBUG_DRI)
|
if (RADEON_DEBUG & RADEON_DRI)
|
||||||
fprintf(stderr, "(reusing depth buffer as stencil)\n");
|
fprintf(stderr, "(reusing depth buffer as stencil)\n");
|
||||||
bo = depth_bo;
|
bo = depth_bo;
|
||||||
radeon_bo_ref(bo);
|
radeon_bo_ref(bo);
|
||||||
|
|
@ -740,7 +740,7 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv,
|
||||||
struct gl_framebuffer *readfb;
|
struct gl_framebuffer *readfb;
|
||||||
|
|
||||||
if (!driContextPriv) {
|
if (!driContextPriv) {
|
||||||
if (RADEON_DEBUG & DEBUG_DRI)
|
if (RADEON_DEBUG & RADEON_DRI)
|
||||||
fprintf(stderr, "%s ctx is null\n", __FUNCTION__);
|
fprintf(stderr, "%s ctx is null\n", __FUNCTION__);
|
||||||
_mesa_make_current(NULL, NULL, NULL);
|
_mesa_make_current(NULL, NULL, NULL);
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
|
|
@ -762,7 +762,7 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv,
|
||||||
radeon_make_renderbuffer_current(radeon, drfb);
|
radeon_make_renderbuffer_current(radeon, drfb);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_DRI)
|
if (RADEON_DEBUG & RADEON_DRI)
|
||||||
fprintf(stderr, "%s ctx %p dfb %p rfb %p\n", __FUNCTION__, radeon->glCtx, drfb, readfb);
|
fprintf(stderr, "%s ctx %p dfb %p rfb %p\n", __FUNCTION__, radeon->glCtx, drfb, readfb);
|
||||||
|
|
||||||
driUpdateFramebufferSize(radeon->glCtx, driDrawPriv);
|
driUpdateFramebufferSize(radeon->glCtx, driDrawPriv);
|
||||||
|
|
@ -797,7 +797,7 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_DRI)
|
if (RADEON_DEBUG & RADEON_DRI)
|
||||||
fprintf(stderr, "End %s\n", __FUNCTION__);
|
fprintf(stderr, "End %s\n", __FUNCTION__);
|
||||||
|
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
#include "tnl/t_context.h"
|
#include "tnl/t_context.h"
|
||||||
#include "main/colormac.h"
|
#include "main/colormac.h"
|
||||||
|
|
||||||
|
#include "radeon_debug.h"
|
||||||
#include "radeon_screen.h"
|
#include "radeon_screen.h"
|
||||||
#include "radeon_drm.h"
|
#include "radeon_drm.h"
|
||||||
#include "dri_util.h"
|
#include "dri_util.h"
|
||||||
|
|
@ -18,22 +19,6 @@ struct radeon_context;
|
||||||
|
|
||||||
#include "radeon_bocs_wrapper.h"
|
#include "radeon_bocs_wrapper.h"
|
||||||
|
|
||||||
/* From http://gcc. gnu.org/onlinedocs/gcc-3.2.3/gcc/Variadic-Macros.html .
|
|
||||||
I suppose we could inline this and use macro to fetch out __LINE__ and stuff in case we run into trouble
|
|
||||||
with other compilers ... GLUE!
|
|
||||||
*/
|
|
||||||
#define WARN_ONCE(a, ...) { \
|
|
||||||
static int warn##__LINE__=1; \
|
|
||||||
if(warn##__LINE__){ \
|
|
||||||
fprintf(stderr, "*********************************WARN_ONCE*********************************\n"); \
|
|
||||||
fprintf(stderr, "File %s function %s line %d\n", \
|
|
||||||
__FILE__, __FUNCTION__, __LINE__); \
|
|
||||||
fprintf(stderr, a, ## __VA_ARGS__);\
|
|
||||||
fprintf(stderr, "***************************************************************************\n"); \
|
|
||||||
warn##__LINE__=0;\
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This union is used to avoid warnings/miscompilation
|
/* This union is used to avoid warnings/miscompilation
|
||||||
with float to uint32_t casts due to strict-aliasing */
|
with float to uint32_t casts due to strict-aliasing */
|
||||||
typedef union { GLfloat f; uint32_t ui32; } float_ui32_type;
|
typedef union { GLfloat f; uint32_t ui32; } float_ui32_type;
|
||||||
|
|
@ -401,23 +386,6 @@ struct radeon_dri_mirror {
|
||||||
int drmMinor;
|
int drmMinor;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define DEBUG_TEXTURE 0x001
|
|
||||||
#define DEBUG_STATE 0x002
|
|
||||||
#define DEBUG_IOCTL 0x004
|
|
||||||
#define DEBUG_PRIMS 0x008
|
|
||||||
#define DEBUG_VERTS 0x010
|
|
||||||
#define DEBUG_FALLBACKS 0x020
|
|
||||||
#define DEBUG_VFMT 0x040
|
|
||||||
#define DEBUG_CODEGEN 0x080
|
|
||||||
#define DEBUG_VERBOSE 0x100
|
|
||||||
#define DEBUG_DRI 0x200
|
|
||||||
#define DEBUG_DMA 0x400
|
|
||||||
#define DEBUG_SANITY 0x800
|
|
||||||
#define DEBUG_SYNC 0x1000
|
|
||||||
#define DEBUG_PIXEL 0x2000
|
|
||||||
#define DEBUG_MEMORY 0x4000
|
|
||||||
|
|
||||||
|
|
||||||
typedef void (*radeon_tri_func) (radeonContextPtr,
|
typedef void (*radeon_tri_func) (radeonContextPtr,
|
||||||
radeonVertex *,
|
radeonVertex *,
|
||||||
radeonVertex *, radeonVertex *);
|
radeonVertex *, radeonVertex *);
|
||||||
|
|
@ -621,15 +589,4 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv,
|
||||||
__DRIdrawablePrivate * driReadPriv);
|
__DRIdrawablePrivate * driReadPriv);
|
||||||
extern void radeonDestroyContext(__DRIcontextPrivate * driContextPriv);
|
extern void radeonDestroyContext(__DRIcontextPrivate * driContextPriv);
|
||||||
|
|
||||||
/* ================================================================
|
|
||||||
* Debugging:
|
|
||||||
*/
|
|
||||||
#define DO_DEBUG 1
|
|
||||||
|
|
||||||
#if DO_DEBUG
|
|
||||||
extern int RADEON_DEBUG;
|
|
||||||
#else
|
|
||||||
#define RADEON_DEBUG 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -137,25 +137,6 @@ static const struct tnl_pipeline_stage *radeon_pipeline[] = {
|
||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct dri_debug_control debug_control[] =
|
|
||||||
{
|
|
||||||
{ "fall", DEBUG_FALLBACKS },
|
|
||||||
{ "tex", DEBUG_TEXTURE },
|
|
||||||
{ "ioctl", DEBUG_IOCTL },
|
|
||||||
{ "prim", DEBUG_PRIMS },
|
|
||||||
{ "vert", DEBUG_VERTS },
|
|
||||||
{ "state", DEBUG_STATE },
|
|
||||||
{ "code", DEBUG_CODEGEN },
|
|
||||||
{ "vfmt", DEBUG_VFMT },
|
|
||||||
{ "vtxf", DEBUG_VFMT },
|
|
||||||
{ "verb", DEBUG_VERBOSE },
|
|
||||||
{ "dri", DEBUG_DRI },
|
|
||||||
{ "dma", DEBUG_DMA },
|
|
||||||
{ "san", DEBUG_SANITY },
|
|
||||||
{ "sync", DEBUG_SYNC },
|
|
||||||
{ NULL, 0 }
|
|
||||||
};
|
|
||||||
|
|
||||||
static void r100_get_lock(radeonContextPtr radeon)
|
static void r100_get_lock(radeonContextPtr radeon)
|
||||||
{
|
{
|
||||||
r100ContextPtr rmesa = (r100ContextPtr)radeon;
|
r100ContextPtr rmesa = (r100ContextPtr)radeon;
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ static const struct dri_debug_control debug_control[] = {
|
||||||
{"fall", RADEON_FALLBACKS},
|
{"fall", RADEON_FALLBACKS},
|
||||||
{"tex", RADEON_TEXTURE},
|
{"tex", RADEON_TEXTURE},
|
||||||
{"ioctl", RADEON_IOCTL},
|
{"ioctl", RADEON_IOCTL},
|
||||||
|
{"verts", RADEON_RENDER},
|
||||||
{"render", RADEON_RENDER},
|
{"render", RADEON_RENDER},
|
||||||
{"swrender", RADEON_SWRENDER},
|
{"swrender", RADEON_SWRENDER},
|
||||||
{"state", RADEON_STATE},
|
{"state", RADEON_STATE},
|
||||||
|
|
|
||||||
|
|
@ -49,22 +49,23 @@ typedef enum radeon_debug_levels {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef enum radeon_debug_types {
|
typedef enum radeon_debug_types {
|
||||||
RADEON_TEXTURE = 0x0001,
|
RADEON_TEXTURE = 0x00001,
|
||||||
RADEON_STATE = 0x0002,
|
RADEON_STATE = 0x00002,
|
||||||
RADEON_IOCTL = 0x0004,
|
RADEON_IOCTL = 0x00004,
|
||||||
RADEON_RENDER = 0x0008,
|
RADEON_RENDER = 0x00008,
|
||||||
RADEON_SWRENDER = 0x0010,
|
RADEON_SWRENDER = 0x00010,
|
||||||
RADEON_FALLBACKS = 0x0020,
|
RADEON_FALLBACKS = 0x00020,
|
||||||
RADEON_VFMT = 0x0040,
|
RADEON_VFMT = 0x00040,
|
||||||
RADEON_SHADER = 0x0080,
|
RADEON_SHADER = 0x00080,
|
||||||
RADEON_CS = 0x0100,
|
RADEON_CS = 0x00100,
|
||||||
RADEON_DRI = 0x0200,
|
RADEON_DRI = 0x00200,
|
||||||
RADEON_DMA = 0x0400,
|
RADEON_DMA = 0x00400,
|
||||||
RADEON_SANITY = 0x0800,
|
RADEON_SANITY = 0x00800,
|
||||||
RADEON_SYNC = 0x1000,
|
RADEON_SYNC = 0x01000,
|
||||||
RADEON_PIXEL = 0x2000,
|
RADEON_PIXEL = 0x02000,
|
||||||
RADEON_MEMORY = 0x4000,
|
RADEON_MEMORY = 0x04000,
|
||||||
RADEON_GENERAL = 0x8000 /* Used for errors and warnings */
|
RADEON_VERTS = 0x08000,
|
||||||
|
RADEON_GENERAL = 0x10000 /* Used for errors and warnings */
|
||||||
} radeon_debug_type_t;
|
} radeon_debug_type_t;
|
||||||
|
|
||||||
extern radeon_debug_type_t radeon_enabled_debug_types;
|
extern radeon_debug_type_t radeon_enabled_debug_types;
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ void radeonEmitVec4(uint32_t *out, const GLvoid * data, int stride, int count)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_VERTS)
|
if (RADEON_DEBUG & RADEON_VERTS)
|
||||||
fprintf(stderr, "%s count %d stride %d out %p data %p\n",
|
fprintf(stderr, "%s count %d stride %d out %p data %p\n",
|
||||||
__FUNCTION__, count, stride, (void *)out, (void *)data);
|
__FUNCTION__, count, stride, (void *)out, (void *)data);
|
||||||
|
|
||||||
|
|
@ -76,7 +76,7 @@ void radeonEmitVec8(uint32_t *out, const GLvoid * data, int stride, int count)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_VERTS)
|
if (RADEON_DEBUG & RADEON_VERTS)
|
||||||
fprintf(stderr, "%s count %d stride %d out %p data %p\n",
|
fprintf(stderr, "%s count %d stride %d out %p data %p\n",
|
||||||
__FUNCTION__, count, stride, (void *)out, (void *)data);
|
__FUNCTION__, count, stride, (void *)out, (void *)data);
|
||||||
|
|
||||||
|
|
@ -95,7 +95,7 @@ void radeonEmitVec12(uint32_t *out, const GLvoid * data, int stride, int count)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_VERTS)
|
if (RADEON_DEBUG & RADEON_VERTS)
|
||||||
fprintf(stderr, "%s count %d stride %d out %p data %p\n",
|
fprintf(stderr, "%s count %d stride %d out %p data %p\n",
|
||||||
__FUNCTION__, count, stride, (void *)out, (void *)data);
|
__FUNCTION__, count, stride, (void *)out, (void *)data);
|
||||||
|
|
||||||
|
|
@ -116,7 +116,7 @@ void radeonEmitVec16(uint32_t *out, const GLvoid * data, int stride, int count)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_VERTS)
|
if (RADEON_DEBUG & RADEON_VERTS)
|
||||||
fprintf(stderr, "%s count %d stride %d out %p data %p\n",
|
fprintf(stderr, "%s count %d stride %d out %p data %p\n",
|
||||||
__FUNCTION__, count, stride, (void *)out, (void *)data);
|
__FUNCTION__, count, stride, (void *)out, (void *)data);
|
||||||
|
|
||||||
|
|
@ -179,8 +179,8 @@ void radeonRefillCurrentDmaRegion(radeonContextPtr rmesa, int size)
|
||||||
if (size > rmesa->dma.minimum_size)
|
if (size > rmesa->dma.minimum_size)
|
||||||
rmesa->dma.minimum_size = (size + 15) & (~15);
|
rmesa->dma.minimum_size = (size + 15) & (~15);
|
||||||
|
|
||||||
if (RADEON_DEBUG & (DEBUG_IOCTL | DEBUG_DMA))
|
radeon_print(RADEON_DMA, RADEON_NORMAL, "%s size %d minimum_size %d\n",
|
||||||
fprintf(stderr, "%s\n", __FUNCTION__);
|
__FUNCTION__, size, rmesa->dma.minimum_size);
|
||||||
|
|
||||||
|
|
||||||
/* unmap old reserved bo */
|
/* unmap old reserved bo */
|
||||||
|
|
@ -235,7 +235,7 @@ void radeonAllocDmaRegion(radeonContextPtr rmesa,
|
||||||
struct radeon_bo **pbo, int *poffset,
|
struct radeon_bo **pbo, int *poffset,
|
||||||
int bytes, int alignment)
|
int bytes, int alignment)
|
||||||
{
|
{
|
||||||
if (RADEON_DEBUG & DEBUG_IOCTL)
|
if (RADEON_DEBUG & RADEON_IOCTL)
|
||||||
fprintf(stderr, "%s %d\n", __FUNCTION__, bytes);
|
fprintf(stderr, "%s %d\n", __FUNCTION__, bytes);
|
||||||
|
|
||||||
if (rmesa->dma.flush)
|
if (rmesa->dma.flush)
|
||||||
|
|
@ -265,7 +265,7 @@ void radeonFreeDmaRegions(radeonContextPtr rmesa)
|
||||||
{
|
{
|
||||||
struct radeon_dma_bo *dma_bo = CALLOC_STRUCT(radeon_dma_bo);
|
struct radeon_dma_bo *dma_bo = CALLOC_STRUCT(radeon_dma_bo);
|
||||||
struct radeon_dma_bo *temp;
|
struct radeon_dma_bo *temp;
|
||||||
if (RADEON_DEBUG & DEBUG_DMA)
|
if (RADEON_DEBUG & RADEON_DMA)
|
||||||
fprintf(stderr, "%s\n", __FUNCTION__);
|
fprintf(stderr, "%s\n", __FUNCTION__);
|
||||||
|
|
||||||
foreach_s(dma_bo, temp, &rmesa->dma.free) {
|
foreach_s(dma_bo, temp, &rmesa->dma.free) {
|
||||||
|
|
@ -293,7 +293,7 @@ void radeonReturnDmaRegion(radeonContextPtr rmesa, int return_bytes)
|
||||||
if (is_empty_list(&rmesa->dma.reserved))
|
if (is_empty_list(&rmesa->dma.reserved))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_IOCTL)
|
if (RADEON_DEBUG & RADEON_IOCTL)
|
||||||
fprintf(stderr, "%s %d\n", __FUNCTION__, return_bytes);
|
fprintf(stderr, "%s %d\n", __FUNCTION__, return_bytes);
|
||||||
rmesa->dma.current_used -= return_bytes;
|
rmesa->dma.current_used -= return_bytes;
|
||||||
rmesa->dma.current_vertexptr = rmesa->dma.current_used;
|
rmesa->dma.current_vertexptr = rmesa->dma.current_used;
|
||||||
|
|
@ -317,7 +317,7 @@ void radeonReleaseDmaRegions(radeonContextPtr rmesa)
|
||||||
const int expire_at = ++rmesa->dma.free.expire_counter + DMA_BO_FREE_TIME;
|
const int expire_at = ++rmesa->dma.free.expire_counter + DMA_BO_FREE_TIME;
|
||||||
const int time = rmesa->dma.free.expire_counter;
|
const int time = rmesa->dma.free.expire_counter;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_DMA) {
|
if (RADEON_DEBUG & RADEON_DMA) {
|
||||||
size_t free = 0,
|
size_t free = 0,
|
||||||
wait = 0,
|
wait = 0,
|
||||||
reserved = 0;
|
reserved = 0;
|
||||||
|
|
@ -399,7 +399,7 @@ void rcommon_flush_last_swtcl_prim( GLcontext *ctx )
|
||||||
struct radeon_dma *dma = &rmesa->dma;
|
struct radeon_dma *dma = &rmesa->dma;
|
||||||
|
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_IOCTL)
|
if (RADEON_DEBUG & RADEON_IOCTL)
|
||||||
fprintf(stderr, "%s\n", __FUNCTION__);
|
fprintf(stderr, "%s\n", __FUNCTION__);
|
||||||
dma->flush = NULL;
|
dma->flush = NULL;
|
||||||
|
|
||||||
|
|
@ -425,7 +425,7 @@ rcommonAllocDmaLowVerts( radeonContextPtr rmesa, int nverts, int vsize )
|
||||||
{
|
{
|
||||||
GLuint bytes = vsize * nverts;
|
GLuint bytes = vsize * nverts;
|
||||||
void *head;
|
void *head;
|
||||||
if (RADEON_DEBUG & DEBUG_IOCTL)
|
if (RADEON_DEBUG & RADEON_IOCTL)
|
||||||
fprintf(stderr, "%s\n", __FUNCTION__);
|
fprintf(stderr, "%s\n", __FUNCTION__);
|
||||||
if(is_empty_list(&rmesa->dma.reserved)
|
if(is_empty_list(&rmesa->dma.reserved)
|
||||||
||rmesa->dma.current_vertexptr + bytes > first_elem(&rmesa->dma.reserved)->bo->size) {
|
||rmesa->dma.current_vertexptr + bytes > first_elem(&rmesa->dma.reserved)->bo->size) {
|
||||||
|
|
@ -460,7 +460,7 @@ void radeonReleaseArrays( GLcontext *ctx, GLuint newinputs )
|
||||||
{
|
{
|
||||||
radeonContextPtr radeon = RADEON_CONTEXT( ctx );
|
radeonContextPtr radeon = RADEON_CONTEXT( ctx );
|
||||||
int i;
|
int i;
|
||||||
if (RADEON_DEBUG & DEBUG_IOCTL)
|
if (RADEON_DEBUG & RADEON_IOCTL)
|
||||||
fprintf(stderr, "%s\n", __FUNCTION__);
|
fprintf(stderr, "%s\n", __FUNCTION__);
|
||||||
|
|
||||||
if (radeon->dma.flush) {
|
if (radeon->dma.flush) {
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
#include "radeon_common.h"
|
#include "radeon_common.h"
|
||||||
#include "radeon_mipmap_tree.h"
|
#include "radeon_mipmap_tree.h"
|
||||||
|
|
||||||
#define FILE_DEBUG_FLAG DEBUG_TEXTURE
|
#define FILE_DEBUG_FLAG RADEON_TEXTURE
|
||||||
#define DBG(...) do { \
|
#define DBG(...) do { \
|
||||||
if (RADEON_DEBUG & FILE_DEBUG_FLAG) \
|
if (RADEON_DEBUG & FILE_DEBUG_FLAG) \
|
||||||
_mesa_printf(__VA_ARGS__); \
|
_mesa_printf(__VA_ARGS__); \
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ void radeonFlushElts( GLcontext *ctx )
|
||||||
uint32_t *cmd = (uint32_t *)(rmesa->radeon.cmdbuf.cs->packets + rmesa->tcl.elt_cmd_start);
|
uint32_t *cmd = (uint32_t *)(rmesa->radeon.cmdbuf.cs->packets + rmesa->tcl.elt_cmd_start);
|
||||||
int dwords = (rmesa->radeon.cmdbuf.cs->section_ndw - rmesa->radeon.cmdbuf.cs->section_cdw);
|
int dwords = (rmesa->radeon.cmdbuf.cs->section_ndw - rmesa->radeon.cmdbuf.cs->section_cdw);
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_IOCTL)
|
if (RADEON_DEBUG & RADEON_IOCTL)
|
||||||
fprintf(stderr, "%s\n", __FUNCTION__);
|
fprintf(stderr, "%s\n", __FUNCTION__);
|
||||||
|
|
||||||
assert( rmesa->radeon.dma.flush == radeonFlushElts );
|
assert( rmesa->radeon.dma.flush == radeonFlushElts );
|
||||||
|
|
@ -236,7 +236,7 @@ void radeonFlushElts( GLcontext *ctx )
|
||||||
|
|
||||||
END_BATCH();
|
END_BATCH();
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_SYNC) {
|
if (RADEON_DEBUG & RADEON_SYNC) {
|
||||||
fprintf(stderr, "%s: Syncing\n", __FUNCTION__);
|
fprintf(stderr, "%s: Syncing\n", __FUNCTION__);
|
||||||
radeonFinish( rmesa->radeon.glCtx );
|
radeonFinish( rmesa->radeon.glCtx );
|
||||||
}
|
}
|
||||||
|
|
@ -252,7 +252,7 @@ GLushort *radeonAllocEltsOpenEnded( r100ContextPtr rmesa,
|
||||||
int align_min_nr;
|
int align_min_nr;
|
||||||
BATCH_LOCALS(&rmesa->radeon);
|
BATCH_LOCALS(&rmesa->radeon);
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_IOCTL)
|
if (RADEON_DEBUG & RADEON_IOCTL)
|
||||||
fprintf(stderr, "%s %d prim %x\n", __FUNCTION__, min_nr, primitive);
|
fprintf(stderr, "%s %d prim %x\n", __FUNCTION__, min_nr, primitive);
|
||||||
|
|
||||||
assert((primitive & RADEON_CP_VC_CNTL_PRIM_WALK_IND));
|
assert((primitive & RADEON_CP_VC_CNTL_PRIM_WALK_IND));
|
||||||
|
|
@ -296,7 +296,7 @@ GLushort *radeonAllocEltsOpenEnded( r100ContextPtr rmesa,
|
||||||
|
|
||||||
retval = (GLushort *)(rmesa->radeon.cmdbuf.cs->packets + rmesa->tcl.elt_cmd_offset);
|
retval = (GLushort *)(rmesa->radeon.cmdbuf.cs->packets + rmesa->tcl.elt_cmd_offset);
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_PRIMS)
|
if (RADEON_DEBUG & RADEON_RENDER)
|
||||||
fprintf(stderr, "%s: header prim %x \n",
|
fprintf(stderr, "%s: header prim %x \n",
|
||||||
__FUNCTION__, primitive);
|
__FUNCTION__, primitive);
|
||||||
|
|
||||||
|
|
@ -318,7 +318,7 @@ void radeonEmitVertexAOS( r100ContextPtr rmesa,
|
||||||
#else
|
#else
|
||||||
BATCH_LOCALS(&rmesa->radeon);
|
BATCH_LOCALS(&rmesa->radeon);
|
||||||
|
|
||||||
if (RADEON_DEBUG & (DEBUG_PRIMS|DEBUG_IOCTL))
|
if (RADEON_DEBUG & (RADEON_PRIMS|DEBUG_IOCTL))
|
||||||
fprintf(stderr, "%s: vertex_size 0x%x offset 0x%x \n",
|
fprintf(stderr, "%s: vertex_size 0x%x offset 0x%x \n",
|
||||||
__FUNCTION__, vertex_size, offset);
|
__FUNCTION__, vertex_size, offset);
|
||||||
|
|
||||||
|
|
@ -350,7 +350,7 @@ void radeonEmitAOS( r100ContextPtr rmesa,
|
||||||
int sz = 1 + (nr >> 1) * 3 + (nr & 1) * 2;
|
int sz = 1 + (nr >> 1) * 3 + (nr & 1) * 2;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_IOCTL)
|
if (RADEON_DEBUG & RADEON_IOCTL)
|
||||||
fprintf(stderr, "%s\n", __FUNCTION__);
|
fprintf(stderr, "%s\n", __FUNCTION__);
|
||||||
|
|
||||||
BEGIN_BATCH(sz+2+(nr * 2));
|
BEGIN_BATCH(sz+2+(nr * 2));
|
||||||
|
|
@ -575,7 +575,7 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask )
|
||||||
GLuint color_mask = 0;
|
GLuint color_mask = 0;
|
||||||
GLuint orig_mask = mask;
|
GLuint orig_mask = mask;
|
||||||
|
|
||||||
if ( RADEON_DEBUG & DEBUG_IOCTL ) {
|
if ( RADEON_DEBUG & RADEON_IOCTL ) {
|
||||||
fprintf( stderr, "radeonClear\n");
|
fprintf( stderr, "radeonClear\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -611,7 +611,7 @@ static void radeonClear( GLcontext *ctx, GLbitfield mask )
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( mask ) {
|
if ( mask ) {
|
||||||
if (RADEON_DEBUG & DEBUG_FALLBACKS)
|
if (RADEON_DEBUG & RADEON_FALLBACKS)
|
||||||
fprintf(stderr, "%s: swrast clear, mask: %x\n", __FUNCTION__, mask);
|
fprintf(stderr, "%s: swrast clear, mask: %x\n", __FUNCTION__, mask);
|
||||||
_swrast_Clear( ctx, mask );
|
_swrast_Clear( ctx, mask );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,7 @@ void radeonUpdateMaterial( GLcontext *ctx )
|
||||||
if (ctx->Light.ColorMaterialEnabled)
|
if (ctx->Light.ColorMaterialEnabled)
|
||||||
mask &= ~ctx->Light.ColorMaterialBitmask;
|
mask &= ~ctx->Light.ColorMaterialBitmask;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_STATE)
|
if (RADEON_DEBUG & RADEON_STATE)
|
||||||
fprintf(stderr, "%s\n", __FUNCTION__);
|
fprintf(stderr, "%s\n", __FUNCTION__);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -234,7 +234,7 @@ void radeonUpdateMaterial( GLcontext *ctx )
|
||||||
check_twoside_fallback( ctx );
|
check_twoside_fallback( ctx );
|
||||||
update_global_ambient( ctx );
|
update_global_ambient( ctx );
|
||||||
}
|
}
|
||||||
else if (RADEON_DEBUG & (DEBUG_PRIMS|DEBUG_STATE))
|
else if (RADEON_DEBUG & (RADEON_PRIMS|DEBUG_STATE))
|
||||||
fprintf(stderr, "%s: Elided noop material call\n", __FUNCTION__);
|
fprintf(stderr, "%s: Elided noop material call\n", __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -624,7 +624,7 @@ static void radeonLightingSpaceChange( GLcontext *ctx )
|
||||||
GLboolean tmp;
|
GLboolean tmp;
|
||||||
RADEON_STATECHANGE( rmesa, tcl );
|
RADEON_STATECHANGE( rmesa, tcl );
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_STATE)
|
if (RADEON_DEBUG & RADEON_STATE)
|
||||||
fprintf(stderr, "%s %d\n", __FUNCTION__, ctx->_NeedEyeCoords);
|
fprintf(stderr, "%s %d\n", __FUNCTION__, ctx->_NeedEyeCoords);
|
||||||
|
|
||||||
if (ctx->_NeedEyeCoords)
|
if (ctx->_NeedEyeCoords)
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ void radeon_lock_hardware(radeonContextPtr radeon
|
||||||
if (ATOMIC_INC_AND_FETCH(radeon->dri.hwLockCount) > 1)
|
if (ATOMIC_INC_AND_FETCH(radeon->dri.hwLockCount) > 1)
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if ( RADEON_DEBUG & DEBUG_SANITY )
|
if ( RADEON_DEBUG & RADEON_SANITY )
|
||||||
fprintf(stderr, "*** %d times of recursive call to %s ***\n"
|
fprintf(stderr, "*** %d times of recursive call to %s ***\n"
|
||||||
"Original call was from %s (file: %s line: %d)\n"
|
"Original call was from %s (file: %s line: %d)\n"
|
||||||
"Now call is coming from %s (file: %s line: %d)\n"
|
"Now call is coming from %s (file: %s line: %d)\n"
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ static void emit_vecfog(GLcontext *ctx, struct radeon_aos *aos,
|
||||||
int size = 1;
|
int size = 1;
|
||||||
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
|
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_VERTS)
|
if (RADEON_DEBUG & RADEON_VERTS)
|
||||||
fprintf(stderr, "%s count %d stride %d\n",
|
fprintf(stderr, "%s count %d stride %d\n",
|
||||||
__FUNCTION__, count, stride);
|
__FUNCTION__, count, stride);
|
||||||
|
|
||||||
|
|
@ -87,7 +87,7 @@ static void emit_vecfog(GLcontext *ctx, struct radeon_aos *aos,
|
||||||
static void emit_s0_vec(uint32_t *out, GLvoid *data, int stride, int count)
|
static void emit_s0_vec(uint32_t *out, GLvoid *data, int stride, int count)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
if (RADEON_DEBUG & DEBUG_VERTS)
|
if (RADEON_DEBUG & RADEON_VERTS)
|
||||||
fprintf(stderr, "%s count %d stride %d\n",
|
fprintf(stderr, "%s count %d stride %d\n",
|
||||||
__FUNCTION__, count, stride);
|
__FUNCTION__, count, stride);
|
||||||
|
|
||||||
|
|
@ -103,7 +103,7 @@ static void emit_stq_vec(uint32_t *out, GLvoid *data, int stride, int count)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_VERTS)
|
if (RADEON_DEBUG & RADEON_VERTS)
|
||||||
fprintf(stderr, "%s count %d stride %d\n",
|
fprintf(stderr, "%s count %d stride %d\n",
|
||||||
__FUNCTION__, count, stride);
|
__FUNCTION__, count, stride);
|
||||||
|
|
||||||
|
|
@ -126,7 +126,7 @@ static void emit_tex_vector(GLcontext *ctx, struct radeon_aos *aos,
|
||||||
int emitsize;
|
int emitsize;
|
||||||
uint32_t *out;
|
uint32_t *out;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_VERTS)
|
if (RADEON_DEBUG & RADEON_VERTS)
|
||||||
fprintf(stderr, "%s %d/%d\n", __FUNCTION__, count, size);
|
fprintf(stderr, "%s %d/%d\n", __FUNCTION__, count, size);
|
||||||
|
|
||||||
switch (size) {
|
switch (size) {
|
||||||
|
|
@ -188,7 +188,7 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs )
|
||||||
GLuint vtx, unit;
|
GLuint vtx, unit;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (RADEON_DEBUG & DEBUG_VERTS)
|
if (RADEON_DEBUG & RADEON_VERTS)
|
||||||
_tnl_print_vert_flags( __FUNCTION__, inputs );
|
_tnl_print_vert_flags( __FUNCTION__, inputs );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,7 @@ static void TAG(emit)( GLcontext *ctx,
|
||||||
|
|
||||||
union emit_union *v = (union emit_union *)dest;
|
union emit_union *v = (union emit_union *)dest;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_VERTS)
|
radeon_print(RADEON_SWRENDER, RADEON_VERBOSE, "%s\n", __FUNCTION__);
|
||||||
fprintf(stderr, "%s\n", __FUNCTION__);
|
|
||||||
|
|
||||||
coord = (GLuint (*)[4])VB->ObjPtr->data;
|
coord = (GLuint (*)[4])VB->ObjPtr->data;
|
||||||
coord_stride = VB->ObjPtr->stride;
|
coord_stride = VB->ObjPtr->stride;
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ static void compute_tex_image_offset(radeonContextPtr rmesa, radeon_mipmap_tree
|
||||||
lvl->faces[face].offset = *curOffset;
|
lvl->faces[face].offset = *curOffset;
|
||||||
*curOffset += lvl->size;
|
*curOffset += lvl->size;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_TEXTURE)
|
if (RADEON_DEBUG & RADEON_TEXTURE)
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"level %d, face %d: rs:%d %dx%d at %d\n",
|
"level %d, face %d: rs:%d %dx%d at %d\n",
|
||||||
level, face, lvl->rowstride, lvl->width, lvl->height, lvl->faces[face].offset);
|
level, face, lvl->rowstride, lvl->width, lvl->height, lvl->faces[face].offset);
|
||||||
|
|
|
||||||
|
|
@ -44,11 +44,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#define MORE_VERBOSE 1
|
#define MORE_VERBOSE 1
|
||||||
|
|
||||||
#if MORE_VERBOSE
|
#if MORE_VERBOSE
|
||||||
#define VERBOSE (RADEON_DEBUG & DEBUG_VERBOSE)
|
#define VERBOSE (RADEON_DEBUG & RADEON_VERBOSE)
|
||||||
#define NORMAL (1)
|
#define NORMAL (1)
|
||||||
#else
|
#else
|
||||||
#define VERBOSE 0
|
#define VERBOSE 0
|
||||||
#define NORMAL (RADEON_DEBUG & DEBUG_VERBOSE)
|
#define NORMAL (RADEON_DEBUG & RADEON_VERBOSE)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -220,30 +220,6 @@ static const GLuint __driNConfigOptions = 17;
|
||||||
|
|
||||||
extern const struct dri_extension gl_20_extension[];
|
extern const struct dri_extension gl_20_extension[];
|
||||||
|
|
||||||
#ifndef RADEON_DEBUG
|
|
||||||
|
|
||||||
static const struct dri_debug_control debug_control[] = {
|
|
||||||
{"fall", DEBUG_FALLBACKS},
|
|
||||||
{"tex", DEBUG_TEXTURE},
|
|
||||||
{"ioctl", DEBUG_IOCTL},
|
|
||||||
{"prim", DEBUG_PRIMS},
|
|
||||||
{"vert", DEBUG_VERTS},
|
|
||||||
{"state", DEBUG_STATE},
|
|
||||||
{"code", DEBUG_CODEGEN},
|
|
||||||
{"vfmt", DEBUG_VFMT},
|
|
||||||
{"vtxf", DEBUG_VFMT},
|
|
||||||
{"verb", DEBUG_VERBOSE},
|
|
||||||
{"dri", DEBUG_DRI},
|
|
||||||
{"dma", DEBUG_DMA},
|
|
||||||
{"san", DEBUG_SANITY},
|
|
||||||
{"sync", DEBUG_SYNC},
|
|
||||||
{"pix", DEBUG_PIXEL},
|
|
||||||
{"mem", DEBUG_MEMORY},
|
|
||||||
{"allmsg", ~DEBUG_SYNC}, /* avoid the term "sync" because the parser uses strstr */
|
|
||||||
{NULL, 0}
|
|
||||||
};
|
|
||||||
#endif /* RADEON_DEBUG */
|
|
||||||
|
|
||||||
#endif /* RADEON_COMMON && defined(RADEON_COMMON_FOR_R300) */
|
#endif /* RADEON_COMMON && defined(RADEON_COMMON_FOR_R300) */
|
||||||
|
|
||||||
extern const struct dri_extension card_extensions[];
|
extern const struct dri_extension card_extensions[];
|
||||||
|
|
@ -966,9 +942,8 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DO_DEBUG && RADEON_COMMON && defined(RADEON_COMMON_FOR_R300)
|
radeon_init_debug();
|
||||||
RADEON_DEBUG = driParseDebugString(getenv("RADEON_DEBUG"), debug_control);
|
|
||||||
#endif
|
|
||||||
/* parse information in __driConfigOptions */
|
/* parse information in __driConfigOptions */
|
||||||
driParseOptionInfo (&screen->optionCache,
|
driParseOptionInfo (&screen->optionCache,
|
||||||
__driConfigOptions, __driNConfigOptions);
|
__driConfigOptions, __driNConfigOptions);
|
||||||
|
|
@ -1301,9 +1276,7 @@ radeonCreateScreen2(__DRIscreenPrivate *sPriv)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DO_DEBUG && RADEON_COMMON && defined(RADEON_COMMON_FOR_R300)
|
radeon_init_debug();
|
||||||
RADEON_DEBUG = driParseDebugString(getenv("RADEON_DEBUG"), debug_control);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* parse information in __driConfigOptions */
|
/* parse information in __driConfigOptions */
|
||||||
driParseOptionInfo (&screen->optionCache,
|
driParseOptionInfo (&screen->optionCache,
|
||||||
|
|
|
||||||
|
|
@ -814,7 +814,7 @@ void radeonUpdateMaterial( GLcontext *ctx )
|
||||||
if (ctx->Light.ColorMaterialEnabled)
|
if (ctx->Light.ColorMaterialEnabled)
|
||||||
mask &= ~ctx->Light.ColorMaterialBitmask;
|
mask &= ~ctx->Light.ColorMaterialBitmask;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_STATE)
|
if (RADEON_DEBUG & RADEON_STATE)
|
||||||
fprintf(stderr, "%s\n", __FUNCTION__);
|
fprintf(stderr, "%s\n", __FUNCTION__);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1548,7 +1548,7 @@ static void radeonEnable( GLcontext *ctx, GLenum cap, GLboolean state )
|
||||||
r100ContextPtr rmesa = R100_CONTEXT(ctx);
|
r100ContextPtr rmesa = R100_CONTEXT(ctx);
|
||||||
GLuint p, flag;
|
GLuint p, flag;
|
||||||
|
|
||||||
if ( RADEON_DEBUG & DEBUG_STATE )
|
if ( RADEON_DEBUG & RADEON_STATE )
|
||||||
fprintf( stderr, "%s( %s = %s )\n", __FUNCTION__,
|
fprintf( stderr, "%s( %s = %s )\n", __FUNCTION__,
|
||||||
_mesa_lookup_enum_by_nr( cap ),
|
_mesa_lookup_enum_by_nr( cap ),
|
||||||
state ? "GL_TRUE" : "GL_FALSE" );
|
state ? "GL_TRUE" : "GL_FALSE" );
|
||||||
|
|
@ -1842,7 +1842,7 @@ static void radeonLightingSpaceChange( GLcontext *ctx )
|
||||||
GLboolean tmp;
|
GLboolean tmp;
|
||||||
RADEON_STATECHANGE( rmesa, tcl );
|
RADEON_STATECHANGE( rmesa, tcl );
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_STATE)
|
if (RADEON_DEBUG & RADEON_STATE)
|
||||||
fprintf(stderr, "%s %d BEFORE %x\n", __FUNCTION__, ctx->_NeedEyeCoords,
|
fprintf(stderr, "%s %d BEFORE %x\n", __FUNCTION__, ctx->_NeedEyeCoords,
|
||||||
rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL]);
|
rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL]);
|
||||||
|
|
||||||
|
|
@ -1857,7 +1857,7 @@ static void radeonLightingSpaceChange( GLcontext *ctx )
|
||||||
rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_RESCALE_NORMALS;
|
rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] &= ~RADEON_RESCALE_NORMALS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_STATE)
|
if (RADEON_DEBUG & RADEON_STATE)
|
||||||
fprintf(stderr, "%s %d AFTER %x\n", __FUNCTION__, ctx->_NeedEyeCoords,
|
fprintf(stderr, "%s %d AFTER %x\n", __FUNCTION__, ctx->_NeedEyeCoords,
|
||||||
rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL]);
|
rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include "radeon_state.h"
|
#include "radeon_state.h"
|
||||||
#include "radeon_swtcl.h"
|
#include "radeon_swtcl.h"
|
||||||
#include "radeon_tcl.h"
|
#include "radeon_tcl.h"
|
||||||
|
#include "radeon_debug.h"
|
||||||
|
|
||||||
|
|
||||||
/* R100: xyzw, c0, c1/fog, stq[0..2] = 4+1+1+3*3 = 15 right? */
|
/* R100: xyzw, c0, c1/fog, stq[0..2] = 4+1+1+3*3 = 15 right? */
|
||||||
|
|
@ -214,9 +215,8 @@ static void radeonSetVertexFormat( GLcontext *ctx )
|
||||||
NULL, 0 );
|
NULL, 0 );
|
||||||
rmesa->radeon.swtcl.vertex_size /= 4;
|
rmesa->radeon.swtcl.vertex_size /= 4;
|
||||||
RENDERINPUTS_COPY( rmesa->radeon.tnl_index_bitset, index_bitset );
|
RENDERINPUTS_COPY( rmesa->radeon.tnl_index_bitset, index_bitset );
|
||||||
if (RADEON_DEBUG & DEBUG_VERTS)
|
radeon_print(RADEON_SWRENDER, RADEON_VERBOSE,
|
||||||
fprintf( stderr, "%s: vertex_size= %d floats\n",
|
"%s: vertex_size= %d floats\n", __FUNCTION__, rmesa->radeon.swtcl.vertex_size);
|
||||||
__FUNCTION__, rmesa->radeon.swtcl.vertex_size);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -420,8 +420,8 @@ static GLboolean radeon_run_render( GLcontext *ctx,
|
||||||
if (!length)
|
if (!length)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_PRIMS)
|
radeon_print(RADEON_SWRENDER, RADEON_NORMAL,
|
||||||
fprintf(stderr, "radeon_render.c: prim %s %d..%d\n",
|
"radeon_render.c: prim %s %d..%d\n",
|
||||||
_mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK),
|
_mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK),
|
||||||
start, start+length);
|
start, start+length);
|
||||||
|
|
||||||
|
|
@ -784,7 +784,7 @@ void radeonFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
|
||||||
TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_RASTER, GL_TRUE );
|
TCL_FALLBACK( ctx, RADEON_TCL_FALLBACK_RASTER, GL_TRUE );
|
||||||
_swsetup_Wakeup( ctx );
|
_swsetup_Wakeup( ctx );
|
||||||
rmesa->radeon.swtcl.RenderIndex = ~0;
|
rmesa->radeon.swtcl.RenderIndex = ~0;
|
||||||
if (RADEON_DEBUG & DEBUG_FALLBACKS) {
|
if (RADEON_DEBUG & RADEON_FALLBACKS) {
|
||||||
fprintf(stderr, "Radeon begin rasterization fallback: 0x%x %s\n",
|
fprintf(stderr, "Radeon begin rasterization fallback: 0x%x %s\n",
|
||||||
bit, getFallbackString(bit));
|
bit, getFallbackString(bit));
|
||||||
}
|
}
|
||||||
|
|
@ -815,7 +815,7 @@ void radeonFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
|
||||||
radeonChooseVertexState( ctx );
|
radeonChooseVertexState( ctx );
|
||||||
radeonChooseRenderState( ctx );
|
radeonChooseRenderState( ctx );
|
||||||
}
|
}
|
||||||
if (RADEON_DEBUG & DEBUG_FALLBACKS) {
|
if (RADEON_DEBUG & RADEON_FALLBACKS) {
|
||||||
fprintf(stderr, "Radeon end rasterization fallback: 0x%x %s\n",
|
fprintf(stderr, "Radeon end rasterization fallback: 0x%x %s\n",
|
||||||
bit, getFallbackString(bit));
|
bit, getFallbackString(bit));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -587,7 +587,7 @@ static void transition_to_hwtnl( GLcontext *ctx )
|
||||||
// radeonReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts,
|
// radeonReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts,
|
||||||
// __FUNCTION__ );
|
// __FUNCTION__ );
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_FALLBACKS)
|
if (RADEON_DEBUG & RADEON_FALLBACKS)
|
||||||
fprintf(stderr, "Radeon end tcl fallback\n");
|
fprintf(stderr, "Radeon end tcl fallback\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -624,7 +624,7 @@ void radeonTclFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
|
||||||
if (mode) {
|
if (mode) {
|
||||||
rmesa->radeon.TclFallback |= bit;
|
rmesa->radeon.TclFallback |= bit;
|
||||||
if (oldfallback == 0) {
|
if (oldfallback == 0) {
|
||||||
if (RADEON_DEBUG & DEBUG_FALLBACKS)
|
if (RADEON_DEBUG & RADEON_FALLBACKS)
|
||||||
fprintf(stderr, "Radeon begin tcl fallback %s\n",
|
fprintf(stderr, "Radeon begin tcl fallback %s\n",
|
||||||
getFallbackString( bit ));
|
getFallbackString( bit ));
|
||||||
transition_to_swtnl( ctx );
|
transition_to_swtnl( ctx );
|
||||||
|
|
@ -633,7 +633,7 @@ void radeonTclFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
|
||||||
else {
|
else {
|
||||||
rmesa->radeon.TclFallback &= ~bit;
|
rmesa->radeon.TclFallback &= ~bit;
|
||||||
if (oldfallback == bit) {
|
if (oldfallback == bit) {
|
||||||
if (RADEON_DEBUG & DEBUG_FALLBACKS)
|
if (RADEON_DEBUG & RADEON_FALLBACKS)
|
||||||
fprintf(stderr, "Radeon end tcl fallback %s\n",
|
fprintf(stderr, "Radeon end tcl fallback %s\n",
|
||||||
getFallbackString( bit ));
|
getFallbackString( bit ));
|
||||||
transition_to_hwtnl( ctx );
|
transition_to_hwtnl( ctx );
|
||||||
|
|
|
||||||
|
|
@ -263,7 +263,7 @@ static void radeonTexEnv( GLcontext *ctx, GLenum target,
|
||||||
GLuint unit = ctx->Texture.CurrentUnit;
|
GLuint unit = ctx->Texture.CurrentUnit;
|
||||||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
|
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
|
||||||
|
|
||||||
if ( RADEON_DEBUG & DEBUG_STATE ) {
|
if ( RADEON_DEBUG & RADEON_STATE ) {
|
||||||
fprintf( stderr, "%s( %s )\n",
|
fprintf( stderr, "%s( %s )\n",
|
||||||
__FUNCTION__, _mesa_lookup_enum_by_nr( pname ) );
|
__FUNCTION__, _mesa_lookup_enum_by_nr( pname ) );
|
||||||
}
|
}
|
||||||
|
|
@ -325,10 +325,8 @@ static void radeonTexParameter( GLcontext *ctx, GLenum target,
|
||||||
{
|
{
|
||||||
radeonTexObj* t = radeon_tex_obj(texObj);
|
radeonTexObj* t = radeon_tex_obj(texObj);
|
||||||
|
|
||||||
if ( RADEON_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
|
radeon_print(RADEON_TEXTURE, RADEON_VERBOSE, "%s( %s )\n", __FUNCTION__,
|
||||||
fprintf( stderr, "%s( %s )\n", __FUNCTION__,
|
|
||||||
_mesa_lookup_enum_by_nr( pname ) );
|
_mesa_lookup_enum_by_nr( pname ) );
|
||||||
}
|
|
||||||
|
|
||||||
switch ( pname ) {
|
switch ( pname ) {
|
||||||
case GL_TEXTURE_MIN_FILTER:
|
case GL_TEXTURE_MIN_FILTER:
|
||||||
|
|
@ -376,10 +374,9 @@ static void radeonDeleteTexture( GLcontext *ctx,
|
||||||
radeonTexObj* t = radeon_tex_obj(texObj);
|
radeonTexObj* t = radeon_tex_obj(texObj);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if ( RADEON_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
|
radeon_print(RADEON_TEXTURE, RADEON_NORMAL,
|
||||||
fprintf( stderr, "%s( %p (target = %s) )\n", __FUNCTION__, (void *)texObj,
|
"%s( %p (target = %s) )\n", __FUNCTION__, (void *)texObj,
|
||||||
_mesa_lookup_enum_by_nr( texObj->Target ) );
|
_mesa_lookup_enum_by_nr( texObj->Target ) );
|
||||||
}
|
|
||||||
|
|
||||||
if ( rmesa ) {
|
if ( rmesa ) {
|
||||||
radeon_firevertices(&rmesa->radeon);
|
radeon_firevertices(&rmesa->radeon);
|
||||||
|
|
|
||||||
|
|
@ -277,7 +277,7 @@ static GLboolean radeonUpdateTextureEnv( GLcontext *ctx, int unit )
|
||||||
assert( (texUnit->_ReallyEnabled == 0)
|
assert( (texUnit->_ReallyEnabled == 0)
|
||||||
|| (texUnit->_Current != NULL) );
|
|| (texUnit->_Current != NULL) );
|
||||||
|
|
||||||
if ( RADEON_DEBUG & DEBUG_TEXTURE ) {
|
if ( RADEON_DEBUG & RADEON_TEXTURE ) {
|
||||||
fprintf( stderr, "%s( %p, %d )\n", __FUNCTION__, (void *)ctx, unit );
|
fprintf( stderr, "%s( %p, %d )\n", __FUNCTION__, (void *)ctx, unit );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -933,7 +933,7 @@ static GLboolean radeon_validate_texgen( GLcontext *ctx, GLuint unit )
|
||||||
(texUnit->GenS.Mode != texUnit->GenQ.Mode)) ) {
|
(texUnit->GenS.Mode != texUnit->GenQ.Mode)) ) {
|
||||||
/* Mixed modes, fallback:
|
/* Mixed modes, fallback:
|
||||||
*/
|
*/
|
||||||
if (RADEON_DEBUG & DEBUG_FALLBACKS)
|
if (RADEON_DEBUG & RADEON_FALLBACKS)
|
||||||
fprintf(stderr, "fallback mixed texgen\n");
|
fprintf(stderr, "fallback mixed texgen\n");
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
@ -941,7 +941,7 @@ static GLboolean radeon_validate_texgen( GLcontext *ctx, GLuint unit )
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* some texgen mode not including both S and T bits */
|
/* some texgen mode not including both S and T bits */
|
||||||
if (RADEON_DEBUG & DEBUG_FALLBACKS)
|
if (RADEON_DEBUG & RADEON_FALLBACKS)
|
||||||
fprintf(stderr, "fallback mixed texgen/nontexgen\n");
|
fprintf(stderr, "fallback mixed texgen/nontexgen\n");
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
@ -991,7 +991,7 @@ static GLboolean radeon_validate_texgen( GLcontext *ctx, GLuint unit )
|
||||||
default:
|
default:
|
||||||
/* Unsupported mode, fallback:
|
/* Unsupported mode, fallback:
|
||||||
*/
|
*/
|
||||||
if (RADEON_DEBUG & DEBUG_FALLBACKS)
|
if (RADEON_DEBUG & RADEON_FALLBACKS)
|
||||||
fprintf(stderr, "fallback GL_SPHERE_MAP\n");
|
fprintf(stderr, "fallback GL_SPHERE_MAP\n");
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -936,7 +936,7 @@ int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *t
|
||||||
if (t->validated || t->image_override)
|
if (t->validated || t->image_override)
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_TEXTURE)
|
if (RADEON_DEBUG & RADEON_TEXTURE)
|
||||||
fprintf(stderr, "%s: Validating texture %p now\n", __FUNCTION__, texObj);
|
fprintf(stderr, "%s: Validating texture %p now\n", __FUNCTION__, texObj);
|
||||||
|
|
||||||
if (baseimage->base.Border > 0)
|
if (baseimage->base.Border > 0)
|
||||||
|
|
@ -964,7 +964,7 @@ int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *t
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!t->mt) {
|
if (!t->mt) {
|
||||||
if (RADEON_DEBUG & DEBUG_TEXTURE)
|
if (RADEON_DEBUG & RADEON_TEXTURE)
|
||||||
fprintf(stderr, " Allocate new miptree\n");
|
fprintf(stderr, " Allocate new miptree\n");
|
||||||
radeon_try_alloc_miptree(rmesa, t, &baseimage->base, 0, texObj->BaseLevel);
|
radeon_try_alloc_miptree(rmesa, t, &baseimage->base, 0, texObj->BaseLevel);
|
||||||
if (!t->mt) {
|
if (!t->mt) {
|
||||||
|
|
@ -977,16 +977,16 @@ int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *t
|
||||||
for(face = 0; face < t->mt->faces; ++face) {
|
for(face = 0; face < t->mt->faces; ++face) {
|
||||||
for(level = t->mt->firstLevel; level <= t->mt->lastLevel; ++level) {
|
for(level = t->mt->firstLevel; level <= t->mt->lastLevel; ++level) {
|
||||||
radeon_texture_image *image = get_radeon_texture_image(texObj->Image[face][level]);
|
radeon_texture_image *image = get_radeon_texture_image(texObj->Image[face][level]);
|
||||||
if (RADEON_DEBUG & DEBUG_TEXTURE)
|
if (RADEON_DEBUG & RADEON_TEXTURE)
|
||||||
fprintf(stderr, " face %i, level %i... %p vs %p ", face, level, t->mt, image->mt);
|
fprintf(stderr, " face %i, level %i... %p vs %p ", face, level, t->mt, image->mt);
|
||||||
if (t->mt == image->mt) {
|
if (t->mt == image->mt) {
|
||||||
if (RADEON_DEBUG & DEBUG_TEXTURE)
|
if (RADEON_DEBUG & RADEON_TEXTURE)
|
||||||
fprintf(stderr, "OK\n");
|
fprintf(stderr, "OK\n");
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RADEON_DEBUG & DEBUG_TEXTURE)
|
if (RADEON_DEBUG & RADEON_TEXTURE)
|
||||||
fprintf(stderr, "migrating\n");
|
fprintf(stderr, "migrating\n");
|
||||||
migrate_image_to_miptree(t->mt, image, face, level);
|
migrate_image_to_miptree(t->mt, image, face, level);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue