diff options
author | David Rosca <nowrep@gmail.com> | 2024-12-28 10:35:05 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-12-28 10:39:25 +0100 |
commit | 954f9abe2aed8acf3304860ff308191e9a9a1f0b (patch) | |
tree | a430a94e962d71ce2fe26a092363264cf42c539c | |
parent | 2c51e8630d7e0f1ae99af748f767b194a8c0791e (diff) |
kms_server: Use MOD_INVALID when modifiers are not supported
Fixes VAAPI import on older AMD cards that doesn't support modifiers.
-rw-r--r-- | kms/server/kms_server.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kms/server/kms_server.c b/kms/server/kms_server.c index b4f3378..2677134 100644 --- a/kms/server/kms_server.c +++ b/kms/server/kms_server.c @@ -19,6 +19,7 @@ #include <xf86drm.h> #include <xf86drmMode.h> #include <drm_mode.h> +#include <drm_fourcc.h> #define MAX_CONNECTORS 32 @@ -362,7 +363,7 @@ static int kms_get_fb(gsr_drm *drm, gsr_kms_response *response, connector_to_crt response->items[item_index].width = drmfb->width; response->items[item_index].height = drmfb->height; response->items[item_index].pixel_format = drmfb->pixel_format; - response->items[item_index].modifier = drmfb->modifier; + response->items[item_index].modifier = drmfb->flags & DRM_MODE_FB_MODIFIERS ? drmfb->modifier : DRM_FORMAT_MOD_INVALID; response->items[item_index].connector_id = crtc_pair ? crtc_pair->connector_id : 0; response->items[item_index].is_cursor = property_mask & PLANE_PROPERTY_IS_CURSOR; if(property_mask & PLANE_PROPERTY_IS_CURSOR) { |