[PATCH xserver 1/3] glamor: Scissor rectangle drawing to the bounds of the rects.

Eric Anholt eric at anholt.net
Wed Aug 2 16:52:05 UTC 2017


Michel Dänzer <michel at daenzer.net> writes:

> On 02/08/17 05:59 AM, Eric Anholt wrote:
>> Scissors provide a critical hint to tiled renderers as to what tiles
>> need to be load/stored because they could be modified by the
>> rendering.
>> 
>> The bounds calculation here is limited to when we have a small number
>> of rects (large enough to cover rounded window corners, but probably
>> not xeyes) to avoid overhead on desktop GL.
>> 
>> No performance difference on i965 with x11perf -rect1 -repeat 1 -reps
>> 10000 (n=50)
>> 
>> Signed-off-by: Eric Anholt <eric at anholt.net>
>> ---
>>  glamor/glamor_rects.c | 26 ++++++++++++++++++++++----
>>  glamor/glamor_utils.h | 35 +++++++++++++++++++++++++++++++++++
>>  2 files changed, 57 insertions(+), 4 deletions(-)
>> 
>> diff --git a/glamor/glamor_rects.c b/glamor/glamor_rects.c
>> index cc029c8c04a6..6cbb040c18ea 100644
>> --- a/glamor/glamor_rects.c
>> +++ b/glamor/glamor_rects.c
>> @@ -53,6 +53,7 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable,
>>      char *vbo_offset;
>>      int box_index;
>>      Bool ret = FALSE;
>> +    BoxRec bounds = glamor_no_rendering_bounds();
>>  
>>      pixmap_priv = glamor_get_pixmap_private(pixmap);
>>      if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv))
>> @@ -60,6 +61,12 @@ glamor_poly_fill_rect_gl(DrawablePtr drawable,
>>  
>>      glamor_make_current(glamor_priv);
>>  
>> +    if (nrect < 100) {
>> +        bounds = glamor_start_rendering_bounds();
>> +        for (int i = 0; i < nrect; i++)
>> +            glamor_bounds_union_rect(&bounds, &prect[i]);
>> +    }
>
> Did your testing hit the nrect == 99 cases? I'd expect those to have the
> most potential impact on throughput.

No, I didn't.  However, the other two patches were nrect=1 cases in
x11perf, which I think would be even more impacted than nrect=99, and
they showed improvements.
-------------- 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/20170802/9c941361/attachment.sig>


More information about the xorg-devel mailing list