[PATCH weston v3] ivi-shell: bugfix, an ivi_surface is not removed from list of ivi_layer when the ivi_surface is removed from the compositor.

Tanibata, Nobuhiko (ADITJ/SWG) ntanibata at jp.adit-jv.com
Wed Aug 19 22:44:33 PDT 2015


Hi Ucan-san,

I reviewed and tested it. Additionally, we shall fix not only this one but also logic of layer list in screen similarly later.

Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA at xddp.denso.co.jp>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA at xddp.denso.co.jp>

BR,
Nobuhiko Tanibata

> -----Original Message-----
> From: Ucan, Emre (ADITG/SW1)
> Sent: Wednesday, August 19, 2015 8:25 PM
> To: wayland-devel at lists.freedesktop.org
> Cc: Tanibata, Nobuhiko (ADITJ/SWG); Ucan, Emre (ADITG/SW1)
> Subject: [PATCH weston v3] ivi-shell: bugfix, an ivi_surface is not removed
> from list of ivi_layer when the ivi_surface is removed from the compositor.
> 
> - Introduce the dirty parameter for triggering the render order change
> - IVI_NOTIFICATION_REMOVE/ADD flags are set only at commit_layer_list.
> 
> Signed-off-by: Emre Ucan <eucan at de.adit-jv.com>
> ---
>  ivi-shell/ivi-layout-private.h |    1 +
>  ivi-shell/ivi-layout.c         |   63
> ++++++++++++++--------------------------
>  2 files changed, 23 insertions(+), 41 deletions(-)
> 
> diff --git a/ivi-shell/ivi-layout-private.h
> b/ivi-shell/ivi-layout-private.h index 9c04c30..074d598 100644
> --- a/ivi-shell/ivi-layout-private.h
> +++ b/ivi-shell/ivi-layout-private.h
> @@ -81,6 +81,7 @@ struct ivi_layout_layer {
>  	} pending;
> 
>  	struct {
> +		int dirty;
>  		struct wl_list surface_list;
>  		struct wl_list link;
>  	} order;
> diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index
> d412069..bc8aead 100644
> --- a/ivi-shell/ivi-layout.c
> +++ b/ivi-shell/ivi-layout.c
> @@ -809,53 +809,38 @@ commit_layer_list(struct ivi_layout *layout)
> 
>  		ivilayer->prop = ivilayer->pending.prop;
> 
> -		if (!(ivilayer->event_mask &
> -		      (IVI_NOTIFICATION_ADD |
> IVI_NOTIFICATION_REMOVE)) ) {
> +		if (!ivilayer->order.dirty) {
>  			continue;
>  		}
> 
> -		if (ivilayer->event_mask & IVI_NOTIFICATION_REMOVE) {
> -			wl_list_for_each_safe(ivisurf, next,
> -				&ivilayer->order.surface_list,
> order.link) {
> -
> 	remove_ordersurface_from_layer(ivisurf);
> +		wl_list_for_each_safe(ivisurf, next,
> +			&ivilayer->order.surface_list, order.link) {
> +			remove_ordersurface_from_layer(ivisurf);
> 
> -				if
> (!wl_list_empty(&ivisurf->order.link)) {
> -
> 	wl_list_remove(&ivisurf->order.link);
> -				}
> -
> -				wl_list_init(&ivisurf->order.link);
> -				ivisurf->event_mask |=
> IVI_NOTIFICATION_REMOVE;
> +			if (!wl_list_empty(&ivisurf->order.link)) {
> +				wl_list_remove(&ivisurf->order.link);
>  			}
> 
> -			wl_list_init(&ivilayer->order.surface_list);
> +			wl_list_init(&ivisurf->order.link);
> +			ivisurf->event_mask |= IVI_NOTIFICATION_REMOVE;
>  		}
> 
> -		if (ivilayer->event_mask & IVI_NOTIFICATION_ADD) {
> -			wl_list_for_each_safe(ivisurf, next,
> -
> &ivilayer->order.surface_list, order.link) {
> -
> 	remove_ordersurface_from_layer(ivisurf);
> -
> -				if
> (!wl_list_empty(&ivisurf->order.link)) {
> -
> 	wl_list_remove(&ivisurf->order.link);
> -				}
> +		wl_list_init(&ivilayer->order.surface_list);
> 
> +		wl_list_for_each(ivisurf,
> &ivilayer->pending.surface_list,
> +					 pending.link) {
> +			if (!wl_list_empty(&ivisurf->order.link)){
> +				wl_list_remove(&ivisurf->order.link);
>  				wl_list_init(&ivisurf->order.link);
>  			}
> 
> -			wl_list_init(&ivilayer->order.surface_list);
> -			wl_list_for_each(ivisurf,
> &ivilayer->pending.surface_list,
> -					 pending.link) {
> -				if
> (!wl_list_empty(&ivisurf->order.link)) {
> -
> 	wl_list_remove(&ivisurf->order.link);
> -
> 	wl_list_init(&ivisurf->order.link);
> -				}
> -
> -
> 	wl_list_insert(&ivilayer->order.surface_list,
> -					       &ivisurf->order.link);
> -				add_ordersurface_to_layer(ivisurf,
> ivilayer);
> -				ivisurf->event_mask |=
> IVI_NOTIFICATION_ADD;
> -			}
> +			wl_list_insert(&ivilayer->order.surface_list,
> +				       &ivisurf->order.link);
> +			add_ordersurface_to_layer(ivisurf, ivilayer);
> +			ivisurf->event_mask |= IVI_NOTIFICATION_ADD;
>  		}
> +
> +		ivilayer->order.dirty = 0;
>  	}
>  }
> 
> @@ -997,8 +982,6 @@ clear_surface_pending_list(struct ivi_layout_layer
> *ivilayer)
> 
>  		wl_list_init(&surface_link->pending.link);
>  	}
> -
> -	ivilayer->event_mask |= IVI_NOTIFICATION_REMOVE;
>  }
> 
>  static void
> @@ -1015,8 +998,6 @@ clear_surface_order_list(struct ivi_layout_layer
> *ivilayer)
> 
>  		wl_list_init(&surface_link->order.link);
>  	}
> -
> -	ivilayer->event_mask |= IVI_NOTIFICATION_REMOVE;
>  }
> 
>  static void
> @@ -2102,7 +2083,7 @@ ivi_layout_layer_set_render_order(struct
> ivi_layout_layer *ivilayer,
>  		}
>  	}
> 
> -	ivilayer->event_mask |= IVI_NOTIFICATION_ADD;
> +	ivilayer->order.dirty = 1;
> 
>  	return IVI_SUCCEEDED;
>  }
> @@ -2526,7 +2507,7 @@ ivi_layout_layer_add_surface(struct
> ivi_layout_layer *ivilayer,
>  		}
>  	}
> 
> -	ivilayer->event_mask |= IVI_NOTIFICATION_ADD;
> +	ivilayer->order.dirty = 1;
> 
>  	return IVI_SUCCEEDED;
>  }
> @@ -2554,7 +2535,7 @@ ivi_layout_layer_remove_surface(struct
> ivi_layout_layer *ivilayer,
>  		}
>  	}
> 
> -	remsurf->event_mask |= IVI_NOTIFICATION_REMOVE;
> +	ivilayer->order.dirty = 1;
>  }
> 
>  static int32_t
> --
> 1.7.9.5



More information about the wayland-devel mailing list