mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
radv/sqtt: Prevent concurrent submit when sqtt is enabled
cc: mesa-stable
(cherry picked from commit 8f7941f92d)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39745>
This commit is contained in:
parent
f53d271a8d
commit
5f5a3691ef
4 changed files with 17 additions and 2 deletions
|
|
@ -1264,7 +1264,7 @@
|
|||
"description": "radv/sqtt: Prevent concurrent submit when sqtt is enabled",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ ac_sqtt_get_data_va(const struct radeon_info *rad_info, const struct ac_sqtt *da
|
|||
void
|
||||
ac_sqtt_init(struct ac_sqtt *data)
|
||||
{
|
||||
simple_mtx_init(&data->lock, mtx_plain);
|
||||
|
||||
list_inithead(&data->rgp_pso_correlation.record);
|
||||
simple_mtx_init(&data->rgp_pso_correlation.lock, mtx_plain);
|
||||
|
||||
|
|
@ -71,6 +73,8 @@ ac_sqtt_init(struct ac_sqtt *data)
|
|||
void
|
||||
ac_sqtt_finish(struct ac_sqtt *data)
|
||||
{
|
||||
simple_mtx_destroy(&data->lock);
|
||||
|
||||
assert(data->rgp_pso_correlation.record_count == 0);
|
||||
simple_mtx_destroy(&data->rgp_pso_correlation.lock);
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#include "ac_pm4.h"
|
||||
#include "ac_rgp.h"
|
||||
#include "amd_family.h"
|
||||
#include "util/simple_mtx.h"
|
||||
|
||||
#define SQTT_BUFFER_ALIGN_SHIFT 12
|
||||
|
||||
|
|
@ -57,6 +58,8 @@ struct ac_sqtt {
|
|||
struct rgp_clock_calibration rgp_clock_calibration;
|
||||
|
||||
struct hash_table_u64 *pipeline_bos;
|
||||
|
||||
simple_mtx_t lock;
|
||||
};
|
||||
|
||||
struct ac_sqtt_data_info {
|
||||
|
|
|
|||
|
|
@ -767,8 +767,11 @@ sqtt_QueueSubmit2(VkQueue _queue, uint32_t submitCount, const VkSubmitInfo2 *pSu
|
|||
if (queue->sqtt_present)
|
||||
return radv_sqtt_wsi_submit(_queue, submitCount, pSubmits, _fence);
|
||||
|
||||
if (instance->vk.trace_per_submit)
|
||||
if (instance->vk.trace_per_submit) {
|
||||
/* Make sure to lock in case of multithreaded submissions. */
|
||||
simple_mtx_lock(&device->sqtt.lock);
|
||||
radv_sqtt_start_capturing(queue);
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < submitCount; i++) {
|
||||
const VkSubmitInfo2 *pSubmit = &pSubmits[i];
|
||||
|
|
@ -852,12 +855,17 @@ sqtt_QueueSubmit2(VkQueue _queue, uint32_t submitCount, const VkSubmitInfo2 *pSu
|
|||
"radv: Failed to capture RGP for this submit because the buffer is too small and auto-resizing "
|
||||
"is disabled. See RADV_THREAD_TRACE_BUFFER_SIZE for increasing the size.\n");
|
||||
}
|
||||
simple_mtx_unlock(&device->sqtt.lock);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
fail:
|
||||
FREE(new_cmdbufs);
|
||||
|
||||
if (instance->vk.trace_per_submit) {
|
||||
simple_mtx_unlock(&device->sqtt.lock);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue