[PATCH weston 1.0] compositor-drm: Remove drm_disable_unused_sprites()

Kristian Høgsberg hoegsberg at gmail.com
Thu Jan 10 13:57:37 PST 2013


On Thu, Dec 27, 2012 at 03:36:35PM +0800, ning.tang at intel.com wrote:
> From: Ning Tang <ning.tang at intel.com>
> 
> If a sprite is no longer used, it is disabled on the call to
> drmModeSetPlane() when doing the output repaint, since its
> pending_fb_id is 0.
> 
> This patch is a backport patch on weston 1.0.
> Originally from Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>
> commit 3b2bd44d924744fa4635390e91afe569351e7d8d
> 
> Some platform has a heavy CPU load caused by redundant drmModeRmFB,
> which is called in drm_disable_unused_sprites and would trigger drm_err.

The patch doesn't apply cleanly, the "This function must take care..."
comment isn't in the 1.0 branch (or master).  I took it out and
applied the patch.

This is a pretty good fix and let's do a 1.0.4 release end of next
week.  If anybody else has fixes or other material for a 1.0.4
release, please let me know in the next few days.

Kristian

> 
> Signed-off-by: Ning Tang <ning.tang at intel.com>
> ---
>  src/compositor-drm.c | 36 ------------------------------------
>  1 file changed, 36 deletions(-)
> 
> diff --git a/src/compositor-drm.c b/src/compositor-drm.c
> index a2169dd..09d2734 100644
> --- a/src/compositor-drm.c
> +++ b/src/compositor-drm.c
> @@ -183,8 +183,6 @@ struct drm_seat {
>  
>  static void
>  drm_output_set_cursor(struct drm_output *output);
> -static void
> -drm_disable_unused_sprites(struct weston_output *output_base);
>  
>  static int
>  drm_sprite_crtc_supported(struct weston_output *output_base, uint32_t supported)
> @@ -423,8 +421,6 @@ drm_output_repaint(struct weston_output *output_base,
>  		output->vblank_pending = 1;
>  	}
>  
> -	drm_disable_unused_sprites(&output->base);
> -
>  	return;
>  }
>  
> @@ -532,38 +528,6 @@ drm_surface_transform_supported(struct weston_surface *es)
>  	return 1;
>  }
>  
> -static void
> -drm_disable_unused_sprites(struct weston_output *output_base)
> -{
> -	struct weston_compositor *ec = output_base->compositor;
> -	struct drm_compositor *c =(struct drm_compositor *) ec;
> -	struct drm_output *output = (struct drm_output *) output_base;
> -	struct drm_sprite *s;
> -	int ret;
> -
> -	wl_list_for_each(s, &c->sprite_list, link) {
> -		if (s->pending_fb_id)
> -			continue;
> -
> -		ret = drmModeSetPlane(c->drm.fd, s->plane_id,
> -				      output->crtc_id, 0, 0,
> -				      0, 0, 0, 0, 0, 0, 0, 0);
> -		if (ret)
> -			weston_log("failed to disable plane: %d: %s\n",
> -				ret, strerror(errno));
> -		drmModeRmFB(c->drm.fd, s->fb_id);
> -
> -		if (s->surface) {
> -			s->surface = NULL;
> -			wl_list_remove(&s->destroy_listener.link);
> -		}
> -
> -		assert(!s->pending_surface);
> -		s->fb_id = 0;
> -		s->pending_fb_id = 0;
> -	}
> -}
> -
>  /*
>   * This function must take care to damage any previously assigned surface
>   * if the sprite ends up binding to a different surface than in the
> -- 
> 1.8.0.2
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list