Revert "KMSDRM_GLES_SwapWindow: fix non-vsync case"

This reverts commit 23b9113ec9.

Temporarily reverting until we have a better solution as this was causing performance issues and poor framerates
for software on the RPI4 that had vsync disabled
This commit is contained in:
Jools Wills 2020-01-28 00:52:06 +00:00
parent edb5d462e6
commit 65e5ccd72e

View file

@ -140,24 +140,32 @@ KMSDRM_GLES_SwapWindow(_THIS, SDL_Window * window) {
if (fb_info == NULL) { if (fb_info == NULL) {
return 0; return 0;
} }
if (_this->egl_data->egl_swapinterval == 0) {
/* Have we already setup the CRTC to one of the GBM buffers? Do so if we have not, /* Swap buffers instantly, possible tearing */
or FlipPage won't work in some cases. */ /* SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "drmModeSetCrtc(%d, %u, %u, 0, 0, &%u, 1, &%ux%u@%u)",
if (!wdata->crtc_ready) { vdata->drm_fd, displaydata->crtc_id, fb_info->fb_id, vdata->saved_conn_id,
if(!KMSDRM_GLES_SetupCrtc(_this, window)) { displaydata->cur_mode.hdisplay, displaydata->cur_mode.vdisplay, displaydata->cur_mode.vrefresh); */
SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Could not set up CRTC for doing pageflips"); ret = KMSDRM_drmModeSetCrtc(vdata->drm_fd, displaydata->crtc_id, fb_info->fb_id,
return 0; 0, 0, &vdata->saved_conn_id, 1, &displaydata->cur_mode);
if(ret != 0) {
SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Could not pageflip with drmModeSetCrtc: %d", ret);
} }
} } else {
/* SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "drmModePageFlip(%d, %u, %u, DRM_MODE_PAGE_FLIP_EVENT, &wdata->waiting_for_flip)",
vdata->drm_fd, displaydata->crtc_id, fb_info->fb_id); */
ret = KMSDRM_drmModePageFlip(vdata->drm_fd, displaydata->crtc_id, fb_info->fb_id,
DRM_MODE_PAGE_FLIP_EVENT, &wdata->waiting_for_flip);
if (_this->egl_data->egl_swapinterval == 1) {
/* Queue page flip at vsync */ /* Queue page flip at vsync */
/* Have we already setup the CRTC to one of the GBM buffers? Do so if we have not,
or FlipPage won't work in some cases. */
if (!wdata->crtc_ready) {
if(!KMSDRM_GLES_SetupCrtc(_this, window)) {
SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Could not set up CRTC for doing vsync-ed pageflips");
return 0;
}
}
/* SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "drmModePageFlip(%d, %u, %u, DRM_MODE_PAGE_FLIP_EVENT, &wdata->waiting_for_flip)",
vdata->drm_fd, displaydata->crtc_id, fb_info->fb_id); */
ret = KMSDRM_drmModePageFlip(vdata->drm_fd, displaydata->crtc_id, fb_info->fb_id,
DRM_MODE_PAGE_FLIP_EVENT, &wdata->waiting_for_flip);
if (ret == 0) { if (ret == 0) {
wdata->waiting_for_flip = SDL_TRUE; wdata->waiting_for_flip = SDL_TRUE;
} else { } else {