summaryrefslogtreecommitdiff
path: root/src/gallium/winsys
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c3
-rw-r--r--src/gallium/winsys/vc4/drm/vc4_drm_winsys.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c b/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c
index 9000a6ac3ed..790ed7d69e9 100644
--- a/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c
+++ b/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c
@@ -40,6 +40,9 @@
static void kmsro_ro_destroy(struct renderonly *ro)
{
+ if (ro->gpu_fd >= 0)
+ close(ro->gpu_fd);
+
FREE(ro);
}
diff --git a/src/gallium/winsys/vc4/drm/vc4_drm_winsys.c b/src/gallium/winsys/vc4/drm/vc4_drm_winsys.c
index a507821a940..ae409923afe 100644
--- a/src/gallium/winsys/vc4/drm/vc4_drm_winsys.c
+++ b/src/gallium/winsys/vc4/drm/vc4_drm_winsys.c
@@ -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);
}