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@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6620
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16886>
This commit is contained in:
Nagappa Koppad, Basanagouda 2022-06-06 14:40:06 +05:30 committed by Marge Bot
parent 01fd789ad5
commit a99e85db9e
1 changed files with 2 additions and 1 deletions

View File

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