src/video/kmsdrm


Log

Author Commit Date CI Message
Pierre Wendling d0bbfdbf 2022-12-01T16:07:03 Clang-Tidy fixes (#6725) (cherry picked from commit 3c501b963dd8f0605a6ce7978882df39ba76f9cd)
Sam Lantinga b8d85c69 2022-11-30T12:51:59 Update for SDL3 coding style (#6717) I updated .clang-format and ran clang-format 14 over the src and test directories to standardize the code base. In general I let clang-format have it's way, and added markup to prevent formatting of code that would break or be completely unreadable if formatted. The script I ran for the src directory is added as build-scripts/clang-format-src.sh This fixes: #6592 #6593 #6594 (cherry picked from commit 5750bcb174300011b91d1de20edb288fcca70f8c)
Sylvain Becker fb0ce375 2022-11-27T17:38:43 Cleanup add brace (#6545) * Add braces after if conditions * More add braces after if conditions * Add braces after while() conditions * Fix compilation because of macro being modified * Add braces to for loop * Add braces after if/goto * Move comments up * Remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements after merge * Fix inconsistent patterns are xxx == NULL vs !xxx * More "{}" for "if() break;" and "if() continue;" * More "{}" after if() short statement * More "{}" after "if () return;" statement * More fix inconsistent patterns are xxx == NULL vs !xxx * Revert some modificaion on SDL_RLEaccel.c * SDL_RLEaccel: no short statement * Cleanup 'if' where the bracket is in a new line * Cleanup 'while' where the bracket is in a new line * Cleanup 'for' where the bracket is in a new line * Cleanup 'else' where the bracket is in a new line (cherry picked from commit 6a2200823c66e53bd3cda4a25f0206b834392652 to reduce conflicts merging between SDL2 and SDL3)
Sam Lantinga ff99e56d 2022-11-18T12:54:55 Fixed KMSDRM window creation failing if OpenGL libraries are not available, but GLES 2.0 libraries are
Sam Lantinga da9ba3a2 2022-11-18T12:17:27 If a CRTC doesn't have a mode configured, use the preferred or largest mode as the default mode Fixes https://github.com/libsdl-org/SDL/issues/6421
Sylvain 1d7966df 2022-11-16T21:27:16 Remove un-needed check for NULL pointer. They were previously checked just before.
Hubert Maier 678ef797 2022-10-30T08:53:34 SDL_KMSDRMOPENGLES.H: Correct spelling mistakes begining -> beginning beggining -> beginning
Eric Curtin 57b5c910 2022-09-28T12:38:32 kmsdrm: only negative devindex's are not allowed ad874536 removed an unnecessary limit as we *can* have a devindex greater than 99, this error message does not reflect the support for values greater than 99.
antonino 5f79cd16 2022-08-24T18:50:02 Fixed spacing
antonino dd68eb5c 2022-08-24T17:57:52 free drm prop before returning
antonino aae566e1 2022-08-23T02:26:29 Use SDL_bool
antonino e3ea9b5b 2022-08-23T00:37:43 restore vrr state on exit
antonino 450e9857 2022-08-22T17:58:41 Use SDL_TRUE and SDL_FALSE
antonino 605b50fc 2022-08-22T17:49:49 kmsdrm: added missing checks
Sam Lantinga 20715fa0 2022-08-22T17:09:42 Fixed build errors
antonino ad874536 2022-08-17T14:56:18 kmsdrm: enable vrr on displays that support it
Ryan C. Gordon 42165fe8 2022-07-27T12:12:03 kmsdrm: slightly better device index hint parsing.
Sam Lantinga 613ce785 2022-07-26T13:34:27 Fixed interpreting SDL_KMSDRM_DEVICE_INDEX="" as index 0
Ryan C. Gordon cc982ea7 2022-07-26T15:43:34 kmsdrm: let device indexes be > 2 digits.
Ryan C. Gordon 542a4da3 2022-07-26T15:11:19 kmsdrm: check SDL_HINT_KMSDRM_DEVICE_INDEX hint in dri_getindex(). Otherwise, it would work for Init but not Available.
Ryan C. Gordon 5d85c7d3 2022-07-26T00:19:16 kmsdrm: Added a hint to specify device index. Fixes #2811.
Ryan C. Gordon 20a76b0e 2022-07-25T23:06:58 video: removed unused devindex argument from bootstrap's create method.
Eric Curtin c0eada20 2022-07-06T17:00:16 Fix assumption that DRI_DEVNAME begins at 0 (#5865) * Fix assumption that DRI_DEVNAME begins at 0 The existing logic of the code was to count every possible entry in KMSDRM_DRI_PATH. After this a for loop would start trying to open filename0, filename1, filename2, etc. In recent Linux kernels (say 5.18) with simpledrm, the lowest KMSDRM_DRI_DEVNAME is often /dev/dri/card1, rather than /dev/dri/card0, causing the code to fail once /dev/dri/card0 has failed to open. Running: modprobe foodrm && modprobe bardrm && rmmod foodrm before you try to run an application with SDL KMSDRM would have also made this fail. * Various changes from review - Removed newline and period from SDL error - Explicitely compare memcmp to zero (also changed to SDL_memcmp) - Changed memcpy to strncpy - Less aggressive line wrapping * Various changes from review - strncpy to SDL_strlcpy - removed size hardcodings for KMSDRM_DRI_PATHSIZE and KMSDRM_DRI_DEVNAMESIZE - made all KMSDRM_DRI defines, run-time variables to reduce bugs caused by these defines being more build-time on Linux and more run-rime on OpenBSD - renamed openbsd69orgreater variable to moderndri - altered comment from "if on OpenBSD" to add difference in 6.9 * Various changes from review - Use max size of destination, rather than max size of source - Less hardcodings
Simon McVittie 63b3b9a5 2022-06-13T16:02:40 Fix some typos in diagnostic messages Detected by Debian's packaging QA tool, Lintian. Signed-off-by: Simon McVittie <smcv@collabora.com>
Pierre Wendling 501a4991 2022-05-05T18:44:32 Add clang-format on/off comments where necessary. Comments were added in places where INDENT-ON/OFF comments are. Places like stdlib's asm don't need it as clang-format doesn't try to indent it.
Cameron Gutman 8f924b82 2022-01-03T16:41:03 kmsdrm: Remove gbm_bo_get_offset() It is not present on some older libgbm versions that we still support and has been unused since 85e8adf.
Sam Lantinga 120c76c8 2022-01-03T09:40:00 Updated copyright for 2022
Davis Mosenkovs 66b0a6ee 2021-12-01T01:33:57 workaround for libmali gbm_device_get_fd() gbm_device_get_fd() in at least some libmali versions duplicates handle. Other implementations do not do duplication. To prevent handle leak save drm_fd in SDL_DisplayData.
Sylvain fae70349 2021-11-23T10:33:12 Fix warnings: static, include, un-initialized vairables
Sam Lantinga c97b7218 2021-11-21T12:18:10 Added SDL_PremultiplyAlpha() to premultiply alpha on a block of SDL_PIXELFORMAT_ARGB8888 pixels
Sam Lantinga 665865ed 2021-11-19T09:58:13 If the hardware is in an error state, the final page flip may not come. We should either put a timeout on the wait when destroying the window, or skip it entirely.
Sam Lantinga c2dd50a9 2021-11-12T08:28:02 Fixed whitespace
David Gow a76b73dd 2021-10-22T19:04:32 kmsdrm: Use SDL_PremultiplySurfaceAlphaToARGB8888() for cursor surface Instead of taking a direct copy of the mouse cursor surface, and then premultiplying on every BO upload (using the custom legacy_alpha_premultiply_ARGB8888 function), use the new SDL_PremultiplySurfaceAlphaToARGB8888() function, which converts a whole surface at a time, once and save the result. The already-premultiplied data is then copied from that to the BO on each upload, adjusting for the stride (which the previous implementation required to be equal to the width), thereby making the extra copy slightly useful.. This also adds support for non-SDL_PIXELFORMAT_ARGB8888 surfaces.
Sam Lantinga 345c161f 2021-09-22T09:06:45 Fixed some accidental uses of external C runtime functions
Vanfanel b1e492d1 2021-08-25T19:31:47 Search for an appropiate plane instead of simply using the first one.
Niklas Haas d6641d71 2021-07-19T11:52:57 kmsdrm: Explicitly set the surface transform and alpha mode This is required by the specification. Set these to sensible defaults. Fixes a validation layer error that occurs otherwise.
Niklas Haas 76007427 2021-07-19T11:26:54 kmsdrm: Properly zero-initialize CreateInfo structs As written, these contain undefined stack contents, which in practice causes crashes/hangs and/or triggers the validation layers (they complain about `pNext` and `flags` not being NULL).
Ozkan Sezer 33b84c8d 2021-06-24T23:10:56 s/memcmp/SDL_memcmp/ for conistency
Anthony Pesch c262569c 2021-06-22T00:03:18 kmsdrm: fix KMSDRM_SetDisplayMode being called for the default desktop mode doing nothing
Anthony Pesch 98bda391 2021-06-23T00:21:31 kmsdrm: sync the display's current mode with what's set in KMSDRM_CreateSurfaces
Anthony Pesch d031a24e 2021-06-08T00:39:04 kmsdrm: defer surface recreation inside of KMSDRM_SetWindowSize and KMSDRM_SetWindowFullscreen as is done in KMSDRM_SetWindowDisplayMode
Anthony Pesch 5a296e25 2021-06-08T20:48:24 kmsdrm: avoid overriding the mode requested by SDL_SetWindowDisplayMode when recreating surfaces
Ryan C. Gordon 37d35a3e 2021-06-11T21:02:49 kmsdrm: hook up KMSDRM_GLES_DefaultProfileConfig for use. Fixes #3678.
Anthony Pesch fc508eab 2021-05-23T15:59:20 kmsdrm: remove redundant modeset_pending flag this variable was added in commit 2067a7db8e4a36ba40ab34a55b3166ca28638a60 and ultimately tracks if this is a surface's first present. checking if the current bo is NULL provides the same functionality and cuts down on a redundant piece of state potentially getting out of sync in the future
Anthony Pesch 4c965b7a 2021-05-23T16:09:27 kmsdrm: fix SetDisplayMode binding the the wrong surface / context SetDisplayMode needs to recreate the EGL surfaces, which then need to be bound along with the correct context in each rendering thread commit 3a1d7d9c9ac670bf35cfa8ebf3706a1e2a3e5de4 removed this behavior which has broken using SetDisplayMode when rendering with multiple contexts the commit message was rather vague, but if the surfaces do need to be created immediately, this process probably needs to be split such that surface is created immediately, but the binding is deferred
Anthony Pesch 0219928d 2021-05-23T16:06:40 kmsdrm: honor mode previously set by SDL_SetWindowDisplayMode when enabling fullscreen and remove duplicate SDL_WINDOWEVENT_RESIZED event commit 2067a7db8e4a36ba40ab34a55b3166ca28638a60 made SDL_SetWindowSize and SDL_SetWindowFullscreen modify the display mode previously set by a call to SDL_SetWindowDisplayMode as far as I understand the SDL API, calling SDL_SetWindowDisplayMode followed by calling SDL_SetWindowFullscreen(..., SDL_WINDOW_FULLSCREEN) is the correct way to mode set / switch to fullscreen this change restores that functionaliy when switching to SDL_WINDOW_FULLSCREEN, but other cases are still modifying the display mode set by the user. rather than modifying the display mode set by the user, it seems this logic inside of KMSDRM_ReconfigureWindow should be pushed further down into KMSDRM_CreateSurfaces (as it was originally) to only modify the final mode that's set (based on the fullscreen flags), but not override the mode requested by the user
Anthony Pesch fd5de93a 2021-05-23T16:05:39 kmsdrm: fix gbm surface dimensions not matching the mode being set commit 2067a7db8e4a36ba40ab34a55b3166ca28638a60 introduced new surface_w and surface_h variables which were passed to gbm_surface_create rather than the dimensions from the drmModeModeInfo structure. commit 5105ecf8b1b37ab4e4b8344550c90dd69f49909e further refactored this code and no longer synchronized these variables inside KMSDRM_SetDisplayMode, breaking it this change removes the variables since they're seemingly redundant to begin with
Cacodemon345 99ef03b9 2021-04-21T01:22:22 KMSDRM: Only use OpenBSD-specific defines on pre-6.9 releases
Cacodemon345 b0178fe5 2021-04-14T00:52:53 KMSDRM: Report correct window position to the application
Ozkan Sezer e97cfe4a 2021-04-06T23:56:10 KMSDRM_Vulkan_CreateSurface(): fixed pointer-cast warning on 32 bit Closes: https://github.com/libsdl-org/SDL/issues/4284
Vanfanel fa818834 2021-03-30T13:25:09 [KMSDRM] Fake refresh rate precision on Vulkan display mode creation.
Vanfanel 942aa7bd 2021-03-30T11:41:26 [KMSDRM] No need to use an SDL_VideoDisplay pointer to access display index.
vanfanel 733b3278 2021-03-29T19:22:26 [KMSDRM] Minor Vulkan code adjustments regarding pointers and display index.
Vanfanel 9de7eaf9 2021-03-28T01:30:26 [KMSDRM] Change error message.
Vanfanel 1ec60a38 2021-03-27T23:52:51 [KMSDRM] Remove unnecessary space.
Vanfanel c13c3c37 2021-03-27T22:50:18 [KMSDRM] For Vulkan, use a mode with the same exact size as the window, if possible, or create a new one.
Ozkan Sezer 5262b52d 2021-03-25T23:56:56 SDL_kmsdrmvideo.c: define EGL_PLATFORM_GBM_MESA if it's missing. Fixes: https://github.com/libsdl-org/SDL/issues/4232
vanfanel 5ac6bd54 2021-03-24T02:54:36 [KMSDRM] Ask for videomode on the correct display when creating a window.
Paul Cercueil c12f46b1 2021-03-22T19:03:25 [KMSDRM] Fix segmentation fault Deference the windata pointer *after* checking that it's non-NULL. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
vanfanel 100166d7 2021-03-22T18:00:41 [KMSDRM] Improve cursor management.
vanfanel cf7eef37 2021-03-19T04:25:40 [KMSDRM] Better error handling: no more segfaults on window creation failure.
Vanfanel 4acd1dca 2021-03-18T14:04:38 [KMSDRM] Improve the way to test if last window is being destroyed.
Vanfanel 8638674a 2021-03-18T13:55:58 [KMSDRM] Correct comment typo.
vanfanel 82ff6045 2021-03-18T12:02:54 [KMSDRM] Unload GL/EGL libs and destroy GBM only when we are destroying the last window.
vanfanel c35e7189 2021-03-18T11:47:23 [KMSDRM] All non-vulkan windows have to be marked as OPENGL, not only the first created one.
vanfanel 281a7bdb 2021-03-18T11:20:18 [KMSDRM] Make the gbm_init flag a viddata member to avoid GBM re-init when several displays are connected.
Vanfanel 7d1b9c9f 2021-03-17T14:40:41 [KMSDRM] Remove unneeded function calls and improve comments for future reference.
Cacodemon345 33598563 2021-02-26T23:21:25 Fix coding style
Cacodemon345 69a600b0 2021-02-26T22:24:48 Implement requested changes
Cacodemon345 0e35f0be 2021-02-26T21:43:36 Fix KMSDRM-related warnings
Cameron Gutman dfa64ead 2021-02-25T19:22:31 KMSDRM: Add hint to enable the backend without DRM master In some cases, it can be useful to have the KMSDRM backend even if it cannot be used for rendering. An app may want to use SDL for input processing while using another rendering API (such as an MMAL overlay on Raspberry Pi) or using its own code to render to DRM overlays that SDL doesn't support. This also moves the check for DRM master to an earlier point where we can fail initialization of the backend, rather than allowing the backend to initialize then failing the creation of a window later.
Cacodemon345 d2d834b9 2021-02-25T15:21:59 KMSDRM: Add gamma support
Mathieu Eyraud 8481229f 2021-02-22T15:00:52 Fix error handling in KMSDRM_AddDisplay Add missing `goto cleanup` and check that `dispdata` is not NULL before dereferencing it.
Mathieu Eyraud 2df9c15e 2021-02-22T14:51:42 Fix memory leak in KMSDRM_Vulkan_CreateSurface Variable `device_props` is never freed.
Vanfanel 11cb53d2 2021-02-21T23:28:49 [KMSDRM] Add missing break and modify comments.
Vanfanel 9172e413 2021-02-21T22:57:22 [KMSDRM] Fix intermitent bug in Vulkan initialization on Raspberry Pi 4.
Vanfanel e4a81a98 2021-02-17T12:06:29 [KMSDRM] Correct indentation.
Manuel Alfayate Corchete 005e2c59 2021-02-09T00:57:25 [KMS/DRM] Bugfix number #5535: Improve reliability, by wahil1976.
Manuel Alfayate Corchete 19fa85d8 2021-02-06T16:05:55 [KMS/DRM] Fix build warning.
Manuel Alfayate Corchete 6ee53258 2021-02-06T14:03:53 [KMS/DRM] Replace indent tabs with spaces, as intended.
Manuel Alfayate Corchete 59cd46c2 2021-02-05T22:16:50 [KMS/DRM] Merge patch for bug #5532: No need to correct cursor position now that all windows are fullscreen. Link: https://bugzilla.libsdl.org/show_bug.cgi?id=5519.
Manuel Alfayate Corchete 538f7ad6 2021-02-05T00:27:11 [KMS/DRM] Remove redundant SDL_SendWindowEvent() call.
Manuel Alfayate Corchete 7beba050 2021-02-04T23:35:52 [KMS/DRM] Restore all-windows-are-fullscreen functionality, since there is no window manager in KMSDRM.
Manuel Alfayate Corchete 2c764331 2021-01-31T04:04:26 [KMS/DRM] Merge patch for bug 5522#: Implement KMSDRM_GetWindowWMInfo().
Manuel Alfayate Corchete bfa51c38 2021-01-31T03:48:29 [KMS/DRM] Fix for bug #5518: only do async pageflips when hardware supports them.
Manuel Alfayate Corchete 088fb525 2021-01-29T23:32:42 [KMS/DRM] Correct small omission on bugfix #5513: y-coord correction has to be done on WarpMouseGlobal, too.
Manuel Alfayate Corchete 8d95aba1 2021-01-29T18:17:16 [KMS/DRM] Remove unused KMSDRM_SetWindowGrab prototype in header file.
Manuel Alfayate Corchete b17c4950 2021-01-29T18:08:04 [KMS/DRM] Patch for bug #5513. KMSDRM backend can now manage and use several displays.
Sam Lantinga f23022ef 2021-01-25T20:03:21 Removed non-functional window grab implementations
Cameron Gutman a0d3c6c6 2021-01-25T21:42:14 Rename SetWindowGrab() to SetWindowMouseGrab()
Manuel Alfayate Corchete 8e1005f8 2021-01-23T22:47:06 [KMS/DRM] Bugfix for #5489: Non-FULLSCREEN windows incorrecty use videomode changing to look fullscreen.
Manuel Alfayate Corchete ee93f0ed 2021-01-19T15:35:43 [KMS/DRM] Revert unaproved fix for bug #5465.
Manuel Alfayate Corchete e1d932f8 2021-01-17T21:33:51 [KMS/DRM] Fix for bug #5468: corruption on dynamic cursor changing caused by wrong buffer size.
Manuel Alfayate Corchete 99facb1d 2021-01-17T21:17:01 [KMS/DRM] Fix for bug #5470: ratio correction for fullscreen windows with no matching resolution. Correct bracket position in else statements so they follow the coding style.
Manuel Alfayate Corchete 03665004 2021-01-15T15:00:17 [KMS/DRM] Small fix to KMSDRM_Waitpageflip(). More comments on how it works.
Sam Lantinga 82aafa9a 2021-01-14T14:32:11 Fixed bug 5461 - Add rewritten WSCONS driver for OpenBSD wahil1976 This patch adds a written-from-scratch WSCONS driver for OpenBSD. It does not have hardcoded keymaps, and it features mouse support when wsmux is available. For this to work, it needs access to the /dev/wskbd* devices which are not available to non-root users by default. Access to those can be granted by changing /etc/fbtab to give the logging user the ownership of those devices.
Manuel Alfayate Corchete 1adadc77 2021-01-14T10:18:40 [KMS/DRM] Adjust come return values. Improve comments.
Manuel Alfayate Corchete 57661e42 2021-01-13T20:17:50 [KMS/DRM] Remove unused header.
Manuel Alfayate Corchete ead3c406 2021-01-13T20:11:01 [KMS/DRM] Refactor, improve and re-comment async pageflips code.
Manuel Alfayate Corchete aac74db6 2021-01-13T15:54:26 [KMS/DRM] Enable async pageflips.