| Summary: | [patch] KMSDRM: Add dynamic modeset support | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Anthony Pesch <inolen> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | shantic |
| Version: | HG 2.1 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
KMSDRM dynamic modeset patch
Fix regression causing joystick events not being generated when using the KMSDRM driver |
||
|
Description
Anthony Pesch
2020-02-05 01:58:14 UTC
As an update, I went back over the triple buffer changes and left them in. I didn't entirely get the code originally, I had just seen it calling KMSDRM_gbm_surface_lock_front_buffer twice for a single swap and had removed it because I was paranoid of bugs stemming from it while working on the modeset changes. I've made a few small changes to the logic that had thrown me off originally and rebased the changes: * The condition wrapping the call to release buffer was incorrect. * The first call to KMSDRM_gbm_surface_lock_front_buffer has been removed. I don't understand why it existed. * Added additional comments describing what was going on in the code (as it does fix the buffer release pattern of the original code before it). These changes sound good. Can you attach a single patch that applies cleanly to the code in Mercurial? Thanks! Created attachment 4198 [details]
KMSDRM dynamic modeset patch
Looks good, thanks! https://hg.libsdl.org/SDL/rev/045f218436fe Feel free to open additional bugs with further refinements. Will do, thanks for taking the time to review. You're welcome! Is there any reason this patch would break gamepad support? I am using SDL on the Odroid Go Advance, if I compile SDL after this commit the gamepad does not work on any app that uses SDL, if I compile a version before this commit, or if I revert it from the latest commit, gamepad works perfectly fine. I see no reason why this would happen, but it does. Hi, I was just communicating with one of the Retropie developers regarding this. This change removed the forced window focus change on creation (https://github.com/inolen/SDL-mirror/commit/3534cb3793f4744509f020f1267f510ec7099366) as part of the change no longer assumes there's only a single window being created. This was perhaps an over-aggressive removal. Due to that change, joystick events are only received if SDL_SetKeyboardFocus is called explicitly, or if the app has specified SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS. I think that part of my change should be reverted to continue setting mouse / keyboard focus to the window being created. If SDL_WINDOW_INPUT_FOCUS is to be used as an input flag the code could be conditional, but that would still leave existing software broken. Re-adding those lines worked, thanks! (In reply to Anthony Pesch from comment #8) > Hi, > > I was just communicating with one of the Retropie developers regarding this. > > This change removed the forced window focus change on creation > (https://github.com/inolen/SDL-mirror/commit/ > 3534cb3793f4744509f020f1267f510ec7099366) as part of the change no longer > assumes there's only a single window being created. This was perhaps an > over-aggressive removal. > > Due to that change, joystick events are only received if > SDL_SetKeyboardFocus is called explicitly, or if the app has specified > SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS. > > I think that part of my change should be reverted to continue setting mouse > / keyboard focus to the window being created. If SDL_WINDOW_INPUT_FOCUS is > to be used as an input flag the code could be conditional, but that would > still leave existing software broken. Created attachment 4237 [details]
Fix regression causing joystick events not being generated when using the KMSDRM driver
Would suggest re-applying the attached patch. The bit got removed partially based on its comment (/* One window, it always has focus */) while I was adding the code to track each window. I didn't notice the regression as I have SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS set.
Sorry about that!.
Fixed, thanks! https://hg.libsdl.org/SDL/rev/3ff45857428d |