Commit Graph

6650 Commits (bdc6e4ffc5db34940b11bb63e2379bcf194ed990)

Author SHA1 Message Date
Manuel Alfayate Corchete 8766d6040b [Video/KMSDRM] Fix potetial access to freed structure and complete errorchecks. 2020-12-21 17:29:24 +01:00
Manuel Alfayate Corchete b06ef3a18c [Video/KMSDRM] Manually re-show the cursor on window creation, if needed. 2020-12-21 01:53:11 +01:00
Ozkan Sezer 4198f0e52c fix uninitialized warnings in KMSDRM_CreateCursor() 2020-12-21 01:20:30 +03:00
Manuel Alfayate Corchete a8dbcab132 [Video/KMSDRM] Don't copy the cursor bitmap to the cursor GBM BO until we're showing it. 2020-12-20 21:48:05 +01:00
Sam Lantinga 67e9132dd5 Fixed circular dependency problem when building in the test directory 2020-12-20 12:22:28 -08:00
Sam Lantinga ee180efda7 Fixed bug 5406 - Upstreaming DragonFlyBSD changes from DeltaPorts (patch from David Carlier) 2020-12-20 12:08:49 -08:00
Ozkan Sezer 22275b35e4 cmake: fix building for mac (bug #5407.) 2020-12-20 21:55:02 +03:00
Manuel Alfayate Corchete 2756b0f337 [Video/KMSDRM] Init and deinit mouse stuff at the same time that GBM stuff. 2020-12-20 14:29:58 +01:00
Ozkan Sezer e91153f278 fix non-ARM h/w on FreeBSD builds (bug #5405, patch from David Carlier.) 2020-12-20 03:03:21 +03:00
Manuel Alfayate Corchete cf71e01734 [Video/KMSDRM] Remove auxiliary AMDGPU compatibility workarounds not needed anymore. 2020-12-19 23:32:09 +01:00
Manuel Alfayate Corchete af1f91cb36 [Video/KMSDRM] Correct typo. 2020-12-19 20:21:07 +01:00
Manuel Alfayate Corchete cf48955680 [Video/KMSDRM] Honor the device index in Vulkan. Add notes about the display index. 2020-12-19 20:15:50 +01:00
Manuel Alfayate Corchete ab3a390e26 [Video/KMSDRM] Better ATOMIC caps testing: patch by Oskan Sezer. 2020-12-19 17:35:04 +01:00
Manuel Alfayate Corchete 436499f3ec [Video/KMSDRM] Comment out some debug info, adjust comments for future work. 2020-12-19 02:08:59 +01:00
Ozkan Sezer 6b81cac420 remove duplicated SDL_SetError after calling check_atomic_modesetting() 2020-12-19 01:25:50 +03:00
Manuel Alfayate Corchete 8952a61324 [Video/KMSDRM] Re-arrange display members setup. 2020-12-18 23:17:42 +01:00
Manuel Alfayate Corchete f60f8d5d84 [Video/KMSDRM]: Add Vulkan support to the KMSDRM backend. 2020-12-18 22:53:51 +01:00
Sam Lantinga cbe13d232d Fixed controller hotplug detection when joystick thread is not enabled 2020-12-18 13:10:36 -08:00
Ozkan Sezer 6ac0b23d3a SDL_DirectFB_video.c: DSPF_ABGR requires directfb >= 1.5.0 -- add guard. 2020-12-18 21:37:20 +03:00
Sam Lantinga f0577bc9ea ControllerList: setup the ps5 default deadzone to match PS4 instead of defaulting to same a XboxOne/Switch 2020-12-18 10:09:06 -08:00
Sam Lantinga 5f7cd1fa88 Added hints to control whether SDL updates joystick and sensor state in the main event loop 2020-12-18 10:08:59 -08:00
Ozkan Sezer 6c4ab48471 SDL_kmsdrmvideo.c: check atomic modesetting in check_modesetting()
.. so that KMSDRM_CreateDevice() can fail and SDL_VideoInit() would
move on to next bootstrap member which is kmsdrm_legacy.  hopefully
fixes bug #5393.
2020-12-18 17:50:02 +03:00
Ozkan Sezer 5c654d0df4 tests: regenerate configure using autoconf patched for AC_PATH_X11
Specifically this patch which does not invoke _AC_PATH_X_XMKMF and
_AC_PATH_X_DIRECT internal autoconf routines when cross-compiling:
http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=33c3a47c04ab70a4dd54963fe433a171bc03747f

Without this, CFLAGS would brokenly have system include paths like
-I/usr/include/X11 when cross-compiling e.g. for windows.  (And it
also resulted in annoying imake crashes for my setup...)
2020-12-18 17:00:00 +03:00
Sam Lantinga 6bd4c717a1 Fixed bug 5402 - ARM support little update proposal
David Carlier

No fix but mostly an update for ARM architecture.
2020-12-17 21:41:23 -08:00
Ozkan Sezer 10625f9d89 SDL_windowsmessagebox.c: go back to hg rev 14458 state.
encountering a NULL caption in AddDialogString() is intended, i.e.
AddDialogStaticIcon() sends it as NULL on purpose.
2020-12-17 23:50:00 +03:00
Ozkan Sezer 4d6eb30523 SDL_windowsmessagebox.c (AddDialogControl): add back NULL caption check.
because AddDialogStaticIcon() sends a NULL caption -- fixes bug #5401.
2020-12-17 23:28:20 +03:00
Ozkan Sezer 90456670b5 more "'for' loop initial declarations are only allowed in C99 mode" fixes 2020-12-17 14:11:00 +03:00
Ozkan Sezer ed4fcb2cfc kmsdrm_legacy build fixes:
- add missing '_LEGACY' to symbol names
- perform missing 2.0.14 portage
- fix 'for' loop initial declarations are only allowed in C99 mode errors
2020-12-16 03:24:10 +03:00
Sam Lantinga f484abbdc8 Added Android mapping for the Xbox One Series X controller over Bluetooth 2020-12-15 14:57:51 -08:00
Sam Lantinga cdd397118f Fixed the Xbox Series X controller showing up twice on Android 2020-12-15 14:57:49 -08:00
Sam Lantinga 14f977348d Fixed whitespace 2020-12-15 14:57:47 -08:00
Ozkan Sezer 9940e71088 Import two post-2.0.12 fixes to kmsdrm_legacy:
Fix build breakage without EGL:
https://hg.libsdl.org/SDL/rev/f2606fe53654e305ab9badb821d9d3afb7f92f49

Fix KMSDRM_CreateWindow segfault when starting L?VE2D engine (bug 5199)
https://hg.libsdl.org/SDL/rev/d2e69a78939463d9ff9448a5f4efd1e208bb97b0
2020-12-16 00:10:30 +03:00
Sam Lantinga f8839289b0 Potential fix for bug 5393 - KMSDRM: using atomic mode setting breaks GPU compatibility
Substring

I was trying the KMSDRM video backend with some very simple programs that were working ok on 2.0.12. The same code won?t work on the current dev branch and I get:

DEBUG: check_modesetting: probing ?/dev/dri/card0?
DEBUG: /dev/dri/card0 connector, encoder and CRTC counts are: 4 5 6
DEBUG: check_modesetting: probing ?/dev/dri/card0?
DEBUG: /dev/dri/card0 connector, encoder and CRTC counts are: 4 5 6
DEBUG: KMSDRM_VideoInit()
DEBUG: Opening device /dev/dri/card0
DEBUG: Opened DRM FD (3)
DEBUG: no atomic modesetting support.
DEBUG: Video subsystem has not been initialized
INFO: Using SDL video driver: (null)
DEBUG: Video subsystem has not been initialized

After carefully checking, the radeon driver doesn?t support atomic modesetting. That?s not the only problem : the same happens with the amdgpu driver if we disable Display Core (kernel parameter amdgpu.dc=0, which is required to get analogue outputs working).

This is a major regression in the KMSDRM driver.

Using atomic mode setting is great, but having no fallback to the "standard KMS" is bad.
2020-12-15 12:22:48 -08:00
Ozkan Sezer c02d88dd12 configury whitespace cleanup (no actual change.) 2020-12-15 23:01:10 +03:00
Sam Lantinga 6cb78120d4 Fixed bug 5399 - make install is broken as it depends on missing rule `build`
Stephen Broadfoot

I've tracked this down to the following changeset bb65ba8e039b

https://hg.libsdl.org/SDL/diff/bb65ba8e039b/Makefile.in

this changeset renames the rule `build` to `build/.created` but the rule `install-lib` still depends on the rule `build`

This affects users who are trying to install via homebrew who are installing via source and not by the bottle as this invokes `make install`

To be clear, the error I was hitting when running make install is

make: *** No rule to make target `build', needed by `install-lib'.  Stop.
2020-12-15 00:42:17 -08:00
Ozkan Sezer 716ac535d8 test/acinclude.m4: rename SDL_CONFIG to SDL2_CONFIG, regenerate configure 2020-12-15 01:20:00 +03:00
Ozkan Sezer 637d425e3e whitespace. 2020-12-15 00:11:10 +03:00
Ethan Lee f1c7cc710b winrt: Buildfix for older UWP SDKs 2020-12-14 12:36:04 -05:00
Sam Lantinga e65e4fd3ef Fixed detecting the guide button on Xbox One S controllers over Bluetooth on Linux 2020-12-14 09:48:51 -08:00
Ethan Lee 169cfe5a7c winrt: EffectiveLocation still needs an ifdef, IsApiContractPresent is for runtime 2020-12-14 11:52:09 -05:00
Sam Lantinga bfffa275ef Fixed bug 5397 - Fcitx input is truncated
sowfelicity

Split the long text input event into multiple shorten text input event.
2020-12-14 09:23:53 -08:00
Sam Lantinga 8795ca7067 Fixed bug 5241 - SDL on Linux needs a way to turn deadzones off
pj5085

I added some printf to verify the math being done.  Of the three joysticks I have, it works correctly for at least two, and seems to work correctly for the third.  I say "seems to" because, for the third joystick, the values never go through the AxisCorrect function, and thus never hit my printf statements, even though they did in the version I wrote my patch against.  I'm not sure what's going on there, but it at least seems to be working correctly in as much as I can tell.

I note this result in particular, for an SNES Gamepad (min=0, max=255):

Joystick value 0 becomes -32768
Joystick value 127 becomes 0
Joystick value 255 becomes 32767

Without the code that forces a zero point, the 127 input value would become -129, so I think you see why I added that code to turn it into zero.  However, I think Kai Krakow has a point about how SDL shouldn't assume that there should be a center.

Obviously in the majority of cases there actually should be a center, and the code that turns that 127 into an actual 0 is creating only a 0.2% error over 0.4% of this joystick's range.  However, what if there is an axis that is some kind of special control, like a 4-position switch, and, for whatever reason, the joystick reports it as an axis with 4 possible values, 0 to 3?  In that case, mutilating the two center values to the same value is much more of an error and and turns that 4-position switch into a 3-position switch.  If any joystick does this with a 2-position switch, then this code would render that control entirely useless as it would report the same value with the switch in either position.  Obviously the code could require that there be at least N possible values, to guess whether something is a proper axis or just some kind of switch, but the choice of N would be arbitrary and that's ugly.

I guess the real problem here is that my gamepad is just kind of broken.  It should be reporting a range of -1 to +1 since that's what it actually does.  Also, as Kai Krakow points out, it's probably not SDL's place to fix broken hardware.  I'll add that, if SDL does fix broken hardware, it should probably actually know that it's broken rather than be merely guessing that it is.

So, to the extent that SDL is able to do stuff like this, perhaps it's something better left for the user to configure in some kind of config file.
2020-12-14 09:15:47 -08:00
Ozkan Sezer 44d4a61d92 minor cleanups to configure.ac to reduce autoconf-2.70 warnings a bit.
configure output is practically unchanged. there are still lots of
AC_TRY_COMPILE/AC_TRY_LINK replacements needed to really eliminate
the warnings, but that's for another time.
2020-12-14 08:11:40 +03:00
Ozkan Sezer f8078d3d6c configure.ac: use AC_DEFINE for SDL_VIDEO_DRIVER_ANDROID 2020-12-14 05:55:20 +03:00
Ozkan Sezer 3c2757ff89 windows SDL_LoadObject: fix warning after commit 2ff650230d96 2020-12-13 18:25:02 +03:00
Ozkan Sezer 15cbddf497 linux/SDL_threadprio.c: fix build on older systems:
SCHED_RESET_ON_FORK is in kernel >= 2.6.32.
2020-12-13 18:00:20 +03:00
Ozkan Sezer 3b92933ac6 SDL_LoadObject (windows, os/2): prevent crash if dll name is NULL. 2020-12-13 17:37:50 +03:00
Ozkan Sezer f674009c56 fix typo from commit 63349df2610a (fixes bug 5396) 2020-12-13 16:51:20 +03:00
Ozkan Sezer b6e63625c8 fix bug #5395: handle old systems where inotify_init1 is not available 2020-12-13 15:32:24 +03:00
Sam Lantinga ee85a41a32 Fixed compile warning 2020-12-13 02:10:46 -08:00