renderonly: close the gpu fd when destroying renderonly
authorLucas Stach <l.stach@pengutronix.de>
Wed, 26 Aug 2020 13:32:08 +0000 (15:32 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 11 Mar 2021 14:41:48 +0000 (14:41 +0000)
commit2229328cf9213bfbfac2e0e5cc411a41bcaae695
treed393de23ee6f28a300410877060b7edbbb5a7640
parent187218395d7c9e8257ac17c7cbf1cc7add5c9363
renderonly: close the gpu fd when destroying renderonly

Currently the screen destruction closes the dup'ed fd, but not the
original renderonly gpu fd, which is kept around for the lifetime of
the renderonly.

Squashed revert of "vc4: Don't leak the GPU fd for renderonly usage."
(commit 99ef66c325a99b3e191987d8327e7e4cd4aafcd7) as requested by Eric.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6983>
src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c
src/gallium/winsys/vc4/drm/vc4_drm_winsys.c