backend-drm: Enable atomic async flip support

Since DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP capability is available in the
mainline kernel, now we should enable back tearing support.

v2:

 - Bump kernel version to 6.9
 - include the fallback definitions

Reviewed-by: Marius Vlad <marius.vlad@collabora.com>
Reviewed-by: Derek Foreman <derek.foreman@collabora.com>
Signed-off-by: Naveen Kumar <naveen1.kumar@intel.com>
This commit is contained in:
Naveen Kumar 2024-04-15 10:21:56 +00:00 committed by Marius Vlad
parent 8988c9436b
commit ad039cdfd2
2 changed files with 9 additions and 13 deletions

View File

@ -64,7 +64,7 @@ pip3 install $PIP_ARGS sphinx_rtd_theme==1.0.0
# The fork pulls in this support from the original GitHub PR, rebased on top of
# a newer upstream version which fixes AArch64 support.
if [[ -n "$KERNEL_DEFCONFIG" ]]; then
git clone --depth=1 --branch=v6.3 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux
git clone --depth=1 --branch=v6.9 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux
cd linux
if [[ "${BUILD_ARCH}" = "x86-64" ]]; then

View File

@ -42,6 +42,10 @@
#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",
@ -1891,19 +1895,11 @@ 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;
#endif
device->tearing_supported = 0;
weston_log("DRM: does not support async page flipping\n");
if (ret == 0)
device->tearing_supported = cap;
weston_log("DRM: %s Atomic async page flip\n",
device->tearing_supported ? "supports" : "does not support");
/*
* KMS support for hardware planes cannot properly synchronize