From bfc7ce3b883caf5ce0d8817c373f5e42f7f1c4e8 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Tue, 18 Jul 2023 13:51:15 +0300 Subject: [PATCH] backend-drm: Make DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP inert Until kernel mainline does merge the aysnc page flip ioctl, make the whole bit look like it's unsupported. We can further switch it back when it lands into the kernel. Fixes: 9203d98f Signed-off-by: Marius Vlad Reported-by: Simon Ser (cherry picked from commit 3e4aff6af4dcdf0d8c0649b26135ab2dc841b0ab) --- libweston/backend-drm/kms.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/libweston/backend-drm/kms.c b/libweston/backend-drm/kms.c index d12fa57e..fd5c3044 100644 --- a/libweston/backend-drm/kms.c +++ b/libweston/backend-drm/kms.c @@ -42,10 +42,6 @@ #include "pixel-formats.h" #include "presentation-time-server-protocol.h" -#ifndef DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP -#define DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP 0x15 -#endif - struct drm_property_enum_info plane_type_enums[] = { [WDRM_PLANE_TYPE_PRIMARY] = { .name = "Primary", @@ -1851,10 +1847,19 @@ init_kms_caps(struct drm_device *device) drmSetClientCap(device->drm.fd, DRM_CLIENT_CAP_WRITEBACK_CONNECTORS, 1); +#if 0 + /* FIXME: DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP isn't merged into mainline so + * we can't really use it at this point. Until then, make it so we + * don't support it. After it gets merged, we can flip this back such + * that we don't need to revert the entire tearing work, and we can + * still get it all back, when the capability is actually available in + * the kernel. */ ret = drmGetCap(device->drm.fd, DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP, &cap); if (ret != 0) cap = 0; - device->tearing_supported = cap; +#endif + device->tearing_supported = 0; + weston_log("DRM: does not support async page flipping\n"); /* * KMS support for hardware planes cannot properly synchronize