src/video/kmsdrm


Log

Author Commit Date CI Message
Conn O'Griofa 2d37d291 2019-09-06T08:44:46 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.
Sam Lantinga bd952900 2019-06-19T06:40:50 Use SDL C runtime functions
Sylvain Becker faed7f83 2019-06-19T10:11:38 KMSDRM: fix inverted strcmp, remove useless if test (Bug 4624)
Sylvain Becker 5998c513 2019-06-19T09:16:53 KMSDRM: fix compilation on linux, no d_namlen (Bug 4624)
Sam Lantinga 99abcbb2 2019-06-18T14:15:10 Fixed bug 4624 - KMS/DRM fails on FreeBSD because /dev/dri/card* nodes are symlinks Jan Martin Mikkelsen Patch to scan /dev/dri based on names rather than file type Loading KMS/DRM on FreeBSD fails because the "available" code in the driver checks for character device nodes under /dev/dri and the /dev/dri/card* files are symlinks rather than device nodes nodes on FreeBSD. The symlink points to /dev/drm/0. The attached patch counts /dev/dri/card* entries rather than directory entries which are character devices.
Sylvain Becker cbe80d47 2019-03-13T14:54:51 KMSDRM: valid file descriptors could positive or 0. -1 is invalid. (Bug 4530)
Sylvain Becker 7b275942 2019-03-11T15:27:42 KMSDRM: missing return value in VideoInit() (Bug 4530)
Sylvain Becker 3b49ee52 2019-03-11T15:22:40 KMSDRM: change calls free() to SDL_free() (Bug 4529)
Sam Lantinga 5e13087b 2019-01-04T22:01:14 Updated copyright for 2019
Sergey Zhuravlevich 583f61b2 2018-12-01T16:31:56 kmsdrm: Check for resources when validating KMSDRM device in check_modesetting. Fixes Bugzilla #4403.
Sergey Zhuravlevich b3ac87d5 2018-12-01T13:09:00 kmsdrm: uninitialized KMSDRM fixes * Search for valid encoder in connector when it doesn't have an encoder ID set. * Search for valid CRTC in resources and encoder's possible CRTCs when encoder doesn't have one set. * Select default mode if CRTC doesn't have a valid one. * Pick current_mode's W/H/Refresh Rate basing on current and valid CRTC mode, not the saved one.
Sam Lantinga aeee424f 2018-10-31T15:16:51 Fixed bug 4349 - SDL_CreateWindow fails with KMS/DRM after upgrading Mesa to 18.2.3 Rainer Sabelka After I did an upgrade of my arch Linux installation (resulting in an update of Mesa to version 18.2.3), all my SDL2 applications which use the KMS/DRM driver stopped working. Reason: Creating a Window with SDL_CreateWindow failed because the call to EGL eglCreateWindowSurface() returns an error "EGL_BAD_MATCH". After investigating with the debugger I figured, that the configuration, which has been selected from the output of eglChooseConfig(), has an "EGL_NATIVE_VISUAL_ID" which does not match the "format" of the underlying gbm surface. The attached patch fixes the problem. It does so, by mimicking Weston's behavior. All configurations returned from eglChooseConfig() which have an visual_id different from the gbm format are discarded, and only from the remaining ones the "best" match is selected.
Ryan C. Gordon 88b32525 2018-10-09T00:27:55 kmsdrm: find available card if called without index. This work was done by Michael Grzeschik, I just cleaned up the patch a little. Fixes Bugzilla #4241.
Sam Lantinga 3ac9e2aa 2018-10-05T17:06:05 Fixed bug 4296 - kmsdrm video driver leaks 1 bo in KMSDRM_GLES_SetupCrtc() Icenowy Zheng One front buffer is locked in GLES_SetupCrtc() and overrides the next_bo just locked in KMSDRM_GLES_SwapWindow, then the next_bo gets lost and is not released even when quitting the video. It may leads to problems with GLES drivers that doesn't clean up GBM correctly if there's any bo left (e.g. the Mali Utgard r6p2 blob). In the case of Mali Utgard r6p2 blob, the DRM device file is still hold by the blob, and if you try to SDL_Quit to let another program to run (this is done by EmulationStation), the new program will fail to open DRM device.
Sam Lantinga 5febdfce 2018-09-24T11:49:25 Fixed whitespace
Sam Lantinga e3cc5b2c 2018-01-03T10:03:25 Updated copyright for 2018
Sam Lantinga 47506fe1 2017-12-04T20:37:01 Fixed bug 3974 - Fix SDL_WarpMouseInWindow on both KMSDRM and RaspberryPi drivers Manuel Alfayate Corchete This patch fixes SDL_WarpMouseInWindow() in both the KMSDRM and Raspberry Pi graphic backends.
Sam Lantinga 8758b7bf 2017-11-24T12:03:28 Fixed bug 3980 - Fix for KMSDRM driver where cursor would not be shown on some gfx hardware because of unsupported cursor size Manuel Alfayate Corchete This fixes a problem with KMSDRM on some graphics hardware where only bigger cursor sizes are supported, such as current Intel gfx. (The kernel-side driver is what limits this: had to look for failing IOCTLs...) That caused SDL_SetCursor() to fail silently, and we were left with a missing cursor without further explanation. With this patch, different "standard" sizes are tried and a bigger one is used (with an intermediate and clean buffer only used to write the new cursor to the BO where it will live after) if we get, let's say, 16x16 which is pretty common but our hardware does not support that.
Brandon Schaefer 9f4e4be8 2017-11-07T09:10:32 Fixed bug 3943 - General SDL_HINT_VIDEO_DOUBLE_BUFFER hint support
Brandon Schaefer 2ac567b7 2017-10-26T16:37:20 Fixed bug 3902 - Add a specific KMSDRM hint for low latency video
Sam Lantinga 10376eb9 2017-10-21T04:20:57 Fixed bug 3901 - Fix vsync-ed pageflips on the KMSDRM video driver Manuel I noticed that, at least on Intel GPU hardware, passing SDL_RENDERER_PRESENTVSYNC would result on a static console instead of the program graphics. That was due to the fact that calling drmModePageFlip() only works if we have previously set up CRTC to one of the GBM buffers with a drmModeSetCrtc() call, so now it's done and things work as expected. The KMSDRM_GLES_SetupCrtc() call is done only one time, only when needed (when egl_swapinterval is not 0: when it's 0, there's no need for it because we flip by calling drmModePageFlip() anyway). The place where KMSDRM_GLES_SetupCrtc() call is done may look strange, but it's right: it needs EGL completely ready because it needs to call eglSwapBuffers() internally to work (see more comments about it in the code).
Sam Lantinga c26946e9 2017-09-01T12:54:38 Fixed bug 3792 - [KMS/DRM] Wrong GBM format Romain Tisserand Using KMS/DRM driver from WIP SDL2.0.6 on Linux/ARM SoC RockChip RK3328 (ARM Mali 450 MP2 GPU). The current code is using GBM_BO_FORMAT_XRGB8888 as GBM buffer format specifier. The Mali driver (it has been confirmed some other vendor implementations too) expects GBM_FORMAT_XRGB8888. The Mesa implementation is actually handling both values as the same, but it's not implemented like this into every gbm.h vendor header. https://github.com/ideak/mesa/blob/master/src/gbm/backends/dri/gbm_dri.c So with stock SDL2 on my card (Mali vendor implementation), it does not work, eglCreateWindowSurface fails, and gbm_is_format_supported fails too (with the BO variant). It runs fine with GBM_FORMAT_XRGB8888. Here is a link of the gbm.h from Mali user-space driver : https://github.com/rockchip-linux/libmali/blob/rockchip/include/gbm.h
Sam Lantinga 50efbda7 2017-08-28T00:43:14 Fixed mingw Windows build, since SDL_vulkan_internal.h includes windows.h
Sam Lantinga 0d011ec6 2017-08-28T00:22:23 Renaming of guard header names to quiet -Wreserved-id-macro
Brandon Schaefer a6dc4ed5 2017-08-21T17:22:00 kmsdrm: Remove moved file
Brandon Schaefer 11717184 2017-08-21T17:20:50 kmsdrm: Cleanup unused headers, rename SDL_kmsdrmevents_c.h -> SDL_kmsdrmevents.h
Sam Lantinga a05522a0 2017-08-11T10:05:45 Fixed bug 3723 - Possible double free in kmsdrm init code on certain errors Simon Hug KMSDRM_VideoInit allocates and frees some connectors and encoders but doesn't set the pointer to NULL after freeing. The cleanup code at the end may free one of those garbage pointer should an error happen in the initialization.
Philipp Wiesemann f216b446 2017-08-05T22:10:36 kmsdrm: Fixed crashes if allocating memory failed.
Philipp Wiesemann 4723943b 2017-08-04T23:00:47 kmsdrm: Fixed compiling without OpenGL support.
Brandon Schaefer 86e95a60 2017-08-02T17:45:15 kmsdrm: Fix tearing in neverputt/ball https://gfycat.com/FatalFarawayHeron
Brandon Schaefer fca91451 2017-08-02T13:51:14 kmsdrm: Fix leaking SDL_VideoDevice*
Sam Lantinga 4be06670 2017-08-02T10:24:47 Fixed potential free of uninitialized memory (thanks Simon!)
Sam Lantinga 56363ebf 2017-08-02T10:22:48 Fixed bug 3690 - SDL2 KMS/DRM render context support Manuel The attached patch adds support for KMS/DRM context graphics. It builds with no problem on X86_64 GNU/Linux systems, provided the needed libraries are present, and on ARM GNU/Linux systems that have KMS/DRM support and a GLES2 implementation. Tested on Raspberry Pi: KMS/DRM is what the Raspberry Pi will use as default in the near future, once the propietary DispmanX API by Broadcom is overtaken by open graphics stack, it's possible to boot current Raspbian system in KMS mode by adding "dtoverlay=vc4-kms-v3d" to config.txt on Raspbian's boot partition. X86 systems use KMS right away in every current GNU/Linux system. Simple build instructions: $./autogen.sh $./configure --enable-video-kmsdrm $make