From f54c8413e676dcec7c4ea9a9277204c30889c618 Mon Sep 17 00:00:00 2001 From: Bob Beckett Date: Tue, 14 Nov 2023 11:18:23 +0100 Subject: [PATCH] panfrost: Add the gallium glue to get panfrost loaded when panthor is detected Needed if we don't want to force users to pass GALLIUM_DRIVER=panfrost. Reviewed-by: Antonino Maniscalco Reviewed-by: Erik Faye-Lund Part-of: --- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c | 2 ++ src/gallium/auxiliary/target-helpers/drm_helper.h | 2 ++ src/gallium/auxiliary/target-helpers/drm_helper_public.h | 1 + src/gallium/targets/dri/meson.build | 2 +- src/gallium/targets/dri/target.c | 1 + 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c index 055c637199d..70b3f3a59d7 100644 --- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c @@ -82,6 +82,7 @@ static const struct drm_driver_descriptor *driver_descriptors[] = { &v3d_driver_descriptor, &vc4_driver_descriptor, &panfrost_driver_descriptor, + &panthor_driver_descriptor, &asahi_driver_descriptor, &etnaviv_driver_descriptor, &tegra_driver_descriptor, @@ -289,6 +290,7 @@ pipe_loader_get_compatible_render_capable_device_fd(int kms_only_fd) #endif #if defined GALLIUM_PANFROST "panfrost", + "panthor", #endif #if defined GALLIUM_V3D "v3d", diff --git a/src/gallium/auxiliary/target-helpers/drm_helper.h b/src/gallium/auxiliary/target-helpers/drm_helper.h index be44b8f71df..8a06b775cdd 100644 --- a/src/gallium/auxiliary/target-helpers/drm_helper.h +++ b/src/gallium/auxiliary/target-helpers/drm_helper.h @@ -335,9 +335,11 @@ pipe_panfrost_create_screen(int fd, const struct pipe_screen_config *config) return screen ? debug_screen_wrap(screen) : NULL; } DRM_DRIVER_DESCRIPTOR(panfrost, NULL, 0) +DRM_DRIVER_DESCRIPTOR_ALIAS(panfrost, panthor, NULL, 0) #else DRM_DRIVER_DESCRIPTOR_STUB(panfrost) +DRM_DRIVER_DESCRIPTOR_STUB(panthor) #endif #ifdef GALLIUM_ASAHI diff --git a/src/gallium/auxiliary/target-helpers/drm_helper_public.h b/src/gallium/auxiliary/target-helpers/drm_helper_public.h index 89c0a429967..e7fcd6b379f 100644 --- a/src/gallium/auxiliary/target-helpers/drm_helper_public.h +++ b/src/gallium/auxiliary/target-helpers/drm_helper_public.h @@ -18,6 +18,7 @@ extern const struct drm_driver_descriptor virtio_gpu_driver_descriptor; extern const struct drm_driver_descriptor v3d_driver_descriptor; extern const struct drm_driver_descriptor vc4_driver_descriptor; extern const struct drm_driver_descriptor panfrost_driver_descriptor; +extern const struct drm_driver_descriptor panthor_driver_descriptor; extern const struct drm_driver_descriptor asahi_driver_descriptor; extern const struct drm_driver_descriptor etnaviv_driver_descriptor; extern const struct drm_driver_descriptor tegra_driver_descriptor; diff --git a/src/gallium/targets/dri/meson.build b/src/gallium/targets/dri/meson.build index aef220e63a2..5b455164ced 100644 --- a/src/gallium/targets/dri/meson.build +++ b/src/gallium/targets/dri/meson.build @@ -112,7 +112,7 @@ foreach d : [[with_gallium_kmsro, [ [with_gallium_softpipe and with_gallium_drisw_kms, 'kms_swrast_dri.so'], [with_gallium_v3d, 'v3d_dri.so'], [with_gallium_vc4, 'vc4_dri.so'], - [with_gallium_panfrost, 'panfrost_dri.so'], + [with_gallium_panfrost, ['panfrost_dri.so', 'panthor_dri.so']], [with_gallium_etnaviv, 'etnaviv_dri.so'], [with_gallium_tegra, 'tegra_dri.so'], [with_gallium_crocus, 'crocus_dri.so'], diff --git a/src/gallium/targets/dri/target.c b/src/gallium/targets/dri/target.c index 44eb077cc10..4e42e003ef2 100644 --- a/src/gallium/targets/dri/target.c +++ b/src/gallium/targets/dri/target.c @@ -84,6 +84,7 @@ DEFINE_LOADER_DRM_ENTRYPOINT(vc4) #if defined(GALLIUM_PANFROST) DEFINE_LOADER_DRM_ENTRYPOINT(panfrost) +DEFINE_LOADER_DRM_ENTRYPOINT(panthor) #endif #if defined(GALLIUM_ASAHI)