[PATCH 8/9] glamor: Fix requested composite VBO size.

Markus Wick markus at selfnet.de
Mon Mar 10 04:31:03 PDT 2014


Am 2014-03-09 05:07, schrieb Eric Anholt:
> The argument to setup_composte_vbo is the number of verts.
> 
> Signed-off-by: Eric Anholt <eric at anholt.net>
> ---
>  glamor/glamor_render.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
> index 7829977..63bddfd 100644
> --- a/glamor/glamor_render.c
> +++ b/glamor/glamor_render.c
> @@ -1253,8 +1253,7 @@ glamor_composite_with_shader(CARD8 op,
>          vert_stride += 4;
>      }
> 
> -    nrect_max = (vert_stride * nrect) > GLAMOR_COMPOSITE_VBO_VERT_CNT 
> ?
> -        (GLAMOR_COMPOSITE_VBO_VERT_CNT / vert_stride) : nrect;
> +    nrect_max = MIN(nrect, GLAMOR_COMPOSITE_VBO_VERT_CNT / 4);
> 
>      while (nrect) {
>          int mrect, rect_processed;
> @@ -1262,7 +1261,7 @@ glamor_composite_with_shader(CARD8 op,
>          float *vertices;
> 
>          mrect = nrect > nrect_max ? nrect_max : nrect;
> -        vertices = glamor_setup_composite_vbo(screen, mrect * 
> vert_stride);
> +        vertices = glamor_setup_composite_vbo(screen, mrect * 4);
>          rect_processed = mrect;
>          vb_stride = glamor_priv->vb_stride / sizeof(float);
>          while (mrect--) {

vert_stride isn't accessed any more at all. I think this is fine as also 
vb_stride is build in the same way. But do you want to remove 
vert_stride?


More information about the xorg-devel mailing list