mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 04:30:10 +01:00
radeonsi: prepare for driver-specific driconf options
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
1e334a396c
commit
0f8c5de869
9 changed files with 58 additions and 1 deletions
|
|
@ -39,6 +39,8 @@ GALLIUM_TARGET_CFLAGS = \
|
||||||
-I$(top_srcdir)/src/gallium/auxiliary \
|
-I$(top_srcdir)/src/gallium/auxiliary \
|
||||||
-I$(top_srcdir)/src/gallium/drivers \
|
-I$(top_srcdir)/src/gallium/drivers \
|
||||||
-I$(top_srcdir)/src/gallium/winsys \
|
-I$(top_srcdir)/src/gallium/winsys \
|
||||||
|
-I$(top_builddir)/src/util/ \
|
||||||
|
-I$(top_builddir)/src/gallium/drivers/ \
|
||||||
$(DEFINES) \
|
$(DEFINES) \
|
||||||
$(PTHREAD_CFLAGS) \
|
$(PTHREAD_CFLAGS) \
|
||||||
$(LIBDRM_CFLAGS) \
|
$(LIBDRM_CFLAGS) \
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ static const struct drm_driver_descriptor driver_descriptors[] = {
|
||||||
{
|
{
|
||||||
.driver_name = "radeonsi",
|
.driver_name = "radeonsi",
|
||||||
.create_screen = pipe_radeonsi_create_screen,
|
.create_screen = pipe_radeonsi_create_screen,
|
||||||
.configuration = pipe_default_configuration_query,
|
.configuration = pipe_radeonsi_configuration_query,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.driver_name = "vmwgfx",
|
.driver_name = "vmwgfx",
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
#include "target-helpers/inline_debug_helper.h"
|
#include "target-helpers/inline_debug_helper.h"
|
||||||
#include "target-helpers/drm_helper_public.h"
|
#include "target-helpers/drm_helper_public.h"
|
||||||
#include "state_tracker/drm_driver.h"
|
#include "state_tracker/drm_driver.h"
|
||||||
|
#include "util/xmlpool.h"
|
||||||
|
|
||||||
static const struct drm_conf_ret throttle_ret = {
|
static const struct drm_conf_ret throttle_ret = {
|
||||||
.type = DRM_CONF_INT,
|
.type = DRM_CONF_INT,
|
||||||
|
|
@ -175,6 +176,24 @@ pipe_radeonsi_create_screen(int fd, const struct pipe_screen_config *config)
|
||||||
return rw ? debug_screen_wrap(rw->screen) : NULL;
|
return rw ? debug_screen_wrap(rw->screen) : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const struct drm_conf_ret *
|
||||||
|
pipe_radeonsi_configuration_query(enum drm_conf conf)
|
||||||
|
{
|
||||||
|
static const struct drm_conf_ret xml_options_ret = {
|
||||||
|
.type = DRM_CONF_POINTER,
|
||||||
|
.val.val_pointer =
|
||||||
|
#include "radeonsi/si_driinfo.h"
|
||||||
|
};
|
||||||
|
|
||||||
|
switch (conf) {
|
||||||
|
case DRM_CONF_XML_OPTIONS:
|
||||||
|
return &xml_options_ret;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return pipe_default_configuration_query(conf);
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
struct pipe_screen *
|
struct pipe_screen *
|
||||||
|
|
@ -184,6 +203,12 @@ pipe_radeonsi_create_screen(int fd, const struct pipe_screen_config *config)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const struct drm_conf_ret *
|
||||||
|
pipe_radeonsi_configuration_query(enum drm_conf conf)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GALLIUM_VMWGFX
|
#ifdef GALLIUM_VMWGFX
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@ pipe_r600_create_screen(int fd, const struct pipe_screen_config *config);
|
||||||
|
|
||||||
struct pipe_screen *
|
struct pipe_screen *
|
||||||
pipe_radeonsi_create_screen(int fd, const struct pipe_screen_config *config);
|
pipe_radeonsi_create_screen(int fd, const struct pipe_screen_config *config);
|
||||||
|
const struct drm_conf_ret *
|
||||||
|
pipe_radeonsi_configuration_query(enum drm_conf conf);
|
||||||
|
|
||||||
struct pipe_screen *
|
struct pipe_screen *
|
||||||
pipe_vmwgfx_create_screen(int fd, const struct pipe_screen_config *config);
|
pipe_vmwgfx_create_screen(int fd, const struct pipe_screen_config *config);
|
||||||
|
|
|
||||||
|
|
@ -34,3 +34,16 @@ AM_CFLAGS = \
|
||||||
noinst_LTLIBRARIES = libradeonsi.la
|
noinst_LTLIBRARIES = libradeonsi.la
|
||||||
|
|
||||||
libradeonsi_la_SOURCES = $(C_SOURCES)
|
libradeonsi_la_SOURCES = $(C_SOURCES)
|
||||||
|
|
||||||
|
GEN_DRIINFO_INPUTS = \
|
||||||
|
$(top_srcdir)/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h \
|
||||||
|
$(srcdir)/driinfo_radeonsi.h
|
||||||
|
|
||||||
|
PYTHON_GEN = $(AM_V_GEN)$(PYTHON2) $(PYTHON_FLAGS)
|
||||||
|
MERGE_DRIINFO = $(top_srcdir)/src/util/merge_driinfo.py
|
||||||
|
|
||||||
|
si_driinfo.h: $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS)
|
||||||
|
$(PYTHON_GEN) $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS) > $@ || ($(RM) $@; false)
|
||||||
|
|
||||||
|
BUILT_SOURCES = $(GENERATED_SOURCES)
|
||||||
|
CLEANFILES = $(GENERATED_SOURCES)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
|
GENERATED_SOURCES := \
|
||||||
|
si_driinfo.h
|
||||||
|
|
||||||
C_SOURCES := \
|
C_SOURCES := \
|
||||||
|
$(GENERATED_SOURCES) \
|
||||||
cik_sdma.c \
|
cik_sdma.c \
|
||||||
si_blit.c \
|
si_blit.c \
|
||||||
si_compute.c \
|
si_compute.c \
|
||||||
|
|
|
||||||
1
src/gallium/drivers/radeonsi/driinfo_radeonsi.h
Normal file
1
src/gallium/drivers/radeonsi/driinfo_radeonsi.h
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
// DriConf options specific to radeonsi
|
||||||
|
|
@ -27,6 +27,7 @@ AM_CPPFLAGS = \
|
||||||
-I$(top_srcdir)/include \
|
-I$(top_srcdir)/include \
|
||||||
-I$(top_srcdir)/src/gallium/drivers \
|
-I$(top_srcdir)/src/gallium/drivers \
|
||||||
-I$(top_srcdir)/src/gallium/winsys \
|
-I$(top_srcdir)/src/gallium/winsys \
|
||||||
|
-I$(top_builddir)/src/util \
|
||||||
$(GALLIUM_PIPE_LOADER_DEFINES) \
|
$(GALLIUM_PIPE_LOADER_DEFINES) \
|
||||||
$(LIBDRM_CFLAGS) \
|
$(LIBDRM_CFLAGS) \
|
||||||
$(VISIBILITY_CFLAGS) \
|
$(VISIBILITY_CFLAGS) \
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
#include "radeon/radeon_winsys.h"
|
#include "radeon/radeon_winsys.h"
|
||||||
#include "amdgpu/drm/amdgpu_public.h"
|
#include "amdgpu/drm/amdgpu_public.h"
|
||||||
#include "radeonsi/si_public.h"
|
#include "radeonsi/si_public.h"
|
||||||
|
#include "util/xmlpool.h"
|
||||||
|
|
||||||
static struct pipe_screen *
|
static struct pipe_screen *
|
||||||
create_screen(int fd, const struct pipe_screen_config *config)
|
create_screen(int fd, const struct pipe_screen_config *config)
|
||||||
|
|
@ -31,11 +32,19 @@ static const struct drm_conf_ret share_fd_ret = {
|
||||||
|
|
||||||
static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
|
static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
|
||||||
{
|
{
|
||||||
|
static const struct drm_conf_ret xml_options_ret = {
|
||||||
|
.type = DRM_CONF_POINTER,
|
||||||
|
.val.val_pointer =
|
||||||
|
#include "radeonsi/si_driinfo.h"
|
||||||
|
};
|
||||||
|
|
||||||
switch (conf) {
|
switch (conf) {
|
||||||
case DRM_CONF_THROTTLE:
|
case DRM_CONF_THROTTLE:
|
||||||
return &throttle_ret;
|
return &throttle_ret;
|
||||||
case DRM_CONF_SHARE_FD:
|
case DRM_CONF_SHARE_FD:
|
||||||
return &share_fd_ret;
|
return &share_fd_ret;
|
||||||
|
case DRM_CONF_XML_OPTIONS:
|
||||||
|
return &xml_options_ret;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue