[PATCH i-g-t 1/2] lib/igt_kms: Enable DRM_CLIENT_CAP_ATOMIC before enabling DRM_CLIENT_CAP_WRITEBACK_CONNECTORS

Pekka Paalanen pekka.paalanen at collabora.com
Fri Feb 16 08:46:47 UTC 2024


On Thu, 15 Feb 2024 16:21:04 -0300
Arthur Grillo <arthurgrillo at riseup.net> wrote:

> As stated at [1], we first need to set DRM_CLIENT_CAP_ATOMIC before
> setting DRM_CLIENT_CAP_WRITEBACK_CONNECTORS. Fix that.
> 
> [1]: https://docs.kernel.org/gpu/drm-uapi.html?highlight=writeback#c.DRM_CLIENT_CAP_WRITEBACK_CONNECTORS
> 
> Fixes: 3642acbb74f5 ("lib/igt_kms: Add writeback support")
> Signed-off-by: Arthur Grillo <arthurgrillo at riseup.net>
> ---
>  lib/igt_kms.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 1b4d0d7612a2..e18f6fe59882 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -2747,6 +2747,9 @@ void igt_display_require(igt_display_t *display, int drm_fd)
>  	display->drm_fd = drm_fd;
>  	is_intel_dev = is_intel_device(drm_fd);
>  
> +	if (drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC, 1) == 0)
> +		display->is_atomic = 1;
> +
>  	drmSetClientCap(drm_fd, DRM_CLIENT_CAP_WRITEBACK_CONNECTORS, 1);
>  
>  	resources = drmModeGetResources(display->drm_fd);
> @@ -2795,8 +2798,6 @@ void igt_display_require(igt_display_t *display, int drm_fd)
>  	}
>  
>  	drmSetClientCap(drm_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);

The docs also say that enabling DRM_CLIENT_CAP_ATOMIC implicitly
enables DRM_CLIENT_CAP_UNIVERSAL_PLANES. But since enabling atomic can
fail, setting universal planes explicitly should not be dropped.

IOW, this code works as far as I can see, but perhaps the client cap
ordering is slightly less logical now. I think it's a purely cosmetic
thing.

> -	if (drmSetClientCap(drm_fd, DRM_CLIENT_CAP_ATOMIC, 1) == 0)
> -		display->is_atomic = 1;
>  
>  	if (drmSetClientCap(drm_fd, LOCAL_DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT, 1) == 0)
>  		display->has_virt_cursor_plane = 1;
> 

Anyway, this looks ok to me, so

Acked-by: Pekka Paalanen <pekka.paalanen at collabora.com>

and the patch 2/2 acked-by me too.


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/igt-dev/attachments/20240216/9c4b4ccd/attachment.sig>


More information about the igt-dev mailing list