From a99e85db9ebd83c41d3606568db8e8d81ca0205c Mon Sep 17 00:00:00 2001 From: "Nagappa Koppad, Basanagouda" Date: Mon, 6 Jun 2022 14:40:06 +0530 Subject: [PATCH] iris:Duplicate DRM fd internally instead of reuse. Scenario we want to avoid is double close of DRM fd in iris driver. Signed-off-by: Nagappa Koppad, Basanagouda Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6620 Reviewed-by: Lionel Landwerlin Reviewed-by: Kenneth Graunke Part-of: --- src/gallium/drivers/iris/iris_screen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c index 79b17b39c5e..3abe5a9e06e 100644 --- a/src/gallium/drivers/iris/iris_screen.c +++ b/src/gallium/drivers/iris/iris_screen.c @@ -38,6 +38,7 @@ #include "pipe/p_context.h" #include "pipe/p_screen.h" #include "util/debug.h" +#include "util/os_file.h" #include "util/u_cpu_detect.h" #include "util/u_inlines.h" #include "util/format/u_format.h" @@ -821,7 +822,7 @@ iris_screen_create(int fd, const struct pipe_screen_config *config) return NULL; screen->fd = iris_bufmgr_get_fd(screen->bufmgr); - screen->winsys_fd = fd; + screen->winsys_fd = os_dupfd_cloexec(fd); screen->id = iris_bufmgr_create_screen_id(screen->bufmgr);