lima: add driconf infrastructure

This is the boiler-plate code needed to support driver-specific driconf
variables in Lima.

Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35207>
This commit is contained in:
Erik Faye-Lund 2025-05-28 15:04:30 +02:00 committed by Marge Bot
parent 43ca34464f
commit 939d3a96fb
5 changed files with 18 additions and 5 deletions

View file

@ -397,10 +397,14 @@ pipe_lima_create_screen(int fd, const struct pipe_screen_config *config)
{
struct pipe_screen *screen;
screen = lima_drm_screen_create(fd);
screen = lima_drm_screen_create(fd, config);
return screen ? debug_screen_wrap(screen) : NULL;
}
DRM_DRIVER_DESCRIPTOR(lima, NULL, 0)
const driOptionDescription lima_driconf[] = {
#include "lima/driinfo_lima.h"
};
DRM_DRIVER_DESCRIPTOR(lima, lima_driconf, ARRAY_SIZE(lima_driconf))
#else
DRM_DRIVER_DESCRIPTOR_STUB(lima)
@ -450,6 +454,9 @@ const driOptionDescription kmsro_driconf[] = {
#ifdef GALLIUM_PANFROST
#include "panfrost/driinfo_panfrost.h"
#endif
#ifdef GALLIUM_LIMA
#include "lima/driinfo_lima.h"
#endif
};
DRM_DRIVER_DESCRIPTOR(kmsro, kmsro_driconf, ARRAY_SIZE(kmsro_driconf))

View file

@ -0,0 +1 @@
/* lima specific driconf options */

View file

@ -27,6 +27,7 @@
#include "util/ralloc.h"
#include "util/u_debug.h"
#include "util/u_screen.h"
#include "util/xmlconfig.h"
#include "renderonly/renderonly.h"
#include "drm-uapi/drm_fourcc.h"
@ -585,6 +586,9 @@ lima_screen_create(int fd, const struct pipe_screen_config *config,
lima_plb_pp_stream_cache_size = MAX2(128 * 1024 * lima_ctx_num_plb,
lima_plb_pp_stream_cache_size);
driParseConfigFiles(config->options, config->options_info, 0,
"lima", NULL, NULL, NULL, 0, NULL, 0);
if (!lima_screen_query_info(screen))
goto err_out0;

View file

@ -29,7 +29,8 @@
struct pipe_screen;
struct renderonly;
struct pipe_screen *lima_drm_screen_create(int drmFD);
struct pipe_screen *lima_drm_screen_create(int drmFD,
const struct pipe_screen_config *config);
struct pipe_screen *lima_drm_screen_create_renderonly(int fd,
struct renderonly *ro,
const struct pipe_screen_config *config);

View file

@ -30,9 +30,9 @@
#include "lima/lima_screen.h"
struct pipe_screen *
lima_drm_screen_create(int fd)
lima_drm_screen_create(int fd, const struct pipe_screen_config *config)
{
return u_pipe_screen_lookup_or_create(os_dupfd_cloexec(fd), NULL,
return u_pipe_screen_lookup_or_create(os_dupfd_cloexec(fd), config,
NULL, lima_screen_create);
}