qt6-bb10/src/plugins
Tor Arne Vestbø 9271068f91 iOS: Pause display link when app moves out of active state
The applicationWillResignActive documentation describes that the app
should "use this method to pause ongoing tasks, disable timers, and
throttle down OpenGL ES frame rates". Similarly, the more modern
sceneWillResignActive describes that the app should "use this method
to quiet your interface and prepare it to stop interacting with the
user. Specifically, pause ongoing tasks, disable timers, and decrease
frame rates or stop updating your interface altogether."

In practice the application enters the inactive (as opposed to the
backgrounded) state when the user brings up the app switcher, or
enters split-view mode, as described by the "Adopting Multitasking
Enhancements on iPad" documentation.

We do propagate the inactive state as Qt::ApplicationInactive, but
it was up to the application itself to react to the state.

To adhere to the documented behavior, we now skip update request
delivery if the app is not active. Once it becomes active again
we re-try the update request delivery.

Relying on the exposed state of window was not an option, as the
window is still technically exposed, even if the app itself is
inactive.

This hopefully fixes a GPU crash observed (only) on A10 iPads
(iPad 7) with iOS 18, when the user entered split-view mode,
possibly due to changes in the system Metal-based OpenGL driver:

  void IOGPUScheduler::signalHardwareError(eRestartRequest, int32_t)
  void IOGPUScheduler::hardware_error_interrupt(IOInterruptEventSource *, int)
  void IOGPUCommandQueue::retireCommandBuffer(IOGPUEventFence *)
      Deny submissions/ignore app[openglwindow] with 2 GPURestarts in 31 submissions.
  Execution of the command buffer was aborted due to an error during execution
      Caused GPU Timeout Error (00000002:kIOGPUCommandBufferCallbackErrorTimeout)
  GLDRendererMetal command buffer completion error
      Error Domain=MTLCommandBufferErrorDomain Code=2
  Execution of the command buffer was aborted due to an error during execution
      Ignored (for causing prior/excessive GPU errors)
  Terminating due to blacklisting by kernel driver

The back-trace always pointed to the display-link callback,
so the assumption is that the crash was triggered by the app
rendering when it shouldn't, during the split-view transition.

Fixes: QTBUG-132314
Pick-to: 6.5 5.15
Change-Id: Idf1f692daa9d437ee69f9436706777b220fbfbf4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit c812190a921660c748be3324c3a34245b24354e9)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 1b993a787d7e1e2ed7bde8102847424db676d2c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-14 08:39:35 +00:00
..
doc/snippets/code Change doc snippet license 2024-02-02 16:52:11 +00:00
generic Fix -Wimplicit-fallthrough for clang 2024-03-01 03:04:06 +00:00
imageformats QJpegPlugin: also recognize jfif suffix 2024-07-23 09:15:31 +00:00
networkinformation Fix GCC -Wextra-semi warnings with Q* macros 2024-12-20 10:40:03 +00:00
platforminputcontexts ibus: use logging category for im debug 2025-02-08 08:08:50 +00:00
platforms iOS: Pause display link when app moves out of active state 2025-02-14 08:39:35 +00:00
platformthemes src/plugins/*: fix GCC -Wextra-semi colon after member func definition 2025-01-01 04:02:36 +00:00
printsupport Replace QPair/qMakePair with std::pair in qtbase/plugins 2024-11-26 11:16:41 +00:00
sqldrivers Bump version to 6.8.3 2025-01-23 11:04:42 +00:00
styles QWindows11Style: Add left margins to Radio/Checkbox indicator 2025-02-10 11:15:47 +00:00
tls Schannel: fix endless loop in TlsCryptographSchannel::transmit() 2024-11-25 15:18:32 +00:00
tracing Use toStdU16String when converting string to std::filesystem::path 2024-10-02 09:19:55 +00:00
CMakeLists.txt Fix CTF with static build 2023-10-30 18:59:21 +03:00
REUSE.toml Add REUSE.toml files 2024-11-07 08:38:49 +01:00