[Spice-devel] [PATCH xf86-video-qxl] Do not call update_area when lacking device memory

Alon Levy alevy at redhat.com
Mon Apr 23 03:39:36 PDT 2012


On Mon, Apr 23, 2012 at 09:04:36AM +0300, Yonit Halperin wrote:
> The QXL_IO_NOTIFY_OOM is intended exactly for handling occurrences of
> lacking memory. The spice server tries to first release resources that
> are no longer in the current tree (and thus, do not need rendering).
> It renders drawables only as a last resort. And even then,
> it does not update the whole primary surface, but rather renders
> the oldest X drawables.
> The call to update_area is redundant, and its effect on performance
> is noticeable when playing full screen video.

Looks good to me.

> 
> Signed-off-by: Yonit Halperin <yhalperi at redhat.com>
> ---
>  src/qxl_driver.c |   14 --------------
>  1 files changed, 0 insertions(+), 14 deletions(-)
> 
> diff --git a/src/qxl_driver.c b/src/qxl_driver.c
> index 5c826f3..8b73dd8 100644
> --- a/src/qxl_driver.c
> +++ b/src/qxl_driver.c
> @@ -294,20 +294,6 @@ qxl_allocnf (qxl_screen_t *qxl, unsigned long size)
>      
>      while (!(result = qxl_alloc (qxl->mem, size)))
>      {
> -	struct QXLRam *ram_header = (void *)(
> -	    (unsigned long)qxl->ram + qxl->rom->ram_header_offset);
> -    
> -	/* Rather than go out of memory, we simply tell the
> -	 * device to dump everything
> -	 */
> -	ram_header->update_area.top = 0;
> -	ram_header->update_area.bottom = qxl->virtual_y;
> -	ram_header->update_area.left = 0;
> -	ram_header->update_area.right = qxl->virtual_x;
> -	ram_header->update_surface = 0;		/* Only primary for now */
> -	
> -        qxl_update_area(qxl);
> -	
>  #if 0
>   	ErrorF ("eliminated memory (%d)\n", nth_oom++);
>  #endif
> -- 
> 1.7.7.6
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel


More information about the Spice-devel mailing list