mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 22:30:12 +01:00
perfetto: unify init
util_perfetto_init() was called in some places, util_cpu_trace_init() was called in other places, and some places used tracing without ever calling either of them util_cpu_trace_init() is now guaranteed to be called: * on gallium screen create * on VK instance create thus no driver/frontend/etc should ever need to call this manually cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36628>
This commit is contained in:
parent
f53bf77d47
commit
c7045e3e63
11 changed files with 3 additions and 26 deletions
|
|
@ -406,9 +406,6 @@ eglGetDisplay(EGLNativeDisplayType nativeDisplay)
|
||||||
_EGLDisplay *disp;
|
_EGLDisplay *disp;
|
||||||
void *native_display_ptr;
|
void *native_display_ptr;
|
||||||
|
|
||||||
#if !DETECT_OS_ANDROID
|
|
||||||
util_cpu_trace_init();
|
|
||||||
#endif
|
|
||||||
_EGL_FUNC_START(NULL, EGL_OBJECT_THREAD_KHR, NULL);
|
_EGL_FUNC_START(NULL, EGL_OBJECT_THREAD_KHR, NULL);
|
||||||
|
|
||||||
STATIC_ASSERT(sizeof(void *) >= sizeof(nativeDisplay));
|
STATIC_ASSERT(sizeof(void *) >= sizeof(nativeDisplay));
|
||||||
|
|
@ -473,9 +470,6 @@ eglGetPlatformDisplayEXT(EGLenum platform, void *native_display,
|
||||||
EGLAttrib *attrib_list;
|
EGLAttrib *attrib_list;
|
||||||
EGLDisplay disp;
|
EGLDisplay disp;
|
||||||
|
|
||||||
#if !DETECT_OS_ANDROID
|
|
||||||
util_cpu_trace_init();
|
|
||||||
#endif
|
|
||||||
_EGL_FUNC_START(NULL, EGL_OBJECT_THREAD_KHR, NULL);
|
_EGL_FUNC_START(NULL, EGL_OBJECT_THREAD_KHR, NULL);
|
||||||
|
|
||||||
if (_eglConvertIntsToAttribs(int_attribs, &attrib_list) != EGL_SUCCESS)
|
if (_eglConvertIntsToAttribs(int_attribs, &attrib_list) != EGL_SUCCESS)
|
||||||
|
|
@ -490,9 +484,6 @@ PUBLIC EGLDisplay EGLAPIENTRY
|
||||||
eglGetPlatformDisplay(EGLenum platform, void *native_display,
|
eglGetPlatformDisplay(EGLenum platform, void *native_display,
|
||||||
const EGLAttrib *attrib_list)
|
const EGLAttrib *attrib_list)
|
||||||
{
|
{
|
||||||
#if !DETECT_OS_ANDROID
|
|
||||||
util_cpu_trace_init();
|
|
||||||
#endif
|
|
||||||
_EGL_FUNC_START(NULL, EGL_OBJECT_THREAD_KHR, NULL);
|
_EGL_FUNC_START(NULL, EGL_OBJECT_THREAD_KHR, NULL);
|
||||||
return _eglGetPlatformDisplayCommon(platform, native_display, attrib_list);
|
return _eglGetPlatformDisplayCommon(platform, native_display, attrib_list);
|
||||||
}
|
}
|
||||||
|
|
@ -666,7 +657,6 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
|
||||||
{
|
{
|
||||||
_EGLDisplay *disp = _eglLockDisplay(dpy);
|
_EGLDisplay *disp = _eglLockDisplay(dpy);
|
||||||
|
|
||||||
util_cpu_trace_init();
|
|
||||||
_EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL);
|
_EGL_FUNC_START(disp, EGL_OBJECT_DISPLAY_KHR, NULL);
|
||||||
|
|
||||||
_eglDeviceRefreshList();
|
_eglDeviceRefreshList();
|
||||||
|
|
|
||||||
|
|
@ -53,8 +53,6 @@ PERFETTO_DEFINE_DATA_SOURCE_STATIC_MEMBERS(FdMemoryDataSource);
|
||||||
extern "C" void
|
extern "C" void
|
||||||
fd_drm_perfetto_init(void)
|
fd_drm_perfetto_init(void)
|
||||||
{
|
{
|
||||||
util_perfetto_init();
|
|
||||||
|
|
||||||
perfetto::DataSourceDescriptor dsd;
|
perfetto::DataSourceDescriptor dsd;
|
||||||
dsd.set_name("gpu.memory.msm");
|
dsd.set_name("gpu.memory.msm");
|
||||||
FdMemoryDataSource::Register(dsd);
|
FdMemoryDataSource::Register(dsd);
|
||||||
|
|
|
||||||
|
|
@ -345,8 +345,6 @@ extern "C" {
|
||||||
void
|
void
|
||||||
tu_perfetto_init(void)
|
tu_perfetto_init(void)
|
||||||
{
|
{
|
||||||
util_perfetto_init();
|
|
||||||
|
|
||||||
{
|
{
|
||||||
perfetto::DataSourceDescriptor dsd;
|
perfetto::DataSourceDescriptor dsd;
|
||||||
#if DETECT_OS_ANDROID
|
#if DETECT_OS_ANDROID
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@
|
||||||
#include "util/u_string.h"
|
#include "util/u_string.h"
|
||||||
#include "util/xmlconfig.h"
|
#include "util/xmlconfig.h"
|
||||||
#include "util/driconf.h"
|
#include "util/driconf.h"
|
||||||
|
#include "util/perf/cpu_trace.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
@ -169,6 +170,8 @@ pipe_loader_create_screen_vk(struct pipe_loader_device *dev, bool sw_vk, bool dr
|
||||||
{
|
{
|
||||||
struct pipe_screen_config config;
|
struct pipe_screen_config config;
|
||||||
|
|
||||||
|
util_cpu_trace_init();
|
||||||
|
|
||||||
pipe_loader_load_options(dev);
|
pipe_loader_load_options(dev);
|
||||||
config.driver_name_is_inferred = driver_name_is_inferred;
|
config.driver_name_is_inferred = driver_name_is_inferred;
|
||||||
config.options_info = &dev->option_info;
|
config.options_info = &dev->option_info;
|
||||||
|
|
|
||||||
|
|
@ -261,8 +261,6 @@ extern "C" {
|
||||||
void
|
void
|
||||||
fd_perfetto_init(void)
|
fd_perfetto_init(void)
|
||||||
{
|
{
|
||||||
util_perfetto_init();
|
|
||||||
|
|
||||||
perfetto::DataSourceDescriptor dsd;
|
perfetto::DataSourceDescriptor dsd;
|
||||||
#if DETECT_OS_ANDROID
|
#if DETECT_OS_ANDROID
|
||||||
// Android tooling expects this data source name
|
// Android tooling expects this data source name
|
||||||
|
|
|
||||||
|
|
@ -966,8 +966,6 @@ panfrost_create_screen(int fd, const struct pipe_screen_config *config,
|
||||||
screen->max_afbc_packing_ratio = debug_get_num_option(
|
screen->max_afbc_packing_ratio = debug_get_num_option(
|
||||||
"PAN_MAX_AFBC_PACKING_RATIO", DEFAULT_MAX_AFBC_PACKING_RATIO);
|
"PAN_MAX_AFBC_PACKING_RATIO", DEFAULT_MAX_AFBC_PACKING_RATIO);
|
||||||
|
|
||||||
util_cpu_trace_init();
|
|
||||||
|
|
||||||
if (panfrost_open_device(screen, fd, dev)) {
|
if (panfrost_open_device(screen, fd, dev)) {
|
||||||
ralloc_free(screen);
|
ralloc_free(screen);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
|
|
@ -316,7 +316,6 @@ void si_ds_end_submit(struct si_ds_queue *queue, uint64_t start_ts)
|
||||||
static void si_driver_ds_init_once(void)
|
static void si_driver_ds_init_once(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_PERFETTO
|
#ifdef HAVE_PERFETTO
|
||||||
util_perfetto_init();
|
|
||||||
perfetto::DataSourceDescriptor dsd;
|
perfetto::DataSourceDescriptor dsd;
|
||||||
#if DETECT_OS_ANDROID
|
#if DETECT_OS_ANDROID
|
||||||
// Android tooling expects this data source name
|
// Android tooling expects this data source name
|
||||||
|
|
|
||||||
|
|
@ -767,8 +767,6 @@ v3d_screen_create(int fd, const struct pipe_screen_config *config,
|
||||||
struct v3d_screen *screen = rzalloc(NULL, struct v3d_screen);
|
struct v3d_screen *screen = rzalloc(NULL, struct v3d_screen);
|
||||||
struct pipe_screen *pscreen;
|
struct pipe_screen *pscreen;
|
||||||
|
|
||||||
util_cpu_trace_init();
|
|
||||||
|
|
||||||
pscreen = &screen->base;
|
pscreen = &screen->base;
|
||||||
|
|
||||||
pscreen->destroy = v3d_screen_destroy;
|
pscreen->destroy = v3d_screen_destroy;
|
||||||
|
|
|
||||||
|
|
@ -466,8 +466,6 @@ vc4_screen_create(int fd, const struct pipe_screen_config *config,
|
||||||
struct pipe_screen *pscreen;
|
struct pipe_screen *pscreen;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
util_cpu_trace_init();
|
|
||||||
|
|
||||||
pscreen = &screen->base;
|
pscreen = &screen->base;
|
||||||
|
|
||||||
pscreen->destroy = vc4_screen_destroy;
|
pscreen->destroy = vc4_screen_destroy;
|
||||||
|
|
|
||||||
|
|
@ -594,7 +594,6 @@ static void
|
||||||
intel_driver_ds_init_once(void)
|
intel_driver_ds_init_once(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_PERFETTO
|
#ifdef HAVE_PERFETTO
|
||||||
util_perfetto_init();
|
|
||||||
perfetto::DataSourceDescriptor dsd;
|
perfetto::DataSourceDescriptor dsd;
|
||||||
#if DETECT_OS_ANDROID
|
#if DETECT_OS_ANDROID
|
||||||
// Android tooling expects this data source name
|
// Android tooling expects this data source name
|
||||||
|
|
|
||||||
|
|
@ -304,8 +304,6 @@ panvk_utrace_perfetto_init(struct panvk_device *dev, uint32_t queue_count)
|
||||||
for (uint32_t i = 0; i < ARRAY_SIZE(utp->stage_iids); i++)
|
for (uint32_t i = 0; i < ARRAY_SIZE(utp->stage_iids); i++)
|
||||||
utp->stage_iids[i] = next_iid++;
|
utp->stage_iids[i] = next_iid++;
|
||||||
|
|
||||||
util_perfetto_init();
|
|
||||||
|
|
||||||
static once_flag register_ds_once = ONCE_FLAG_INIT;
|
static once_flag register_ds_once = ONCE_FLAG_INIT;
|
||||||
call_once(®ister_ds_once, register_data_source);
|
call_once(®ister_ds_once, register_data_source);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue