etnaviv: fix refcnt initialization in etna_screen
authorAleksander Morgado <aleksander@aleksander.es>
Thu, 6 Jul 2017 21:18:57 +0000 (23:18 +0200)
committerLucas Stach <l.stach@pengutronix.de>
Fri, 7 Jul 2017 13:39:29 +0000 (15:39 +0200)
commit5d8514de14bd27170293bb373e06f5ff43c708ad
tree38f86f869ffe167d99d499327c6d4ca0f020837c
parentc03612264635c701acffb1ce78f35c583ba0e2d3
etnaviv: fix refcnt initialization in etna_screen

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.

Fixes: c9e8b49b885 ("etnaviv: gallium driver for Vivante GPUs")
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
src/gallium/drivers/etnaviv/etnaviv_screen.c