[PATCH weston v12 12/40] compositor-drm: Discover atomic properties

Pekka Paalanen ppaalanen at gmail.com
Wed Oct 4 09:05:03 UTC 2017


On Tue, 26 Sep 2017 18:15:45 +0100
Daniel Stone <daniels at collabora.com> wrote:

> From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> 
> Set the atomic client cap, where it exists, and use this to discover the
> plane/CRTC/connector properties we require for atomic modesetting.
> 
> Signed-off-by: Daniel Stone <daniels at collabora.com>
> Co-authored-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> ---
>  configure.ac               |  3 +++
>  libweston/compositor-drm.c | 57 +++++++++++++++++++++++++++++++++++++++++++++-
>  2 files changed, 59 insertions(+), 1 deletion(-)


> @@ -2816,6 +2839,13 @@ init_kms_caps(struct drm_backend *b)
>  	weston_log("DRM: %s universal planes\n",
>  		   b->universal_planes ? "supports" : "does not support");
>  
> +#ifdef HAVE_DRM_ATOMIC
> +	ret = drmSetClientCap(b->drm.fd, DRM_CLIENT_CAP_ATOMIC, 1);
> +	b->atomic_modeset = (ret == 0);

Hi,

as I saw this being discussed in IRC, maybe this should be conditional
on universal planes, because enabling atomic will also enable universal
planes, and that will break the debug code disabling universal planes.

> +#endif
> +	weston_log("DRM: %s atomic modesetting\n",
> +		   b->atomic_modeset ? "supports" : "does not support");
> +
>  	return 0;
>  }
>  
> @@ -2959,6 +2989,16 @@ drm_plane_create(struct drm_backend *b, const drmModePlane *kplane,
>  			.enum_values = plane_type_enums,
>  			.num_enum_values = WDRM_PLANE_TYPE__COUNT,
>  		},
> +		[WDRM_PLANE_SRC_X] = { .name = "SRC_X", },
> +		[WDRM_PLANE_SRC_Y] = { .name = "SRC_Y", },
> +		[WDRM_PLANE_SRC_W] = { .name = "SRC_W", },
> +		[WDRM_PLANE_SRC_H] = { .name = "SRC_H", },
> +		[WDRM_PLANE_CRTC_X] = { .name = "CRTC_X", },
> +		[WDRM_PLANE_CRTC_Y] = { .name = "CRTC_Y", },
> +		[WDRM_PLANE_CRTC_W] = { .name = "CRTC_W", },
> +		[WDRM_PLANE_CRTC_H] = { .name = "CRTC_H", },
> +		[WDRM_PLANE_FB_ID] = { .name = "FB_ID", },
> +		[WDRM_PLANE_CRTC_ID] = { .name = "CRTC_ID", },
>  	};
>  
>  	plane = zalloc(sizeof(*plane) +
> @@ -3141,7 +3181,6 @@ create_sprites(struct drm_backend *b)
>  	drmModePlane *kplane;
>  	struct drm_plane *drm_plane;
>  	uint32_t i;
> -

Stray change.

>  	kplane_res = drmModeGetPlaneResources(b->drm.fd);
>  	if (!kplane_res) {
>  		weston_log("failed to get plane resources: %s\n",

Those two fixed gives this:
Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>


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/20171004/a98f0bf6/attachment.sig>


More information about the wayland-devel mailing list