broadcom/cle: parse once the XML spec
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Instead of loading and parsing the XML spec everytime a CLIF is created,
do it once and cache for further calls.

This also avoids leaking the spec loading.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40747>
This commit is contained in:
Juan A. Suarez Romero 2026-04-01 16:42:06 +02:00 committed by Marge Bot
parent d4646cd444
commit 1be54acdee

View file

@ -629,7 +629,10 @@ static uint32_t zlib_inflate(const void *compressed_data,
struct v3d_spec *
v3d_spec_load(const struct v3d_device_info *devinfo)
{
struct v3d_spec *spec = calloc(1, sizeof(struct v3d_spec));
static struct v3d_spec *spec = NULL;
if (spec)
return spec;
spec = calloc(1, sizeof(struct v3d_spec));
if (!spec)
return NULL;