radeon: scale query buffer size to result size
authorNicolai Hähnle <nhaehnle@gmail.com>
Tue, 24 Nov 2015 13:54:54 +0000 (14:54 +0100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 25 Nov 2015 14:28:09 +0000 (15:28 +0100)
Performance monitor queries can become very big, especially considering that
instances of a block in different shader engines are queried separately.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeon/r600_query.c

index b1cfb6e462b8c69c5e0dec8da0fde637ac1f8151..38bbbbf8a5ef1077052ceae92e21d83b954f44d0 100644 (file)
@@ -232,7 +232,7 @@ void r600_query_hw_destroy(struct r600_common_context *rctx,
 static struct r600_resource *r600_new_query_buffer(struct r600_common_context *ctx,
                                                   struct r600_query_hw *query)
 {
-       unsigned buf_size = 4096;
+       unsigned buf_size = MAX2(query->result_size, 4096);
 
        /* Queries are normally read by the CPU after
         * being written by the gpu, hence staging is probably a good