summaryrefslogtreecommitdiffstats
path: root/minuitwrp/graphics_drm.cpp
diff options
context:
space:
mode:
authorSimon Shi <simonsmh@gmail.com>2018-06-02 16:18:45 +0200
committerDees Troy <dees_troy@teamw.in>2018-06-05 14:55:04 +0200
commit25b850d6527b0da775fbcfb4910dccb0c3c09dbb (patch)
tree73362172a76f97bad5f849bc58a50cab2bc1af79 /minuitwrp/graphics_drm.cpp
parentRevert "updater: Remove some obsoleted functions for file-based OTA." (diff)
downloadandroid_bootable_recovery-25b850d6527b0da775fbcfb4910dccb0c3c09dbb.tar
android_bootable_recovery-25b850d6527b0da775fbcfb4910dccb0c3c09dbb.tar.gz
android_bootable_recovery-25b850d6527b0da775fbcfb4910dccb0c3c09dbb.tar.bz2
android_bootable_recovery-25b850d6527b0da775fbcfb4910dccb0c3c09dbb.tar.lz
android_bootable_recovery-25b850d6527b0da775fbcfb4910dccb0c3c09dbb.tar.xz
android_bootable_recovery-25b850d6527b0da775fbcfb4910dccb0c3c09dbb.tar.zst
android_bootable_recovery-25b850d6527b0da775fbcfb4910dccb0c3c09dbb.zip
Diffstat (limited to 'minuitwrp/graphics_drm.cpp')
-rw-r--r--minuitwrp/graphics_drm.cpp21
1 files changed, 1 insertions, 20 deletions
diff --git a/minuitwrp/graphics_drm.cpp b/minuitwrp/graphics_drm.cpp
index aaa9e4e19..c321bb7d8 100644
--- a/minuitwrp/graphics_drm.cpp
+++ b/minuitwrp/graphics_drm.cpp
@@ -42,7 +42,6 @@ struct drm_surface {
static drm_surface *drm_surfaces[2];
static int current_buffer;
-static bool flip_pending = false;
static GRSurface *draw_buf = NULL;
static drmModeCrtc *main_monitor_crtc;
@@ -481,36 +480,18 @@ static GRSurface* drm_init(minui_backend* backend __unused) {
return draw_buf;
}
-static void drm_page_flip_event(int fd, unsigned int frame, unsigned int sec,
- unsigned int usec, void *data) {
- flip_pending = false;
-}
-
static GRSurface* drm_flip(minui_backend* backend __unused) {
int ret;
- drmEventContext ev;
-
- memset(&ev, 0, sizeof(ev));
-
memcpy(drm_surfaces[current_buffer]->base.data,
draw_buf->data, draw_buf->height * draw_buf->row_bytes);
- ev.version = 2;
- ev.page_flip_handler = drm_page_flip_event;
-
- /* wait for previous page flip, if any, to complete */
- while (flip_pending) {
- drmHandleEvent(drm_fd, &ev);
- }
ret = drmModePageFlip(drm_fd, main_monitor_crtc->crtc_id,
- drm_surfaces[current_buffer]->fb_id, DRM_MODE_PAGE_FLIP_EVENT, NULL);
+ drm_surfaces[current_buffer]->fb_id, 0, NULL);
if (ret < 0) {
printf("drmModePageFlip failed ret=%d\n", ret);
return NULL;
}
-
- flip_pending = true;
current_buffer = 1 - current_buffer;
return draw_buf;
}