mirror of https://github.com/encounter/SDL.git
kmsdrm: remove redundant function, use drm_atomic_setbuffers() for disconnecting planes instead.
This commit is contained in:
parent
16c04f266a
commit
0b7b7721b9
|
@ -119,7 +119,7 @@ KMSDRM_GLES_SwapWindow(_THIS, SDL_Window * window)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add the pageflip to te request list. */
|
/* Add the pageflip to te request list. */
|
||||||
drm_atomic_setbuffer(_this, dispdata->display_plane, fb->fb_id);
|
drm_atomic_setbuffer(_this, dispdata->display_plane, fb->fb_id, dispdata->crtc->crtc->crtc_id);
|
||||||
|
|
||||||
/* Issue the one and only atomic commit where all changes will be requested!.
|
/* Issue the one and only atomic commit where all changes will be requested!.
|
||||||
We need e a non-blocking atomic commit for triple buffering, because we
|
We need e a non-blocking atomic commit for triple buffering, because we
|
||||||
|
@ -188,7 +188,7 @@ KMSDRM_GLES_SwapWindowDB(_THIS, SDL_Window * window)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add the pageflip to te request list. */
|
/* Add the pageflip to te request list. */
|
||||||
drm_atomic_setbuffer(_this, dispdata->display_plane, fb->fb_id);
|
drm_atomic_setbuffer(_this, dispdata->display_plane, fb->fb_id, dispdata->crtc->crtc->crtc_id);
|
||||||
|
|
||||||
/* Issue the one and only atomic commit where all changes will be requested!.
|
/* Issue the one and only atomic commit where all changes will be requested!.
|
||||||
Blocking for double buffering: won't return until completed. */
|
Blocking for double buffering: won't return until completed. */
|
||||||
|
|
|
@ -466,7 +466,7 @@ free_plane(struct plane **plane) {
|
||||||
/* buffers and/or the GBM surface containig them. */
|
/* buffers and/or the GBM surface containig them. */
|
||||||
/**********************************************************************************/
|
/**********************************************************************************/
|
||||||
void
|
void
|
||||||
drm_atomic_setbuffer(_THIS, struct plane *plane, uint32_t fb_id)
|
drm_atomic_setbuffer(_THIS, struct plane *plane, uint32_t fb_id, uint32_t crtc_id)
|
||||||
{
|
{
|
||||||
SDL_DisplayData *dispdata = (SDL_DisplayData *)SDL_GetDisplayDriverData(0);
|
SDL_DisplayData *dispdata = (SDL_DisplayData *)SDL_GetDisplayDriverData(0);
|
||||||
|
|
||||||
|
@ -475,7 +475,7 @@ drm_atomic_setbuffer(_THIS, struct plane *plane, uint32_t fb_id)
|
||||||
dispdata->atomic_req = KMSDRM_drmModeAtomicAlloc();
|
dispdata->atomic_req = KMSDRM_drmModeAtomicAlloc();
|
||||||
|
|
||||||
add_plane_property(dispdata->atomic_req, plane, "FB_ID", fb_id);
|
add_plane_property(dispdata->atomic_req, plane, "FB_ID", fb_id);
|
||||||
add_plane_property(dispdata->atomic_req, plane, "CRTC_ID", dispdata->crtc->crtc->crtc_id);
|
add_plane_property(dispdata->atomic_req, plane, "CRTC_ID", crtc_id);
|
||||||
add_plane_property(dispdata->atomic_req, plane, "SRC_W", dispdata->mode.hdisplay << 16);
|
add_plane_property(dispdata->atomic_req, plane, "SRC_W", dispdata->mode.hdisplay << 16);
|
||||||
add_plane_property(dispdata->atomic_req, plane, "SRC_H", dispdata->mode.vdisplay << 16);
|
add_plane_property(dispdata->atomic_req, plane, "SRC_H", dispdata->mode.vdisplay << 16);
|
||||||
add_plane_property(dispdata->atomic_req, plane, "SRC_X", 0);
|
add_plane_property(dispdata->atomic_req, plane, "SRC_X", 0);
|
||||||
|
@ -492,33 +492,6 @@ drm_atomic_setbuffer(_THIS, struct plane *plane, uint32_t fb_id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
drm_atomic_unsetbuffer(_THIS, struct plane *plane)
|
|
||||||
{
|
|
||||||
SDL_DisplayData *dispdata = (SDL_DisplayData *)SDL_GetDisplayDriverData(0);
|
|
||||||
|
|
||||||
/* Do we have a set of changes already in the making? If not, allocate a new one. */
|
|
||||||
if (!dispdata->atomic_req)
|
|
||||||
dispdata->atomic_req = KMSDRM_drmModeAtomicAlloc();
|
|
||||||
|
|
||||||
add_plane_property(dispdata->atomic_req, plane, "FB_ID", 0);
|
|
||||||
add_plane_property(dispdata->atomic_req, plane, "CRTC_ID", 0);
|
|
||||||
add_plane_property(dispdata->atomic_req, plane, "SRC_W", 0);
|
|
||||||
add_plane_property(dispdata->atomic_req, plane, "SRC_H", 0);
|
|
||||||
add_plane_property(dispdata->atomic_req, plane, "SRC_X", 0);
|
|
||||||
add_plane_property(dispdata->atomic_req, plane, "SRC_Y", 0);
|
|
||||||
add_plane_property(dispdata->atomic_req, plane, "CRTC_W", 0);
|
|
||||||
add_plane_property(dispdata->atomic_req, plane, "CRTC_H", 0);
|
|
||||||
add_plane_property(dispdata->atomic_req, plane, "CRTC_X", 0);
|
|
||||||
add_plane_property(dispdata->atomic_req, plane, "CRTC_Y", 0);
|
|
||||||
|
|
||||||
if (dispdata->kms_in_fence_fd != -1) {
|
|
||||||
add_crtc_property(dispdata->atomic_req, dispdata->crtc, "OUT_FENCE_PTR",
|
|
||||||
VOID2U64(&dispdata->kms_out_fence_fd));
|
|
||||||
add_plane_property(dispdata->atomic_req, plane, "IN_FENCE_FD", dispdata->kms_in_fence_fd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
drm_atomic_setcursor(KMSDRM_CursorData *curdata, int x, int y)
|
drm_atomic_setcursor(KMSDRM_CursorData *curdata, int x, int y)
|
||||||
{
|
{
|
||||||
|
@ -849,7 +822,7 @@ KMSDRM_DestroySurfaces(_THIS, SDL_Window * window)
|
||||||
the display plane from the GBM surface buffer it's reading by setting
|
the display plane from the GBM surface buffer it's reading by setting
|
||||||
it's CRTC_ID and FB_ID props to 0.
|
it's CRTC_ID and FB_ID props to 0.
|
||||||
*/
|
*/
|
||||||
drm_atomic_unsetbuffer(_this, dispdata->display_plane);
|
drm_atomic_setbuffer(_this, dispdata->display_plane, 0, 0);
|
||||||
drm_atomic_commit(_this, SDL_TRUE);
|
drm_atomic_commit(_this, SDL_TRUE);
|
||||||
|
|
||||||
if (windata->bo) {
|
if (windata->bo) {
|
||||||
|
|
|
@ -138,7 +138,7 @@ KMSDRM_FBInfo *KMSDRM_FBFromBO(_THIS, struct gbm_bo *bo);
|
||||||
|
|
||||||
/* Atomic functions that are used from SDL_kmsdrmopengles.c and SDL_kmsdrmmouse.c */
|
/* Atomic functions that are used from SDL_kmsdrmopengles.c and SDL_kmsdrmmouse.c */
|
||||||
void drm_atomic_modeset(_THIS, int mode_index);
|
void drm_atomic_modeset(_THIS, int mode_index);
|
||||||
void drm_atomic_setbuffer(_THIS, struct plane *plane, uint32_t fb_id);
|
void drm_atomic_setbuffer(_THIS, struct plane *plane, uint32_t fb_id, uint32_t crtc_id);
|
||||||
void drm_atomic_waitpending(_THIS);
|
void drm_atomic_waitpending(_THIS);
|
||||||
int drm_atomic_commit(_THIS, SDL_bool blocking);
|
int drm_atomic_commit(_THIS, SDL_bool blocking);
|
||||||
int drm_atomic_setcursor(KMSDRM_CursorData *curdata, int x, int y);
|
int drm_atomic_setcursor(KMSDRM_CursorData *curdata, int x, int y);
|
||||||
|
|
Loading…
Reference in New Issue