[Mesa-dev] [PATCH v4 7/7] gallium: add pipe_screen::resource_changed callback wrappers
Marek Olšák
maraeo at gmail.com
Fri Dec 9 22:20:02 UTC 2016
On Tue, Dec 6, 2016 at 5:17 PM, Philipp Zabel <p.zabel at pengutronix.de> wrote:
> Add resource_changed to the ddebug, rbug, and trace wrappers. Since it
> is optional, there is no need to add it to noop.
>
> Signed-off-by: Philipp Zabel <p.zabel at pengutronix.de>
> Suggested-by: Nicolai Hähnle <nhaehnle at gmail.com>
> ---
> src/gallium/drivers/ddebug/dd_screen.c | 10 ++++++++++
> src/gallium/drivers/rbug/rbug_screen.c | 11 +++++++++++
> src/gallium/drivers/trace/tr_screen.c | 20 ++++++++++++++++++++
> 3 files changed, 41 insertions(+)
>
> diff --git a/src/gallium/drivers/ddebug/dd_screen.c b/src/gallium/drivers/ddebug/dd_screen.c
> index a0c0dd0..3e20abe 100644
> --- a/src/gallium/drivers/ddebug/dd_screen.c
> +++ b/src/gallium/drivers/ddebug/dd_screen.c
> @@ -227,6 +227,15 @@ dd_screen_resource_from_user_memory(struct pipe_screen *_screen,
> }
>
> static void
> +dd_screen_resource_changed(struct pipe_screen *_screen,
> + struct pipe_resource *res)
> +{
> + struct pipe_screen *screen = dd_screen(_screen)->screen;
> +
> + screen->resource_changed(screen, res);
> +}
> +
> +static void
> dd_screen_resource_destroy(struct pipe_screen *_screen,
> struct pipe_resource *res)
> {
> @@ -385,6 +394,7 @@ ddebug_screen_create(struct pipe_screen *screen)
> dscreen->base.resource_from_handle = dd_screen_resource_from_handle;
> SCR_INIT(resource_from_user_memory);
> dscreen->base.resource_get_handle = dd_screen_resource_get_handle;
> + dscreen->base.resource_changed = dd_screen_resource_changed;
This should use SCR_INIT, because it's optional.
Marek
More information about the mesa-dev
mailing list