mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-07 03:40:27 +01:00
radv/sqtt: Prevent concurrent submit when sqtt is enabled
cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39090>
This commit is contained in:
parent
1b1e38ffd5
commit
8f7941f92d
3 changed files with 16 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
@ -61,6 +62,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 {
|
||||
|
|
|
|||
|
|
@ -778,8 +778,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];
|
||||
|
|
@ -863,12 +866,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