summaryrefslogtreecommitdiff
path: root/fb.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@gnugeneration.com>2017-01-17 21:15:44 -0800
committerVito Caputo <vcaputo@gnugeneration.com>2017-01-17 21:15:44 -0800
commitee2073d4e411555aba878277131b56f7eb562c84 (patch)
treefe7a497b5b7853b16749748a8d6d9fa8f405e7ea /fb.c
parentf9f580747bd73a6010165337514d165a0f69d879 (diff)
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.
Diffstat (limited to 'fb.c')
-rw-r--r--fb.c4
1 files changed, 4 insertions, 0 deletions
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;
© All Rights Reserved