From ee2073d4e411555aba878277131b56f7eb562c84 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Tue, 17 Jan 2017 21:15:44 -0800 Subject: fb: require 2+ pages in fb_new() If NUM_FB_PAGES was redefined to 1 rototiller would hang, since 1 is insufficient for page-flipping. --- fb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fb.c b/fb.c index 39e7feb..4d1a562 100644 --- a/fb.c +++ b/fb.c @@ -280,6 +280,10 @@ fb_t * fb_new(int drm_fd, uint32_t crtc_id, uint32_t *connectors, int n_connecto _fb_page_t *page; fb_t *fb; + /* XXX: page-flipping is the only supported rendering model, requiring 2+ pages. */ + if (n_pages < 2) + return NULL; + fb = calloc(1, sizeof(fb_t)); if (!fb) return NULL; -- cgit v1.2.3