Wed, 25 Mar 2020 09:38:45 -0700src/video/kmsdrm/SDL_kmsdrmvideo.c: fix build
Fabrice Fontaine <fontaine.fabrice@gmail.com> [Wed, 25 Mar 2020 09:38:45 -0700] rev 13672
src/video/kmsdrm/SDL_kmsdrmvideo.c: fix build
Build is broken without EGL since version 2.0.12 and
https://hg.libsdl.org/SDL/rev/9761858bd6a3:

/home/giuliobenetti/autobuild/run/instance-1/output-1/build/sdl2-2.0.12/src/video/kmsdrm/SDL_kmsdrmvideo.c: In function 'KMSDRM_CreateSurfaces':
/home/giuliobenetti/autobuild/run/instance-1/output-1/build/sdl2-2.0.12/src/video/kmsdrm/SDL_kmsdrmvideo.c:394:5: error: unknown type name 'EGLContext'
EGLContext egl_context;
^

Fixes:
- http://autobuild.buildroot.org/results/fafd20a01591032662f9ca025fcea3478239cf3c

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Tue, 24 Mar 2020 10:05:51 -0700src/video/directfb/SDL_DirectFB_render.c: fix build
Fabrice Fontaine <fontaine.fabrice@gmail.com> [Tue, 24 Mar 2020 10:05:51 -0700] rev 13671
src/video/directfb/SDL_DirectFB_render.c: fix build
Build with directfb is broken due to a spurious '}' and a missing 'E'
since version 2.0.12 and https://hg.libsdl.org/SDL/rev/2d5b5a5ccbfb:

/home/buildroot/autobuild/run/instance-2/output-1/build/sdl2-2.0.12/src/video/directfb/SDL_DirectFB_render.c: In function 'SetBlendMode':
/home/buildroot/autobuild/run/instance-2/output-1/build/sdl2-2.0.12/src/video/directfb/SDL_DirectFB_render.c:202:9: error: case label not within a switch statement
202 | case SDL_BLENDMODE_MUL:
| ^~~~

/home/buildroot/autobuild/run/instance-2/output-1/build/sdl2-2.0.12/src/video/directfb/SDL_DirectFB_render.c:205:67: error: 'DSBF_DSTCOLOR' undeclared (first use in this function); did you mean 'DSBF_DESTCOLOR'?
205 | SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_DSTCOLOR));
| ^~~~~~~~~~~~~

Fixes:
- http://autobuild.buildroot.org/results/83ccefee68c2800c0544e6f40fa8bc8ee6b67b77

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Mon, 23 Mar 2020 14:10:25 -0700Don't check the HIDAPI driver for the virtual device created by xow
Sam Lantinga <slouken@libsdl.org> [Mon, 23 Mar 2020 14:10:25 -0700] rev 13670
Don't check the HIDAPI driver for the virtual device created by xow

Mon, 23 Mar 2020 12:10:05 -0700Fixed bug 5052 - Interval between SDL_SENSORUPDATE events for gyroscopes is too high
Sam Lantinga <slouken@libsdl.org> [Mon, 23 Mar 2020 12:10:05 -0700] rev 13669
Fixed bug 5052 - Interval between SDL_SENSORUPDATE events for gyroscopes is too high

Andrei Kortunov

Hello. I try to implement an application for Android, which uses a new sensors API from 2.0.9 to control a camera rotation via built-in gyroscope, using the code from the test/testsensor.c as an example.

Gyroscope input itself works well, but an interval between SDL_SENSORUPDATE events is about 200ms (the SENSOR_DELAY_NORMAL, I believe), when I need the interval about 20-40ms (the SENSOR_DELAY_GAME or SENSOR_DELAY_FASTEST).

Mon, 23 Mar 2020 14:54:31 -0400iOS: fixed bug whereby some SDL testing apps weren't launching
David Ludwig <dludwig@pobox.com> [Mon, 23 Mar 2020 14:54:31 -0400] rev 13668
iOS: fixed bug whereby some SDL testing apps weren't launching

Test apps in Xcode-iOS/Test/TestiPhoneOS.xcodeproj weren't launching
in the most-recent release of Xcode and the iOS Simulator (version 11.3.1).
This was caused by their shared Info.plist file not defining a
CFBundleShortVersionString (as reported by Xcode, when launching a test
app from within Xcode).

Sun, 22 Mar 2020 20:09:14 -0400Do not overwrite window surface created by driver
Jay Petacat <jay@jayschwa.net> [Sun, 22 Mar 2020 20:09:14 -0400] rev 13667
Do not overwrite window surface created by driver

If a driver's implementation of CreateWindowFramebuffer sets the window
surface, use that rather than overwriting it. A driver may set the window
surface if data cannot be passed via the CreateWindowFramebuffer output
parameters (e.g. surface palette colors).

Mon, 23 Mar 2020 11:42:44 -0700Fixed building back to Mac OSX using the 10.7 SDK
Sam Lantinga <slouken@libsdl.org> [Mon, 23 Mar 2020 11:42:44 -0700] rev 13666
Fixed building back to Mac OSX using the 10.7 SDK

Sun, 22 Mar 2020 22:03:38 -0400alsa: Fix excessive I/O causing higher CPU usage SDL-1.2
Ryan C. Gordon <icculus@icculus.org> [Sun, 22 Mar 2020 22:03:38 -0400] rev 13665
alsa: Fix excessive I/O causing higher CPU usage

"On GCW Zero jz4770 platform, I saw higher than usual CPU usage when
running a more recent kernel (4.xx series versus 3.xx). Upon
investigation, it was found that the ALSA pcm file was not blocking
as it should. This resulted in ~30-50,000 system calls a second that
were unnecesary.

After adjusting the order in which SDL requests its pcm blocking mode,
the number of syscalls a second has dropped to a much smaller figure,
< 1,000/sec if I recall correctly. CPU usage also dropped by ~5%."

(This patch was written by Daniel Silsby.)

Fixes Bugzilla #4941.

Sun, 22 Mar 2020 14:32:47 -0400opengl: Don't enable/disable texturing except when actually rendering.
Ryan C. Gordon <icculus@icculus.org> [Sun, 22 Mar 2020 14:32:47 -0400] rev 13664
opengl: Don't enable/disable texturing except when actually rendering.

Otherwise our cached state goes out of sync when updating a texture. Since
these state changes aren't necessary, they were removed instead of updating
the cached state.

Fixes Bugzilla #4998.

Sun, 22 Mar 2020 11:01:14 -0700Fixed bug 5051 - Switch Pro Controller hidapi driver does not report battery levels when connected via Bluetooth
Sam Lantinga <slouken@libsdl.org> [Sun, 22 Mar 2020 11:01:14 -0700] rev 13663
Fixed bug 5051 - Switch Pro Controller hidapi driver does not report battery levels when connected via Bluetooth

bluenaxela+sdl

I've noticed that the Switch Pro Controller hidapi driver does not report battery levels when connected via Bluetooth, despite having code for setting joystick->epowerlevel.

This is caused by the driver always using k_eSwitchInputReportIDs_SimpleControllerState via Bluetooth. Using that mode means that the state reports you get back from the controller do not include battery state. Not using the full controller state over Bluetooth effectively makes this driver's support for setting joystick->epowerlevel entirely pointless, only ever reporting SDL_JOYSTICK_POWER_WIRED.

Is there a reason this was set to only use SimpleControllerState via Bluetooth?

I've attached a patch I'm using to allow getting battery level for the Switch Pro Controller.

A couple notes about this patch:
1) It changes LoadStickCalibration to accept the input_mode that is selected, because that's really what should determine what is used for stick extents, since stick extents differ between the modes.
2) In my patch I only use FullControllerState when the vid/pid matches the official Switch Pro Controller, as a cautionary measure in case some third-party controllers have problems with FullControllerState mode via Bluetooth (I noticed a HORI Wireless Switch Pad I had seemed to not read controller calibration correctly for stick extents. Maybe it's calibration data was uninitialized on account of having never been used with a Switch? I'm unsure, though if that guess is right maybe SDL2 should be detecting an uninitiated calibration state and using some sensible defaults)