[PATCH v4 4/7] etnaviv: implement resource_changed to invalidate internal resources derived from imported buffers

Christian Gmeiner christian.gmeiner at gmail.com
Wed Jan 18 15:43:25 UTC 2017


Reviewed-by: Christian Gmeiner <christian.gmeiner at gmail.com>

2016-12-06 17:17 GMT+01:00 Philipp Zabel <p.zabel at pengutronix.de>:
> Implement the resource_changed pipe callback to invalidate internal
> resources derived from imported buffers. This is needed to update the
> texture for re-imported renderables.
>
> Signed-off-by: Philipp Zabel <p.zabel at pengutronix.de>
> ---
>  src/gallium/drivers/etnaviv/etnaviv_resource.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c b/src/gallium/drivers/etnaviv/etnaviv_resource.c
> index a8858c5..20ec8f8 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_resource.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c
> @@ -275,6 +275,18 @@ etna_resource_create(struct pipe_screen *pscreen,
>  }
>
>  static void
> +etna_resource_changed(struct pipe_screen *pscreen, struct pipe_resource *prsc)
> +{
> +   struct etna_resource *res = etna_resource(prsc);
> +
> +   /* Make sure texture is older than the imported renderable buffer,
> +    * so etna_update_sampler_source will copy the pixel data again.
> +    */
> +   if (res->texture)
> +      etna_resource(res->texture)->seqno = res->seqno - 1;
> +}
> +
> +static void
>  etna_resource_destroy(struct pipe_screen *pscreen, struct pipe_resource *prsc)
>  {
>     struct etna_resource *rsc = etna_resource(prsc);
> @@ -436,5 +448,6 @@ etna_resource_screen_init(struct pipe_screen *pscreen)
>     pscreen->resource_create = etna_resource_create;
>     pscreen->resource_from_handle = etna_resource_from_handle;
>     pscreen->resource_get_handle = etna_resource_get_handle;
> +   pscreen->resource_changed = etna_resource_changed;
>     pscreen->resource_destroy = etna_resource_destroy;
>  }
> --
> 2.10.2
>

greets
--
Christian Gmeiner, MSc

https://www.youtube.com/user/AloryOFFICIAL
https://soundcloud.com/christian-gmeiner


More information about the etnaviv mailing list