[PATCH] compositor-drm: handle null cursor_plane

Pekka Paalanen ppaalanen at gmail.com
Tue Feb 20 13:31:25 UTC 2018


On Mon, 19 Feb 2018 17:59:42 +0300
Greg V <greg at unrelenting.technology> wrote:

> Was crashing when I tried to take a screenshot.
> ---
> On my slightly unconventional setup (FreeBSD amdgpu), after merging 
> recent changes, pressing the screenshot hotkey was crashing weston.
> 
> Debugging revealed that cursor_plane was 0x0 here.
> I don't know why exactly, but adding this check fixes it.
> 
>  libweston/compositor-drm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
> index ff090907..278bc02d 100644
> --- a/libweston/compositor-drm.c
> +++ b/libweston/compositor-drm.c
> @@ -1830,8 +1830,10 @@ drm_output_apply_state_legacy(struct drm_output_state *state)
>  	 */
>  	if (output->base.disable_planes) {
>  		output->cursor_view = NULL;
> -		output->cursor_plane->base.x = INT32_MIN;
> -		output->cursor_plane->base.y = INT32_MIN;
> +		if (output->cursor_plane) {
> +			output->cursor_plane->base.x = INT32_MIN;
> +			output->cursor_plane->base.y = INT32_MIN;
> +		}
>  	}
>  
>  	if (state->dpms != WESTON_DPMS_ON) {

Indeed, a correct fix. Pushed:
   d7157847..1f781761  master -> master

cursor_plane is allowed to be NULL in case there actually isn't one
available from DRM.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20180220/57a3ca8b/attachment.sig>


More information about the wayland-devel mailing list