hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From f2d650cc5a822ab06f581b6a2ec56030d85fc62d Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Tue, 23 Jun 2020 17:17:13 +0800
Subject: [PATCH 04/74] HACK: backend-drm: Disable DRM_CLIENT_CAP_ASPECT_RATIO
 for kernel < 4.19
 
This conflicts with custom cap in Rockchip BSP 4.4 kernel.
 
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
 libweston/backend-drm/kms.c | 5 +++++
 1 file changed, 5 insertions(+)
 
diff --git a/libweston/backend-drm/kms.c b/libweston/backend-drm/kms.c
index 780d007..35113d5 100644
--- a/libweston/backend-drm/kms.c
+++ b/libweston/backend-drm/kms.c
@@ -29,6 +29,8 @@
 
 #include "config.h"
 
+#include <linux/version.h>
+
 #include <stdint.h>
 
 #include <xf86drm.h>
@@ -1492,10 +1494,13 @@ init_kms_caps(struct drm_backend *b)
     if (!b->atomic_modeset || getenv("WESTON_FORCE_RENDERER"))
         b->sprites_are_broken = true;
 
+    /* HACK: This conflicts with custom cap in Rockchip BSP 4.4 kernel */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)
     ret = drmSetClientCap(b->drm.fd, DRM_CLIENT_CAP_ASPECT_RATIO, 1);
     b->aspect_ratio_supported = (ret == 0);
     weston_log("DRM: %s picture aspect ratio\n",
            b->aspect_ratio_supported ? "supports" : "does not support");
+#endif
 
     return 0;
 }
-- 
2.20.1