broadcom/simulator: Expose V3D revision number in the simulator interface

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34465>
This commit is contained in:
Maíra Canal 2025-04-10 15:08:01 -03:00 committed by Marge Bot
parent 1d5da22dfd
commit d3ad4e3465
3 changed files with 10 additions and 0 deletions

View file

@ -76,6 +76,7 @@ static struct v3d_simulator_state {
struct v3d_hw *v3d;
int ver;
int rev;
/* Size of the heap. */
uint64_t mem_size;
@ -1175,6 +1176,7 @@ v3d_simulator_init_global()
v3d_hw_set_mem(sim_state.v3d, b->ofs, 0xd0, 4096);
sim_state.ver = v3d_hw_get_version(sim_state.v3d);
sim_state.rev = v3d_hw_get_revision(sim_state.v3d);
simple_mtx_unlock(&sim_state.mutex);

View file

@ -89,6 +89,13 @@ int v3d_hw_get_version(struct v3d_hw *hw)
return ident->tech_version * 10 + ident->revision;
}
int v3d_hw_get_revision(struct v3d_hw *hw)
{
const V3D_HUB_IDENT_T *ident = hw->get_hub_ident();
return ident->sub_rev;
}
void
v3d_hw_set_isr(struct v3d_hw *hw, void (*isr)(uint32_t status))
{

View file

@ -40,6 +40,7 @@ uint32_t v3d_hw_read_reg(struct v3d_hw *hw, uint32_t reg);
void v3d_hw_write_reg(struct v3d_hw *hw, uint32_t reg, uint32_t val);
void v3d_hw_tick(struct v3d_hw *hw);
int v3d_hw_get_version(struct v3d_hw *hw);
int v3d_hw_get_revision(struct v3d_hw *hw);
void v3d_hw_set_isr(struct v3d_hw *hw, void (*isr)(uint32_t status));
uint32_t v3d_hw_get_hub_core();