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>
This commit is contained in:
committed by
Marge Bot
parent
0e7ac7d65f
commit
e3b8d1da6d
@@ -911,6 +911,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:
|
||||
|
||||
Reference in New Issue
Block a user