mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
radeon,r200: fix buffer validation after CS flush
This validates all bound buffers (CB, ZB, textures, DMA) at the beginning of CS. This fixes "bo->space_accouned" assertion failures. Tested by: Jochen Rollwagen <joro-2013@t-online.de> Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
0b5d88a518
commit
085a861545
8 changed files with 8 additions and 15 deletions
|
|
@ -190,6 +190,7 @@ static void r200_init_vtbl(radeonContextPtr radeon)
|
|||
radeon->vtbl.check_blit = r200_check_blit;
|
||||
radeon->vtbl.blit = r200_blit;
|
||||
radeon->vtbl.is_format_renderable = radeonIsFormatRenderable;
|
||||
radeon->vtbl.revalidate_all_buffers = r200ValidateBuffers;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2210,7 +2210,7 @@ static void update_texturematrix( struct gl_context *ctx )
|
|||
}
|
||||
}
|
||||
|
||||
static GLboolean r200ValidateBuffers(struct gl_context *ctx)
|
||||
GLboolean r200ValidateBuffers(struct gl_context *ctx)
|
||||
{
|
||||
r200ContextPtr rmesa = R200_CONTEXT(ctx);
|
||||
struct radeon_renderbuffer *rrb;
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ extern void r200UpdateViewportOffset( struct gl_context *ctx );
|
|||
extern void r200UpdateWindow( struct gl_context *ctx );
|
||||
extern void r200UpdateDrawBuffer(struct gl_context *ctx);
|
||||
|
||||
extern GLboolean r200ValidateBuffers(struct gl_context *ctx);
|
||||
extern GLboolean r200ValidateState( struct gl_context *ctx );
|
||||
|
||||
extern void r200_vtbl_update_scissor( struct gl_context *ctx );
|
||||
|
|
|
|||
|
|
@ -532,17 +532,6 @@ static INLINE void radeonEmitAtoms(radeonContextPtr radeon, GLboolean emitAll)
|
|||
COMMIT_BATCH();
|
||||
}
|
||||
|
||||
static GLboolean radeon_revalidate_bos(struct gl_context *ctx)
|
||||
{
|
||||
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
|
||||
int ret;
|
||||
|
||||
ret = radeon_cs_space_check(radeon->cmdbuf.cs);
|
||||
if (ret == RADEON_CS_SPACE_FLUSH)
|
||||
return GL_FALSE;
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
void radeonEmitState(radeonContextPtr radeon)
|
||||
{
|
||||
radeon_print(RADEON_STATE, RADEON_NORMAL, "%s\n", __FUNCTION__);
|
||||
|
|
@ -661,9 +650,8 @@ int rcommonFlushCmdBufLocked(radeonContextPtr rmesa, const char *caller)
|
|||
radeon_cs_erase(rmesa->cmdbuf.cs);
|
||||
rmesa->cmdbuf.flushing = 0;
|
||||
|
||||
if (radeon_revalidate_bos(&rmesa->glCtx) == GL_FALSE) {
|
||||
if (!rmesa->vtbl.revalidate_all_buffers(&rmesa->glCtx))
|
||||
fprintf(stderr,"failed to revalidate buffers\n");
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -496,6 +496,7 @@ struct radeon_context {
|
|||
unsigned reg_height,
|
||||
unsigned flip_y);
|
||||
unsigned (*is_format_renderable)(mesa_format mesa_format);
|
||||
GLboolean (*revalidate_all_buffers)(struct gl_context *ctx);
|
||||
} vtbl;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -157,6 +157,7 @@ static void r100_init_vtbl(radeonContextPtr radeon)
|
|||
radeon->vtbl.check_blit = r100_check_blit;
|
||||
radeon->vtbl.blit = r100_blit;
|
||||
radeon->vtbl.is_format_renderable = radeonIsFormatRenderable;
|
||||
radeon->vtbl.revalidate_all_buffers = r100ValidateBuffers;
|
||||
}
|
||||
|
||||
/* Create the device specific context.
|
||||
|
|
|
|||
|
|
@ -1992,7 +1992,7 @@ static void update_texturematrix( struct gl_context *ctx )
|
|||
}
|
||||
}
|
||||
|
||||
static GLboolean r100ValidateBuffers(struct gl_context *ctx)
|
||||
GLboolean r100ValidateBuffers(struct gl_context *ctx)
|
||||
{
|
||||
r100ContextPtr rmesa = R100_CONTEXT(ctx);
|
||||
struct radeon_renderbuffer *rrb;
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ extern void radeonUpdateDrawBuffer( struct gl_context *ctx );
|
|||
extern void radeonUploadTexMatrix( r100ContextPtr rmesa,
|
||||
int unit, GLboolean swapcols );
|
||||
|
||||
extern GLboolean r100ValidateBuffers(struct gl_context *ctx);
|
||||
extern GLboolean radeonValidateState( struct gl_context *ctx );
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue