From ea3e700e3567bdef61f09714355b2359a9a67b56 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 16 Dec 2021 08:48:38 +1000 Subject: [PATCH] mesa/st: cleanup last bits of st perfmon code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just some small cleanups left to finish perfmon code movement. Acked-by: Marek Olšák Part-of: --- src/mesa/main/context.c | 1 + src/mesa/meson.build | 2 - src/mesa/state_tracker/st_cb_perfmon.c | 57 -------------------------- src/mesa/state_tracker/st_cb_perfmon.h | 35 ---------------- src/mesa/state_tracker/st_context.c | 12 +++++- 5 files changed, 11 insertions(+), 96 deletions(-) delete mode 100644 src/mesa/state_tracker/st_cb_perfmon.c delete mode 100644 src/mesa/state_tracker/st_cb_perfmon.h diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 03f4ebed51a..baaa2a26da2 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1156,6 +1156,7 @@ _mesa_free_context_data(struct gl_context *ctx, bool destroy_debug_output) _mesa_free_transform_feedback(ctx); _mesa_free_performance_monitors(ctx); _mesa_free_performance_queries(ctx); + _mesa_free_perfomance_monitor_groups(ctx); _mesa_free_resident_handles(ctx); _mesa_reference_buffer_object(ctx, &ctx->Pack.BufferObj, NULL); diff --git a/src/mesa/meson.build b/src/mesa/meson.build index ef4ff77032e..d8ea1463ed5 100644 --- a/src/mesa/meson.build +++ b/src/mesa/meson.build @@ -342,8 +342,6 @@ files_libmesa = files( 'state_tracker/st_cb_feedback.h', 'state_tracker/st_cb_flush.c', 'state_tracker/st_cb_flush.h', - 'state_tracker/st_cb_perfmon.c', - 'state_tracker/st_cb_perfmon.h', 'state_tracker/st_cb_perfquery.c', 'state_tracker/st_cb_perfquery.h', 'state_tracker/st_cb_program.c', diff --git a/src/mesa/state_tracker/st_cb_perfmon.c b/src/mesa/state_tracker/st_cb_perfmon.c deleted file mode 100644 index 64c5ef9b911..00000000000 --- a/src/mesa/state_tracker/st_cb_perfmon.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2013 Christoph Bumiller - * Copyright (C) 2015 Samuel Pitoiset - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * Performance monitoring counters interface to gallium. - */ - -#include "st_debug.h" -#include "st_context.h" -#include "st_cb_bitmap.h" -#include "st_cb_perfmon.h" -#include "st_util.h" - -#include "util/bitset.h" - -#include "pipe/p_context.h" -#include "pipe/p_screen.h" -#include "util/u_memory.h" - -#include "main/performance_monitor.h" - -bool -st_have_perfmon(struct st_context *st) -{ - struct pipe_screen *screen = st->screen; - - if (!screen->get_driver_query_info || !screen->get_driver_query_group_info) - return false; - - return screen->get_driver_query_group_info(screen, 0, NULL) != 0; -} - -void -st_destroy_perfmon(struct st_context *st) -{ - _mesa_free_perfomance_monitor_groups(st->ctx); -} diff --git a/src/mesa/state_tracker/st_cb_perfmon.h b/src/mesa/state_tracker/st_cb_perfmon.h deleted file mode 100644 index 69480d3c4a9..00000000000 --- a/src/mesa/state_tracker/st_cb_perfmon.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2013 Christoph Bumiller - * Copyright (C) 2015 Samuel Pitoiset - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -#ifndef ST_CB_PERFMON_H -#define ST_CB_PERFMON_H - -#include "util/list.h" - -bool -st_have_perfmon(struct st_context *st); - -void -st_destroy_perfmon(struct st_context *st); - -#endif diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 674c436484f..4c5c9d86461 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -46,7 +46,6 @@ #include "st_cb_drawtex.h" #include "st_cb_eglimage.h" #include "st_cb_feedback.h" -#include "st_cb_perfmon.h" #include "st_cb_perfquery.h" #include "st_cb_program.h" #include "st_cb_flush.h" @@ -422,7 +421,6 @@ st_destroy_context_priv(struct st_context *st, bool destroy_pipe) st_destroy_bitmap(st); st_destroy_drawpix(st); st_destroy_drawtex(st); - st_destroy_perfmon(st); st_destroy_pbo_helpers(st); st_destroy_bound_texture_handles(st); st_destroy_bound_image_handles(st); @@ -493,6 +491,16 @@ st_init_driver_flags(struct st_context *st) ST_NEW_FS_STATE | ST_NEW_CS_STATE; } +static bool +st_have_perfmon(struct st_context *st) +{ + struct pipe_screen *screen = st->screen; + + if (!screen->get_driver_query_info || !screen->get_driver_query_group_info) + return false; + + return screen->get_driver_query_group_info(screen, 0, NULL) != 0; +} static struct st_context * st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,