etnaviv: drm: Stop after model query failure

Calling etna_gpu_new() with a nonexisting core can happen when iterating
all cores. Bail immediately if querying the model failed, there is no
use in also failing to query the revision.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28921>
This commit is contained in:
Philipp Zabel 2024-04-17 14:41:54 +02:00 committed by Marge Bot
parent ba59882212
commit 06683288e0

View file

@ -217,12 +217,12 @@ struct etna_gpu *etna_gpu_new(struct etna_device *dev, unsigned int core)
gpu->dev = dev;
gpu->core = core;
gpu->info.model = get_param(dev, core, ETNAVIV_PARAM_GPU_MODEL);
gpu->info.revision = get_param(dev, core, ETNAVIV_PARAM_GPU_REVISION);
gpu->info.model = get_param(dev, core, ETNAVIV_PARAM_GPU_MODEL);
if (!gpu->info.model)
goto fail;
gpu->info.revision = get_param(dev, core, ETNAVIV_PARAM_GPU_REVISION);
DEBUG_MSG(" GPU model: 0x%x (rev %x)", gpu->info.model, gpu->info.revision);
if (dev->drm_version >= ETNA_DRM_VERSION(1, 4)) {