Mesa (main): iris:Duplicate DRM fd internally instead of reuse.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 6 20:24:42 UTC 2022


Module: Mesa
Branch: main
Commit: a99e85db9ebd83c41d3606568db8e8d81ca0205c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a99e85db9ebd83c41d3606568db8e8d81ca0205c

Author: Nagappa Koppad, Basanagouda <basanagouda.nagappa.koppad at intel.com>
Date:   Mon Jun  6 14:58:06 2022 +0530

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 <basanagouda.nagappa.koppad at intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6620
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16886>

---

 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);
 



More information about the mesa-commit mailing list