svga: split the num-resources-mapped hud to textures & buffers
authorCharmaine Lee <charmainel@vmware.com>
Wed, 31 Aug 2016 21:49:52 +0000 (14:49 -0700)
committerBrian Paul <brianp@vmware.com>
Sat, 17 Sep 2016 16:09:00 +0000 (10:09 -0600)
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>
src/gallium/drivers/svga/svga_context.h
src/gallium/drivers/svga/svga_pipe_query.c
src/gallium/drivers/svga/svga_resource_buffer.h
src/gallium/drivers/svga/svga_resource_texture.c
src/gallium/drivers/svga/svga_screen.c

index 7873e6380b1b867d0edf067303f9efe658a3e2a8..afb04120ef57f20f5eb044bbd983325eee27604e 100644 (file)
@@ -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 */
index dcb26ebc16c66d8341ece4bc82d5a3bb4f384c8a..b5b244c8fbb2a4c973d6b587074e4f4098e7e064 100644 (file)
@@ -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:
index 69075888892056e8167fd9e22f6a6cd3b193f290..2804a99c004df2663c38d772fcfd95c7e757750e 100644 (file)
@@ -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);
index 1f1a76bb224f0ceb8a66be652703c8ef1c1f9dd7..2086afab52a181e2fe6f87b40bae69ca4ba62c00 100644 (file)
@@ -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);
index 4c2d67188165c4f6a364b5c2e9e6258ac6e79b1e..6d5c73b02954e8538f3f4dd85c39943200b2e46d 100644 (file)
@@ -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),