Commit graph

11361 commits

Author SHA1 Message Date
Jools Wills
1ebd3293e9
Revert "Revert "Modesetting support for KMSDRM driver"" 2020-01-03 00:19:02 +00:00
Jools Wills
227b61683c
Merge pull request #17 from RetroPie/revert-16-retropie-2.0.10_modeset
Revert "Modesetting support for KMSDRM driver"
2020-01-01 05:51:20 +00:00
Jools Wills
63270f2df0
Revert "Modesetting support for KMSDRM driver" 2020-01-01 05:42:50 +00:00
Jools Wills
04a4692bb7
Merge pull request #16 from psyke83/retropie-2.0.10_modeset
Modesetting support for KMSDRM driver
2019-12-31 05:33:47 +00:00
Conn O'Griofa
6b1e8ac6dd kmsdrm: enable aspect ratio support
Enable the DRM_CLIENT_CAP_ASPECT_RATIO cap to communicate aspect
ratio information via mode flags, making additional modes available.
2019-11-19 16:57:12 +00:00
cmitu
6113b056a2 KMSDRM_VideoInit: add hints for overriding the default video mode 2019-11-17 08:32:16 +00:00
Sylvain Becker
1509ccac91 Fixed bug 4798 - PNG w/transparency breaks in SDL 2.0.10 but works in SDL 2.0.9 2019-09-11 11:37:48 +01:00
Conn O'Griofa
23b9113ec9 KMSDRM_GLES_SwapWindow: fix non-vsync case
If KMSDRM_drmModeSetCrtc is called when the swap interval is
set to 0, the driver behaves as though vertical sync is engaged by
limiting framerate to the refresh rate, but performance is much worse
than with vertical sync enabled.

Resolve this issue by ensuring that the Crtc is only set up once,
and KMSDRM_drmModePageFlip is called, albeit without any followup
queueing or waiting for flips.
2019-09-11 11:37:47 +01:00
Ozkan Sezer
c9f99401db RPI_FreeCursor: set global_cursor to NULL to prevent double-free (bug 4769) 2019-09-11 11:37:47 +01:00
Conn O'Griofa
c7e1c332e3 SDL_EGL_ChooseConfig: don't fall through if no matching format exists
On Raspberry Pi 3 via the VC4 driver in firmware KMS mode, none of the
found configs match the desired format, causing the function to fall through
without any config being selected.

Fix by first iterating over the found configs, and if no match exists,
don't exclude the non-matching configs. This should fix RPI3 and possibly other
targets without breaking targets that have a matching native format (such as RPI4).
2019-09-11 11:37:04 +01:00
Conn O'Griofa
2db72c1511 Improve kmsdrm + rpi driver coexistence
* Ensure that DEFAULT_OGL is set correctly (fixes OpenGL)
* Silence kmsdrm driver init error when using VideoCore.
* Remove VideoCore cflags from SDL_CFLAGS; these flags are unnecessary
  and will cause conflicts when building SDL2 applications for VC4.
2019-09-03 02:24:04 +01:00
Nicolas Adenis-Lamarre
57b95ddd3b fix sdl2 joystick events after joystick closed
See: https://bugzilla.libsdl.org/show_bug.cgi?id=4640
2019-08-07 11:30:17 +01:00
Jools Wills
65b77e23ab mali-fbdev support
* mali-fbdev support from https://github.com/mihailescu2m/libsdl2-2.0.2-dfsg1 with changes for newer SDL
2019-08-07 02:18:51 +01:00
Stefan
9ae0a812a1 rpi video - Use dispmanx scaling (#1)
* Use dispmanx scaling
* There is the new SDL hint SDL_VIDEO_RPI_SCALE_MODE. There are three values.
 * The variable can be set to the following values:
 *   "0"       - Window resolution is desktop resolution.
 *               This is the behaviour of SDL <= 2.0.4. (default)
 *   "1"       - Requested video resolution will be scaled to desktop resolution.
 *               Aspect ratio of requested video resolution will be respected.
 *   "2"       - Requested video resolution will be scaled to desktop resolution
 *   "3"       - Integer scaling. dst_rect is an integral multiple of src_rect. Should prevent scaling artifacts.
* Add aspect ratio hint
2019-08-07 02:05:56 +01:00
Jools Wills
110c83c15f packaging fixes -
* updated debian/control to match debian/ubuntu package names
 * fix libudev dependency
 * rename libsdl2.install -> libsdl2-2.0-0.install
2019-08-07 02:05:14 +01:00
Jools Wills
475ce1988d Revert "Linux joystick: Look at entire axis namespace for controls (thanks, "spaz16"!)."
This reverts commit 4cb7923f25.

see https://github.com/RetroPie/RetroPie-Setup/issues/1297
2019-08-07 02:05:04 +01:00
Andrew Eikum
b71dec57ab hidapi: Zero out new hid_device_info structs 2019-07-23 14:41:00 -05:00
Ethan Lee
7a84f02172 Copypaste SDL_NSLog to UIKit backend, document it as such 2019-07-17 23:20:57 -04:00
Sam Lantinga
c4c43627bb Fixed bug 4726 - Fix for tvOS GetPrefPath
Caleb Cornett

Unlike iOS and macOS, tvOS does not have any persistent local storage. In fact, the ApplicationSupport directory pointed to by the existing Cocoa GetPrefPath() throws an error whenever any attempt is made to access it. To get any local storage on an Apple TV, our only option is to use a temporary cache directory.

This patch changes the tvOS PrefPath to this cache directory and also logs a critical warning that this if developers want their save data to persist across game sessions, they must use some form of iCloud storage.
2019-07-18 19:33:17 -07:00
Sam Lantinga
c0871789d5 Fixed build error 2019-07-17 16:47:19 -07:00
Sam Lantinga
6e1595997a Merged latest changes from Steam into controller_type.h 2019-07-17 16:47:17 -07:00
Sam Lantinga
6a313250ad Add linked list of opened HID devices to prevent accessing already freed devices in device removal callback that is sometimes called even after being unregistered 2019-07-17 16:47:13 -07:00
Sam Lantinga
d5f6eda1b2 Added support for the Victrix Pro Fight Stick for PS4 2019-07-17 13:01:44 -07:00
Cameron Gutman
bdb24dc076 Allow hotplugging joysticks without udev 2019-06-24 21:08:26 -07:00
Sam Lantinga
c5309610f9 Fixed bug 4704 - SDL_HINT_ANDROID_SEPERATE_MOUSE_AND_TOUCH on Windows?
superfury

I notice that, somehow, when locking the mouse into place(using SDL_SetRelativeMouseMode), somehow at least the movement information gets through to both mouse movement and touch movement events?

My app handles both, so when moving a touched finger accross the app(using RDP from an Android device) I see the mouse moving inside the app when it shouldn't(meaning that the touch movement is ignored properly by the app(press-location dependant) but the mouse movement is still performed due to the mouse movement events)?
2019-07-15 09:36:53 -07:00
Sam Lantinga
6e31658d7c Fixed bug 4723 - Generic Xbox pad controller bindings seem odd/broken
alexrice999

I have a knock off wired xbox 360 controller called afterglow for xbox 360 controller. Despite there being a few afterglow controllers in the controller mapping the guid of my controller seems to map to Generic Xbox pad. This binding is as follows:
```
 "030000006f0e00001304000000010000,Generic X-Box pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:a0,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:a3,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
```
When running openmw I have a strange issue that the joysticks work for up and down movements but not for side to side. I managed to track this down to the side to side events being classified as joystick events instead of gamepad events.
I believe this is due to both "leftstick" and "leftx" being bound to "a0" which seems odd to me. If I change openmw's mappings to remove these the controller works as expected. I was hoping someone who knows a lot more than me (as I have only been exploring this today trying to fix my controller) would know what is happening
2019-07-14 16:59:39 -07:00
Jimb Esser
f300711f50 Blacklist Corsair device causing hang 2019-07-14 16:48:31 -07:00
Alex Szpakowski
60cae8d8af macOS: Fix SDL_GL_CreateContext/MakeCurrent on non-main threads causing a Main Thread Checker warning when built with Xcode 11 / the macOS 10.15 SDK.
Fixes bug #4714.
2019-07-13 17:04:02 -03:00
Ryan C. Gordon
5ad9adcc0e ios: Fixed MFi guide button not being detected (thanks, Caleb!).
Fixes Bugzilla #4721.
2019-07-12 21:28:43 -04:00
Ryan C. Gordon
85acfec543 cmake: Add setupapi library to Windows build dependencies (hidapi needs it).
Fixes Bugzilla #4719.
2019-07-12 13:40:58 -04:00
Ryan C. Gordon
1ceddc5a20 cocoa: Set keyboard mod state correctly when turning off capslock.
Fixes Bugzilla #4716.

--HG--
extra : rebase_source : 5b360391f52cf3a4655f9bd3a7f4a2ad0c487851
2019-07-11 01:07:14 -04:00
Sylvain Becker
aec1d08f5a x11: prevent a synthetic mouse event when using a touchscreen
With multitouch, register to receive XI_Motion (which desctivates MotionNotify),
so that we can distinguish real mouse motions from synthetic one.

(bug 4690)
2019-07-10 10:06:28 +02:00
Ryan C. Gordon
2196977939 x11: set some modality things on message boxes with parent windows.
--HG--
extra : amend_source : 48628fd472f064256c194505f50c2e4bb040f03a
2019-07-09 17:28:02 -04:00
Sylvain Becker
ecbbaa8996 SDL_Mouse/Touch: discard synthetic events when hints are not set.
Those are generated/flagged by platform layer.
2019-07-09 11:46:42 +02:00
Ozkan Sezer
40cd461506 fix permissions 2019-07-09 08:55:00 +03:00
Ryan C. Gordon
d94ce6c016 cmake: Added HIDAPI support.
--HG--
extra : rebase_source : 0b5f91722b2552f1f047e67a1f9c6a19be93c20d
2019-07-08 16:46:52 -04:00
Ryan C. Gordon
1f7b118b31 configure: Windows and macOS now respect --enable-hidapi.
(and it defaults to "yes" on those platforms. Other places, which use libusb,
still default to no because they probably need root permissions to work.)

--HG--
extra : rebase_source : a1e87bb21658338374c94701860e90eacd90c6ea
2019-07-08 16:08:16 -04:00
Cameron Gutman
894d41096c Ignore synthetic mouse events generated for touchscreens
Windows generates fake raw mouse events for touchscreens for compatibility
with legacy apps that predate touch support in Windows. We already handle
touch events explicitly, so drop the synthetic events to avoid duplicates.
2019-07-07 11:23:16 -07:00
Ryan C. Gordon
aef73dd969 cocoa: Another attempt at mouse vs touch support.
This time, we make anything we think is a MacBook trackpad report its touches
as SDL_MOUSE_TOUCHID, even though they're not _actually_ synthesized events,
and let all mouse input--even if the OS synthesized it from a multitouch
trackpad on our behalf--look like physical input. This is backwards from
reality, but produces the results most apps will expect.

Note that if you have a real touch device that doesn't appear to be the
trackpad, it'll produce real touch events with unique device ids, so it's
not a total loss here, but also note that the way we decide if it was the
trackpad is an imperfect heuristic; it happens to work out right now, but
it's not impossible that a real touchscreen could come to the Mac at some
point and (incorrectly?) call it a "mouse" input, etc.

But for now, good enough.

Fixes Bugzilla #4690.
2019-07-08 13:41:01 -04:00
Sam Lantinga
8c8d26cd8f Fixed bug 4710 - audio/alsa: avoid configuring hardware parameters with only a single period
Anthony Pesch

The previous code first configured the period size using snd_pcm_hw_par-
ams_set_period_size_near. Then, it further narrowed the configuration
space by calling snd_pcm_hw_params_set_buffer_size_near using a buffer
size of 2 times the _requested_ period size in order to try and get a
configuration with only 2 periods. If the configured period size was
larger than the requested size, the second call could inadvertently
narrow the configuration space to contain only a single period.

Rather than fixing the call to snd_pcm_hw_params_set_buffer_size_near
to use a size of 2 times the configured period size, the code has been
changed to use snd_pcm_hw_params_set_periods_min in order to more
clearly explain the intent.
2019-07-07 09:10:56 -07:00
Sam Lantinga
f19f7b7741 Fixed bug 4707 - SDL_SetRelativeMouseMode fails on Vivante
Cameron Gutman

The bugfix in https://hg.libsdl.org/SDL/rev/ba1a66b57385 caused SDL_SetRelativeMouseMode() to begin failing on Vivante (Steam Link). Even though Vivante doesn't have a SetRelativeMouseMode() or WarpMouse() function, it's in relative mode already (because it uses evdev) so the function was actually working as intended.

I think providing a no-op SetRelativeMouseMode() function for Vivante is a reasonable fix. Since it's already getting relative events through evdev, it really is a no-op to "enter relative mode".

In fact, this is probably the right thing to do for all backends that use evdev (vivante, raspberry, and kmsdrm). Raspberry and kmsdrm both have WarpMouse() implementations so SDL_SetRelativeMouseMode() isn't failing there, but it still seems to make sense not to have to do the fake warping if they're evdev-based anyway.
2019-07-03 15:57:55 -07:00
Sylvain Becker
f937c8e7b4 Fixed bug 4702 - Android back button does not send SDL_KEYDOWN event
fallback when event.getSource() is SOURCE_UNKNOWN
2019-07-03 13:37:54 +02:00
Sam Lantinga
41ee61e718 Fixed bug 4708 - testdropfile: double-free
Juha Niemimäki

SDLTest_CommonEvent seems to free the file name so testdropfile prints some garbage to console and crashes when freeing the name again.
2019-07-03 02:37:15 -07:00
Ryan C. Gordon
bba68b14bb raspberry: Actually commit the whole patch. :) (Thanks, Joe!)
Fixes Bugzilla #4699.
2019-07-02 16:49:35 -04:00
Ryan C. Gordon
9fd62317a4 cocoa: Don't report trackpad mouse events as synthesized touches.
Fixes Bugzilla #4690, sort of. I guess.
2019-07-02 12:29:36 -04:00
Ryan C. Gordon
81ed2b286b raspberry: Fixed missing mouse cursor (thanks, Joe!)
"Starting with changeset 12433, the mouse cursor is not displayed on the
Raspberry Pi platform, due to a bug in the handling of the new
"global_cursor" in RPI_ShowCursor(). Currently, if cursor == global_cursor,
the function immediately returns 0. The function should not return here.
Instead, if cursor == global_cursor, it shouldn't try to hide the current
cursor and update global_cursor = cursor. However, it *should* still continue
through the rest of the function."

Fixes Bugzilla #4699.
2019-07-02 10:26:54 -04:00
Ryan C. Gordon
df3ddbe0b2 dbus: Don't SimulateUserActivity if we're already inhibiting the screensaver. 2019-07-02 09:43:26 -04:00
Ryan C. Gordon
6ebf6310e0 dbus: Add org.freedesktop.ScreenSaver.SimulateUserActivity support. 2019-07-02 09:38:31 -04:00
Alex Szpakowski
da0ede5e21 iOS: Fix the window size not being set properly when Split View is used on an iPad (bug #4586). 2019-07-01 14:52:56 -03:00
Sam Lantinga
6356c53dc5 Made it more explicit that 2.0.10 and newer are required for the SDL_RW* functions 2019-07-01 09:05:15 -07:00