SDL: Use drmModeAddFB() if drmModeAddFB2WithModifiers() fails (6f7aa)

From 6f7aa1e755c581ce88f8bda6a3601367f84b2ce5 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 15 Aug 2024 11:51:46 -0700
Subject: [PATCH] Use drmModeAddFB() if drmModeAddFB2WithModifiers() fails

Fixes https://github.com/libsdl-org/SDL/issues/10276

(cherry picked from commit 8e99ec34bba27f239b3446abcad42783225404cf)
(cherry picked from commit b36021495014c9ca9eeaef2d233ac6af6ec6045b)
---
 src/video/kmsdrm/SDL_kmsdrmvideo.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c
index 35005b9086353..b7abb4fc785f5 100644
--- a/src/video/kmsdrm/SDL_kmsdrmvideo.c
+++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c
@@ -380,15 +380,9 @@ KMSDRM_FBInfo *KMSDRM_FBFromBO(_THIS, struct gbm_bo *bo)
     ret = KMSDRM_drmModeAddFB2WithModifiers(viddata->drm_fd, w, h, format, handles, strides, offsets, modifiers, &fb_info->fb_id, flags);
 
     if (ret) {
-        handles[0] = KMSDRM_gbm_bo_get_handle(bo).u32;
         strides[0] = KMSDRM_gbm_bo_get_stride(bo);
-        offsets[0] = 0;
-        for (int i = 1; i<4; i++) {
-            handles[i] = 0;
-            strides[i] = 0;
-            offsets[i] = 0;
-        }
-        ret = KMSDRM_drmModeAddFB2(viddata->drm_fd, w, h, format, handles, strides, offsets, &fb_info->fb_id, 0);
+        handles[0] = KMSDRM_gbm_bo_get_handle(bo).u32;
+        ret = KMSDRM_drmModeAddFB(viddata->drm_fd, w, h, 24, 32, strides[0], handles[0], &fb_info->fb_id);
     }
 
     if (ret) {