From bf7a3bcb00d0dce22ff3fe42fe6236beeab4403b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 31 May 2015 15:28:39 -0700 Subject: [PATCH 1/4] glamor: Actually allow glyphs of dimension 65 to 128 in the cache. The cache was trying to allow glyph_max_dim in, but since we were putting over 64x64 into HW memory, it would end up in the single-glyph-per-render bail_one path. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard --- glamor/glamor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/glamor/glamor.c b/glamor/glamor.c index 807f28ebd..71ca4f425 100644 --- a/glamor/glamor.c +++ b/glamor/glamor.c @@ -160,7 +160,9 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth, return NullPixmap; if ((usage == GLAMOR_CREATE_PIXMAP_CPU - || (usage == CREATE_PIXMAP_USAGE_GLYPH_PICTURE && w <= 64 && h <= 64) + || (usage == CREATE_PIXMAP_USAGE_GLYPH_PICTURE && + w <= glamor_priv->glyph_max_dim && + h <= glamor_priv->glyph_max_dim) || (w == 0 && h == 0) || !glamor_check_pixmap_fbo_depth(depth)) || (!GLAMOR_TEXTURED_LARGE_PIXMAP && From 077bb1bdea0fa9af846c02896df680293cf9e25c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 31 May 2015 15:46:55 -0700 Subject: [PATCH 2/4] glamor: Clean up some declarations in glyph rendering. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard --- glamor/glamor_composite_glyphs.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/glamor/glamor_composite_glyphs.c b/glamor/glamor_composite_glyphs.c index 39ed854bc..47bf64725 100644 --- a/glamor/glamor_composite_glyphs.c +++ b/glamor/glamor_composite_glyphs.c @@ -331,8 +331,6 @@ glamor_composite_glyphs(CARD8 op, ScreenPtr screen = drawable->pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_program *prog = NULL; - PicturePtr glyph_pict = NULL; - DrawablePtr glyph_draw; glamor_program_render *glyphs_program = &glamor_priv->glyphs_program; struct glamor_glyph_atlas *glyph_atlas = NULL; int x = 0, y = 0; @@ -360,11 +358,10 @@ glamor_composite_glyphs(CARD8 op, /* Glyph not empty? */ if (glyph->info.width && glyph->info.height) { - glamor_pixmap_private *glyph_pix_priv; - - glyph_pict = GlyphPicture(glyph)[screen_num]; - glyph_draw = glyph_pict->pDrawable; - glyph_pix_priv = glamor_get_pixmap_private((PixmapPtr) glyph_draw); + PicturePtr glyph_pict = GlyphPicture(glyph)[screen_num]; + DrawablePtr glyph_draw = glyph_pict->pDrawable; + glamor_pixmap_private *glyph_pix_priv = + glamor_get_pixmap_private((PixmapPtr) glyph_draw); /* Need to draw with slow path? */ From 9c679d06055cc62aa9209318705e87dc33fba4c8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 31 May 2015 16:07:01 -0700 Subject: [PATCH 3/4] glamor: Skip actual FBO setup in our glyph atlas. VC4 (and many GLES2 renderers) can't render to GL_ALPHA, so our pixmap would end up as GLAMOR_MEMORY and our dereference of the FBO would setfault. Instead, tell the pixmap creation that we don't need an FBO at all. Our glyph upload path was already glTexImage for non-a1, and a more general software fallback for a1 (since the glyph is also in system memory). Signed-off-by: Eric Anholt Reviewed-by: Keith Packard --- glamor/glamor_composite_glyphs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/glamor/glamor_composite_glyphs.c b/glamor/glamor_composite_glyphs.c index 47bf64725..c30cbed21 100644 --- a/glamor/glamor_composite_glyphs.c +++ b/glamor/glamor_composite_glyphs.c @@ -112,7 +112,8 @@ glamor_glyph_atlas_init(ScreenPtr screen, struct glamor_glyph_atlas *atlas) PictFormatPtr format = atlas->format; atlas->atlas = glamor_create_pixmap(screen, glamor_priv->glyph_atlas_dim, - glamor_priv->glyph_atlas_dim, format->depth, 0); + glamor_priv->glyph_atlas_dim, format->depth, + GLAMOR_CREATE_FBO_NO_FBO); atlas->x = 0; atlas->y = 0; atlas->row_height = 0; From 790311cec30ac3d35e580b9f1266236f558033d4 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 31 May 2015 16:08:10 -0700 Subject: [PATCH 4/4] glamor: Don't try to disable attrib divisors without the extension. Fixes epoxy assertion failures on vc4. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard --- glamor/glamor_composite_glyphs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/glamor/glamor_composite_glyphs.c b/glamor/glamor_composite_glyphs.c index c30cbed21..1f0d75ede 100644 --- a/glamor/glamor_composite_glyphs.c +++ b/glamor/glamor_composite_glyphs.c @@ -266,9 +266,11 @@ glamor_glyphs_flush(CARD8 op, PicturePtr src, PicturePtr dst, glDisable(GL_SCISSOR_TEST); - glVertexAttribDivisor(GLAMOR_VERTEX_SOURCE, 0); + if (glamor_glyph_use_130(glamor_priv)) { + glVertexAttribDivisor(GLAMOR_VERTEX_SOURCE, 0); + glVertexAttribDivisor(GLAMOR_VERTEX_POS, 0); + } glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE); - glVertexAttribDivisor(GLAMOR_VERTEX_POS, 0); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); glDisable(GL_BLEND); }