summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharmaine Lee <charmainel@vmware.com>2016-08-31 14:49:52 -0700
committerBrian Paul <brianp@vmware.com>2016-09-17 10:09:00 -0600
commitee39814d90b9ecfb35dc4b5977b1f1ced0c0fd83 (patch)
treecc8aaee3982d09c2d69eb2cecd96009cd691c5e8
parentf168c886c9f0940551de23b242cb794547cfaf0c (diff)
svga: split the num-resources-mapped hud to textures & buffers
Replace the num-resources-mapped hud with num-textures-mapped and num-buffers-mapped, so we can differentiate the map counts for these two different resources. Reviewed-by: Brian Paul <brianp@vmware.com>
-rw-r--r--src/gallium/drivers/svga/svga_context.h6
-rw-r--r--src/gallium/drivers/svga/svga_pipe_query.c23
-rw-r--r--src/gallium/drivers/svga/svga_resource_buffer.h2
-rw-r--r--src/gallium/drivers/svga/svga_resource_texture.c3
-rw-r--r--src/gallium/drivers/svga/svga_screen.c4
5 files changed, 26 insertions, 12 deletions
diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h
index 7873e6380b1..afb04120ef5 100644
--- a/src/gallium/drivers/svga/svga_context.h
+++ b/src/gallium/drivers/svga/svga_context.h
@@ -53,7 +53,8 @@ enum svga_hud {
SVGA_QUERY_NUM_FLUSHES,
SVGA_QUERY_NUM_VALIDATIONS,
SVGA_QUERY_MAP_BUFFER_TIME,
- SVGA_QUERY_NUM_RESOURCES_MAPPED,
+ SVGA_QUERY_NUM_BUFFERS_MAPPED,
+ SVGA_QUERY_NUM_TEXTURES_MAPPED,
SVGA_QUERY_NUM_BYTES_UPLOADED,
SVGA_QUERY_COMMAND_BUFFER_SIZE,
SVGA_QUERY_FLUSH_TIME,
@@ -537,7 +538,8 @@ struct svga_context
uint64_t num_flushes; /**< SVGA_QUERY_NUM_FLUSHES */
uint64_t num_validations; /**< SVGA_QUERY_NUM_VALIDATIONS */
uint64_t map_buffer_time; /**< SVGA_QUERY_MAP_BUFFER_TIME */
- uint64_t num_resources_mapped; /**< SVGA_QUERY_NUM_RESOURCES_MAPPED */
+ uint64_t num_buffers_mapped; /**< SVGA_QUERY_NUM_BUFFERS_MAPPED */
+ uint64_t num_textures_mapped; /**< SVGA_QUERY_NUM_TEXTURES_MAPPED */
uint64_t command_buffer_size; /**< SVGA_QUERY_COMMAND_BUFFER_SIZE */
uint64_t flush_time; /**< SVGA_QUERY_FLUSH_TIME */
uint64_t surface_write_flushes; /**< SVGA_QUERY_SURFACE_WRITE_FLUSHES */
diff --git a/src/gallium/drivers/svga/svga_pipe_query.c b/src/gallium/drivers/svga/svga_pipe_query.c
index dcb26ebc16c..b5b244c8fbb 100644
--- a/src/gallium/drivers/svga/svga_pipe_query.c
+++ b/src/gallium/drivers/svga/svga_pipe_query.c
@@ -731,7 +731,8 @@ svga_create_query(struct pipe_context *pipe,
case SVGA_QUERY_NUM_FALLBACKS:
case SVGA_QUERY_NUM_FLUSHES:
case SVGA_QUERY_NUM_VALIDATIONS:
- case SVGA_QUERY_NUM_RESOURCES_MAPPED:
+ case SVGA_QUERY_NUM_BUFFERS_MAPPED:
+ case SVGA_QUERY_NUM_TEXTURES_MAPPED:
case SVGA_QUERY_NUM_BYTES_UPLOADED:
case SVGA_QUERY_COMMAND_BUFFER_SIZE:
case SVGA_QUERY_SURFACE_WRITE_FLUSHES:
@@ -808,7 +809,8 @@ svga_destroy_query(struct pipe_context *pipe, struct pipe_query *q)
case SVGA_QUERY_NUM_FLUSHES:
case SVGA_QUERY_NUM_VALIDATIONS:
case SVGA_QUERY_MAP_BUFFER_TIME:
- case SVGA_QUERY_NUM_RESOURCES_MAPPED:
+ case SVGA_QUERY_NUM_BUFFERS_MAPPED:
+ case SVGA_QUERY_NUM_TEXTURES_MAPPED:
case SVGA_QUERY_NUM_BYTES_UPLOADED:
case SVGA_QUERY_COMMAND_BUFFER_SIZE:
case SVGA_QUERY_FLUSH_TIME:
@@ -896,8 +898,11 @@ svga_begin_query(struct pipe_context *pipe, struct pipe_query *q)
case SVGA_QUERY_MAP_BUFFER_TIME:
sq->begin_count = svga->hud.map_buffer_time;
break;
- case SVGA_QUERY_NUM_RESOURCES_MAPPED:
- sq->begin_count = svga->hud.num_resources_mapped;
+ case SVGA_QUERY_NUM_BUFFERS_MAPPED:
+ sq->begin_count = svga->hud.num_buffers_mapped;
+ break;
+ case SVGA_QUERY_NUM_TEXTURES_MAPPED:
+ sq->begin_count = svga->hud.num_textures_mapped;
break;
case SVGA_QUERY_NUM_BYTES_UPLOADED:
sq->begin_count = svga->hud.num_bytes_uploaded;
@@ -1010,8 +1015,11 @@ svga_end_query(struct pipe_context *pipe, struct pipe_query *q)
case SVGA_QUERY_MAP_BUFFER_TIME:
sq->end_count = svga->hud.map_buffer_time;
break;
- case SVGA_QUERY_NUM_RESOURCES_MAPPED:
- sq->end_count = svga->hud.num_resources_mapped;
+ case SVGA_QUERY_NUM_BUFFERS_MAPPED:
+ sq->end_count = svga->hud.num_buffers_mapped;
+ break;
+ case SVGA_QUERY_NUM_TEXTURES_MAPPED:
+ sq->end_count = svga->hud.num_textures_mapped;
break;
case SVGA_QUERY_NUM_BYTES_UPLOADED:
sq->end_count = svga->hud.num_bytes_uploaded;
@@ -1142,7 +1150,8 @@ svga_get_query_result(struct pipe_context *pipe,
case SVGA_QUERY_NUM_FLUSHES:
case SVGA_QUERY_NUM_VALIDATIONS:
case SVGA_QUERY_MAP_BUFFER_TIME:
- case SVGA_QUERY_NUM_RESOURCES_MAPPED:
+ case SVGA_QUERY_NUM_BUFFERS_MAPPED:
+ case SVGA_QUERY_NUM_TEXTURES_MAPPED:
case SVGA_QUERY_NUM_BYTES_UPLOADED:
case SVGA_QUERY_COMMAND_BUFFER_SIZE:
case SVGA_QUERY_FLUSH_TIME:
diff --git a/src/gallium/drivers/svga/svga_resource_buffer.h b/src/gallium/drivers/svga/svga_resource_buffer.h
index 69075888892..2804a99c004 100644
--- a/src/gallium/drivers/svga/svga_resource_buffer.h
+++ b/src/gallium/drivers/svga/svga_resource_buffer.h
@@ -263,7 +263,7 @@ svga_buffer_hw_storage_map(struct svga_context *svga,
{
struct svga_winsys_screen *sws = svga_buffer_winsys_screen(sbuf);
- svga->hud.num_resources_mapped++;
+ svga->hud.num_buffers_mapped++;
if (sws->have_gb_objects) {
return svga->swc->surface_map(svga->swc, sbuf->handle, flags, retry);
diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c
index 1f1a76bb224..2086afab52a 100644
--- a/src/gallium/drivers/svga/svga_resource_texture.c
+++ b/src/gallium/drivers/svga/svga_resource_texture.c
@@ -539,6 +539,7 @@ svga_texture_transfer_map(struct pipe_context *pipe,
* At this point, the svga_surfaces_flush() should already have
* called in svga_texture_get_transfer().
*/
+ svga->hud.surface_write_flushes++;
svga_context_flush(svga, NULL);
map = svga->swc->surface_map(svga->swc, surf, usage, &retry);
}
@@ -583,7 +584,7 @@ svga_texture_transfer_map(struct pipe_context *pipe,
}
svga->hud.map_buffer_time += (svga_get_time(svga) - begin);
- svga->hud.num_resources_mapped++;
+ svga->hud.num_textures_mapped++;
done:
SVGA_STATS_TIME_POP(sws);
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
index 4c2d6718816..6d5c73b0295 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -853,7 +853,9 @@ svga_get_driver_query_info(struct pipe_screen *screen,
PIPE_DRIVER_QUERY_TYPE_UINT64),
QUERY("map-buffer-time", SVGA_QUERY_MAP_BUFFER_TIME,
PIPE_DRIVER_QUERY_TYPE_MICROSECONDS),
- QUERY("num-resources-mapped", SVGA_QUERY_NUM_RESOURCES_MAPPED,
+ QUERY("num-buffers-mapped", SVGA_QUERY_NUM_BUFFERS_MAPPED,
+ PIPE_DRIVER_QUERY_TYPE_UINT64),
+ QUERY("num-textures-mapped", SVGA_QUERY_NUM_TEXTURES_MAPPED,
PIPE_DRIVER_QUERY_TYPE_UINT64),
QUERY("num-bytes-uploaded", SVGA_QUERY_NUM_BYTES_UPLOADED,
PIPE_DRIVER_QUERY_TYPE_BYTES),