SDL/src
Eric Curtin c0eada2019
Fix assumption that DRI_DEVNAME begins at 0 (#5865)
* Fix assumption that DRI_DEVNAME begins at 0

The existing logic of the code was to count every possible entry in
KMSDRM_DRI_PATH. After this a for loop would start trying to open
filename0, filename1, filename2, etc. In recent Linux kernels (say
5.18) with simpledrm, the lowest KMSDRM_DRI_DEVNAME is often
/dev/dri/card1, rather than /dev/dri/card0, causing the code to fail
once /dev/dri/card0 has failed to open. Running:

modprobe foodrm && modprobe bardrm && rmmod foodrm

before you try to run an application with SDL KMSDRM would have also
made this fail.

* Various changes from review

- Removed newline and period from SDL error
- Explicitely compare memcmp to zero (also changed to SDL_memcmp)
- Changed memcpy to strncpy
- Less aggressive line wrapping

* Various changes from review

- strncpy to SDL_strlcpy
- removed size hardcodings for KMSDRM_DRI_PATHSIZE and
  KMSDRM_DRI_DEVNAMESIZE
- made all KMSDRM_DRI defines, run-time variables to reduce bugs caused
  by these defines being more build-time on Linux and more run-rime on
  OpenBSD
- renamed openbsd69orgreater variable to moderndri
- altered comment from "if on OpenBSD" to add difference in 6.9

* Various changes from review

- Use max size of destination, rather than max size of source
- Less hardcodings
2022-07-06 09:00:16 -07:00
..
atomic Added include: libkern/OSAtomic.h 2022-07-05 07:50:57 -07:00
audio Fix C89 declaration for macOS modules. 2022-06-27 15:19:40 -07:00
core make SDL_SetTextInputRect take a pointer to const 2022-07-04 09:38:01 -07:00
cpuinfo Use proper header for OpenBSD PPC CPU detection 2022-06-27 11:01:34 -07:00
dynapi make SDL_SetTextInputRect take a pointer to const 2022-07-04 09:38:01 -07:00
events Xbox GDKX support (#5869) 2022-07-01 13:59:14 -07:00
file Xbox GDKX support (#5869) 2022-07-01 13:59:14 -07:00
filesystem Improving mkdir creating parents folder 2022-07-03 09:23:34 -07:00
haptic Xbox GDKX support (#5869) 2022-07-01 13:59:14 -07:00
hidapi Fix C89 declaration for macOS modules. 2022-06-27 15:19:40 -07:00
joystick Xbox GDKX support (#5869) 2022-07-01 13:59:14 -07:00
libm Add some PS2 flags 2022-06-15 15:15:26 -07:00
loadso use SDL_InvalidParamError or SDL_assert instead of custom SDL_SetError 2022-01-28 20:40:19 -05:00
locale Vita: add SDL_GetPreferredLocales support 2022-03-29 15:02:21 -07:00
main Improve SDL2 main, adding memory card and usb drivers 2022-06-29 03:15:00 +03:00
misc Xbox GDKX support (#5869) 2022-07-01 13:59:14 -07:00
power Don't fail to get battery status if the upower refresh call fails 2022-02-04 14:02:44 -08:00
render Xbox GDKX support (#5869) 2022-07-01 13:59:14 -07:00
sensor Removed problematic call to ISensor_SetEventSink() 2022-03-17 10:01:13 -07:00
stdlib Fix fallback implementations of SDL_strchr and SDL_strrchr for '\0' 2022-07-04 11:10:26 -04:00
test Xbox GDKX support (#5869) 2022-07-01 13:59:14 -07:00
thread Xbox GDKX support (#5869) 2022-07-01 13:59:14 -07:00
timer Xbox GDKX support (#5869) 2022-07-01 13:59:14 -07:00
video Fix assumption that DRI_DEVNAME begins at 0 (#5865) 2022-07-06 09:00:16 -07:00
SDL.c Xbox GDKX support (#5869) 2022-07-01 13:59:14 -07:00
SDL_assert.c Windows GDK Support (#5830) 2022-06-27 10:19:39 -07:00
SDL_assert_c.h Updated copyright for 2022 2022-01-03 09:40:21 -08:00
SDL_dataqueue.c Updated copyright for 2022 2022-01-03 09:40:21 -08:00
SDL_dataqueue.h Updated copyright for 2022 2022-01-03 09:40:21 -08:00
SDL_error.c Fix SIGSEV in SDL_error (After removing the limit on the size of the SDL error message) (see #5795) 2022-06-28 09:46:12 +02:00
SDL_error_c.h Removed the limit on the size of the SDL error message 2022-06-27 16:59:50 -07:00
SDL_guid.c Refactoring: move GUID operations out of Joystick 2022-06-04 17:22:13 -07:00
SDL_hints.c SDL_SetHintWithPriority: actually, this test is good. 2022-06-06 10:55:29 -04:00
SDL_hints_c.h Updated copyright for 2022 2022-01-03 09:40:21 -08:00
SDL_internal.h Fix enabling SDL_DYNAMIC_API in OpenWatcom builds 2022-05-19 20:11:10 +03:00
SDL_list.c Add SDL_list.c/h 2022-04-01 08:01:44 +02:00
SDL_list.h Add SDL_list.c/h 2022-04-01 08:01:44 +02:00
SDL_log.c android: Add missing entries to SDL_category_prefixes table. 2022-07-05 17:50:19 -07:00
SDL_log_c.h Added declaration of SDL_LogInit() and SDL_LogQuit() 2022-04-28 15:01:34 -07:00