SDL/src/video
Sam Lantinga 3e935aecb9 Fixed bug 4966 - KMSDRM: Add dynamic modeset support
Anthony Pesch

* Remove triple buffering support. As far as I can tell, this goes against the libdrm API; the EGL implementations themselves control the buffering. Removing it isn't absolutely necessary as it seemingly works on the Pi at least, but I noticed this while doing my work and explained my reasoning in the commit.

* Replace the crtc_ready logic which allocates an extra bo to perform the initial CRTC configuration (which is required before calling drmModePageFlip) with a call to drmModeSetCrtc after the front and back buffers are allocated, avoiding this allocation.

* Standardized the SDL_*Data variable names and null checks to improve readability. Given that there were duplicate fields in each SDL_*Data structure, having generic names such as "data" at times was very confusing.

* Removed unused fields from the SDL_*Data structures and moves all display related fields out of SDL_VideoData and into SDL_DisplayData. Not required since the code only supports a single display right now, but this was helpful in reading and understanding the code initially.

* Implement KMSDRM_GetDisplayModes / KMSDRM_SetDisplayMode to provide dynamic modeset support.

These changes have been tested on a Raspberry Pi 4 and a Dell XPS laptop with an HD 520.

As an update, I went back over the triple buffer changes and left them in. I didn't entirely get the code originally, I had just seen it calling KMSDRM_gbm_surface_lock_front_buffer twice for a single swap and had removed it because I was paranoid of bugs stemming from it while working on the modeset changes.

I've made a few small changes to the logic that had thrown me off originally and rebased the changes:
* The condition wrapping the call to release buffer was incorrect.
* The first call to KMSDRM_gbm_surface_lock_front_buffer has been removed. I don't understand why it existed.
* Added additional comments describing what was going on in the code (as it does fix the buffer release pattern of the original code before it).
2020-02-09 11:44:22 -08:00
..
android Android: prevents rare crashes when app goes to background or ends. 2020-01-17 12:41:54 +01:00
arm ARM: NEON assembly optimization for SDL_FillRect 2019-10-24 21:17:52 -04:00
cocoa Miscellaneous pending fixes 2020-01-29 20:09:08 -08:00
directfb Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
dummy Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
emscripten Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
haiku Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
khronos Added Vulkan headers version 1.1.91 2018-11-06 16:57:07 -08:00
kmsdrm Fixed bug 4966 - KMSDRM: Add dynamic modeset support 2020-02-09 11:44:22 -08:00
nacl Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
offscreen Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
pandora Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
psp Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
qnx Fixed mingw Windows build, since SDL_vulkan_internal.h includes windows.h 2017-08-28 00:43:14 -07:00
raspberry Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
uikit Fixed build 2020-01-30 14:58:41 -08:00
vivante Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
wayland Fixed bug 4917 - Wayland: handle discrete pointer axis events 2020-02-03 00:57:12 -08:00
windows Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
winrt Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
x11 Fixed bug 4833 - Use EGL for X11? 2020-02-03 08:06:52 -08:00
yuv2rgb Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_blit.c Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_blit.h Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_blit_0.c Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_blit_1.c Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_blit_A.c Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_blit_auto.c Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_blit_auto.h Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_blit_copy.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_blit_copy.h Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_blit_N.c Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_blit_slow.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_blit_slow.h Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_bmp.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_clipboard.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_egl.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_egl_c.h Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_fillrect.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_pixels.c A few #defines to reduce SDL2 footprint. 2020-01-21 21:33:40 +01:00
SDL_pixels_c.h Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_rect.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_rect_c.h Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_RLEaccel.c Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_RLEaccel_c.h A few #defines to reduce SDL2 footprint. 2020-01-21 21:33:40 +01:00
SDL_shape.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_shape_internals.h Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_stretch.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_surface.c A few #defines to reduce SDL2 footprint. 2020-01-21 21:33:40 +01:00
SDL_sysvideo.h Export SDL functions for iOS application delegates 2020-01-30 14:51:33 -08:00
SDL_video.c video: Added a hint to override the display's usable bounds. 2020-01-27 10:58:30 -05:00
SDL_vulkan_internal.h Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_vulkan_utils.c Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
SDL_yuv.c Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00
SDL_yuv_c.h Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
sdlgenblit.pl Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds 2020-01-23 01:00:52 -08:00