panfrost: add driconf infrastructure
This is the boiler-plate code needed to support driver-specific driconf variables in Panfrost. Acked-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27916>
This commit is contained in:
committed by
Marge Bot
parent
d861bd1563
commit
2bcdc4939c
@@ -331,11 +331,15 @@ pipe_panfrost_create_screen(int fd, const struct pipe_screen_config *config)
|
||||
{
|
||||
struct pipe_screen *screen;
|
||||
|
||||
screen = panfrost_drm_screen_create(fd);
|
||||
screen = panfrost_drm_screen_create(fd, config);
|
||||
return screen ? debug_screen_wrap(screen) : NULL;
|
||||
}
|
||||
DRM_DRIVER_DESCRIPTOR(panfrost, NULL, 0)
|
||||
DRM_DRIVER_DESCRIPTOR_ALIAS(panfrost, panthor, NULL, 0)
|
||||
|
||||
const driOptionDescription pan_driconf[] = {
|
||||
#include "panfrost/driinfo_panfrost.h"
|
||||
};
|
||||
DRM_DRIVER_DESCRIPTOR(panfrost, pan_driconf, ARRAY_SIZE(pan_driconf))
|
||||
DRM_DRIVER_DESCRIPTOR_ALIAS(panfrost, panthor, pan_driconf, ARRAY_SIZE(pan_driconf))
|
||||
|
||||
#else
|
||||
DRM_DRIVER_DESCRIPTOR_STUB(panfrost)
|
||||
@@ -456,6 +460,9 @@ const driOptionDescription kmsro_driconf[] = {
|
||||
#ifdef GALLIUM_FREEDRENO
|
||||
#include "freedreno/driinfo_freedreno.h"
|
||||
#endif
|
||||
#ifdef GALLIUM_PANFROST
|
||||
#include "panfrost/driinfo_panfrost.h"
|
||||
#endif
|
||||
};
|
||||
DRM_DRIVER_DESCRIPTOR(kmsro, kmsro_driconf, ARRAY_SIZE(kmsro_driconf))
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/* panfrost specific driconf options */
|
||||
@@ -20,6 +20,7 @@
|
||||
# SOFTWARE.
|
||||
|
||||
files_panfrost = files(
|
||||
'driinfo_panfrost.h',
|
||||
'pan_afbc_cso.c',
|
||||
'pan_bo.c',
|
||||
'pan_device.c',
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "util/u_process.h"
|
||||
#include "util/u_screen.h"
|
||||
#include "util/u_video.h"
|
||||
#include "util/xmlconfig.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
@@ -834,6 +835,9 @@ panfrost_create_screen(int fd, const struct pipe_screen_config *config,
|
||||
|
||||
struct panfrost_device *dev = pan_device(&screen->base);
|
||||
|
||||
driParseConfigFiles(config->options, config->options_info, 0,
|
||||
"panfrost", NULL, NULL, NULL, 0, NULL, 0);
|
||||
|
||||
/* Debug must be set first for pandecode to work correctly */
|
||||
dev->debug =
|
||||
debug_get_flags_option("PAN_MESA_DEBUG", panfrost_debug_options, 0);
|
||||
|
||||
@@ -34,7 +34,9 @@ struct renderonly;
|
||||
struct renderonly_scanout;
|
||||
struct winsys_handle;
|
||||
|
||||
struct pipe_screen *panfrost_drm_screen_create(int drmFD);
|
||||
struct pipe_screen *
|
||||
panfrost_drm_screen_create(int drmFD,
|
||||
const struct pipe_screen_config *config);
|
||||
struct pipe_screen *
|
||||
panfrost_drm_screen_create_renderonly(int fd, struct renderonly *ro,
|
||||
const struct pipe_screen_config *config);
|
||||
|
||||
@@ -119,9 +119,9 @@ free_dumb:
|
||||
}
|
||||
|
||||
struct pipe_screen *
|
||||
panfrost_drm_screen_create(int fd)
|
||||
panfrost_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,
|
||||
panfrost_create_screen);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user