[Spice-devel] [PATCH xf86-video-qxl 2/2] Tune the dfps region tracking to collapse to the bounding rectangle if too many small, incremental, updates are provided.

Christophe Fergeau cfergeau at redhat.com
Fri Sep 19 09:19:49 PDT 2014


Did not look in details at v2, but ack series. Thanks for going the
extra mile of splitting them!


Christophe

On Fri, Sep 19, 2014 at 10:44:12AM -0500, Jeremy White wrote:
> Attempting to use x11perf to measure performance revealed a fairly
> serious weakness in the dfps code in that use case.  In between
> fps ticks, the updated_region would grow to have thousands of
> rectangles, which made processing extraordinarily slow.
> 
> This patch provides a cap on the number of rectangles inside
> a region; once it reaches the cap, we collapse the update_region
> to just transmit the bounding rectangle instead.
> 
> Signed-off-by: Jeremy White <jwhite at codeweavers.com>
> ---
>  src/dfps.c |   17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/src/dfps.c b/src/dfps.c
> index a57523b..5db34dc 100644
> --- a/src/dfps.c
> +++ b/src/dfps.c
> @@ -128,12 +128,29 @@ static Bool unaccel (void)
>      return FALSE;
>  }
>  
> +
> +/* Establish a maximum number of disparate regions we'll track before we just
> +   treat the entire bounding rectangle as having changed.
> +
> +   The number 20 seemed intuitive, and also produced the best results in
> +   benchmarking x11perf -circle10 -repeat 1
> +*/
> +#define DFPS_MAX_UPDATE_REGIONS 20
> +static void dfps_update_box(RegionPtr dest, int x_1, int x_2, int y_1, int y_2);
> +
>  static void dfps_update_region(RegionPtr dest, RegionPtr src)
>  {
>      Bool throwaway_bool;
>  
>      RegionAppend(dest, src);
>      RegionValidate(dest, &throwaway_bool);
> +    if (RegionNumRects(dest) > DFPS_MAX_UPDATE_REGIONS)
> +    {
> +        struct pixman_box16 box = * (RegionExtents(dest));
> +        RegionUninit(dest);
> +        RegionInit(dest, NULL, 0);
> +        dfps_update_box(dest, box.x1, box.x2, box.y1, box.y2);
> +    }
>  }
>  
>  static void dfps_update_box(RegionPtr dest, int x_1, int x_2, int y_1, int y_2)
> -- 
> 1.7.10.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20140919/83274092/attachment-0001.sig>


More information about the Spice-devel mailing list