[Mesa-dev] [PATCH v4 7/7] gallium: add pipe_screen::resource_changed callback wrappers
Emil Velikov
emil.l.velikov at gmail.com
Wed Jan 18 15:49:56 UTC 2017
On 6 December 2016 at 16:17, 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;
As mentioned by Marek this should use SCR_INIT() or we'll crash in our
wrapper above.
The other wrapper drivers will need similar macro/fix. Although from a
quick look they also need an implementation of the other optional API.
Thanks
Emil
More information about the mesa-dev
mailing list