[Mesa-dev] [PATCH 04/27] gallium: introduce memory object v2
Marek Olšák
maraeo at gmail.com
Fri Jul 14 19:23:23 UTC 2017
On Thu, Jul 13, 2017 at 12:45 AM, Andres Rodriguez <andresx7 at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> v2: fix comment regarding fd ownership, define pipe_memory_object
> ---
> src/gallium/drivers/ddebug/dd_screen.c | 40 ++++++++++++++++++++++++++++++++++
> src/gallium/include/pipe/p_screen.h | 36 ++++++++++++++++++++++++++++++
> src/gallium/include/pipe/p_state.h | 8 +++++++
> 3 files changed, 84 insertions(+)
>
> diff --git a/src/gallium/drivers/ddebug/dd_screen.c b/src/gallium/drivers/ddebug/dd_screen.c
> index a5d2be1..fe9c841 100644
> --- a/src/gallium/drivers/ddebug/dd_screen.c
> +++ b/src/gallium/drivers/ddebug/dd_screen.c
> @@ -245,6 +245,22 @@ dd_screen_resource_from_user_memory(struct pipe_screen *_screen,
> return res;
> }
>
> +static struct pipe_resource *
> +dd_screen_resource_from_memobj(struct pipe_screen *_screen,
> + const struct pipe_resource *templ,
> + struct pipe_memory_object *memobj,
> + uint64_t offset)
> +{
> + struct pipe_screen *screen = dd_screen(_screen)->screen;
> + struct pipe_resource *res =
> + screen->resource_from_memobj(screen, templ, memobj, offset);
> +
> + if (!res)
> + return NULL;
> + res->screen = _screen;
> + return res;
> +}
> +
> static void
> dd_screen_resource_changed(struct pipe_screen *_screen,
> struct pipe_resource *res)
> @@ -303,7 +319,28 @@ dd_screen_fence_finish(struct pipe_screen *_screen,
> return screen->fence_finish(screen, ctx, fence, timeout);
> }
>
> +/********************************************************************
> + * memobj
> + */
> +
> +static struct pipe_memory_object *
> +dd_screen_memobj_create_from_handle(struct pipe_screen *_screen,
> + struct winsys_handle *handle,
> + bool dedicated)
> +{
> + struct pipe_screen *screen = dd_screen(_screen)->screen;
> +
> + return screen->memobj_create_from_handle(screen, handle, dedicated);
> +}
> +
> +static void
> +dd_screen_memobj_destroy(struct pipe_screen *_screen,
> + struct pipe_memory_object *memobj)
> +{
> + struct pipe_screen *screen = dd_screen(_screen)->screen;
>
> + return screen->memobj_destroy(screen, memobj);
stray "return"
With that fixed, this patch is:
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
More information about the mesa-dev
mailing list