mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 05:00:09 +01:00
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 99ef66c325) 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>
This commit is contained in:
parent
187218395d
commit
2229328cf9
2 changed files with 4 additions and 1 deletions
|
|
@ -40,6 +40,9 @@
|
|||
|
||||
static void kmsro_ro_destroy(struct renderonly *ro)
|
||||
{
|
||||
if (ro->gpu_fd >= 0)
|
||||
close(ro->gpu_fd);
|
||||
|
||||
FREE(ro);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,5 +61,5 @@ struct pipe_screen *
|
|||
vc4_drm_screen_create_renderonly(struct renderonly *ro,
|
||||
const struct pipe_screen_config *config)
|
||||
{
|
||||
return vc4_screen_create(ro->gpu_fd, ro);
|
||||
return vc4_screen_create(fcntl(ro->gpu_fd, F_DUPFD_CLOEXEC, 3), ro);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue