panvk/csf: fix uninitialized read in utrace_clone_init_builder

Previous code assumed that the caller of utrace_clone_init_builder would
fill some parameters of the builder config, but we were not. Instead,
initialize these from the csif props the same as all the other builder
instances.

Signed-off-by: Benjamin Lee <benjamin.lee@collabora.com>
Fixes: 3096cf2a5d ("panvk/csf: flush and process trace events for all cmdbufs")
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34270>
(cherry picked from commit e183650aa4)
This commit is contained in:
Benjamin Lee 2025-03-28 22:04:32 -07:00 committed by Eric Engestrom
parent d2e0c22518
commit 350839a5f1
2 changed files with 7 additions and 3 deletions

View file

@ -364,7 +364,7 @@
"description": "panvk/csf: fix uninitialized read in utrace_clone_init_builder",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "3096cf2a5ddd851cf60c835e013377ccbce0e3eb",
"notes": null

View file

@ -5,6 +5,8 @@
#include "panvk_utrace.h"
#include "drm-uapi/panthor_drm.h"
#include "genxml/cs_builder.h"
#include "panvk_cmd_buffer.h"
#include "panvk_device.h"
@ -148,9 +150,11 @@ void
panvk_per_arch(utrace_clone_init_builder)(struct cs_builder *b,
struct panvk_pool *pool)
{
const struct drm_panthor_csif_info *csif_info =
panthor_kmod_get_csif_props(pool->dev->kmod.dev);
const struct cs_builder_conf builder_conf = {
.nr_registers = 96,
.nr_kernel_registers = 4,
.nr_registers = csif_info->cs_reg_count,
.nr_kernel_registers = MAX2(csif_info->unpreserved_cs_reg_count, 4),
.alloc_buffer = alloc_clone_buffer,
.cookie = pool,
};