From 954f9abe2aed8acf3304860ff308191e9a9a1f0b Mon Sep 17 00:00:00 2001 From: David Rosca Date: Sat, 28 Dec 2024 10:35:05 +0100 Subject: kms_server: Use MOD_INVALID when modifiers are not supported Fixes VAAPI import on older AMD cards that doesn't support modifiers. --- kms/server/kms_server.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 #include #include +#include #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) { -- cgit v1.2.3