diff options
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/driver_rbug/rbug_screen.c')
-rw-r--r-- | lib/mesa/src/gallium/auxiliary/driver_rbug/rbug_screen.c | 180 |
1 files changed, 7 insertions, 173 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/driver_rbug/rbug_screen.c b/lib/mesa/src/gallium/auxiliary/driver_rbug/rbug_screen.c index 9ddb6dfa7..693e7fab9 100644 --- a/lib/mesa/src/gallium/auxiliary/driver_rbug/rbug_screen.c +++ b/lib/mesa/src/gallium/auxiliary/driver_rbug/rbug_screen.c @@ -37,7 +37,7 @@ #include "rbug_context.h" #include "rbug_objects.h" -DEBUG_GET_ONCE_BOOL_OPTION(rbug, "GALLIUM_RBUG", false) +DEBUG_GET_ONCE_BOOL_OPTION(rbug, "GALLIUM_RBUG", FALSE) static void rbug_screen_destroy(struct pipe_screen *_screen) @@ -77,16 +77,6 @@ rbug_screen_get_device_vendor(struct pipe_screen *_screen) return screen->get_device_vendor(screen); } -static const void * -rbug_screen_get_compiler_options(struct pipe_screen *_screen, - enum pipe_shader_ir ir, - enum pipe_shader_type shader) -{ - struct pipe_screen *screen = rbug_screen(_screen)->screen; - - return screen->get_compiler_options(screen, ir, shader); -} - static struct disk_cache * rbug_screen_get_disk_shader_cache(struct pipe_screen *_screen) { @@ -129,7 +119,7 @@ rbug_screen_get_paramf(struct pipe_screen *_screen, param); } -static bool +static boolean rbug_screen_is_format_supported(struct pipe_screen *_screen, enum pipe_format format, enum pipe_texture_target target, @@ -148,64 +138,6 @@ rbug_screen_is_format_supported(struct pipe_screen *_screen, tex_usage); } -static void -rbug_screen_query_dmabuf_modifiers(struct pipe_screen *_screen, - enum pipe_format format, int max, - uint64_t *modifiers, - unsigned int *external_only, int *count) -{ - struct rbug_screen *rb_screen = rbug_screen(_screen); - struct pipe_screen *screen = rb_screen->screen; - - screen->query_dmabuf_modifiers(screen, - format, - max, - modifiers, - external_only, - count); -} - -static bool -rbug_screen_is_dmabuf_modifier_supported(struct pipe_screen *_screen, - uint64_t modifier, - enum pipe_format format, - bool *external_only) -{ - struct rbug_screen *rb_screen = rbug_screen(_screen); - struct pipe_screen *screen = rb_screen->screen; - - return screen->is_dmabuf_modifier_supported(screen, - modifier, - format, - external_only); -} - -static unsigned int -rbug_screen_get_dmabuf_modifier_planes(struct pipe_screen *_screen, - uint64_t modifier, - enum pipe_format format) -{ - struct rbug_screen *rb_screen = rbug_screen(_screen); - struct pipe_screen *screen = rb_screen->screen; - - return screen->get_dmabuf_modifier_planes(screen, modifier, format); -} - -static int -rbug_screen_get_sparse_texture_virtual_page_size(struct pipe_screen *_screen, - enum pipe_texture_target target, - bool multi_sample, - enum pipe_format format, - unsigned offset, unsigned size, - int *x, int *y, int *z) -{ - struct rbug_screen *rb_screen = rbug_screen(_screen); - struct pipe_screen *screen = rb_screen->screen; - - return screen->get_sparse_texture_virtual_page_size(screen, target, multi_sample, - format, offset, size, x, y, z); -} - static struct pipe_context * rbug_screen_context_create(struct pipe_screen *_screen, void *priv, unsigned flags) @@ -220,17 +152,6 @@ rbug_screen_context_create(struct pipe_screen *_screen, return NULL; } -static bool -rbug_screen_can_create_resource(struct pipe_screen *_screen, - const struct pipe_resource *templat) -{ - struct rbug_screen *rb_screen = rbug_screen(_screen); - struct pipe_screen *screen = rb_screen->screen; - - return screen->can_create_resource(screen, - templat); -} - static struct pipe_resource * rbug_screen_resource_create(struct pipe_screen *_screen, const struct pipe_resource *templat) @@ -248,25 +169,6 @@ rbug_screen_resource_create(struct pipe_screen *_screen, } static struct pipe_resource * -rbug_screen_resource_create_with_modifiers(struct pipe_screen *_screen, - const struct pipe_resource *templat, - const uint64_t *modifiers, int count) -{ - struct rbug_screen *rb_screen = rbug_screen(_screen); - struct pipe_screen *screen = rb_screen->screen; - struct pipe_resource *result; - - result = screen->resource_create_with_modifiers(screen, - templat, - modifiers, - count); - - if (result) - return rbug_resource_create(rb_screen, result); - return NULL; -} - -static struct pipe_resource * rbug_screen_resource_from_handle(struct pipe_screen *_screen, const struct pipe_resource *templ, struct winsys_handle *handle, @@ -296,7 +198,7 @@ rbug_screen_check_resource_capability(struct pipe_screen *_screen, return screen->check_resource_capability(screen, resource, bind); } -static bool +static boolean rbug_screen_resource_get_handle(struct pipe_screen *_screen, struct pipe_context *_pipe, struct pipe_resource *_resource, @@ -313,43 +215,6 @@ rbug_screen_resource_get_handle(struct pipe_screen *_screen, resource, handle, usage); } -static bool -rbug_screen_resource_get_param(struct pipe_screen *_screen, - struct pipe_context *_pipe, - struct pipe_resource *_resource, - unsigned plane, - unsigned layer, - unsigned level, - enum pipe_resource_param param, - unsigned handle_usage, - uint64_t *value) -{ - struct rbug_screen *rb_screen = rbug_screen(_screen); - struct rbug_context *rb_pipe = rbug_context(_pipe); - struct rbug_resource *rb_resource = rbug_resource(_resource); - struct pipe_screen *screen = rb_screen->screen; - struct pipe_resource *resource = rb_resource->resource; - - return screen->resource_get_param(screen, rb_pipe ? rb_pipe->pipe : NULL, - resource, plane, layer, level, param, - handle_usage, value); -} - - -static void -rbug_screen_resource_get_info(struct pipe_screen *_screen, - struct pipe_resource *_resource, - unsigned *stride, - unsigned *offset) -{ - struct rbug_screen *rb_screen = rbug_screen(_screen); - struct rbug_resource *rb_resource = rbug_resource(_resource); - struct pipe_screen *screen = rb_screen->screen; - struct pipe_resource *resource = rb_resource->resource; - - screen->resource_get_info(screen, resource, stride, offset); -} - static void rbug_screen_resource_changed(struct pipe_screen *_screen, struct pipe_resource *_resource) @@ -359,7 +224,8 @@ rbug_screen_resource_changed(struct pipe_screen *_screen, struct pipe_screen *screen = rb_screen->screen; struct pipe_resource *resource = rb_resource->resource; - screen->resource_changed(screen, resource); + if (screen->resource_changed) + screen->resource_changed(screen, resource); } static void @@ -371,7 +237,6 @@ rbug_screen_resource_destroy(struct pipe_screen *screen, static void rbug_screen_flush_frontbuffer(struct pipe_screen *_screen, - struct pipe_context *_ctx, struct pipe_resource *_resource, unsigned level, unsigned layer, void *context_private, struct pipe_box *sub_box) @@ -380,10 +245,8 @@ rbug_screen_flush_frontbuffer(struct pipe_screen *_screen, struct rbug_resource *rb_resource = rbug_resource(_resource); struct pipe_screen *screen = rb_screen->screen; struct pipe_resource *resource = rb_resource->resource; - struct pipe_context *ctx = _ctx ? rbug_context(_ctx)->pipe : NULL; screen->flush_frontbuffer(screen, - ctx, resource, level, layer, context_private, sub_box); @@ -402,7 +265,7 @@ rbug_screen_fence_reference(struct pipe_screen *_screen, fence); } -static bool +static boolean rbug_screen_fence_finish(struct pipe_screen *_screen, struct pipe_context *_ctx, struct pipe_fence_handle *fence, @@ -415,25 +278,7 @@ rbug_screen_fence_finish(struct pipe_screen *_screen, return screen->fence_finish(screen, ctx, fence, timeout); } -static int -rbug_screen_fence_get_fd(struct pipe_screen *_screen, - struct pipe_fence_handle *fence) -{ - struct rbug_screen *rb_screen = rbug_screen(_screen); - struct pipe_screen *screen = rb_screen->screen; - - return screen->fence_get_fd(screen, fence); -} - -static char * -rbug_screen_finalize_nir(struct pipe_screen *_screen, void *nir) -{ - struct pipe_screen *screen = rbug_screen(_screen)->screen; - - return screen->finalize_nir(screen, nir); -} - -bool +boolean rbug_enabled() { return debug_get_option_rbug(); @@ -463,33 +308,22 @@ rbug_screen_create(struct pipe_screen *screen) rb_screen->base.destroy = rbug_screen_destroy; rb_screen->base.get_name = rbug_screen_get_name; rb_screen->base.get_vendor = rbug_screen_get_vendor; - SCR_INIT(get_compiler_options); SCR_INIT(get_disk_shader_cache); rb_screen->base.get_device_vendor = rbug_screen_get_device_vendor; rb_screen->base.get_param = rbug_screen_get_param; rb_screen->base.get_shader_param = rbug_screen_get_shader_param; rb_screen->base.get_paramf = rbug_screen_get_paramf; rb_screen->base.is_format_supported = rbug_screen_is_format_supported; - SCR_INIT(query_dmabuf_modifiers); - SCR_INIT(is_dmabuf_modifier_supported); - SCR_INIT(get_dmabuf_modifier_planes); rb_screen->base.context_create = rbug_screen_context_create; - SCR_INIT(can_create_resource); rb_screen->base.resource_create = rbug_screen_resource_create; - SCR_INIT(resource_create_with_modifiers); rb_screen->base.resource_from_handle = rbug_screen_resource_from_handle; SCR_INIT(check_resource_capability); rb_screen->base.resource_get_handle = rbug_screen_resource_get_handle; - SCR_INIT(resource_get_param); - SCR_INIT(resource_get_info); SCR_INIT(resource_changed); rb_screen->base.resource_destroy = rbug_screen_resource_destroy; rb_screen->base.flush_frontbuffer = rbug_screen_flush_frontbuffer; rb_screen->base.fence_reference = rbug_screen_fence_reference; rb_screen->base.fence_finish = rbug_screen_fence_finish; - rb_screen->base.fence_get_fd = rbug_screen_fence_get_fd; - SCR_INIT(finalize_nir); - SCR_INIT(get_sparse_texture_virtual_page_size); rb_screen->screen = screen; |