pvr: Use common physical device enumeration
authorMatt Coster <matt.coster@imgtec.com>
Tue, 9 May 2023 08:57:14 +0000 (09:57 +0100)
committerMarge Bot <emma+marge@anholt.net>
Thu, 18 May 2023 15:56:59 +0000 (15:56 +0000)
commit4643319f430a9d976473ad4b734daa88de44e4da
treee3d2b3bda9f646f465228ee33188d55dea456333
parent31e98d3783f6fbeebb0f320496703986c2066944
pvr: Use common physical device enumeration

The PowerVR IP does not contain display hardware - this means it is
always necessary to open two separate devices for render and display.
The try_create_for_drm callback is not suitable for this configuration,
so we use the enumerate callback instead.

The previous implementation did not check that the discovered display
device was compatible with the render device - this is corrected by
unifying the compatibility lists into pvr_drm_configs.

The pvr driver is not currently supported on systems which contain
multiple compatible render or display devices, so the enumerate callback
implementation returns the first discovered render device and its
compatible display device.

This change also removes the workaround for drmGetDevices2() required
after libdrm commit 8cb12a2528d795c45bba5f03b3486b4040fb0f45. The
upstream fix has been in releases of libdrm for over a year now, and
mesa requires reasonably a recent version which is new enough to
contain it.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23023>
src/imagination/vulkan/pvr_device.c
src/imagination/vulkan/pvr_private.h