The PM4_MICRO_CNTL register has a single flag that is used by drivers to enable processing of CCE commands from the CCE FIFO. Reverse engineering uncovered additional debug fields, many of which have an unclear purpose. They have been omitted for now but could be added if needed.
Signed-off-by: Chad Jablonski <[email protected]> --- hw/display/ati.c | 7 +++++++ hw/display/ati_cce.h | 2 ++ hw/display/ati_regs.h | 3 +++ 3 files changed, 12 insertions(+) diff --git a/hw/display/ati.c b/hw/display/ati.c index a4bef92efd..5f52739d33 100644 --- a/hw/display/ati.c +++ b/hw/display/ati.c @@ -540,6 +540,9 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size) (s->cce.no_update << 27) | (s->cce.buffer_size_l2qw & 0x7ffffff); break; + case PM4_MICRO_CNTL: + val = s->cce.freerun ? PM4_MICRO_FREERUN : 0; + break; default: break; } @@ -990,6 +993,10 @@ void ati_reg_write(ATIVGAState *s, hwaddr addr, s->cce.buffer_mode = (data >> 28) & 0xf; break; } + case PM4_MICRO_CNTL: { + s->cce.freerun = data & PM4_MICRO_FREERUN; + break; + } default: break; } diff --git a/hw/display/ati_cce.h b/hw/display/ati_cce.h index 25a2430c60..a6a9aa87c4 100644 --- a/hw/display/ati_cce.h +++ b/hw/display/ati_cce.h @@ -21,6 +21,8 @@ typedef struct ATIPM4MicrocodeState { typedef struct ATICCEState { ATIPM4MicrocodeState microcode; + /* MicroCntl */ + bool freerun; /* BufferCntl */ uint32_t buffer_size_l2qw; bool no_update; diff --git a/hw/display/ati_regs.h b/hw/display/ati_regs.h index 4d1ccc1434..d7118449f5 100644 --- a/hw/display/ati_regs.h +++ b/hw/display/ati_regs.h @@ -392,6 +392,9 @@ #define PM4_BUFFER_CNTL_64BM_64VCBM_64INDBM 0x00000008 #define PM4_BUFFER_CNTL_64PIO_64VCPIO_64INPIO 0x0000000f +/* PM4_MICRO_CNTL bit constants */ +#define PM4_MICRO_FREERUN 0x40000000 + /* DP_DATATYPE bit constants */ #define DST_8BPP 0x00000002 #define DST_15BPP 0x00000003 -- 2.51.2
