backend-drm: Check for the atomic tearing capability

Check if our drm device supports atomic async page flips.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2022-11-24 14:11:01 -06:00
parent 974a707add
commit 9203d98f8b
2 changed files with 11 additions and 0 deletions

View File

@ -298,6 +298,8 @@ struct drm_device {
bool atomic_modeset;
bool tearing_supported;
bool aspect_ratio_supported;
int32_t cursor_width;

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",
@ -1639,6 +1643,11 @@ init_kms_caps(struct drm_device *device)
drmSetClientCap(device->drm.fd, DRM_CLIENT_CAP_WRITEBACK_CONNECTORS, 1);
ret = drmGetCap(device->drm.fd, DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP, &cap);
if (ret != 0)
cap = 0;
device->tearing_supported = cap;
/*
* KMS support for hardware planes cannot properly synchronize
* without nuclear page flip. Without nuclear/atomic, hw plane