aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2014-07-04 11:41:46 +0200
committerMartin Peres <[email protected]>2015-05-06 00:03:35 +0300
commitb620829b5e4364e9d5ed30e8603de41087ff454f (patch)
tree8ca84bfcd78932202f369400a3aafd2484691b03 /src/gallium/drivers
parentf137f5c691f5bd97a8b7f881f1f6837bff0ebc7a (diff)
gallium: add new fields to pipe_driver_query_info
According to the spec of GL_AMD_performance_monitor, valid type values returned are UNSIGNED_INT, UNSIGNED_INT64_AMD, PERCENTAGE_AMD, FLOAT. This also introduces the new field group_id in order to categorize queries into groups. v2: add PIPE_DRIVER_QUERY_TYPE_BYTES v3: fix incorrect query type for radeon and svga drivers Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Martin Peres <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_query.c6
-rw-r--r--src/gallium/drivers/radeon/r600_pipe_common.c22
-rw-r--r--src/gallium/drivers/svga/svga_screen.c6
3 files changed, 16 insertions, 18 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
index f21deeacfbc..5be150ea11c 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
@@ -1419,7 +1419,8 @@ nvc0_screen_get_driver_query_info(struct pipe_screen *pscreen,
info->name = nvc0_drv_stat_names[id];
info->query_type = NVC0_QUERY_DRV_STAT(id);
info->max_value = 0;
- info->uses_byte_units = !!strstr(info->name, "bytes");
+ if (strstr(info->name, "bytes"))
+ info->type = PIPE_DRIVER_QUERY_TYPE_BYTES;
return 1;
} else
#endif
@@ -1428,14 +1429,12 @@ nvc0_screen_get_driver_query_info(struct pipe_screen *pscreen,
info->name = nve4_pm_query_names[id - NVC0_QUERY_DRV_STAT_COUNT];
info->query_type = NVE4_PM_QUERY(id - NVC0_QUERY_DRV_STAT_COUNT);
info->max_value = (id < NVE4_PM_QUERY_METRIC_MP_OCCUPANCY) ? 0 : 100;
- info->uses_byte_units = FALSE;
return 1;
} else
if (screen->compute) {
info->name = nvc0_pm_query_names[id - NVC0_QUERY_DRV_STAT_COUNT];
info->query_type = NVC0_PM_QUERY(id - NVC0_QUERY_DRV_STAT_COUNT);
info->max_value = 0;
- info->uses_byte_units = FALSE;
return 1;
}
}
@@ -1443,7 +1442,6 @@ nvc0_screen_get_driver_query_info(struct pipe_screen *pscreen,
info->name = "this_is_not_the_query_you_are_looking_for";
info->query_type = 0xdeadd01d;
info->max_value = 0;
- info->uses_byte_units = FALSE;
return 0;
}
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index eddb37dd992..a9b04d8ccf9 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -658,17 +658,17 @@ static int r600_get_driver_query_info(struct pipe_screen *screen,
struct r600_common_screen *rscreen = (struct r600_common_screen*)screen;
struct pipe_driver_query_info list[] = {
{"draw-calls", R600_QUERY_DRAW_CALLS, 0},
- {"requested-VRAM", R600_QUERY_REQUESTED_VRAM, rscreen->info.vram_size, TRUE},
- {"requested-GTT", R600_QUERY_REQUESTED_GTT, rscreen->info.gart_size, TRUE},
- {"buffer-wait-time", R600_QUERY_BUFFER_WAIT_TIME, 0, FALSE},
- {"num-cs-flushes", R600_QUERY_NUM_CS_FLUSHES, 0, FALSE},
- {"num-bytes-moved", R600_QUERY_NUM_BYTES_MOVED, 0, TRUE},
- {"VRAM-usage", R600_QUERY_VRAM_USAGE, rscreen->info.vram_size, TRUE},
- {"GTT-usage", R600_QUERY_GTT_USAGE, rscreen->info.gart_size, TRUE},
- {"temperature", R600_QUERY_GPU_TEMPERATURE, 100, FALSE},
- {"shader-clock", R600_QUERY_CURRENT_GPU_SCLK, 0, FALSE},
- {"memory-clock", R600_QUERY_CURRENT_GPU_MCLK, 0, FALSE},
- {"GPU-load", R600_QUERY_GPU_LOAD, 100, FALSE}
+ {"requested-VRAM", R600_QUERY_REQUESTED_VRAM, rscreen->info.vram_size, PIPE_DRIVER_QUERY_TYPE_BYTES},
+ {"requested-GTT", R600_QUERY_REQUESTED_GTT, rscreen->info.gart_size, PIPE_DRIVER_QUERY_TYPE_BYTES},
+ {"buffer-wait-time", R600_QUERY_BUFFER_WAIT_TIME, 0},
+ {"num-cs-flushes", R600_QUERY_NUM_CS_FLUSHES, 0},
+ {"num-bytes-moved", R600_QUERY_NUM_BYTES_MOVED, 0, PIPE_DRIVER_QUERY_TYPE_BYTES},
+ {"VRAM-usage", R600_QUERY_VRAM_USAGE, rscreen->info.vram_size, PIPE_DRIVER_QUERY_TYPE_BYTES},
+ {"GTT-usage", R600_QUERY_GTT_USAGE, rscreen->info.gart_size, PIPE_DRIVER_QUERY_TYPE_BYTES},
+ {"temperature", R600_QUERY_GPU_TEMPERATURE, 100},
+ {"shader-clock", R600_QUERY_CURRENT_GPU_SCLK, 0},
+ {"memory-clock", R600_QUERY_CURRENT_GPU_MCLK, 0},
+ {"GPU-load", R600_QUERY_GPU_LOAD, 100}
};
unsigned num_queries;
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
index ab26413064e..35e5a114b04 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -568,9 +568,9 @@ svga_get_driver_query_info(struct pipe_screen *screen,
struct pipe_driver_query_info *info)
{
static const struct pipe_driver_query_info queries[] = {
- {"draw-calls", SVGA_QUERY_DRAW_CALLS, 0, FALSE},
- {"fallbacks", SVGA_QUERY_FALLBACKS, 0, FALSE},
- {"memory-used", SVGA_QUERY_MEMORY_USED, 0, TRUE}
+ {"draw-calls", SVGA_QUERY_DRAW_CALLS, 0},
+ {"fallbacks", SVGA_QUERY_FALLBACKS, 0},
+ {"memory-used", SVGA_QUERY_MEMORY_USED, 0, PIPE_DRIVER_QUERY_TYPE_BYTES}
};
if (!info)