r = -ENOMEM;
goto out_err;
}
+
+ /* init dirty list */
+ LIST_INITHEAD(&ctx->dirty);
return 0;
out_err:
r600_context_fini(ctx);
block->status &= ~(R600_BLOCK_STATUS_ENABLED | R600_BLOCK_STATUS_DIRTY);
r600_bo_reference(ctx->radeon, &block->reloc[1].bo, NULL);
r600_bo_reference(ctx->radeon , &block->reloc[2].bo, NULL);
+ LIST_DEL(&block->list);
return;
}
block->reg[0] = state->regs[0].value;
block->status |= R600_BLOCK_STATUS_ENABLED;
block->status |= R600_BLOCK_STATUS_DIRTY;
ctx->pm4_dirty_cdwords += block->pm4_ndwords + block->pm4_flush_ndwords;
+ LIST_ADDTAIL(&block->list,&ctx->dirty);
}
}
block = range->blocks[CTX_BLOCK_ID(ctx, offset)];
if (state == NULL) {
block->status &= ~(R600_BLOCK_STATUS_ENABLED | R600_BLOCK_STATUS_DIRTY);
+ LIST_DEL(&block->list);
return;
}
block->reg[0] = state->regs[0].value;
block->status |= R600_BLOCK_STATUS_ENABLED;
block->status |= R600_BLOCK_STATUS_DIRTY;
ctx->pm4_dirty_cdwords += block->pm4_ndwords + block->pm4_flush_ndwords;
+ LIST_ADDTAIL(&block->list,&ctx->dirty);
}
}
block = range->blocks[CTX_BLOCK_ID(ctx, fake_offset)];
if (state == NULL) {
block->status &= ~(R600_BLOCK_STATUS_ENABLED | R600_BLOCK_STATUS_DIRTY);
+ LIST_DEL(&block->list);
return;
}
if (state->nregs <= 3) {
block->status |= R600_BLOCK_STATUS_ENABLED;
block->status |= R600_BLOCK_STATUS_DIRTY;
ctx->pm4_dirty_cdwords += block->pm4_ndwords + block->pm4_flush_ndwords;
+ LIST_ADDTAIL(&block->list,&ctx->dirty);
}
}
struct r600_bo *cb[12];
struct r600_bo *db;
unsigned ndwords = 9, flush;
+ struct r600_block *dirty_block;
if (draw->indices) {
ndwords = 13;
}
/* enough room to copy packet */
- for (int i = 0; i < ctx->nblocks; i++) {
- if (ctx->blocks[i]->status & R600_BLOCK_STATUS_DIRTY) {
- r600_context_block_emit_dirty(ctx, ctx->blocks[i]);
- }
+ LIST_FOR_EACH_ENTRY(dirty_block,&ctx->dirty,list) {
+ r600_context_block_emit_dirty(ctx, dirty_block);
}
+ LIST_INITHEAD(&ctx->dirty);
/* draw packet */
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_INDEX_TYPE, 0);
block->status |= R600_BLOCK_STATUS_ENABLED;
block->status |= R600_BLOCK_STATUS_DIRTY;
ctx->pm4_dirty_cdwords += block->pm4_ndwords + block->pm4_flush_ndwords;
+ LIST_ADDTAIL(&block->list,&ctx->dirty);
}
}
r = -ENOMEM;
goto out_err;
}
+
+ /* init dirty list */
+ LIST_INITHEAD(&ctx->dirty);
return 0;
out_err:
r600_context_fini(ctx);
block->status |= R600_BLOCK_STATUS_ENABLED;
block->status |= R600_BLOCK_STATUS_DIRTY;
ctx->pm4_dirty_cdwords += block->pm4_ndwords + block->pm4_flush_ndwords;
+ LIST_ADDTAIL(&block->list,&ctx->dirty);
}
}
}
block->status &= ~(R600_BLOCK_STATUS_ENABLED | R600_BLOCK_STATUS_DIRTY);
r600_bo_reference(ctx->radeon, &block->reloc[1].bo, NULL);
r600_bo_reference(ctx->radeon , &block->reloc[2].bo, NULL);
+ LIST_DEL(&block->list);
return;
}
block->reg[0] = state->regs[0].value;
block->status |= R600_BLOCK_STATUS_ENABLED;
block->status |= R600_BLOCK_STATUS_DIRTY;
ctx->pm4_dirty_cdwords += block->pm4_ndwords + block->pm4_flush_ndwords;
+ LIST_ADDTAIL(&block->list,&ctx->dirty);
}
}
block = range->blocks[CTX_BLOCK_ID(ctx, offset)];
if (state == NULL) {
block->status &= ~(R600_BLOCK_STATUS_ENABLED | R600_BLOCK_STATUS_DIRTY);
+ LIST_DEL(&block->list);
return;
}
block->reg[0] = state->regs[0].value;
block->status |= R600_BLOCK_STATUS_ENABLED;
block->status |= R600_BLOCK_STATUS_DIRTY;
ctx->pm4_dirty_cdwords += block->pm4_ndwords + block->pm4_flush_ndwords;
+ LIST_ADDTAIL(&block->list,&ctx->dirty);
}
}
block = range->blocks[CTX_BLOCK_ID(ctx, offset)];
if (state == NULL) {
block->status &= ~(R600_BLOCK_STATUS_ENABLED | R600_BLOCK_STATUS_DIRTY);
+ LIST_DEL(&block->list);
return;
}
if (state->nregs <= 3) {
block->status |= R600_BLOCK_STATUS_ENABLED;
block->status |= R600_BLOCK_STATUS_DIRTY;
ctx->pm4_dirty_cdwords += block->pm4_ndwords + block->pm4_flush_ndwords;
+ LIST_ADDTAIL(&block->list,&ctx->dirty);
}
}
struct r600_bo *cb[8];
struct r600_bo *db;
unsigned ndwords = 9;
+ struct r600_block *dirty_block;
if (draw->indices) {
ndwords = 13;
}
/* enough room to copy packet */
- for (int i = 0; i < ctx->nblocks; i++) {
- if (ctx->blocks[i]->status & R600_BLOCK_STATUS_DIRTY) {
- r600_context_block_emit_dirty(ctx, ctx->blocks[i]);
- }
+ LIST_FOR_EACH_ENTRY(dirty_block,&ctx->dirty,list) {
+ r600_context_block_emit_dirty(ctx, dirty_block);
}
+ LIST_INITHEAD(&ctx->dirty);
/* draw packet */
ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_INDEX_TYPE, 0);
*/
for (int i = 0; i < ctx->nblocks; i++) {
if (ctx->blocks[i]->status & R600_BLOCK_STATUS_ENABLED) {
+ if(!(ctx->blocks[i]->status & R600_BLOCK_STATUS_DIRTY))
+ LIST_ADDTAIL(&ctx->blocks[i]->list,&ctx->dirty);
ctx->pm4_dirty_cdwords += ctx->blocks[i]->pm4_ndwords + ctx->blocks[i]->pm4_flush_ndwords;
ctx->blocks[i]->status |= R600_BLOCK_STATUS_DIRTY;
}