mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 11:08:03 +02:00
i965: Remove the validated BO list, now that it's unused.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Paul Berry <stereotype441@gmail.com>
This commit is contained in:
parent
3d851ae488
commit
eaf4d3e6e2
12 changed files with 2 additions and 109 deletions
|
|
@ -595,19 +595,6 @@ struct brw_context
|
|||
|
||||
struct {
|
||||
struct brw_state_flags dirty;
|
||||
/**
|
||||
* List of buffers accumulated in brw_validate_state to receive
|
||||
* drm_intel_bo_check_aperture treatment before exec, so we can
|
||||
* know if we should flush the batch and try again before
|
||||
* emitting primitives.
|
||||
*
|
||||
* This can be a fixed number as we only have a limited number of
|
||||
* objects referenced from the batchbuffer in a primitive emit,
|
||||
* consisting of the vertex buffers, pipelined state pointers,
|
||||
* the CURBE, the depth buffer, and a query BO.
|
||||
*/
|
||||
drm_intel_bo *validated_bos[VERT_ATTRIB_MAX + BRW_WM_MAX_SURF + 16];
|
||||
unsigned int validated_bo_count;
|
||||
} state;
|
||||
|
||||
struct brw_cache cache;
|
||||
|
|
|
|||
|
|
@ -322,8 +322,6 @@ static void prepare_constant_buffer(struct brw_context *brw)
|
|||
bufsz);
|
||||
}
|
||||
|
||||
brw_add_validated_bo(brw, brw->curbe.curbe_bo);
|
||||
|
||||
/* Because this provokes an action (ie copy the constants into the
|
||||
* URB), it shouldn't be shortcircuited if identical to the
|
||||
* previous time - because eg. the urb destination may have
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ static void brw_prepare_vertices(struct brw_context *brw)
|
|||
return;
|
||||
|
||||
if (brw->vb.nr_buffers)
|
||||
goto validate;
|
||||
goto prepare;
|
||||
|
||||
/* XXX: In the rare cases where this happens we fallback all
|
||||
* the way to software rasterization, although a tnl fallback
|
||||
|
|
@ -535,11 +535,8 @@ static void brw_prepare_vertices(struct brw_context *brw)
|
|||
|
||||
brw->vb.nr_buffers = j;
|
||||
|
||||
validate:
|
||||
prepare:
|
||||
brw_prepare_query_begin(brw);
|
||||
for (i = 0; i < brw->vb.nr_buffers; i++) {
|
||||
brw_add_validated_bo(brw, brw->vb.buffers[i].bo);
|
||||
}
|
||||
}
|
||||
|
||||
static void brw_emit_vertices(struct brw_context *brw)
|
||||
|
|
@ -738,7 +735,6 @@ static void brw_prepare_indices(struct brw_context *brw)
|
|||
drm_intel_bo_unreference(brw->ib.bo);
|
||||
brw->ib.bo = bo;
|
||||
|
||||
brw_add_validated_bo(brw, brw->ib.bo);
|
||||
brw->state.dirty.brw |= BRW_NEW_INDEX_BUFFER;
|
||||
} else {
|
||||
drm_intel_bo_unreference(bo);
|
||||
|
|
|
|||
|
|
@ -196,22 +196,6 @@ const struct brw_tracked_state brw_psp_urb_cbs = {
|
|||
.emit = upload_psp_urb_cbs,
|
||||
};
|
||||
|
||||
static void prepare_depthbuffer(struct brw_context *brw)
|
||||
{
|
||||
struct intel_context *intel = &brw->intel;
|
||||
struct gl_context *ctx = &intel->ctx;
|
||||
struct gl_framebuffer *fb = ctx->DrawBuffer;
|
||||
struct intel_renderbuffer *drb = intel_get_renderbuffer(fb, BUFFER_DEPTH);
|
||||
struct intel_renderbuffer *srb = intel_get_renderbuffer(fb, BUFFER_STENCIL);
|
||||
|
||||
if (drb)
|
||||
brw_add_validated_bo(brw, drb->region->bo);
|
||||
if (drb && drb->hiz_region)
|
||||
brw_add_validated_bo(brw, drb->hiz_region->bo);
|
||||
if (srb)
|
||||
brw_add_validated_bo(brw, srb->region->bo);
|
||||
}
|
||||
|
||||
static void emit_depthbuffer(struct brw_context *brw)
|
||||
{
|
||||
struct intel_context *intel = &brw->intel;
|
||||
|
|
@ -436,7 +420,6 @@ const struct brw_tracked_state brw_depthbuffer = {
|
|||
.brw = BRW_NEW_BATCH,
|
||||
.cache = 0,
|
||||
},
|
||||
.prepare = prepare_depthbuffer,
|
||||
.emit = emit_depthbuffer,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -246,8 +246,6 @@ brw_prepare_query_begin(struct brw_context *brw)
|
|||
|
||||
brw->query.index = 0;
|
||||
}
|
||||
|
||||
brw_add_validated_bo(brw, brw->query.bo);
|
||||
}
|
||||
|
||||
/** Called just before primitive drawing to get a beginning PS_DEPTH_COUNT. */
|
||||
|
|
|
|||
|
|
@ -35,17 +35,6 @@
|
|||
|
||||
#include "brw_context.h"
|
||||
|
||||
static INLINE void
|
||||
brw_add_validated_bo(struct brw_context *brw, drm_intel_bo *bo)
|
||||
{
|
||||
assert(brw->state.validated_bo_count < ARRAY_SIZE(brw->state.validated_bos));
|
||||
|
||||
if (bo != NULL) {
|
||||
drm_intel_bo_reference(bo);
|
||||
brw->state.validated_bos[brw->state.validated_bo_count++] = bo;
|
||||
}
|
||||
};
|
||||
|
||||
extern const struct brw_tracked_state brw_blend_constant_color;
|
||||
extern const struct brw_tracked_state brw_cc_vp;
|
||||
extern const struct brw_tracked_state brw_cc_unit;
|
||||
|
|
@ -139,7 +128,6 @@ void brw_validate_state(struct brw_context *brw);
|
|||
void brw_upload_state(struct brw_context *brw);
|
||||
void brw_init_state(struct brw_context *brw);
|
||||
void brw_destroy_state(struct brw_context *brw);
|
||||
void brw_clear_validated_bos(struct brw_context *brw);
|
||||
|
||||
/***********************************************************************
|
||||
* brw_state_cache.c
|
||||
|
|
|
|||
|
|
@ -303,19 +303,6 @@ static void xor_states( struct brw_state_flags *result,
|
|||
result->cache = a->cache ^ b->cache;
|
||||
}
|
||||
|
||||
void
|
||||
brw_clear_validated_bos(struct brw_context *brw)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Clear the last round of validated bos */
|
||||
for (i = 0; i < brw->state.validated_bo_count; i++) {
|
||||
drm_intel_bo_unreference(brw->state.validated_bos[i]);
|
||||
brw->state.validated_bos[i] = NULL;
|
||||
}
|
||||
brw->state.validated_bo_count = 0;
|
||||
}
|
||||
|
||||
struct dirty_bit_map {
|
||||
uint32_t bit;
|
||||
char *name;
|
||||
|
|
@ -444,13 +431,9 @@ void brw_validate_state( struct brw_context *brw )
|
|||
int num_atoms = brw->num_prepare_atoms;
|
||||
GLuint i;
|
||||
|
||||
brw_clear_validated_bos(brw);
|
||||
|
||||
state->mesa |= brw->intel.NewGLState;
|
||||
brw->intel.NewGLState = 0;
|
||||
|
||||
brw_add_validated_bo(brw, intel->batch.bo);
|
||||
|
||||
if (brw->emit_state_always) {
|
||||
state->mesa |= ~0;
|
||||
state->brw |= ~0;
|
||||
|
|
@ -509,8 +492,6 @@ void brw_upload_state(struct brw_context *brw)
|
|||
int i;
|
||||
static int dirty_count = 0;
|
||||
|
||||
brw_clear_validated_bos(brw);
|
||||
|
||||
if (unlikely(INTEL_DEBUG)) {
|
||||
/* Debug version which enforces various sanity checks on the
|
||||
* state flags which are generated and checked to help ensure
|
||||
|
|
|
|||
|
|
@ -145,7 +145,6 @@ prepare_vs_surfaces(struct brw_context *brw)
|
|||
int nr_surfaces = 0;
|
||||
|
||||
if (brw->vs.const_bo) {
|
||||
brw_add_validated_bo(brw, brw->vs.const_bo);
|
||||
nr_surfaces = 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,6 @@ static void brw_destroy_context( struct intel_context *intel )
|
|||
|
||||
brw_destroy_state(brw);
|
||||
brw_draw_destroy( brw );
|
||||
brw_clear_validated_bos(brw);
|
||||
ralloc_free(brw->wm.compile_data);
|
||||
|
||||
dri_bo_release(&brw->curbe.curbe_bo);
|
||||
|
|
|
|||
|
|
@ -549,17 +549,10 @@ prepare_wm_surfaces(struct brw_context *brw)
|
|||
int nr_surfaces = 0;
|
||||
|
||||
for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) {
|
||||
struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[i];
|
||||
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
|
||||
struct intel_region *region = irb ? irb->region : NULL;
|
||||
|
||||
if (region)
|
||||
brw_add_validated_bo(brw, region->bo);
|
||||
nr_surfaces = SURF_INDEX_DRAW(i) + 1;
|
||||
}
|
||||
|
||||
if (brw->wm.const_bo) {
|
||||
brw_add_validated_bo(brw, brw->wm.const_bo);
|
||||
nr_surfaces = SURF_INDEX_FRAG_CONST_BUFFER + 1;
|
||||
}
|
||||
|
||||
|
|
@ -567,10 +560,6 @@ prepare_wm_surfaces(struct brw_context *brw)
|
|||
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
|
||||
|
||||
if (texUnit->_ReallyEnabled) {
|
||||
struct gl_texture_object *tObj = texUnit->_Current;
|
||||
struct intel_texture_object *intelObj = intel_texture_object(tObj);
|
||||
|
||||
brw_add_validated_bo(brw, intelObj->mt->region->bo);
|
||||
nr_surfaces = SURF_INDEX_TEXTURE(i) + 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,20 +56,6 @@ gen7_depth_format(struct brw_context *brw)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void prepare_depthbuffer(struct brw_context *brw)
|
||||
{
|
||||
struct intel_context *intel = &brw->intel;
|
||||
struct gl_context *ctx = &intel->ctx;
|
||||
struct gl_framebuffer *fb = ctx->DrawBuffer;
|
||||
struct intel_renderbuffer *drb = intel_get_renderbuffer(fb, BUFFER_DEPTH);
|
||||
struct intel_renderbuffer *srb = intel_get_renderbuffer(fb, BUFFER_STENCIL);
|
||||
|
||||
if (drb)
|
||||
brw_add_validated_bo(brw, drb->region->bo);
|
||||
if (srb)
|
||||
brw_add_validated_bo(brw, srb->region->bo);
|
||||
}
|
||||
|
||||
static void emit_depthbuffer(struct brw_context *brw)
|
||||
{
|
||||
struct intel_context *intel = &brw->intel;
|
||||
|
|
@ -177,6 +163,5 @@ const struct brw_tracked_state gen7_depthbuffer = {
|
|||
.brw = BRW_NEW_BATCH,
|
||||
.cache = 0,
|
||||
},
|
||||
.prepare = prepare_depthbuffer,
|
||||
.emit = emit_depthbuffer,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -311,28 +311,18 @@ prepare_wm_surfaces(struct brw_context *brw)
|
|||
|
||||
if (ctx->DrawBuffer->_NumColorDrawBuffers >= 1) {
|
||||
for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) {
|
||||
struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[i];
|
||||
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
|
||||
struct intel_region *region = irb ? irb->region : NULL;
|
||||
|
||||
if (region)
|
||||
brw_add_validated_bo(brw, region->bo);
|
||||
nr_surfaces = SURF_INDEX_DRAW(i) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (brw->wm.const_bo) {
|
||||
brw_add_validated_bo(brw, brw->wm.const_bo);
|
||||
nr_surfaces = SURF_INDEX_FRAG_CONST_BUFFER + 1;
|
||||
}
|
||||
|
||||
for (i = 0; i < BRW_MAX_TEX_UNIT; i++) {
|
||||
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
|
||||
struct gl_texture_object *tObj = texUnit->_Current;
|
||||
struct intel_texture_object *intelObj = intel_texture_object(tObj);
|
||||
|
||||
if (texUnit->_ReallyEnabled) {
|
||||
brw_add_validated_bo(brw, intelObj->mt->region->bo);
|
||||
nr_surfaces = SURF_INDEX_TEXTURE(i) + 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue