diff options
author | Aleksander Morgado <[email protected]> | 2017-07-06 23:18:57 +0200 |
---|---|---|
committer | Andres Gomez <[email protected]> | 2017-07-12 19:32:09 +0300 |
commit | 401c37f500f351272dede9e7464d836183dafac4 (patch) | |
tree | e2b43dfeb642b9f260b4cc45e7f060657d750951 | |
parent | d856e97d928c97c159964f1edd07f95909f572f0 (diff) |
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: [email protected]
Signed-off-by: Aleksander Morgado <[email protected]>
Reviewed-by: Christian Gmeiner <[email protected]>
Reviewed-by: Lucas Stach <[email protected]>
(cherry picked from commit 5d8514de14bd27170293bb373e06f5ff43c708ad)
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_screen.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c index 8b251467691..5f1d2802209 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c @@ -752,6 +752,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"); |