dev-amdgpu: Rework handling of unknown registers

The top level AMDGPUDevice currently reads/writes all unknown registers
to/from a map containing the previously written value. This is intended
as a way to handle registers that are not part of the model but the
driver requires for functionality. Since this is at the top level, it
can mask changes to register values which do not go through the same
interface. For example, reading an MMIO, changing via PM4 queue, and
reading again returns the stale cached value.

This commit removes the usage of the regs map in AMDGPUDevice,
implements some important MMIOs that were previously handled by it, and
moves the unknown register handling to the NBIO aperture only. To reduce
the number of additional MMIOs to implement, the display manager in
vega10 is now disabled.

Change-Id: Iff0a599dd82d663c7e710b79c6ef6d0ad1fc44a2
This commit is contained in:
Matthew Poremba
2024-02-08 12:26:27 -06:00
parent 009cec56e0
commit 6bbde8fbb8
7 changed files with 96 additions and 67 deletions

View File

@@ -87,8 +87,6 @@ class AMDGPUDevice : public PciDevice
/**
* Structures to hold registers, doorbells, and some frame memory
*/
using GPURegMap = std::unordered_map<uint32_t, uint64_t>;
GPURegMap regs;
std::unordered_map<uint32_t, QueueType> doorbells;
std::unordered_map<uint32_t, PacketPtr> pendingDoorbellPkts;
@@ -195,9 +193,8 @@ class AMDGPUDevice : public PciDevice
* Register value getter/setter. Used by other GPU blocks to change
* values from incoming driver/user packets.
*/
bool haveRegVal(uint32_t addr);
uint32_t getRegVal(uint32_t addr);
void setRegVal(uint32_t addr, uint32_t value);
uint32_t getRegVal(uint64_t addr);
void setRegVal(uint64_t addr, uint32_t value);
/**
* Methods related to translations and system/device memory.