intel/measure: add nogl feature

Do not trigger INTEL_MEASURE for ogl apps with INTEL_MEASURE=nogl

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31938>
This commit is contained in:
Felix DeGrood
2024-11-01 15:37:04 +00:00
committed by Marge Bot
parent 5d09374ffe
commit f345019830
3 changed files with 10 additions and 0 deletions
+1
View File
@@ -51,6 +51,7 @@ iris_init_screen_measure(struct iris_screen *screen)
struct intel_measure_device *measure_device = &screen->measure;
memset(measure_device, 0, sizeof(*measure_device));
measure_device->type = INTEL_MEASURE_DEVICE_OGL;
intel_measure_init(measure_device);
measure_device->release_batch = &measure_batch_free;
struct intel_measure_config *config = measure_device->config;
+6
View File
@@ -101,6 +101,7 @@ intel_measure_init(struct intel_measure_device *device)
const char *batch_size_s = strstr(env_copy, "batch_size=");
const char *buffer_size_s = strstr(env_copy, "buffer_size=");
const char *cpu_s = strstr(env_copy, "cpu");
const char *no_ogl = strstr(env_copy, "nogl");
while (true) {
char *sep = strrchr(env_copy, ',');
if (sep == NULL)
@@ -108,6 +109,11 @@ intel_measure_init(struct intel_measure_device *device)
*sep = '\0';
}
if (no_ogl && device->type == INTEL_MEASURE_DEVICE_OGL) {
config.enabled = false;
return;
}
if (filename && __normal_user()) {
filename += 5;
config.file = fopen(filename, "w");
+3
View File
@@ -61,6 +61,8 @@ enum intel_measure_events {
INTEL_MEASURE_FRAME = (1 << 4),
};
enum intel_measure_device_type { INTEL_MEASURE_DEVICE_VK=0, INTEL_MEASURE_DEVICE_OGL };
struct intel_measure_config {
/* Stderr, or optionally set with INTEL_MEASURE=file={path{ */
@@ -138,6 +140,7 @@ struct intel_measure_device {
unsigned frame;
unsigned render_pass_count;
intel_measure_release_batch_cb release_batch;
enum intel_measure_device_type type;
/* Holds the list of (iris/anv)_measure_batch snapshots that have been
* submitted for rendering, but have not completed.