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