diff options
author | Thierry Reding <treding@nvidia.com> | 2015-11-09 18:15:52 +0100 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2016-07-04 11:36:20 +0200 |
commit | 7ed5cbdbcccb275a8c804a5c853e76fab6b8a14c (patch) | |
tree | 2ae5df16e32574f08618c61d511fd483eb1a6a73 | |
parent | 96357f77e79eae2cfd4b9c0186d0fafabb09ba55 (diff) |
WIP
-rw-r--r-- | src/gallium/drivers/tegra/tegra_context.c | 24 | ||||
-rw-r--r-- | src/gallium/drivers/tegra/tegra_context.h | 8 | ||||
-rw-r--r-- | src/gallium/drivers/tegra/tegra_resource.h | 8 | ||||
-rw-r--r-- | src/gallium/drivers/tegra/tegra_screen.c | 19 |
4 files changed, 22 insertions, 37 deletions
diff --git a/src/gallium/drivers/tegra/tegra_context.c b/src/gallium/drivers/tegra/tegra_context.c index 389bc8bc6a5..9a0ce5b1659 100644 --- a/src/gallium/drivers/tegra/tegra_context.c +++ b/src/gallium/drivers/tegra/tegra_context.c @@ -541,18 +541,17 @@ tegra_set_sampler_views(struct pipe_context *pcontext, } static void -tegra_set_shader_resources(struct pipe_context *pcontext, - unsigned start, - unsigned count, - struct pipe_surface **resources) +tegra_set_shader_images(struct pipe_context *pcontext, unsigned shader, + unsigned start, unsigned count, + struct pipe_image_view **views) { struct tegra_context *context = to_tegra_context(pcontext); - debug_printf("> %s(pcontext=%p, startt=%u, count=%u, resources=%p)\n", - __func__, pcontext, start, count, resources); + debug_printf("> %s(pcontext=%p, shader=%u, start=%u, count=%u, views=%p)\n", + __func__, pcontext, shader, start, count, views); - context->gpu->set_shader_resources(context->gpu, start, count, - resources); + context->gpu->set_shader_images(context->gpu, shader, start, count, + views); debug_printf("< %s()\n", __func__); } @@ -869,18 +868,19 @@ tegra_transfer_inline_write(struct pipe_context *pcontext, } struct pipe_context * -tegra_context_create(struct pipe_screen *pscreen, void *priv) +tegra_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags) { struct tegra_screen *screen = to_tegra_screen(pscreen); struct tegra_context *context; - debug_printf("> %s(pscreen=%p, priv=%p)\n", __func__, pscreen, priv); + debug_printf("> %s(pscreen=%p, priv=%p, flags=%x)\n", __func__, + pscreen, priv, flags); context = calloc(1, sizeof(*context)); if (!context) return NULL; - context->gpu = screen->gpu->context_create(screen->gpu, priv); + context->gpu = screen->gpu->context_create(screen->gpu, priv, flags); if (!context->gpu) { debug_error("failed to create GPU context\n"); free(context); @@ -933,7 +933,7 @@ tegra_context_create(struct pipe_screen *pscreen, void *priv) context->base.set_viewport_states = tegra_set_viewport_states; context->base.set_sampler_views = tegra_set_sampler_views; - context->base.set_shader_resources = tegra_set_shader_resources; + context->base.set_shader_images = tegra_set_shader_images; context->base.set_vertex_buffers = tegra_set_vertex_buffers; context->base.set_index_buffer = tegra_set_index_buffer; diff --git a/src/gallium/drivers/tegra/tegra_context.h b/src/gallium/drivers/tegra/tegra_context.h index 2a26ec6d9c6..826a751eebc 100644 --- a/src/gallium/drivers/tegra/tegra_context.h +++ b/src/gallium/drivers/tegra/tegra_context.h @@ -41,20 +41,20 @@ to_tegra_context(struct pipe_context *context) } struct pipe_context *tegra_context_create(struct pipe_screen *pscreen, - void *priv); + void *priv, unsigned flags); struct tegra_sampler_view { struct pipe_sampler_view base; struct pipe_sampler_view *gpu; }; -static INLINE struct tegra_sampler_view * +static inline struct tegra_sampler_view * to_tegra_sampler_view(struct pipe_sampler_view *view) { return (struct tegra_sampler_view *)view; } -static INLINE struct pipe_sampler_view * +static inline struct pipe_sampler_view * tegra_sampler_view_unwrap(struct pipe_sampler_view *view) { if (!view) @@ -71,7 +71,7 @@ struct tegra_transfer { void *map; }; -static INLINE struct tegra_transfer * +static inline struct tegra_transfer * to_tegra_transfer(struct pipe_transfer *transfer) { return (struct tegra_transfer *)transfer; diff --git a/src/gallium/drivers/tegra/tegra_resource.h b/src/gallium/drivers/tegra/tegra_resource.h index 783fb37ec46..b1a3bc5b9f5 100644 --- a/src/gallium/drivers/tegra/tegra_resource.h +++ b/src/gallium/drivers/tegra/tegra_resource.h @@ -37,13 +37,13 @@ struct tegra_resource { size_t size; }; -static INLINE struct tegra_resource * +static inline struct tegra_resource * to_tegra_resource(struct pipe_resource *resource) { return (struct tegra_resource *)resource; } -static INLINE struct pipe_resource * +static inline struct pipe_resource * tegra_resource_unwrap(struct pipe_resource *resource) { if (!resource) @@ -72,13 +72,13 @@ struct tegra_surface { struct pipe_surface *gpu; }; -static INLINE struct tegra_surface * +static inline struct tegra_surface * to_tegra_surface(struct pipe_surface *surface) { return (struct tegra_surface *)surface; } -static INLINE struct pipe_surface * +static inline struct pipe_surface * tegra_surface_unwrap(struct pipe_surface *surface) { if (!surface) diff --git a/src/gallium/drivers/tegra/tegra_screen.c b/src/gallium/drivers/tegra/tegra_screen.c index b6394faa0c6..cec7aec59eb 100644 --- a/src/gallium/drivers/tegra/tegra_screen.c +++ b/src/gallium/drivers/tegra/tegra_screen.c @@ -25,6 +25,8 @@ #include <fcntl.h> #include <stdio.h> +#include <sys/stat.h> + #ifdef HAVE_LIBUDEV #include <libudev.h> #endif @@ -145,22 +147,6 @@ tegra_fence_reference(struct pipe_screen *pscreen, } static boolean -tegra_fence_signalled(struct pipe_screen *pscreen, - struct pipe_fence_handle *fence) -{ - struct tegra_screen *screen = to_tegra_screen(pscreen); - boolean ret; - - debug_printf("> %s(pscreen=%p, fence=%p)\n", __func__, pscreen, - fence); - - ret = screen->gpu->fence_signalled(screen->gpu, fence); - - debug_printf("< %s() = %d\n", __func__, ret); - return ret; -} - -static boolean tegra_fence_finish(struct pipe_screen *pscreen, struct pipe_fence_handle *fence, uint64_t timeout) @@ -376,7 +362,6 @@ tegra_screen_create(int fd) screen->base.resource_destroy = tegra_resource_destroy; screen->base.fence_reference = tegra_fence_reference; - screen->base.fence_signalled = tegra_fence_signalled; screen->base.fence_finish = tegra_fence_finish; debug_printf("< %s() = %p\n", __func__, &screen->base); |