diff --git a/src/gallium/auxiliary/pipe-loader/meson.build b/src/gallium/auxiliary/pipe-loader/meson.build index a4a13c002a6..1eb28f9f4da 100644 --- a/src/gallium/auxiliary/pipe-loader/meson.build +++ b/src/gallium/auxiliary/pipe-loader/meson.build @@ -48,6 +48,9 @@ endif if with_gallium_zink renderonly_drivers_c_args += '-DGALLIUM_ZINK' endif +if with_gallium_neutron + renderonly_drivers_c_args += '-DGALLIUM_NEUTRON' +endif libpipe_loader_static = static_library( 'pipe_loader_static', diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c index b97c526aedd..33062f5b408 100644 --- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c @@ -86,6 +86,7 @@ static const struct drm_driver_descriptor *driver_descriptors[] = { &etnaviv_driver_descriptor, &rocket_driver_descriptor, ðosu_driver_descriptor, + &neutron_driver_descriptor, &tegra_driver_descriptor, &lima_driver_descriptor, &zink_driver_descriptor, @@ -388,6 +389,9 @@ pipe_loader_get_compatible_render_capable_device_fds(int kms_only_fd, unsigned i #if defined GALLIUM_ETHOSU "ethosu", #endif +#if defined GALLIUM_NEUTRON + "neutron", +#endif #if defined GALLIUM_V3D "v3d", #endif diff --git a/src/gallium/auxiliary/target-helpers/drm_helper.h b/src/gallium/auxiliary/target-helpers/drm_helper.h index 65481b37ce3..0220fac99c5 100644 --- a/src/gallium/auxiliary/target-helpers/drm_helper.h +++ b/src/gallium/auxiliary/target-helpers/drm_helper.h @@ -53,6 +53,7 @@ const struct drm_driver_descriptor descriptor_name = { \ #undef GALLIUM_ASAHI #undef GALLIUM_ROCKET #undef GALLIUM_ETHOSU +#undef GALLIUM_NEUTRON #endif #ifdef GALLIUM_I915 @@ -482,6 +483,24 @@ DRM_DRIVER_DESCRIPTOR(ethosu, NULL, 0) DRM_DRIVER_DESCRIPTOR_STUB(ethosu) #endif +#ifdef GALLIUM_NEUTRON +#include "neutron/drm/neutron_drm_public.h" + +static struct pipe_screen * +pipe_neutron_create_screen(int fd, const struct pipe_screen_config *config) +{ + struct pipe_screen *screen; + + screen = neutron_drm_screen_create(fd, config); + return screen ? debug_screen_wrap(screen) : NULL; +} + +DRM_DRIVER_DESCRIPTOR(neutron, NULL, 0) + +#else +DRM_DRIVER_DESCRIPTOR_STUB(neutron) +#endif + #ifdef GALLIUM_KMSRO #include "kmsro/drm/kmsro_drm_public.h" diff --git a/src/gallium/auxiliary/target-helpers/drm_helper_public.h b/src/gallium/auxiliary/target-helpers/drm_helper_public.h index fe0e12280f6..193acd4ffdf 100644 --- a/src/gallium/auxiliary/target-helpers/drm_helper_public.h +++ b/src/gallium/auxiliary/target-helpers/drm_helper_public.h @@ -24,6 +24,7 @@ extern const struct drm_driver_descriptor etnaviv_driver_descriptor; extern const struct drm_driver_descriptor rknpu_driver_descriptor; extern const struct drm_driver_descriptor rocket_driver_descriptor; extern const struct drm_driver_descriptor ethosu_driver_descriptor; +extern const struct drm_driver_descriptor neutron_driver_descriptor; extern const struct drm_driver_descriptor tegra_driver_descriptor; extern const struct drm_driver_descriptor lima_driver_descriptor; extern const struct drm_driver_descriptor zink_driver_descriptor;