From 45dc8b4d979aa2275f20db399a4430f0224799f5 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Fri, 12 Sep 2025 17:08:15 +0200 Subject: [PATCH] kms-dri-sw: Report linear modifiers in get_handle() Dumb-buffers or imported dmabufs are always linear - otherwise they couldn't be used by llvmpipe/lavapipe. So far, however, they have been implicitly reported as DRM_FORMAT_MOD_INVALID when queried through e.g. `gbm_bo_get_modifier()`. That is a problem for lavapipe, which requires explicit modifiers. Thus report modifiers as linear, fixing clients like Westons Vulkan backend on CI (vkms+lavapipe). Signed-off-by: Robert Mader Reviewed-by: Daniel Stone Part-of: --- src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c index 89c0abae531..f377f5aa1ff 100644 --- a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c +++ b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c @@ -42,6 +42,7 @@ #include #include +#include "drm-uapi/drm_fourcc.h" #include "util/compiler.h" #include "util/format/u_formats.h" #include "pipe/p_state.h" @@ -514,12 +515,14 @@ kms_sw_displaytarget_get_handle(struct sw_winsys *winsys, whandle->handle = kms_sw_dt->handle; whandle->stride = plane->stride; whandle->offset = plane->offset; + whandle->modifier = DRM_FORMAT_MOD_LINEAR; return true; case WINSYS_HANDLE_TYPE_FD: if (!drmPrimeHandleToFD(kms_sw->fd, kms_sw_dt->handle, DRM_CLOEXEC | DRM_RDWR, (int*)&whandle->handle)) { whandle->stride = plane->stride; whandle->offset = plane->offset; + whandle->modifier = DRM_FORMAT_MOD_LINEAR; return true; } FALLTHROUGH;