Skip to content

Commit

Permalink
kmsdrm: Init cursor surface on SetCursor() ONLY. Removal of dynamic m…
Browse files Browse the repository at this point in the history
…odeset because it causes A LOT of problems with some kernel video drivers. Some refactoring and cleanups.
  • Loading branch information
vanfanel committed Aug 23, 2020
1 parent 0d0ba11 commit 16c04f2
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 340 deletions.
7 changes: 3 additions & 4 deletions src/video/kmsdrm/SDL_kmsdrmopengles.c
Expand Up @@ -111,11 +111,11 @@ KMSDRM_GLES_SwapWindow(_THIS, SDL_Window * window)
be chosen by EGL as back buffer to draw on), and get a handle to it to request the pageflip on it. */
windata->next_bo = KMSDRM_gbm_surface_lock_front_buffer(windata->gs);
if (!windata->next_bo) {
return SDL_SetError("Failed to lock frontbuffer");
return SDL_SetError("Failed to lock frontbuffer on GBM surface destruction");
}
fb = KMSDRM_FBFromBO(_this, windata->next_bo);
if (!fb) {
return SDL_SetError("Failed to get a new framebuffer");
return SDL_SetError("Failed to get a new framebuffer on GBM surface destruction");
}

/* Add the pageflip to te request list. */
Expand All @@ -125,9 +125,8 @@ KMSDRM_GLES_SwapWindow(_THIS, SDL_Window * window)
We need e a non-blocking atomic commit for triple buffering, because we
must not block on this atomic commit so we can re-enter program loop once more. */
ret = drm_atomic_commit(_this, SDL_FALSE);

if (ret) {
return SDL_SetError("failed to issue atomic commit");
return SDL_SetError("failed to issue atomic commit on GBM surface destruction");
}

/* Release the last front buffer so EGL can chose it as back buffer and render on it again. */
Expand Down
13 changes: 0 additions & 13 deletions src/video/kmsdrm/SDL_kmsdrmsym.h
Expand Up @@ -61,21 +61,8 @@ SDL_KMSDRM_SYM(int,drmModeAddFB2WithModifiers,(int fd, uint32_t width, uint32_t
SDL_KMSDRM_SYM(int,drmModeRmFB,(int fd, uint32_t bufferId))
SDL_KMSDRM_SYM(drmModeFBPtr,drmModeGetFB,(int fd, uint32_t buf))
SDL_KMSDRM_SYM(drmModeCrtcPtr,drmModeGetCrtc,(int fd, uint32_t crtcId))
SDL_KMSDRM_SYM(int,drmModeSetCrtc,(int fd, uint32_t crtcId, uint32_t bufferId,
uint32_t x, uint32_t y, uint32_t *connectors, int count,
drmModeModeInfoPtr mode))
SDL_KMSDRM_SYM(int,drmModeSetCursor,(int fd, uint32_t crtcId, uint32_t bo_handle,
uint32_t width, uint32_t height))
SDL_KMSDRM_SYM(int,drmModeSetCursor2,(int fd, uint32_t crtcId, uint32_t bo_handle,
uint32_t width, uint32_t height,
int32_t hot_x, int32_t hot_y))
SDL_KMSDRM_SYM(int,drmModeMoveCursor,(int fd, uint32_t crtcId, int x, int y))
SDL_KMSDRM_SYM(drmModeEncoderPtr,drmModeGetEncoder,(int fd, uint32_t encoder_id))
SDL_KMSDRM_SYM(drmModeConnectorPtr,drmModeGetConnector,(int fd, uint32_t connector_id))
SDL_KMSDRM_SYM(int,drmHandleEvent,(int fd,drmEventContextPtr evctx))
SDL_KMSDRM_SYM(int,drmModePageFlip,(int fd, uint32_t crtc_id, uint32_t fb_id,
uint32_t flags, void *user_data))


/* Atomic functions */

Expand Down

0 comments on commit 16c04f2

Please sign in to comment.