} else if (!t) {
OUT_BATCH(r300->radeon.radeonScreen->texOffset[0]);
} else {
- if (t->bo) {
- OUT_BATCH_RELOC(t->tile_bits, t->bo, 0,
- RADEON_GEM_DOMAIN_VRAM, 0, 0);
- } else {
- OUT_BATCH(t->override_offset);
- }
+ if (t->bo) {
+ OUT_BATCH_RELOC(t->tile_bits, t->bo, 0,
+ RADEON_GEM_DOMAIN_VRAM, 0, 0);
+ } else {
+ OUT_BATCH(t->override_offset);
+ }
}
- END_BATCH();
+ END_BATCH();
}
}
}
GLframebuffer *fb = r300->radeon.dri.drawable->driverPrivate;
rrb = r300->radeon.state.color.rrb;
- if (r300->radeon.radeonScreen->driScreen->dri2.enabled) {
- rrb = fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer;
- }
+ if (r300->radeon.radeonScreen->driScreen->dri2.enabled) {
+ rrb = fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer;
+ }
if (!rrb || !rrb->bo) {
fprintf(stderr, "no rrb\n");
return;
return;
zbpitch = (rrb->pitch / rrb->cpp);
- if (rrb->bo->flags & RADEON_BO_FLAGS_MACRO_TILE) {
- zbpitch |= R300_DEPTHMACROTILE_ENABLE;
- }
- if (rrb->bo->flags & RADEON_BO_FLAGS_MICRO_TILE){
- zbpitch |= R300_DEPTHMICROTILE_TILED;
- }
-
+ if (rrb->bo->flags & RADEON_BO_FLAGS_MACRO_TILE) {
+ zbpitch |= R300_DEPTHMACROTILE_ENABLE;
+ }
+ if (rrb->bo->flags & RADEON_BO_FLAGS_MICRO_TILE){
+ zbpitch |= R300_DEPTHMICROTILE_TILED;
+ }
+
BEGIN_BATCH(4);
OUT_BATCH_REGSEQ(R300_ZB_DEPTHOFFSET, 1);
OUT_BATCH_RELOC(0, rrb->bo, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0);
ALLOC_STATE(vpi, vpu, R300_VPI_CMDSIZE, 0);
r300->hw.vpi.cmd[0] =
cmdvpu(r300->radeon.radeonScreen, R300_PVS_CODE_START, 0);
- r300->hw.vpi.emit = emit_vpu;
+ r300->hw.vpi.emit = emit_vpu;
if (is_r500) {
ALLOC_STATE(vpp, vpu, R300_VPP_CMDSIZE, 0);
r300->hw.vpp.cmd[0] =
cmdvpu(r300->radeon.radeonScreen, R500_PVS_CONST_START, 0);
- r300->hw.vpp.emit = emit_vpu;
+ r300->hw.vpp.emit = emit_vpu;
ALLOC_STATE(vps, vpu, R300_VPS_CMDSIZE, 0);
r300->hw.vps.cmd[0] =
cmdvpu(r300->radeon.radeonScreen, R500_POINT_VPORT_SCALE_OFFSET, 1);
- r300->hw.vps.emit = emit_vpu;
+ r300->hw.vps.emit = emit_vpu;
for (i = 0; i < 6; i++) {
- ALLOC_STATE(vpucp[i], vpu, R300_VPUCP_CMDSIZE, 0);
- r300->hw.vpucp[i].cmd[0] =
- cmdvpu(r300->radeon.radeonScreen,
+ ALLOC_STATE(vpucp[i], vpu, R300_VPUCP_CMDSIZE, 0);
+ r300->hw.vpucp[i].cmd[0] =
+ cmdvpu(r300->radeon.radeonScreen,
R500_PVS_UCP_START + i, 1);
- r300->hw.vpucp[i].emit = emit_vpu;
+ r300->hw.vpucp[i].emit = emit_vpu;
}
} else {
ALLOC_STATE(vpp, vpu, R300_VPP_CMDSIZE, 0);
r300->hw.vpp.cmd[0] =
cmdvpu(r300->radeon.radeonScreen, R300_PVS_CONST_START, 0);
- r300->hw.vpp.emit = emit_vpu;
+ r300->hw.vpp.emit = emit_vpu;
ALLOC_STATE(vps, vpu, R300_VPS_CMDSIZE, 0);
r300->hw.vps.cmd[0] =
cmdvpu(r300->radeon.radeonScreen, R300_POINT_VPORT_SCALE_OFFSET, 1);
- r300->hw.vps.emit = emit_vpu;
+ r300->hw.vps.emit = emit_vpu;
for (i = 0; i < 6; i++) {
ALLOC_STATE(vpucp[i], vpu, R300_VPUCP_CMDSIZE, 0);
r300->hw.vpucp[i].cmd[0] =
cmdvpu(r300->radeon.radeonScreen,
- R300_PVS_UCP_START + i, 1);
- r300->hw.vpucp[i].emit = emit_vpu;
+ R300_PVS_UCP_START + i, 1);
+ r300->hw.vpucp[i].emit = emit_vpu;
}
}
}
OUT_BATCH(1 << R300_PVS_LAST_VTX_SRC_INST_SHIFT);
END_BATCH();
- vpu.check = check_vpu;
- vpu.cmd = _cmd;
- vpu.cmd[0] = cmdvpu(r300->radeon.radeonScreen, 0, 2);
+ vpu.check = check_vpu;
+ vpu.cmd = _cmd;
+ vpu.cmd[0] = cmdvpu(r300->radeon.radeonScreen, 0, 2);
vpu.cmd[1] = PVS_OP_DST_OPERAND(VE_ADD, GL_FALSE, GL_FALSE,
0, 0xf, PVS_DST_REG_OUT);
vpu.cmd[6] = PVS_SRC_OPERAND(1, PVS_SRC_SELECT_X,
PVS_SRC_SELECT_Y, PVS_SRC_SELECT_Z,
PVS_SRC_SELECT_W, PVS_SRC_REG_INPUT,
+
VSF_FLAG_NONE);
vpu.cmd[7] = PVS_SRC_OPERAND(1, PVS_SRC_SELECT_FORCE_0,
PVS_SRC_SELECT_FORCE_0,
PVS_SRC_SELECT_FORCE_0,
PVS_SRC_REG_INPUT, VSF_FLAG_NONE);
vpu.cmd[8] = 0x0;
- emit_vpu(r300, &vpu);
+ emit_vpu(r300, &vpu);
}
}
OUT_BATCH(vertex_count);
radeon_cs_write_reloc(rmesa->cmdbuf.cs,
rmesa->state.elt_dma_bo,
- 0,
- rmesa->state.elt_dma_bo->size,
RADEON_GEM_DOMAIN_GTT, 0, 0);
}
END_BATCH();
offset * 4 * rmesa->state.aos[i + 0].stride;
radeon_cs_write_reloc(rmesa->cmdbuf.cs,
rmesa->state.aos[i+0].bo,
- voffset,
- rmesa->state.aos[i+0].bo->size,
RADEON_GEM_DOMAIN_GTT,
0, 0);
voffset = rmesa->state.aos[i + 1].offset +
offset * 4 * rmesa->state.aos[i + 1].stride;
radeon_cs_write_reloc(rmesa->cmdbuf.cs,
rmesa->state.aos[i+1].bo,
- voffset,
- rmesa->state.aos[i+1].bo->size,
RADEON_GEM_DOMAIN_GTT,
0, 0);
}
offset * 4 * rmesa->state.aos[nr - 1].stride;
radeon_cs_write_reloc(rmesa->cmdbuf.cs,
rmesa->state.aos[nr-1].bo,
- voffset,
- rmesa->state.aos[nr-1].bo->size,
RADEON_GEM_DOMAIN_GTT,
0, 0);
}
static int cs_write_reloc(struct radeon_cs *cs,
struct radeon_bo *bo,
- uint32_t start_offset,
- uint32_t end_offset,
uint32_t read_domain,
uint32_t write_domain,
uint32_t flags)
if (write_domain == RADEON_GEM_DOMAIN_CPU) {
return -EINVAL;
}
- /* check reloc window */
- if (end_offset > bo->size) {
- return -EINVAL;
- }
- if (start_offset > end_offset) {
- return -EINVAL;
- }
/* check if bo is already referenced */
for(i = 0; i < cs->crelocs; i++) {
uint32_t *indices;
if (relocs[i].base.bo->handle == bo->handle) {
- /* update start and end offset */
- if (start_offset < relocs[i].base.start_offset) {
- relocs[i].base.start_offset = start_offset;
- }
- if (end_offset > relocs[i].base.end_offset) {
- relocs[i].base.end_offset = end_offset;
- }
/* Check domains must be in read or write. As we check already
* checked that in argument one of the read or write domain was
* set we only need to check that if previous reloc as the read
}
cs->relocs = relocs;
relocs[cs->crelocs].base.bo = bo;
- relocs[cs->crelocs].base.start_offset = start_offset;
- relocs[cs->crelocs].base.end_offset = end_offset;
relocs[cs->crelocs].base.read_domain = read_domain;
relocs[cs->crelocs].base.write_domain = write_domain;
relocs[cs->crelocs].base.flags = flags;
for (j = 0; j < relocs[i].cindices; j++) {
uint32_t soffset, eoffset;
- soffset = relocs[i].base.start_offset;
- eoffset = relocs[i].base.end_offset;
r = radeon_bo_legacy_validate(relocs[i].base.bo,
&soffset, &eoffset);
if (r) {