[PATCH xserver 2/3] glamor: Scissor CopyArea to the bounds of the drawing.

Eric Anholt eric at anholt.net
Mon Aug 14 19:38:30 UTC 2017


Mark Marshall <markmarshall14 at gmail.com> writes:

> On 1 August 2017 at 22:59, Eric Anholt <eric at anholt.net> wrote:
>> Like the previous fix to rectangles, this reduces the area drawn on
>> tiled renderers by letting the CPU-side tile setup know what tiles
>> might be drawn at all.
>>
>> Surprisingly, it improves x11perf -copypixwin1 -repeat 1 -reps 10000
>> on i965 by 2.93185% +/- 1.5561% (n=90).
>>
>> Signed-off-by: Eric Anholt <eric at anholt.net>
>> ---
>>  glamor/glamor_copy.c  | 27 +++++++++++++++++++++++----
>>  glamor/glamor_utils.h |  9 +++++++++
>>  2 files changed, 32 insertions(+), 4 deletions(-)
>>
>> diff --git a/glamor/glamor_copy.c b/glamor/glamor_copy.c
>> index f7d6eb163fac..3296b7b1bf75 100644
>> --- a/glamor/glamor_copy.c
>> +++ b/glamor/glamor_copy.c
>> @@ -351,6 +351,7 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src,
>>      const glamor_facet *copy_facet;
>>      int n;
>>      Bool ret = FALSE;
>> +    BoxRec bounds = glamor_no_rendering_bounds();
>>
>>      glamor_make_current(glamor_priv);
>>
>> @@ -391,11 +392,20 @@ glamor_copy_fbo_fbo_draw(DrawablePtr src,
>>      glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_SHORT, GL_FALSE,
>>                            2 * sizeof (GLshort), vbo_offset);
>>
>> +    if (nbox < 100) {
>> +        bounds = glamor_start_rendering_bounds();
>> +        for (int i = 0; i < nbox; i++)
>> +            glamor_bounds_union_box(&bounds, &box[i]);
>> +    }
>> +
>>      for (n = 0; n < nbox; n++) {
>>          v[0] = box->x1; v[1] = box->y1;
>>          v[2] = box->x1; v[3] = box->y2;
>>          v[4] = box->x2; v[5] = box->y2;
>>          v[6] = box->x2; v[7] = box->y1;
>> +
>> +        glamor_bounds_union_box(&bounds, box);
>> +
>
> I'm only looking at the diff, but aren't you doing
> glamor_bounds_union_box twice in the n < 100 case, and in the n >= 100
> case I guess it does nothing anyway, apart from waste cycles?

Thanks, that was leftover debug code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20170814/c9372360/attachment-0001.sig>


More information about the xorg-devel mailing list