Atlas - SDL_kmsdrmopengles.c
Home / ext / SDL / src / video / kmsdrm Lines: 1 | Size: 23786 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]1/* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2025 Sam Lantinga <[email protected]> 4 5 This software is provided 'as-is', without any express or implied 6 warranty. In no event will the authors be held liable for any damages 7 arising from the use of this software. 8 9 Permission is granted to anyone to use this software for any purpose, 10 including commercial applications, and to alter it and redistribute it 11 freely, subject to the following restrictions: 12 13 1. The origin of this software must not be misrepresented; you must not 14 claim that you wrote the original software. If you use this software 15 in a product, an acknowledgment in the product documentation would be 16 appreciated but is not required. 17 2. Altered source versions must be plainly marked as such, and must not be 18 misrepresented as being the original software. 19 3. This notice may not be removed or altered from any source distribution. 20*/ 21 22#include "SDL_internal.h" 23 24#ifdef SDL_VIDEO_DRIVER_KMSDRM 25 26#include "SDL_kmsdrmvideo.h" 27#include "SDL_kmsdrmopengles.h" 28#include "SDL_kmsdrmdyn.h" 29#include <errno.h> 30 31#define VOID2U64(x) ((uint64_t)(size_t)(x)) 32 33#ifndef EGL_PLATFORM_GBM_MESA 34#define EGL_PLATFORM_GBM_MESA 0x31D7 35#endif 36 37#ifndef EGL_SYNC_NATIVE_FENCE_ANDROID 38#define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144 39#endif 40 41#ifndef EGL_SYNC_NATIVE_FENCE_FD_ANDROID 42#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145 43#endif 44 45#ifndef EGL_NO_NATIVE_FENCE_FD_ANDROID 46#define EGL_NO_NATIVE_FENCE_FD_ANDROID -1 47#endif 48 49 50// EGL implementation of SDL OpenGL support 51 52void KMSDRM_GLES_DefaultProfileConfig(SDL_VideoDevice *_this, int *mask, int *major, int *minor) 53{ 54 /* if SDL was _also_ built with the Raspberry Pi driver (so we're 55 definitely a Pi device) or with the ROCKCHIP video driver 56 (it's a ROCKCHIP device), default to GLES2. */ 57#if defined(SDL_VIDEO_DRIVER_RPI) || defined(SDL_VIDEO_DRIVER_ROCKCHIP) 58 *mask = SDL_GL_CONTEXT_PROFILE_ES; 59 *major = 2; 60 *minor = 0; 61#endif 62} 63 64bool KMSDRM_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) 65{ 66 /* Just pretend you do this here, but don't do it until KMSDRM_CreateWindow(), 67 where we do the same library load we would normally do here. 68 because this gets called by SDL_CreateWindow() before KMSDR_CreateWindow(), 69 so gbm dev isn't yet created when this is called, AND we can't alter the 70 call order in SDL_CreateWindow(). */ 71#if 0 72 NativeDisplayType display = (NativeDisplayType)_this->internal->gbm_dev; 73 return SDL_EGL_LoadLibrary(_this, path, display, EGL_PLATFORM_GBM_MESA); 74#endif 75 return true; 76} 77 78void KMSDRM_GLES_UnloadLibrary(SDL_VideoDevice *_this) 79{ 80 /* As with KMSDRM_GLES_LoadLibrary(), we define our own "dummy" unloading function 81 so we manually unload the library whenever we want. */ 82} 83 84SDL_EGL_CreateContext_impl(KMSDRM) 85 86bool KMSDRM_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval) 87{ 88 if (!_this->egl_data) { 89 return SDL_SetError("EGL not initialized"); 90 } 91 92 if (interval == 0 || interval == 1) { 93 _this->egl_data->egl_swapinterval = interval; 94 } else { 95 return SDL_SetError("Only swap intervals of 0 or 1 are supported"); 96 } 97 98 return true; 99} 100 101static EGLSyncKHR create_fence(SDL_VideoDevice *_this, int fd) 102{ 103 EGLint attrib_list[] = { 104 EGL_SYNC_NATIVE_FENCE_FD_ANDROID, fd, 105 EGL_NONE, 106 }; 107 108 EGLSyncKHR fence = _this->egl_data->eglCreateSyncKHR(_this->egl_data->egl_display, EGL_SYNC_NATIVE_FENCE_ANDROID, attrib_list); 109 110 SDL_assert(fence); 111 return fence; 112} 113 114/***********************************************************************************/ 115/* Comments about buffer access protection mechanism (=fences) are the ones boxed. */ 116/* Also, DON'T remove the asserts: if a fence-related call fails, it's better that */ 117/* program exits immediately, or we could leave KMS waiting for a failed/missing */ 118/* fence forever. */ 119/***********************************************************************************/ 120static bool KMSDRM_GLES_SwapWindowFenced(SDL_VideoDevice *_this, SDL_Window * window) 121{ 122 SDL_WindowData *windata = ((SDL_WindowData *) window->internal); 123 SDL_DisplayData *dispdata = SDL_GetDisplayDriverDataForWindow(window); 124 KMSDRM_FBInfo *fb; 125 KMSDRM_PlaneInfo info; 126 bool modesetting = false; 127 128 SDL_zero(info); 129 130 /******************************************************************/ 131 /* Create the GPU-side FENCE OBJECT. It will be inserted into the */ 132 /* GL CMDSTREAM exactly at the end of the gl commands that form a */ 133 /* frame.(KMS will have to wait on it before doing a pageflip.) */ 134 /******************************************************************/ 135 dispdata->gpu_fence = create_fence(_this, EGL_NO_NATIVE_FENCE_FD_ANDROID); 136 SDL_assert(dispdata->gpu_fence); 137 138 /******************************************************************/ 139 /* eglSwapBuffers flushes the fence down the GL CMDSTREAM, so we */ 140 /* know for sure it's there now. */ 141 /* Also it marks, at EGL level, the buffer that we want to become */ 142 /* the new front buffer. (Remember that won't really happen until */ 143 /* we request a pageflip at the KMS level and it completes. */ 144 /******************************************************************/ 145 if (! _this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, windata->egl_surface)) { 146 return SDL_EGL_SetError("Failed to swap EGL buffers", "eglSwapBuffers"); 147 } 148 149 /******************************************************************/ 150 /* EXPORT the GPU-side FENCE OBJECT to the fence INPUT FD, so we */ 151 /* can pass it into the kernel. Atomic ioctl will pass the */ 152 /* in-fence fd into the kernel, thus telling KMS that it has to */ 153 /* wait for GPU to finish rendering the frame (remember where we */ 154 /* put the fence in the GL CMDSTREAM) before doing the changes */ 155 /* requested in the atomic ioct (the pageflip in this case). */ 156 /* (We export the GPU-side FENCE OJECT to the fence INPUT FD now, */ 157 /* not sooner, because now we are sure that the GPU-side fence is */ 158 /* in the CMDSTREAM to be lifted when the CMDSTREAM to this point */ 159 /* is completed). */ 160 /******************************************************************/ 161 dispdata->kms_in_fence_fd = _this->egl_data->eglDupNativeFenceFDANDROID (_this->egl_data->egl_display, dispdata->gpu_fence); 162 163 _this->egl_data->eglDestroySyncKHR(_this->egl_data->egl_display, dispdata->gpu_fence); 164 SDL_assert(dispdata->kms_in_fence_fd != -1); 165 166 /* Lock the buffer that is marked by eglSwapBuffers() to become the 167 next front buffer (so it can not be chosen by EGL as back buffer 168 to draw on), and get a handle to it to request the pageflip on it. 169 REMEMBER that gbm_surface_lock_front_buffer() ALWAYS has to be 170 called after eglSwapBuffers(). */ 171 windata->next_bo = KMSDRM_gbm_surface_lock_front_buffer(windata->gs); 172 if (!windata->next_bo) { 173 return SDL_SetError("Failed to lock frontbuffer"); 174 } 175 fb = KMSDRM_FBFromBO(_this, windata->next_bo); 176 if (!fb) { 177 return SDL_SetError("Failed to get a new framebuffer from BO"); 178 } 179 180 if (!windata->bo) { 181 /* On the first swap, immediately present the new front buffer. Before 182 drmModePageFlip can be used the CRTC has to be configured to use 183 the current connector and mode with drmModeSetCrtc */ 184 SDL_VideoData *viddata = _this->internal; 185 const int ret = KMSDRM_drmModeSetCrtc(viddata->drm_fd, 186 dispdata->crtc.crtc->crtc_id, fb->fb_id, 0, 0, 187 &dispdata->connector.connector->connector_id, 1, &dispdata->mode); 188 189 if (ret) { 190 return SDL_SetError("Could not set videomode on CRTC."); 191 } 192 } 193 194 /* Add the pageflip to the request list. */ 195 info.plane = dispdata->display_plane; 196 info.crtc_id = dispdata->crtc.crtc->crtc_id; 197 info.fb_id = fb->fb_id; 198 info.src_w = window->w; // !!! FIXME: was windata->src_w in the original atomic patch 199 info.src_h = window->h; // !!! FIXME: was windata->src_h in the original atomic patch 200 info.crtc_w = dispdata->mode.hdisplay; // !!! FIXME: was windata->output_w in the original atomic patch 201 info.crtc_h = dispdata->mode.vdisplay; // !!! FIXME: was windata->output_h in the original atomic patch 202 info.crtc_x = 0; // !!! FIXME: was windata->output_x in the original atomic patch 203 204 drm_atomic_set_plane_props(dispdata, &info); 205 206 /*****************************************************************/ 207 /* Tell the display (KMS) that it will have to wait on the fence */ 208 /* for the GPU-side FENCE. */ 209 /* */ 210 /* Since KMS is a kernel thing, we have to pass an FD into */ 211 /* the kernel, and get another FD out of the kernel. */ 212 /* */ 213 /* 1) To pass the GPU-side fence into the kernel, we set the */ 214 /* INPUT FD as the IN_FENCE_FD prop of the PRIMARY PLANE. */ 215 /* This FD tells KMS (the kernel) to wait for the GPU-side fence.*/ 216 /* */ 217 /* 2) To get the KMS-side fence out of the kernel, we set the */ 218 /* OUTPUT FD as the OUT_FEWNCE_FD prop of the CRTC. */ 219 /* This FD will be later imported as a FENCE OBJECT which will be*/ 220 /* used to tell the GPU to wait for KMS to complete the changes */ 221 /* requested in atomic_commit (the pageflip in this case). */ 222 /*****************************************************************/ 223 if (dispdata->kms_in_fence_fd != -1) 224 { 225 add_plane_property(dispdata->atomic_req, dispdata->display_plane, 226 "IN_FENCE_FD", dispdata->kms_in_fence_fd); 227 add_crtc_property(dispdata->atomic_req, &dispdata->crtc, 228 "OUT_FENCE_PTR", VOID2U64(&dispdata->kms_out_fence_fd)); 229 } 230 231 /* Do we have a pending modesetting? If so, set the necessary 232 props so it's included in the incoming atomic commit. */ 233 if (windata->egl_surface_dirty) { 234 // !!! FIXME: this CreateSurfaces call is what the legacy path does; it's not clear to me if the atomic paths need to do it too. 235 KMSDRM_CreateSurfaces(_this, window); 236 237 uint32_t blob_id; 238 SDL_VideoData *viddata = (SDL_VideoData *)_this->internal; 239 240 add_connector_property(dispdata->atomic_req, &dispdata->connector, "CRTC_ID", dispdata->crtc.crtc->crtc_id); 241 KMSDRM_drmModeCreatePropertyBlob(viddata->drm_fd, &dispdata->mode, sizeof(dispdata->mode), &blob_id); 242 add_crtc_property(dispdata->atomic_req, &dispdata->crtc, "MODE_ID", blob_id); 243 add_crtc_property(dispdata->atomic_req, &dispdata->crtc, "active", 1); 244 modesetting = true; 245 } 246 247 /*****************************************************************/ 248 /* Issue a non-blocking atomic commit: for triple buffering, */ 249 /* this must not block so the game can start building another */ 250 /* frame, even if the just-requested pageflip hasnt't completed. */ 251 /*****************************************************************/ 252 if (drm_atomic_commit(_this, dispdata, false, modesetting)) { 253 return SDL_SetError("Failed to issue atomic commit on pageflip"); 254 } 255 256 /* Release the previous front buffer so EGL can chose it as back buffer 257 and render on it again. */ 258 if (windata->bo) { 259 KMSDRM_gbm_surface_release_buffer(windata->gs, windata->bo); 260 } 261 /* Take note of the buffer about to become front buffer, so next 262 time we come here we can free it like we just did with the previous 263 front buffer. */ 264 windata->bo = windata->next_bo; 265 266 /****************************************************************/ 267 /* Import the KMS-side FENCE OUTPUT FD from the kernel to the */ 268 /* KMS-side FENCE OBJECT so we can use use it to fence the GPU. */ 269 /****************************************************************/ 270 dispdata->kms_fence = create_fence(_this, dispdata->kms_out_fence_fd); 271 SDL_assert(dispdata->kms_fence); 272 273 /****************************************************************/ 274 /* "Delete" the fence OUTPUT FD, because we already have the */ 275 /* KMS FENCE OBJECT, the fence itself is away from us, on the */ 276 /* kernel side. */ 277 /****************************************************************/ 278 dispdata->kms_out_fence_fd = -1; 279 280 /*****************************************************************/ 281 /* Tell the GPU to wait on the fence for the KMS-side FENCE, */ 282 /* which means waiting until the requested pageflip is completed.*/ 283 /*****************************************************************/ 284 _this->egl_data->eglWaitSyncKHR(_this->egl_data->egl_display, dispdata->kms_fence, 0); 285 286 return true; 287} 288 289static bool KMSDRM_GLES_SwapWindowDoubleBuffered(SDL_VideoDevice *_this, SDL_Window * window) 290{ 291 SDL_WindowData *windata = ((SDL_WindowData *) window->internal); 292 SDL_DisplayData *dispdata = SDL_GetDisplayDriverDataForWindow(window); 293 KMSDRM_FBInfo *fb; 294 KMSDRM_PlaneInfo info; 295 bool modesetting = false; 296 297 SDL_zero(info); 298 299 /**********************************************************************************/ 300 /* In double-buffer mode, atomic_commit will always be synchronous/blocking (ie: */ 301 /* won't return until the requested changes are really done). */ 302 /* Also, there's no need to fence KMS or the GPU, because we won't be entering */ 303 /* game loop again (hence not building or executing a new cmdstring) until */ 304 /* pageflip is done, so we don't need to protect the KMS/GPU access to the buffer.*/ 305 /**********************************************************************************/ 306 307 /* Mark, at EGL level, the buffer that we want to become the new front buffer. 308 It won't really happen until we request a pageflip at the KMS level and it 309 completes. */ 310 if (! _this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, windata->egl_surface)) { 311 return SDL_EGL_SetError("Failed to swap EGL buffers", "eglSwapBuffers"); 312 } 313 /* Lock the buffer that is marked by eglSwapBuffers() to become the next front buffer 314 (so it can not be chosen by EGL as back buffer to draw on), and get a handle to it, 315 to request the pageflip on it. */ 316 windata->next_bo = KMSDRM_gbm_surface_lock_front_buffer(windata->gs); 317 if (!windata->next_bo) { 318 return SDL_SetError("Failed to lock frontbuffer"); 319 } 320 fb = KMSDRM_FBFromBO(_this, windata->next_bo); 321 if (!fb) { 322 return SDL_SetError("Failed to get a new framebuffer BO"); 323 } 324 325 if (!windata->bo) { 326 /* On the first swap, immediately present the new front buffer. Before 327 drmModePageFlip can be used the CRTC has to be configured to use 328 the current connector and mode with drmModeSetCrtc */ 329 SDL_VideoData *viddata = _this->internal; 330 const int ret = KMSDRM_drmModeSetCrtc(viddata->drm_fd, 331 dispdata->crtc.crtc->crtc_id, fb->fb_id, 0, 0, 332 &dispdata->connector.connector->connector_id, 1, &dispdata->mode); 333 334 if (ret) { 335 return SDL_SetError("Could not set videomode on CRTC."); 336 } 337 } 338 339 /* Add the pageflip to the request list. */ 340 info.plane = dispdata->display_plane; 341 info.crtc_id = dispdata->crtc.crtc->crtc_id; 342 info.fb_id = fb->fb_id; 343 info.src_w = window->w; // !!! FIXME: was windata->src_w in the original atomic patch 344 info.src_h = window->h; // !!! FIXME: was windata->src_h in the original atomic patch 345 info.crtc_w = dispdata->mode.hdisplay; // !!! FIXME: was windata->output_w in the original atomic patch 346 info.crtc_h = dispdata->mode.vdisplay; // !!! FIXME: was windata->output_h in the original atomic patch 347 info.crtc_x = 0; // !!! FIXME: was windata->output_x in the original atomic patch 348 349 drm_atomic_set_plane_props(dispdata, &info); 350 351 /* Do we have a pending modesetting? If so, set the necessary 352 props so it's included in the incoming atomic commit. */ 353 if (windata->egl_surface_dirty) { 354 // !!! FIXME: this CreateSurfaces call is what the legacy path does; it's not clear to me if the atomic paths need to do it too. 355 KMSDRM_CreateSurfaces(_this, window); 356 357 uint32_t blob_id; 358 359 SDL_VideoData *viddata = (SDL_VideoData *)_this->internal; 360 361 add_connector_property(dispdata->atomic_req, &dispdata->connector, "CRTC_ID", dispdata->crtc.crtc->crtc_id); 362 KMSDRM_drmModeCreatePropertyBlob(viddata->drm_fd, &dispdata->mode, sizeof(dispdata->mode), &blob_id); 363 add_crtc_property(dispdata->atomic_req, &dispdata->crtc, "MODE_ID", blob_id); 364 add_crtc_property(dispdata->atomic_req, &dispdata->crtc, "active", 1); 365 modesetting = true; 366 } 367 368 /* Issue the one and only atomic commit where all changes will be requested! 369 Blocking for double buffering: won't return until completed. */ 370 if (drm_atomic_commit(_this, dispdata, true, modesetting)) { 371 return SDL_SetError("Failed to issue atomic commit on pageflip"); 372 } 373 374 /* Release last front buffer so EGL can chose it as back buffer and render on it again. */ 375 if (windata->bo) { 376 KMSDRM_gbm_surface_release_buffer(windata->gs, windata->bo); 377 } 378 379 /* Take note of current front buffer, so we can free it next time we come here. */ 380 windata->bo = windata->next_bo; 381 382 return true; 383} 384 385static bool KMSDRM_GLES_SwapWindowLegacy(SDL_VideoDevice *_this, SDL_Window *window) 386{ 387 SDL_WindowData *windata = window->internal; 388 SDL_DisplayData *dispdata = SDL_GetDisplayDriverDataForWindow(window); 389 SDL_VideoData *viddata = _this->internal; 390 KMSDRM_FBInfo *fb_info; 391 int ret = 0; 392 393 /* Always wait for the previous issued flip before issuing a new one, 394 even if you do async flips. */ 395 uint32_t flip_flags = DRM_MODE_PAGE_FLIP_EVENT; 396 397 // Skip the swap if we've switched away to another VT 398 if (windata->egl_surface == EGL_NO_SURFACE) { 399 // Wait a bit, throttling to ~100 FPS 400 SDL_Delay(10); 401 return true; 402 } 403 404 // Recreate the GBM / EGL surfaces if the display mode has changed 405 if (windata->egl_surface_dirty) { 406 KMSDRM_CreateSurfaces(_this, window); 407 } 408 409 /* Wait for confirmation that the next front buffer has been flipped, at which 410 point the previous front buffer can be released */ 411 if (!KMSDRM_WaitPageflip(_this, windata)) { 412 return SDL_SetError("Wait for previous pageflip failed"); 413 } 414 415 // Release the previous front buffer 416 if (windata->bo) { 417 KMSDRM_gbm_surface_release_buffer(windata->gs, windata->bo); 418 } 419 420 windata->bo = windata->next_bo; 421 422 /* Mark a buffer to become the next front buffer. 423 This won't happen until pageflip completes. */ 424 if (!(_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, 425 windata->egl_surface))) { 426 return SDL_SetError("eglSwapBuffers failed"); 427 } 428 429 /* From the GBM surface, get the next BO to become the next front buffer, 430 and lock it so it can't be allocated as a back buffer (to prevent EGL 431 from drawing into it!) */ 432 windata->next_bo = KMSDRM_gbm_surface_lock_front_buffer(windata->gs); 433 if (!windata->next_bo) { 434 return SDL_SetError("Could not lock front buffer on GBM surface"); 435 } 436 437 // Get an actual usable fb for the next front buffer. 438 fb_info = KMSDRM_FBFromBO(_this, windata->next_bo); 439 if (!fb_info) { 440 return SDL_SetError("Could not get a framebuffer"); 441 } 442 443 if (!windata->bo) { 444 /* On the first swap, immediately present the new front buffer. Before 445 drmModePageFlip can be used the CRTC has to be configured to use 446 the current connector and mode with drmModeSetCrtc */ 447 ret = KMSDRM_drmModeSetCrtc(viddata->drm_fd, 448 dispdata->crtc.crtc->crtc_id, fb_info->fb_id, 0, 0, 449 &dispdata->connector.connector->connector_id, 1, &dispdata->mode); 450 451 if (ret) { 452 return SDL_SetError("Could not set videomode on CRTC."); 453 } 454 } else { 455 /* On subsequent swaps, queue the new front buffer to be flipped during 456 the next vertical blank 457 458 Remember: drmModePageFlip() never blocks, it just issues the flip, 459 which will be done during the next vblank, or immediately if 460 we pass the DRM_MODE_PAGE_FLIP_ASYNC flag. 461 Since calling drmModePageFlip() will return EBUSY if we call it 462 without having completed the last issued flip, we must pass the 463 DRM_MODE_PAGE_FLIP_ASYNC if we don't block on EGL (egl_swapinterval = 0). 464 That makes it flip immediately, without waiting for the next vblank 465 to do so, so even if we don't block on EGL, the flip will have completed 466 when we get here again. */ 467 if (_this->egl_data->egl_swapinterval == 0 && viddata->async_pageflip_support) { 468 flip_flags |= DRM_MODE_PAGE_FLIP_ASYNC; 469 } 470 471 ret = KMSDRM_drmModePageFlip(viddata->drm_fd, dispdata->crtc.crtc->crtc_id, 472 fb_info->fb_id, flip_flags, &windata->waiting_for_flip); 473 474 if (ret == 0) { 475 windata->waiting_for_flip = true; 476 } else { 477 SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Could not queue pageflip: %d", ret); 478 } 479 480 /* Wait immediately for vsync (as if we only had two buffers). 481 Even if we are already doing a WaitPageflip at the beginning of this 482 function, this is NOT redundant because here we wait immediately 483 after submitting the image to the screen, reducing lag, and if 484 we have waited here, there won't be a pending pageflip so the 485 WaitPageflip at the beginning of this function will be a no-op. 486 Just leave it here and don't worry. 487 Run your SDL program with "SDL_VIDEO_DOUBLE_BUFFER=1 <program_name>" 488 to enable this. */ 489 if (windata->double_buffer) { 490 if (!KMSDRM_WaitPageflip(_this, windata)) { 491 return SDL_SetError("Immediate wait for previous pageflip failed"); 492 } 493 } 494 } 495 496 return true; 497} 498 499bool KMSDRM_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window * window) 500{ 501 SDL_WindowData *windata = (SDL_WindowData *) window->internal; 502 503 if (windata->swap_window == NULL) { 504 SDL_VideoData *viddata = _this->internal; 505 if (viddata->is_atomic) { 506 // We want the fenced version by default, but it needs extensions. 507 if ( (SDL_GetHintBoolean(SDL_HINT_VIDEO_DOUBLE_BUFFER, false)) || (!SDL_EGL_HasExtension(_this, SDL_EGL_DISPLAY_EXTENSION, "EGL_ANDROID_native_fence_sync")) ) { 508 windata->swap_window = KMSDRM_GLES_SwapWindowDoubleBuffered; 509 } else { 510 windata->swap_window = KMSDRM_GLES_SwapWindowFenced; 511 } 512 } else { 513 windata->swap_window = KMSDRM_GLES_SwapWindowLegacy; 514 } 515 } 516 return windata->swap_window(_this, window); 517} 518 519SDL_EGL_MakeCurrent_impl(KMSDRM) 520 521#endif // SDL_VIDEO_DRIVER_KMSDRM 522[FILE END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.