From 78e628ae43015a2a8b6a1d7339eb7eb63ab56848 Mon Sep 17 00:00:00 2001 From: Charmaine Lee Date: Mon, 21 Dec 2015 11:07:08 -0800 Subject: [PATCH] svga: add num-generate-mipmap HUD query The actual increment of the num-generate-mipmap counter will be done in a subsequent patch when hw generate mipmap is supported. Reviewed-by: Brian Paul Reviewed-by: Jose Fonseca --- src/gallium/drivers/svga/svga_context.h | 4 +++- src/gallium/drivers/svga/svga_pipe_query.c | 7 +++++++ src/gallium/drivers/svga/svga_screen.c | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h index e4f29b8..f1a2041 100644 --- a/src/gallium/drivers/svga/svga_context.h +++ b/src/gallium/drivers/svga/svga_context.h @@ -59,8 +59,9 @@ #define SVGA_QUERY_NUM_RESOURCES (PIPE_QUERY_DRIVER_SPECIFIC + 9) #define SVGA_QUERY_NUM_STATE_OBJECTS (PIPE_QUERY_DRIVER_SPECIFIC + 10) #define SVGA_QUERY_NUM_SURFACE_VIEWS (PIPE_QUERY_DRIVER_SPECIFIC + 11) +#define SVGA_QUERY_NUM_GENERATE_MIPMAP (PIPE_QUERY_DRIVER_SPECIFIC + 12) /*SVGA_QUERY_MAX has to be last because it is size of an array*/ -#define SVGA_QUERY_MAX (PIPE_QUERY_DRIVER_SPECIFIC + 12) +#define SVGA_QUERY_MAX (PIPE_QUERY_DRIVER_SPECIFIC + 13) /** * Maximum supported number of constant buffers per shader @@ -505,6 +506,7 @@ struct svga_context uint64_t num_state_objects; /**< SVGA_QUERY_NUM_STATE_OBJECTS */ uint64_t num_surface_views; /**< SVGA_QUERY_NUM_SURFACE_VIEWS */ uint64_t num_bytes_uploaded; /**< SVGA_QUERY_NUM_BYTES_UPLOADED */ + uint64_t num_generate_mipmap; /**< SVGA_QUERY_NUM_GENERATE_MIPMAP */ } hud; /** The currently bound stream output targets */ diff --git a/src/gallium/drivers/svga/svga_pipe_query.c b/src/gallium/drivers/svga/svga_pipe_query.c index b67d56c..255494a 100644 --- a/src/gallium/drivers/svga/svga_pipe_query.c +++ b/src/gallium/drivers/svga/svga_pipe_query.c @@ -732,6 +732,7 @@ svga_create_query(struct pipe_context *pipe, case SVGA_QUERY_NUM_SURFACE_VIEWS: case SVGA_QUERY_NUM_RESOURCES_MAPPED: case SVGA_QUERY_NUM_BYTES_UPLOADED: + case SVGA_QUERY_NUM_GENERATE_MIPMAP: break; default: assert(!"unexpected query type in svga_create_query()"); @@ -800,6 +801,7 @@ svga_destroy_query(struct pipe_context *pipe, struct pipe_query *q) case SVGA_QUERY_NUM_SURFACE_VIEWS: case SVGA_QUERY_NUM_RESOURCES_MAPPED: case SVGA_QUERY_NUM_BYTES_UPLOADED: + case SVGA_QUERY_NUM_GENERATE_MIPMAP: /* nothing */ break; default: @@ -887,6 +889,7 @@ svga_begin_query(struct pipe_context *pipe, struct pipe_query *q) case SVGA_QUERY_NUM_RESOURCES: case SVGA_QUERY_NUM_STATE_OBJECTS: case SVGA_QUERY_NUM_SURFACE_VIEWS: + case SVGA_QUERY_NUM_GENERATE_MIPMAP: /* nothing */ break; default: @@ -980,6 +983,7 @@ svga_end_query(struct pipe_context *pipe, struct pipe_query *q) case SVGA_QUERY_NUM_RESOURCES: case SVGA_QUERY_NUM_STATE_OBJECTS: case SVGA_QUERY_NUM_SURFACE_VIEWS: + case SVGA_QUERY_NUM_GENERATE_MIPMAP: /* nothing */ break; default: @@ -1090,6 +1094,9 @@ svga_get_query_result(struct pipe_context *pipe, case SVGA_QUERY_NUM_SURFACE_VIEWS: vresult->u64 = svga->hud.num_surface_views; break; + case SVGA_QUERY_NUM_GENERATE_MIPMAP: + vresult->u64 = svga->hud.num_generate_mipmap; + break; default: assert(!"unexpected query type in svga_get_query_result"); } diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index 0528d8d..1ff3143 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -823,6 +823,8 @@ svga_get_driver_query_info(struct pipe_screen *screen, PIPE_DRIVER_QUERY_TYPE_UINT64), QUERY("num-surface-views", SVGA_QUERY_NUM_SURFACE_VIEWS, PIPE_DRIVER_QUERY_TYPE_UINT64), + QUERY("num-generate-mipmap", SVGA_QUERY_NUM_GENERATE_MIPMAP, + PIPE_DRIVER_QUERY_TYPE_UINT64), }; #undef QUERY -- 2.7.4