From 07f25aa785ba3f75b8ca71116b4d010b4df48959 Mon Sep 17 00:00:00 2001 From: Lucas Fryzek Date: Mon, 1 Apr 2024 15:34:36 -0400 Subject: [PATCH] lavapipe: EXT_external_memory_dma_buf Reviewed-By: Mike Blumenkrantz Part-of: --- src/gallium/frontends/lavapipe/lvp_device.c | 6 ++++++ src/gallium/frontends/lavapipe/lvp_private.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c index 0a081495a2fd3..a7773c52ef07e 100644 --- a/src/gallium/frontends/lavapipe/lvp_device.c +++ b/src/gallium/frontends/lavapipe/lvp_device.c @@ -1181,6 +1181,12 @@ lvp_physical_device_init(struct lvp_physical_device *device, device->max_images = device->pscreen->get_shader_param(device->pscreen, MESA_SHADER_FRAGMENT, PIPE_SHADER_CAP_MAX_SHADER_IMAGES); device->vk.supported_extensions = lvp_device_extensions_supported; +#ifdef HAVE_LIBDRM + /* if import or export is supported then EXT_external_memory_dma_buf is supported */ + if (device->pscreen->get_param(device->pscreen, PIPE_CAP_DMABUF)) + device->vk.supported_extensions.EXT_external_memory_dma_buf = true; +#endif + lvp_get_features(device, &device->vk.supported_features); lvp_get_properties(device, &device->vk.properties); diff --git a/src/gallium/frontends/lavapipe/lvp_private.h b/src/gallium/frontends/lavapipe/lvp_private.h index 6e440d2f47ef0..b3bf064833e39 100644 --- a/src/gallium/frontends/lavapipe/lvp_private.h +++ b/src/gallium/frontends/lavapipe/lvp_private.h @@ -44,6 +44,10 @@ #include "cso_cache/cso_context.h" #include "nir.h" +#ifdef HAVE_LIBDRM +#include +#endif + /* Pre-declarations needed for WSI entrypoints */ struct wl_surface; struct wl_display;