From 3c11b43e59a8faf6288213207aafcd1f895999f3 Mon Sep 17 00:00:00 2001
From: Cameron Gutman <[EMAIL REDACTED]>
Date: Thu, 2 Apr 2026 20:45:20 -0500
Subject: [PATCH] kmsdrm: Initialize kms_in_fence_fd to -1
Prior to this fix, we closed stdin on the first call to drm_atomic_commit().
---
src/video/kmsdrm/SDL_kmsdrmvideo.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c
index 7d5c13e19b587..0c061b9d297fa 100644
--- a/src/video/kmsdrm/SDL_kmsdrmvideo.c
+++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c
@@ -1125,6 +1125,7 @@ static void KMSDRM_AddDisplay(SDL_VideoDevice *_this, drmModeConnector *conn, dr
to sane values. */
dispdata->cursor_bo = NULL;
dispdata->cursor_bo_drm_fd = -1;
+ dispdata->kms_in_fence_fd = -1;
dispdata->kms_out_fence_fd = -1;
/* Since we create and show the default cursor on KMSDRM_InitMouse(),