mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 06:30:10 +01:00
panvk: do not open-code debug_get_num_option
Open-coding the size-parsing here is fragile. Let's use a common helper for this instead. CID: 1665346 Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37903>
This commit is contained in:
parent
37a7a157e8
commit
22d929f265
1 changed files with 1 additions and 15 deletions
|
|
@ -170,21 +170,7 @@ panvk_utrace_capture_data(struct u_trace *ut, void *cs, void *dst_buffer,
|
|||
static uint32_t
|
||||
get_utrace_clone_mem_size()
|
||||
{
|
||||
const char *v = os_get_option("PANVK_UTRACE_CLONE_MEM_SIZE");
|
||||
if (v) {
|
||||
uint32_t size = 0;
|
||||
sscanf(v, "%u", &size);
|
||||
if (size > 0) {
|
||||
return size;
|
||||
}
|
||||
sscanf(v, "0x%x", &size);
|
||||
if (size > 0) {
|
||||
mesa_logi("selected utrace mem size = 0x%x (%u) hex", size, size);
|
||||
return size;
|
||||
}
|
||||
}
|
||||
/* 10 MB default */
|
||||
return 0xa00000;
|
||||
return debug_get_num_option("PANVK_UTRACE_CLONE_MEM_SIZE", 0xa00000);
|
||||
}
|
||||
|
||||
VkResult
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue