diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2024-04-17 14:41:54 +0200 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-04-26 19:30:08 +0000 |
commit | 06683288e0b891aba3b1ae602e820cde17638197 (patch) | |
tree | d8c12e57b155c329551322ac148d662fa8acf761 | |
parent | ba59882212afdc3ddafc070c53092ae3f0aea618 (diff) |
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>
-rw-r--r-- | src/etnaviv/drm/etnaviv_gpu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/etnaviv/drm/etnaviv_gpu.c b/src/etnaviv/drm/etnaviv_gpu.c index b528b07e9c0..71238ef34a5 100644 --- a/src/etnaviv/drm/etnaviv_gpu.c +++ b/src/etnaviv/drm/etnaviv_gpu.c @@ -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)) { |