drm/vc4: hvs: Change prototype of __vc4_hvs_alloc to pass registers
authorMaxime Ripard <maxime@cerno.tech>
Fri, 24 Mar 2023 14:45:50 +0000 (15:45 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:34:55 +0000 (11:34 +0000)
commit311fc3f773578617b4947c5fabc95bbbd262186f
treea626d94a0f2b18dc2d4b5b6dacf6bb693a27ac79
parent8066a717722ea406898c996da067aef5cc5dcb57
drm/vc4: hvs: Change prototype of __vc4_hvs_alloc to pass registers

The BCM2712 HVS has registers to report the size of the various SRAM the
driver uses, and their size actually differ depending on the stepping.

The initialisation of the memory pools happen in the __vc4_hvs_alloc()
function that also allocates the main HVS structure, that will then hold
the pointer to the memory mapping of the registers.

This creates some kind of circular dependency that we can break by
passing the mapping pointer as an argument for __vc4_hvs_alloc() to use
to query to get the SRAM sizes and initialise the memory pools
accordingly.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/vc4/tests/vc4_mock.c
drivers/gpu/drm/vc4/vc4_drv.h
drivers/gpu/drm/vc4/vc4_hvs.c