diff --git a/src/gallium/auxiliary/pipe-loader/meson.build b/src/gallium/auxiliary/pipe-loader/meson.build index c2115b1cf7e..f01f594664d 100644 --- a/src/gallium/auxiliary/pipe-loader/meson.build +++ b/src/gallium/auxiliary/pipe-loader/meson.build @@ -39,6 +39,9 @@ endif if with_gallium_asahi renderonly_drivers_c_args += '-DGALLIUM_ASAHI' endif +if with_gallium_rocket + renderonly_drivers_c_args += '-DGALLIUM_ROCKET' +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 5c6302d4afa..12e1da12b22 100644 --- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c @@ -84,6 +84,7 @@ static const struct drm_driver_descriptor *driver_descriptors[] = { &panthor_driver_descriptor, &asahi_driver_descriptor, &etnaviv_driver_descriptor, + &rocket_driver_descriptor, &tegra_driver_descriptor, &lima_driver_descriptor, &zink_driver_descriptor, @@ -247,9 +248,7 @@ pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev) } #define DRM_ACCEL_DEV_NAME_FORMAT "%s/accel%d" -#define DRM_ACCEL_MAX_NODES 63 -#define DRM_ACCEL_MIN_MINOR 0 -#define DRM_ACCEL_MAX_MINOR (DRM_ACCEL_MIN_MINOR + DRM_ACCEL_MAX_NODES) +#define DRM_ACCEL_MAX_MINOR 255 #define DRM_ACCEL_DIR_NAME "/dev/accel" static int @@ -295,8 +294,7 @@ pipe_loader_accel_probe(struct pipe_loader_device **devs, int ndev) { int i, j, fd; - for (i = DRM_ACCEL_MIN_MINOR, j = 0; - i <= DRM_ACCEL_MAX_MINOR; i++) { + for (i = 0, j = 0; i <= DRM_ACCEL_MAX_MINOR; i++) { struct pipe_loader_device *dev; fd = open_accel_minor(i); @@ -378,6 +376,9 @@ pipe_loader_get_compatible_render_capable_device_fds(int kms_only_fd, unsigned i "panfrost", "panthor", #endif +#if defined GALLIUM_ROCKET + "rocket", +#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 88cff81323a..5e30b9e3b93 100644 --- a/src/gallium/auxiliary/target-helpers/drm_helper.h +++ b/src/gallium/auxiliary/target-helpers/drm_helper.h @@ -51,6 +51,7 @@ const struct drm_driver_descriptor descriptor_name = { \ #undef GALLIUM_PANFROST #undef GALLIUM_LIMA #undef GALLIUM_ASAHI +#undef GALLIUM_ROCKET #endif #ifdef GALLIUM_I915 @@ -430,6 +431,36 @@ DRM_DRIVER_DESCRIPTOR(zink, zink_driconf, ARRAY_SIZE(zink_driconf)) DRM_DRIVER_DESCRIPTOR_STUB(zink) #endif +#ifdef GALLIUM_ROCKET +#include "rocket/drm/rkt_drm_public.h" + +static struct pipe_screen * +pipe_rknpu_create_screen(int fd, const struct pipe_screen_config *config) +{ + struct pipe_screen *screen; + + screen = rkt_drm_screen_create(fd, config); + return screen ? debug_screen_wrap(screen) : NULL; +} + +DRM_DRIVER_DESCRIPTOR(rknpu, NULL, 0) + +static struct pipe_screen * +pipe_rocket_create_screen(int fd, const struct pipe_screen_config *config) +{ + struct pipe_screen *screen; + + screen = rkt_drm_screen_create(fd, config); + return screen ? debug_screen_wrap(screen) : NULL; +} + +DRM_DRIVER_DESCRIPTOR(rocket, NULL, 0) + +#else +DRM_DRIVER_DESCRIPTOR_STUB(rknpu) +DRM_DRIVER_DESCRIPTOR_STUB(rocket) +#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 e7fcd6b379f..2f06df86da4 100644 --- a/src/gallium/auxiliary/target-helpers/drm_helper_public.h +++ b/src/gallium/auxiliary/target-helpers/drm_helper_public.h @@ -21,6 +21,8 @@ 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 rknpu_driver_descriptor; +extern const struct drm_driver_descriptor rocket_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;