panvk: Disallow unknown GPU models early in physical device init

We rely on the panfrost_model details around the codebase, if it's not
known this is a problem.

As a result, we will now disallow anything that isn't known like what
we do on Gallium.

Fixes: c95ef9e323 ("panvk: Fix NULL deref on model name when device isn't supported")
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Suggested-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33371>
(cherry picked from commit e3b8d1da6d)
This commit is contained in:
Mary Guillemard 2025-02-04 10:08:37 +01:00 committed by Eric Engestrom
parent 687790670f
commit 32f0add871
2 changed files with 9 additions and 1 deletions

View file

@ -94,7 +94,7 @@
"description": "panvk: Disallow unknown GPU models early in physical device init",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "c95ef9e3232ef35da3b3d7a77d0726d0cde3fe23",
"notes": null

View file

@ -905,6 +905,14 @@ panvk_physical_device_init(struct panvk_physical_device *device,
unsigned arch = pan_arch(device->kmod.props.gpu_prod_id);
if (!device->model) {
result = panvk_errorf(instance, VK_ERROR_INCOMPATIBLE_DRIVER,
"Unknown gpu_id (%#x) or variant (%#x)",
device->kmod.props.gpu_prod_id,
device->kmod.props.gpu_variant);
goto fail;
}
switch (arch) {
case 6:
case 7: