Path: blob/21.2-virgl/src/gallium/drivers/crocus/crocus_monitor.h
4570 views
/*1* Copyright © 2019 Intel Corporation2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice shall be included11* in all copies or substantial portions of the Software.12*13* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS14* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL16* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER17* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING18* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER19* DEALINGS IN THE SOFTWARE.20*/2122#ifndef CROCUS_MONITOR_H23#define CROCUS_MONITOR_H2425#include "pipe/p_screen.h"2627struct crocus_monitor_counter {28int group;29int counter;30};3132struct crocus_monitor_config {33struct intel_perf_config *perf_cfg;3435/* gallium requires an index for each counter */36int num_counters;37struct crocus_monitor_counter *counters;38};3940int crocus_get_monitor_info(struct pipe_screen *pscreen, unsigned index,41struct pipe_driver_query_info *info);42int crocus_get_monitor_group_info(struct pipe_screen *pscreen,43unsigned index,44struct pipe_driver_query_group_info *info);4546struct crocus_context;47struct crocus_screen;4849struct crocus_monitor_object *50crocus_create_monitor_object(struct crocus_context *ice,51unsigned num_queries,52unsigned *query_types);5354struct pipe_query;55void crocus_destroy_monitor_object(struct pipe_context *ctx,56struct crocus_monitor_object *monitor);5758bool59crocus_begin_monitor(struct pipe_context *ctx,60struct crocus_monitor_object *monitor);61bool62crocus_end_monitor(struct pipe_context *ctx,63struct crocus_monitor_object *monitor);6465bool66crocus_get_monitor_result(struct pipe_context *ctx,67struct crocus_monitor_object *monitor,68bool wait,69union pipe_numeric_type_union *result);7071#endif727374