tu/perfetto: Remove now unnecessary tu_perfetto_util
Since Turnip now uses C++ we can directly include tu_device.h into perfetto code. Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12805>
This commit is contained in:

committed by
Marge Bot

parent
bd16d3cdaf
commit
18a47efb80
@@ -110,7 +110,7 @@ tu_tracepoints = custom_target(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if with_perfetto
|
if with_perfetto
|
||||||
libtu_files += ['tu_perfetto.cc', 'tu_perfetto_util.cc']
|
libtu_files += ['tu_perfetto.cc']
|
||||||
tu_deps += dep_perfetto
|
tu_deps += dep_perfetto
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
#include <perfetto.h>
|
#include <perfetto.h>
|
||||||
|
|
||||||
#include "tu_perfetto.h"
|
#include "tu_perfetto.h"
|
||||||
|
#include "tu_device.h"
|
||||||
|
|
||||||
#include "util/hash_table.h"
|
#include "util/hash_table.h"
|
||||||
#include "util/perf/u_perfetto.h"
|
#include "util/perf/u_perfetto.h"
|
||||||
@@ -167,7 +168,7 @@ send_descriptors(TuRenderpassDataSource::TraceContext &ctx)
|
|||||||
static struct tu_perfetto_stage *
|
static struct tu_perfetto_stage *
|
||||||
stage_push(struct tu_device *dev)
|
stage_push(struct tu_device *dev)
|
||||||
{
|
{
|
||||||
struct tu_perfetto_state *p = tu_device_get_perfetto_state(dev);
|
struct tu_perfetto_state *p = &dev->perfetto;
|
||||||
|
|
||||||
if (p->stage_depth >= ARRAY_SIZE(p->stages)) {
|
if (p->stage_depth >= ARRAY_SIZE(p->stages)) {
|
||||||
p->skipped_depth++;
|
p->skipped_depth++;
|
||||||
@@ -182,7 +183,7 @@ typedef void (*trace_payload_as_extra_func)(perfetto::protos::pbzero::GpuRenderS
|
|||||||
static struct tu_perfetto_stage *
|
static struct tu_perfetto_stage *
|
||||||
stage_pop(struct tu_device *dev)
|
stage_pop(struct tu_device *dev)
|
||||||
{
|
{
|
||||||
struct tu_perfetto_state *p = tu_device_get_perfetto_state(dev);
|
struct tu_perfetto_state *p = &dev->perfetto;
|
||||||
|
|
||||||
if (!p->stage_depth)
|
if (!p->stage_depth)
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -245,8 +246,7 @@ stage_end(struct tu_device *dev, uint64_t ts_ns, enum tu_stage_id stage_id,
|
|||||||
struct tu_perfetto_stage *stage = stage_pop(dev);
|
struct tu_perfetto_stage *stage = stage_pop(dev);
|
||||||
auto trace_flush_data =
|
auto trace_flush_data =
|
||||||
(const struct tu_u_trace_submission_data *) flush_data;
|
(const struct tu_u_trace_submission_data *) flush_data;
|
||||||
uint32_t submission_id =
|
uint32_t submission_id = trace_flush_data->submission_id;
|
||||||
tu_u_trace_submission_data_get_submit_id(trace_flush_data);
|
|
||||||
|
|
||||||
if (!stage)
|
if (!stage)
|
||||||
return;
|
return;
|
||||||
|
@@ -41,14 +41,6 @@ void tu_perfetto_init(void);
|
|||||||
|
|
||||||
void tu_perfetto_submit(struct tu_device *dev, uint32_t submission_id);
|
void tu_perfetto_submit(struct tu_device *dev, uint32_t submission_id);
|
||||||
|
|
||||||
/* Helpers */
|
|
||||||
|
|
||||||
struct tu_perfetto_state *
|
|
||||||
tu_device_get_perfetto_state(struct tu_device *dev);
|
|
||||||
|
|
||||||
uint32_t
|
|
||||||
tu_u_trace_submission_data_get_submit_id(const struct tu_u_trace_submission_data *data);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,23 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright © 2021 Igalia S.L.
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "tu_device.h"
|
|
||||||
#include "tu_perfetto.h"
|
|
||||||
|
|
||||||
/* Including tu_device.h in tu_perfetto.cc doesn't work, so
|
|
||||||
* we need some helper methods to access tu_device.
|
|
||||||
*/
|
|
||||||
|
|
||||||
struct tu_perfetto_state *
|
|
||||||
tu_device_get_perfetto_state(struct tu_device *dev)
|
|
||||||
{
|
|
||||||
return &dev->perfetto;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t
|
|
||||||
tu_u_trace_submission_data_get_submit_id(const struct tu_u_trace_submission_data *data)
|
|
||||||
{
|
|
||||||
return data->submission_id;
|
|
||||||
}
|
|
Reference in New Issue
Block a user