[PATCH weston 08/68] compositor-drm: Extract EGL destroy to helper

Armin Krezović krezovic.armin at gmail.com
Fri Dec 9 20:55:41 UTC 2016


On 09.12.2016 20:57, Daniel Stone wrote:
> No functional change.
> 
> Differential Revision: https://phabricator.freedesktop.org/D1484
> 
> Signed-off-by: Daniel Stone <daniels at collabora.com>

Nice

Reviewed-by: Armin Krezović <krezovic.armin at gmail.com>

> ---
>  libweston/compositor-drm.c | 26 +++++++++++++++-----------
>  1 file changed, 15 insertions(+), 11 deletions(-)
> 
> diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
> index 2d5faa0..5fb45b4 100644
> --- a/libweston/compositor-drm.c
> +++ b/libweston/compositor-drm.c
> @@ -1322,9 +1322,6 @@ drm_assign_planes(struct weston_output *output_base)
>  	pixman_region32_fini(&overlap);
>  }
>  
> -static void
> -drm_output_fini_pixman(struct drm_output *output);
> -
>  /**
>   * Find the closest-matching mode for a given target
>   *
> @@ -1363,8 +1360,12 @@ choose_mode (struct drm_output *output, struct weston_mode *target_mode)
>  
>  static int
>  drm_output_init_egl(struct drm_output *output, struct drm_backend *b);
> +static void
> +drm_output_fini_egl(struct drm_output *output);
>  static int
>  drm_output_init_pixman(struct drm_output *output, struct drm_backend *b);
> +static void
> +drm_output_fini_pixman(struct drm_output *output);
>  
>  static int
>  drm_output_switch_mode(struct weston_output *output_base, struct weston_mode *mode)
> @@ -1414,9 +1415,7 @@ drm_output_switch_mode(struct weston_output *output_base, struct weston_mode *mo
>  			return -1;
>  		}
>  	} else {
> -		gl_renderer->output_destroy(&output->base);
> -		gbm_surface_destroy(output->gbm_surface);
> -
> +		drm_output_fini_egl(output);
>  		if (drm_output_init_egl(output, b) < 0) {
>  			weston_log("failed to init output egl state with "
>  				   "new mode");
> @@ -1853,6 +1852,13 @@ drm_output_init_egl(struct drm_output *output, struct drm_backend *b)
>  	return 0;
>  }
>  
> +static void
> +drm_output_fini_egl(struct drm_output *output)
> +{
> +	gl_renderer->output_destroy(&output->base);
> +	gbm_surface_destroy(output->gbm_surface);
> +}
> +
>  static int
>  drm_output_init_pixman(struct drm_output *output, struct drm_backend *b)
>  {
> @@ -2423,12 +2429,10 @@ drm_output_deinit(struct weston_output *base)
>  	struct drm_output *output = to_drm_output(base);
>  	struct drm_backend *b = to_drm_backend(base->compositor);
>  
> -	if (b->use_pixman) {
> +	if (b->use_pixman)
>  		drm_output_fini_pixman(output);
> -	} else {
> -		gl_renderer->output_destroy(&output->base);
> -		gbm_surface_destroy(output->gbm_surface);
> -	}
> +	else
> +		drm_output_fini_egl(output);
>  
>  	weston_plane_release(&output->fb_plane);
>  	weston_plane_release(&output->cursor_plane);
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 870 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20161209/e58c2065/attachment-0001.sig>


More information about the wayland-devel mailing list