kmsdrm: also do pending modeseting in SwapWindowDoubleBuffered().
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
diff --git a/src/video/kmsdrm/SDL_kmsdrmopengles.c b/src/video/kmsdrm/SDL_kmsdrmopengles.c
index f7c2d85..12bd354 100644
--- a/src/video/kmsdrm/SDL_kmsdrmopengles.c
+++ b/src/video/kmsdrm/SDL_kmsdrmopengles.c
@@ -179,23 +179,6 @@ KMSDRM_GLES_SwapWindowFenced(_THIS, SDL_Window * window)
return SDL_SetError("Failed to request prop changes for setting plane buffer and CRTC");
}
- /* Do we have a pending modesetting? If so, set the necessary
- props so it's included in the incoming atomic commit. */
- if (dispdata->modeset_pending) {
- SDL_VideoData *viddata = (SDL_VideoData *)_this->driverdata;
- uint32_t blob_id;
- dispdata->atomic_flags |= DRM_MODE_ATOMIC_ALLOW_MODESET;
- if (add_connector_property(dispdata->atomic_req, dispdata->connector, "CRTC_ID", dispdata->crtc->crtc->crtc_id) < 0)
- return -1;
- if (KMSDRM_drmModeCreatePropertyBlob(viddata->drm_fd, &dispdata->mode, sizeof(dispdata->mode), &blob_id) != 0)
- return -1;
- if (add_crtc_property(dispdata->atomic_req, dispdata->crtc, "MODE_ID", blob_id) < 0)
- return -1;
- if (add_crtc_property(dispdata->atomic_req, dispdata->crtc, "ACTIVE", 1) < 0)
- return -1;
- dispdata->modeset_pending = SDL_FALSE;
- }
-
/*****************************************************************/
/* Tell the display (KMS) that it will have to wait on the fence */
/* for the GPU-side FENCE. */
@@ -223,6 +206,23 @@ KMSDRM_GLES_SwapWindowFenced(_THIS, SDL_Window * window)
return SDL_SetError("Failed to set CRTC OUT_FENCE_PTR prop");
}
+ /* Do we have a pending modesetting? If so, set the necessary
+ props so it's included in the incoming atomic commit. */
+ if (dispdata->modeset_pending) {
+ SDL_VideoData *viddata = (SDL_VideoData *)_this->driverdata;
+ uint32_t blob_id;
+ dispdata->atomic_flags |= DRM_MODE_ATOMIC_ALLOW_MODESET;
+ if (add_connector_property(dispdata->atomic_req, dispdata->connector, "CRTC_ID", dispdata->crtc->crtc->crtc_id) < 0)
+ return -1;
+ if (KMSDRM_drmModeCreatePropertyBlob(viddata->drm_fd, &dispdata->mode, sizeof(dispdata->mode), &blob_id) != 0)
+ return -1;
+ if (add_crtc_property(dispdata->atomic_req, dispdata->crtc, "MODE_ID", blob_id) < 0)
+ return -1;
+ if (add_crtc_property(dispdata->atomic_req, dispdata->crtc, "ACTIVE", 1) < 0)
+ return -1;
+ dispdata->modeset_pending = SDL_FALSE;
+ }
+
/*****************************************************************/
/* Issue a non-blocking atomic commit: for triple buffering, */
/* this must not block so the game can start building another */
@@ -314,6 +314,23 @@ KMSDRM_GLES_SwapWindowDoubleBuffered(_THIS, SDL_Window * window)
return SDL_SetError("Failed to request prop changes for setting plane buffer and CRTC");
}
+ /* Do we have a pending modesetting? If so, set the necessary
+ props so it's included in the incoming atomic commit. */
+ if (dispdata->modeset_pending) {
+ SDL_VideoData *viddata = (SDL_VideoData *)_this->driverdata;
+ uint32_t blob_id;
+ dispdata->atomic_flags |= DRM_MODE_ATOMIC_ALLOW_MODESET;
+ if (add_connector_property(dispdata->atomic_req, dispdata->connector, "CRTC_ID", dispdata->crtc->crtc->crtc_id) < 0)
+ return -1;
+ if (KMSDRM_drmModeCreatePropertyBlob(viddata->drm_fd, &dispdata->mode, sizeof(dispdata->mode), &blob_id) != 0)
+ return -1;
+ if (add_crtc_property(dispdata->atomic_req, dispdata->crtc, "MODE_ID", blob_id) < 0)
+ return -1;
+ if (add_crtc_property(dispdata->atomic_req, dispdata->crtc, "ACTIVE", 1) < 0)
+ return -1;
+ dispdata->modeset_pending = SDL_FALSE;
+ }
+
/* Issue the one and only atomic commit where all changes will be requested!.
Blocking for double buffering: won't return until completed. */
if (drm_atomic_commit(_this, SDL_TRUE)) {