This enables more queries for the Gallium HUD with radeonsi.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
FREE(rscreen);
}
-static uint64_t r600_get_timestamp(struct pipe_screen *screen)
-{
- struct r600_screen *rscreen = (struct r600_screen*)screen;
-
- return 1000000 * rscreen->b.ws->query_value(rscreen->b.ws, RADEON_TIMESTAMP) /
- rscreen->b.info.r600_clock_crystal_freq;
-}
-
-static int r600_get_driver_query_info(struct pipe_screen *screen,
- unsigned index,
- struct pipe_driver_query_info *info)
-{
- struct r600_screen *rscreen = (struct r600_screen*)screen;
- struct pipe_driver_query_info list[] = {
- {"draw-calls", R600_QUERY_DRAW_CALLS, 0},
- {"requested-VRAM", R600_QUERY_REQUESTED_VRAM, rscreen->b.info.vram_size, TRUE},
- {"requested-GTT", R600_QUERY_REQUESTED_GTT, rscreen->b.info.gart_size, TRUE},
- {"buffer-wait-time", R600_QUERY_BUFFER_WAIT_TIME, 0, FALSE}
- };
-
- if (!info)
- return Elements(list);
-
- if (index >= Elements(list))
- return 0;
-
- *info = list[index];
- return 1;
-}
-
static struct pipe_resource *r600_resource_create(struct pipe_screen *screen,
const struct pipe_resource *templ)
{
rscreen->b.b.get_shader_param = r600_get_shader_param;
rscreen->b.b.get_paramf = r600_get_paramf;
rscreen->b.b.get_compute_param = r600_get_compute_param;
- rscreen->b.b.get_timestamp = r600_get_timestamp;
if (rscreen->b.info.chip_class >= EVERGREEN) {
rscreen->b.b.is_format_supported = evergreen_is_format_supported;
} else {
rscreen->b.b.is_format_supported = r600_is_format_supported;
}
- rscreen->b.b.get_driver_query_info = r600_get_driver_query_info;
if (rscreen->b.info.has_uvd) {
rscreen->b.b.get_video_param = ruvd_get_video_param;
rscreen->b.b.is_video_format_supported = ruvd_is_format_supported;
#include "r600_pipe_common.h"
#include "r600_cs.h"
#include "tgsi/tgsi_parse.h"
+#include "util/u_memory.h"
#include "util/u_format_s3tc.h"
#include "util/u_upload_mgr.h"
#include <inttypes.h>
}
}
+static uint64_t r600_get_timestamp(struct pipe_screen *screen)
+{
+ struct r600_common_screen *rscreen = (struct r600_common_screen*)screen;
+
+ return 1000000 * rscreen->ws->query_value(rscreen->ws, RADEON_TIMESTAMP) /
+ rscreen->info.r600_clock_crystal_freq;
+}
+
+static int r600_get_driver_query_info(struct pipe_screen *screen,
+ unsigned index,
+ struct pipe_driver_query_info *info)
+{
+ 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}
+ };
+
+ if (!info)
+ return Elements(list);
+
+ if (index >= Elements(list))
+ return 0;
+
+ *info = list[index];
+ return 1;
+}
+
static void r600_fence_reference(struct pipe_screen *screen,
struct pipe_fence_handle **ptr,
struct pipe_fence_handle *fence)
rscreen->b.get_name = r600_get_name;
rscreen->b.get_vendor = r600_get_vendor;
+ rscreen->b.get_driver_query_info = r600_get_driver_query_info;
+ rscreen->b.get_timestamp = r600_get_timestamp;
rscreen->b.fence_finish = r600_fence_finish;
rscreen->b.fence_reference = r600_fence_reference;
rscreen->b.fence_signalled = r600_fence_signalled;
FREE(sscreen);
}
-static uint64_t si_get_timestamp(struct pipe_screen *screen)
-{
- struct si_screen *sscreen = (struct si_screen*)screen;
-
- return 1000000 * sscreen->b.ws->query_value(sscreen->b.ws, RADEON_TIMESTAMP) /
- sscreen->b.info.r600_clock_crystal_freq;
-}
-
struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws)
{
struct si_screen *sscreen = CALLOC_STRUCT(si_screen);
sscreen->b.b.get_shader_param = si_get_shader_param;
sscreen->b.b.get_paramf = si_get_paramf;
sscreen->b.b.get_compute_param = si_get_compute_param;
- sscreen->b.b.get_timestamp = si_get_timestamp;
sscreen->b.b.is_format_supported = si_is_format_supported;
if (sscreen->b.info.has_uvd) {
sscreen->b.b.get_video_param = ruvd_get_video_param;
}
pipe_resource_reference(&ib.buffer, NULL);
+ sctx->b.num_draw_calls++;
}