Merge pull request #2815 from Cacodemon345/voodoo-unimpl-regs

voodoo: Partial implementation of cmdStatus0 register
This commit is contained in:
Miran Grča
2022-11-06 16:25:57 +01:00
committed by GitHub
3 changed files with 16 additions and 0 deletions

View File

@@ -320,6 +320,8 @@ typedef struct voodoo_t {
uint32_t cmdfifo_amin, cmdfifo_amax;
int cmdfifo_holecount;
atomic_uint cmd_status;
uint32_t sSetupMode;
vert_t verts[4];
unsigned int vertex_ages[3];

View File

@@ -178,6 +178,7 @@ enum {
cmdRdPtrH0 = 0x30,
cmdAMin0 = 0x34,
cmdAMax0 = 0x3c,
cmdStatus0 = 0x40,
cmdFifoDepth0 = 0x44,
cmdHoleCnt0 = 0x48,
@@ -1170,6 +1171,10 @@ banshee_cmd_read(banshee_t *banshee, uint32_t addr)
// banshee_log("Read cmdfifo_depth %08x\n", ret);
break;
case cmdStatus0:
ret = voodoo->cmd_status;
break;
case 0x108:
break;
@@ -2981,6 +2986,7 @@ banshee_init_common(const device_t *info, char *fn, int has_sgram, int type, int
banshee->voodoo->tex_mem[1] = banshee->svga.vram;
banshee->voodoo->tex_mem_w[1] = (uint16_t *) banshee->svga.vram;
banshee->voodoo->texture_mask = banshee->svga.vram_mask;
banshee->voodoo->cmd_status = (1 << 28);
voodoo_generate_filter_v1(banshee->voodoo);
banshee->vidSerialParallelPort = VIDSERIAL_DDC_DCK_W | VIDSERIAL_DDC_DDA_W;

View File

@@ -106,6 +106,7 @@ voodoo_queue_command(voodoo_t *voodoo, uint32_t addr_type, uint32_t val)
fifo->addr_type = addr_type;
voodoo->fifo_write_idx++;
voodoo->cmd_status &= ~(1 << 24);
if (FIFO_ENTRIES > 0xe000)
voodoo_wake_fifo_thread(voodoo);
@@ -283,6 +284,8 @@ voodoo_fifo_thread(void *param)
voodoo->time += end_time - start_time;
}
voodoo->cmd_status |= (1 << 24);
while (voodoo->cmdfifo_enabled && (voodoo->cmdfifo_depth_rd != voodoo->cmdfifo_depth_wr || voodoo->cmdfifo_in_sub)) {
uint64_t start_time = plat_timer_read();
uint64_t end_time;
@@ -296,9 +299,13 @@ voodoo_fifo_thread(void *param)
// voodoo_fifo_log(" CMDFIFO header %08x at %08x\n", header, voodoo->cmdfifo_rp);
voodoo->cmd_status &= ~7;
voodoo->cmd_status |= (header & 7);
voodoo->cmd_status |= (1 << 11);
switch (header & 7) {
case 0:
// voodoo_fifo_log("CMDFIFO0\n");
voodoo->cmd_status = (voodoo->cmd_status & 0xffff8fff) | (((header >> 3) & 7) << 12);
switch ((header >> 3) & 7) {
case 0: /*NOP*/
break;
@@ -323,6 +330,7 @@ voodoo_fifo_thread(void *param)
default:
fatal("Bad CMDFIFO0 %08x\n", header);
}
voodoo->cmd_status = (voodoo->cmd_status & ~(1 << 27)) | (voodoo->cmdfifo_in_sub << 27);
break;
case 1: