src/video/kmsdrm/SDL_kmsdrmmouse.c


Log

Author Commit Date CI Message
Manuel Alfayate Corchete 87a86675 2020-10-22T16:01:51 kmsdrm: Always use spaces for indentation. Always use SDL_calloc() for calloc.
Manuel Alfayate Corchete 78c274cb 2020-09-26T19:18:09 kmsdrm: merge patches from Ozkan Sezer for removing c-99'isms and raising libgbm version reqeriments.
Manuel Alfayate Corchete 9c342e76 2020-09-13T21:41:10 kmsdrm: merge heap buffer overflow and cursor creation patches from meyraud705.
Manuel Alfayate Corchete 0cb9bfa5 2020-09-12T15:58:47 kmsdrm: less excessive error checkhing
Manuel Alfayate Corchete d7aebbd5 2020-09-06T12:08:22 kmsdrm: Don't create surfaces until EGL context is available.
Manuel Alfayate Corchete 9b43464d 2020-08-25T16:30:23 kmsdrm: Add programmer credits to the Atomic KMSDRM driver.
Manuel Alfayate Corchete d43e666e 2020-08-25T04:05:36 kmsdrm: Buffer management refactoring. Fixes for compatibility with more video drivers.
Manuel Alfayate Corchete eade05ca 2020-08-24T12:51:20 kmsdrm: Finetune integer type usage. Add some comments.
Manuel Alfayate Corchete a76f1763 2020-08-24T01:10:11 kmsdrm: Move cursor plane setup and freeing to MouseInit() and MouseQuit(), for better consistency.
Manuel Alfayate Corchete 0d593d7e 2020-08-23T23:44:07 kmsdrm: Add error control to plane prop setting function. Do most plane prop setting with a single function.
Manuel Alfayate Corchete e06e9c35 2020-08-23T11:26:55 kmsdrm: move cursor-related atomic helper functions and related struct typedefs to the SDL_kmsdrmmouse unit.
Manuel Alfayate Corchete 5d32eda9 2020-08-19T01:31:22 kmsdrm: implement smarter surface recreation function to be used in videomode changes. Other minor arrangements.
Manuel Alfayate Corchete f79da817 2020-08-18T01:52:15 kmsdrm: free all connector, crtc and plane memory on KMSDRM_VideoQuit().
Manuel Alfayate Corchete 92cb9192 2020-08-17T18:35:04 kmsdrm: move hardware cursor functionality to the ATOMIC interface. Disconnect the display plane from the GBM surface buffers before destroying the GBM surface.
Manuel Alfayate Corchete 412b21b0 2020-07-20T11:42:23 Rename the gbm device struct from gbm to gbm_dev for better readabilty.
Sam Lantinga 71e9df99 2020-07-19T08:55:01 Fixed bug 5231 - Fix for hardware cursor: size and alpha-premultiplication. Manuel Alfayate Corchete I noticed pt2-clone had problems with it's optional hardware mouse on the KMSDRM backend: cursor had a transparent block around it. So I was investigating and it seems that a GBM cursor needs it's pixels to be alpha-premultiplied instead of straight-alpha. A lso, I was previously relying on "manual testing" for the cursor size, but it's far better to use whatever the DRM driver recommends via drmGetCap(): any working driver should make a size recommendation via drmGetCap(), so that's what we use now. I took this decision because I found out that the AMDGPU driver reported working cursor sizes that would appear garbled on screen, and only the recommended cursor size works.
Sam Lantinga bcbaa4ec 2020-05-26T16:34:50 If there isn't a GetGlobalMouseState() implementation, fall back to the normal one.
Sam Lantinga 437577f9 2020-05-26T16:29:26 Fixed bug 5141 - KMSDRM: manage SDL_GetGlobalMouseState() Manuel Alfayate Corchete On the KMSDRM backend, there is no such thing as a desktop, yet some programs could (and DO) use SDL_GetGlobalMouseState(). So I think its good idea that, in KMSDRM, it returns the same mouse coordinates anyway as SDL_GetMouseState() would return. There is nothing else it could return, as far as I can understand, since there is no desktop anyway. This small patch does precisely that.
Sam Lantinga 3e935aec 2020-02-09T11:44:22 Fixed bug 4966 - KMSDRM: Add dynamic modeset support Anthony Pesch * Remove triple buffering support. As far as I can tell, this goes against the libdrm API; the EGL implementations themselves control the buffering. Removing it isn't absolutely necessary as it seemingly works on the Pi at least, but I noticed this while doing my work and explained my reasoning in the commit. * Replace the crtc_ready logic which allocates an extra bo to perform the initial CRTC configuration (which is required before calling drmModePageFlip) with a call to drmModeSetCrtc after the front and back buffers are allocated, avoiding this allocation. * Standardized the SDL_*Data variable names and null checks to improve readability. Given that there were duplicate fields in each SDL_*Data structure, having generic names such as "data" at times was very confusing. * Removed unused fields from the SDL_*Data structures and moves all display related fields out of SDL_VideoData and into SDL_DisplayData. Not required since the code only supports a single display right now, but this was helpful in reading and understanding the code initially. * Implement KMSDRM_GetDisplayModes / KMSDRM_SetDisplayMode to provide dynamic modeset support. These changes have been tested on a Raspberry Pi 4 and a Dell XPS laptop with an HD 520. 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).
Sam Lantinga a8780c6a 2020-01-16T20:49:25 Updated copyright date for 2020
Sam Lantinga 5e13087b 2019-01-04T22:01:14 Updated copyright for 2019
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 11717184 2017-08-21T17:20:50 kmsdrm: Cleanup unused headers, rename SDL_kmsdrmevents_c.h -> SDL_kmsdrmevents.h
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