aboutsummaryrefslogtreecommitdiff
path: root/kms
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-07-18 03:21:16 +0200
committerdec05eba <dec05eba@protonmail.com>2023-07-18 03:21:16 +0200
commitb2644a9881ea65ff64234953fcd97664a60b98af (patch)
tree4938f694baa1f5e9541043285d819863cff93b0d /kms
parent0a2806972f51109024a114a1c8ad5396e9d535c7 (diff)
Fix wayland capture on amd/intel
Diffstat (limited to 'kms')
-rw-r--r--kms/server/kms_server.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/kms/server/kms_server.c b/kms/server/kms_server.c
index dc24224..4ed11fa 100644
--- a/kms/server/kms_server.c
+++ b/kms/server/kms_server.c
@@ -92,24 +92,25 @@ static bool plane_is_cursor_plane(int drmfd, uint32_t plane_id) {
for(uint32_t i = 0; i < props->count_props; ++i) {
drmModePropertyPtr prop = drmModeGetProperty(drmfd, props->props[i]);
- if(prop) {
- if(strcmp(prop->name, "type") == 0) {
- const uint64_t current_enum_value = props->prop_values[i];
- bool is_cursor = false;
-
- for(int j = 0; j < prop->count_enums; ++j) {
- if(prop->enums[j].value == current_enum_value && strcmp(prop->enums[j].name, "Cursor") == 0) {
- is_cursor = true;
- break;
- }
+ if(!prop)
+ continue;
- }
+ const uint32_t type = prop->flags & (DRM_MODE_PROP_LEGACY_TYPE | DRM_MODE_PROP_EXTENDED_TYPE);
+ if((type & DRM_MODE_PROP_ENUM) && strcmp(prop->name, "type") == 0) {
+ const uint64_t current_enum_value = props->prop_values[i];
+ bool is_cursor = false;
- drmModeFreeProperty(prop);
- return is_cursor;
+ for(int j = 0; j < prop->count_enums; ++j) {
+ if(prop->enums[j].value == current_enum_value && strcmp(prop->enums[j].name, "Cursor") == 0) {
+ is_cursor = true;
+ break;
+ }
}
+
drmModeFreeProperty(prop);
+ return is_cursor;
}
+ drmModeFreeProperty(prop);
}
drmModeFreeObjectProperties(props);