[Mesa-dev] [PATCH] etnaviv: fix refcnt initialization in etna_screen

Christian Gmeiner christian.gmeiner at gmail.com
Fri Jul 7 10:16:51 UTC 2017


2017-07-06 23:18 GMT+02:00 Aleksander Morgado <aleksander at aleksander.es>:
> Despite being a member of the etna_screen struct, 'refcnt' is used by
> the winsys-specific logic to track the reference count of the object
> managed in a hash table. When the count reaches zero, the pipe screen
> is removed from the table and destroyed.
>
> Fix the logic by initializing the refcnt to 1 when screen created.
> This initialization is done in etna_screen_create(), to follow the
> same logic as in freedreno and virgl.
>
> Signed-off-by: Aleksander Morgado <aleksander at aleksander.es>

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

> ---
>  src/gallium/drivers/etnaviv/etnaviv_screen.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c
> index eefb51c5da..fa0cbd9076 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c
> @@ -772,6 +772,7 @@ etna_screen_create(struct etna_device *dev, struct etna_gpu *gpu,
>     screen->dev = dev;
>     screen->gpu = gpu;
>     screen->ro = renderonly_dup(ro);
> +   screen->refcnt = 1;
>
>     if (!screen->ro) {
>        DBG("could not create renderonly object");
> --
> 2.13.1
>

greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info


More information about the mesa-dev mailing list