From 06057267762d4ed32b22da79704139333f31e680 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 15 Jan 2019 16:03:44 -0800 Subject: [PATCH] v3d: Don't leak the GPU fd for renderonly usage. The CTS was running out of fds, because of the ro->gpu_fd never being closed. ro->gpu_fd should match the screen (in case the caller of v3d_drm_screen_create_renderonly() has a scanout_for_resource() that uses gpu_fd) and the screen is expected to close its fd at the end, fixing the resource leak. Fixes: e113b21cb779 ("v3d: Add renderonly support.") --- src/gallium/winsys/v3d/drm/v3d_drm_winsys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/winsys/v3d/drm/v3d_drm_winsys.c b/src/gallium/winsys/v3d/drm/v3d_drm_winsys.c index a4786068bba..cda830f3e84 100644 --- a/src/gallium/winsys/v3d/drm/v3d_drm_winsys.c +++ b/src/gallium/winsys/v3d/drm/v3d_drm_winsys.c @@ -37,5 +37,5 @@ v3d_drm_screen_create(int fd) struct pipe_screen * v3d_drm_screen_create_renderonly(struct renderonly *ro) { - return v3d_screen_create(fcntl(ro->gpu_fd, F_DUPFD_CLOEXEC, 3), ro); + return v3d_screen_create(ro->gpu_fd, ro); } -- 2.30.2