radv: fail to initialize when the AMD GPU generation is unsupported

Better to be conservative than allowing something that isn't supposed
to be working.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33031>
This commit is contained in:
Samuel Pitoiset 2025-01-15 12:00:43 +01:00 committed by Marge Bot
parent 0b310ae4d8
commit c942d957b0

View file

@ -22,12 +22,25 @@
#include "vk_drm_syncobj.h" #include "vk_drm_syncobj.h"
#include "xf86drm.h" #include "xf86drm.h"
static bool
radv_is_gpu_supported(const struct radeon_info *info)
{
/* Unknown GPU generations aren't supported. */
if (info->gfx_level > GFX12)
return false;
return true;
}
static bool static bool
do_winsys_init(struct radv_amdgpu_winsys *ws, int fd) do_winsys_init(struct radv_amdgpu_winsys *ws, int fd)
{ {
if (!ac_query_gpu_info(fd, ws->dev, &ws->info, true)) if (!ac_query_gpu_info(fd, ws->dev, &ws->info, true))
return false; return false;
if (!radv_is_gpu_supported(&ws->info))
return false;
/* /*
* Override the max submits on video queues. * Override the max submits on video queues.
* If you submit multiple session contexts in the same IB sequence the * If you submit multiple session contexts in the same IB sequence the