diff --git a/src/gallium/auxiliary/target-helpers/drm_helper.h b/src/gallium/auxiliary/target-helpers/drm_helper.h index 3d452825aa1..be44b8f71df 100644 --- a/src/gallium/auxiliary/target-helpers/drm_helper.h +++ b/src/gallium/auxiliary/target-helpers/drm_helper.h @@ -348,10 +348,14 @@ pipe_asahi_create_screen(int fd, const struct pipe_screen_config *config) { struct pipe_screen *screen; - screen = asahi_drm_screen_create(fd); + screen = asahi_drm_screen_create(fd, config); return screen ? debug_screen_wrap(screen) : NULL; } -DRM_DRIVER_DESCRIPTOR(asahi, NULL, 0) + +const driOptionDescription asahi_driconf[] = { + #include "asahi/driinfo_asahi.h" +}; +DRM_DRIVER_DESCRIPTOR(asahi, asahi_driconf, ARRAY_SIZE(asahi_driconf)) #else DRM_DRIVER_DESCRIPTOR_STUB(asahi) @@ -444,6 +448,9 @@ const driOptionDescription kmsro_driconf[] = { #if defined(GALLIUM_VC4) || defined(GALLIUM_V3D) #include "v3d/driinfo_v3d.h" #endif +#ifdef GALLIUM_ASAHI + #include "asahi/driinfo_asahi.h" +#endif #ifdef GALLIUM_FREEDRENO #include "freedreno/driinfo_freedreno.h" #endif diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index f3a51752071..de7a5120f91 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -33,6 +33,7 @@ #include "util/u_memory.h" #include "util/u_screen.h" #include "util/u_upload_mgr.h" +#include "util/xmlconfig.h" #include "agx_device.h" #include "agx_disk_cache.h" #include "agx_fence.h" @@ -2129,7 +2130,8 @@ agx_screen_get_fd(struct pipe_screen *pscreen) } struct pipe_screen * -agx_screen_create(int fd, struct renderonly *ro) +agx_screen_create(int fd, struct renderonly *ro, + const struct pipe_screen_config *config) { struct agx_screen *agx_screen; struct pipe_screen *screen; @@ -2144,6 +2146,10 @@ agx_screen_create(int fd, struct renderonly *ro) agx_screen->dev.debug = debug_get_flags_option("ASAHI_MESA_DEBUG", agx_debug_options, 0); + /* parse driconf configuration now for device specific overrides */ + driParseConfigFiles(config->options, config->options_info, 0, "asahi", NULL, + NULL, NULL, 0, NULL, 0); + agx_screen->dev.fd = fd; agx_screen->dev.ro = ro; diff --git a/src/gallium/drivers/asahi/agx_public.h b/src/gallium/drivers/asahi/agx_public.h index f0e0a372c99..0e264cc5317 100644 --- a/src/gallium/drivers/asahi/agx_public.h +++ b/src/gallium/drivers/asahi/agx_public.h @@ -12,7 +12,8 @@ extern "C" { struct pipe_screen; struct renderonly; -struct pipe_screen *agx_screen_create(int fd, struct renderonly *ro); +struct pipe_screen *agx_screen_create(int fd, struct renderonly *ro, + const struct pipe_screen_config *config); #ifdef __cplusplus } diff --git a/src/gallium/drivers/asahi/driinfo_asahi.h b/src/gallium/drivers/asahi/driinfo_asahi.h new file mode 100644 index 00000000000..243f2383376 --- /dev/null +++ b/src/gallium/drivers/asahi/driinfo_asahi.h @@ -0,0 +1,5 @@ +/* asahi specific driconf options */ + +/* clang-format off */ +DRI_CONF_SECTION_MISCELLANEOUS +DRI_CONF_SECTION_END diff --git a/src/gallium/drivers/asahi/meson.build b/src/gallium/drivers/asahi/meson.build index 9a279e8011f..fbf057bd540 100644 --- a/src/gallium/drivers/asahi/meson.build +++ b/src/gallium/drivers/asahi/meson.build @@ -2,6 +2,7 @@ # SPDX-License-Identifier: MIT files_asahi = files( + 'driinfo_asahi.h', 'agx_batch.c', 'agx_blit.c', 'agx_disk_cache.c', diff --git a/src/gallium/winsys/asahi/drm/asahi_drm_public.h b/src/gallium/winsys/asahi/drm/asahi_drm_public.h index 56ede24e964..0ca62eefaa2 100644 --- a/src/gallium/winsys/asahi/drm/asahi_drm_public.h +++ b/src/gallium/winsys/asahi/drm/asahi_drm_public.h @@ -13,7 +13,8 @@ struct pipe_screen; struct pipe_screen_config; struct renderonly; -struct pipe_screen *asahi_drm_screen_create(int drmFD); +struct pipe_screen * +asahi_drm_screen_create(int drmFD, const struct pipe_screen_config *config); struct pipe_screen * asahi_drm_screen_create_renderonly(int fd, struct renderonly *ro, const struct pipe_screen_config *config); diff --git a/src/gallium/winsys/asahi/drm/asahi_drm_winsys.c b/src/gallium/winsys/asahi/drm/asahi_drm_winsys.c index 555ccdf5d6a..f08df35e772 100644 --- a/src/gallium/winsys/asahi/drm/asahi_drm_winsys.c +++ b/src/gallium/winsys/asahi/drm/asahi_drm_winsys.c @@ -23,13 +23,13 @@ static struct pipe_screen * asahi_screen_create(int fd, const struct pipe_screen_config *config, struct renderonly *ro) { - return agx_screen_create(fd, ro); + return agx_screen_create(fd, ro, config); } struct pipe_screen * -asahi_drm_screen_create(int fd) +asahi_drm_screen_create(int fd, const struct pipe_screen_config *config) { - return u_pipe_screen_lookup_or_create(os_dupfd_cloexec(fd), NULL, NULL, + return u_pipe_screen_lookup_or_create(os_dupfd_cloexec(fd), config, NULL, asahi_screen_create); }