From 64081d0eacf3e53a029b8e8b63096cc153e98549 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 11 Jan 2016 17:02:57 +1000 Subject: [PATCH] glamor: fallback if font is too large for FBO size. running xfontsel on haswell here, with a max texture size of 8kx8k, one font wants 9711 height. This fallsback to sw in this case. A proper solution probably involves using an array texture. Reviewed-by: Keith Packard Signed-off-by: Dave Airlie --- glamor/glamor_font.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/glamor/glamor_font.c b/glamor/glamor_font.c index 6753d5089..9b0dbd116 100644 --- a/glamor/glamor_font.c +++ b/glamor/glamor_font.c @@ -80,6 +80,11 @@ glamor_font_get(ScreenPtr screen, FontPtr font) overall_width = glyph_width_bytes * num_cols; overall_height = glyph_height * num_rows; + if (overall_width > glamor_priv->max_fbo_size || + overall_height > glamor_priv->max_fbo_size) { + /* fallback if we don't fit inside a texture */ + return NULL; + } bits = malloc(overall_width * overall_height); if (!bits) return NULL;