aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/parser
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xfree86/parser')
-rw-r--r--xorg-server/hw/xfree86/parser/Configint.h2
-rw-r--r--xorg-server/hw/xfree86/parser/Screen.c22
-rw-r--r--xorg-server/hw/xfree86/parser/xf86Parser.h5
-rw-r--r--xorg-server/hw/xfree86/parser/xf86tokens.h1
4 files changed, 28 insertions, 2 deletions
diff --git a/xorg-server/hw/xfree86/parser/Configint.h b/xorg-server/hw/xfree86/parser/Configint.h
index 31035ae2d..e5fa6cec2 100644
--- a/xorg-server/hw/xfree86/parser/Configint.h
+++ b/xorg-server/hw/xfree86/parser/Configint.h
@@ -204,6 +204,8 @@ else\
"Multiple \"%s\" lines."
#define MUST_BE_OCTAL_MSG \
"The number \"%d\" given in this section must be in octal (0xxx) format."
+#define GPU_DEVICE_TOO_MANY \
+"More than %d GPU devices defined."
/* Warning messages */
#define OBSOLETE_MSG \
diff --git a/xorg-server/hw/xfree86/parser/Screen.c b/xorg-server/hw/xfree86/parser/Screen.c
index 9d8eda277..b5b454ff4 100644
--- a/xorg-server/hw/xfree86/parser/Screen.c
+++ b/xorg-server/hw/xfree86/parser/Screen.c
@@ -211,6 +211,7 @@ static xf86ConfigSymTabRec ScreenTab[] = {
{DEFAULTFBBPP, "defaultfbbpp"},
{VIRTUAL, "virtual"},
{OPTION, "option"},
+ {GDEVICE, "gpudevice"},
{-1, ""},
};
@@ -270,6 +271,13 @@ xf86parseScreenSection(void)
Error(QUOTE_MSG, "Device");
ptr->scrn_device_str = xf86_lex_val.str;
break;
+ case GDEVICE:
+ if (xf86getSubToken(&(ptr->scrn_comment)) != STRING)
+ Error(QUOTE_MSG, "GPUDevice");
+ if (ptr->num_gpu_devices == CONF_MAXGPUDEVICES)
+ Error(GPU_DEVICE_TOO_MANY, CONF_MAXGPUDEVICES);
+ ptr->scrn_gpu_device_str[ptr->num_gpu_devices++] = xf86_lex_val.str;
+ break;
case MONITOR:
if (xf86getSubToken(&(ptr->scrn_comment)) != STRING)
Error(QUOTE_MSG, "Monitor");
@@ -342,7 +350,7 @@ xf86printScreenSection(FILE * cf, XF86ConfScreenPtr ptr)
XF86ConfAdaptorLinkPtr aptr;
XF86ConfDisplayPtr dptr;
XF86ModePtr mptr;
-
+ int i;
while (ptr) {
fprintf(cf, "Section \"Screen\"\n");
if (ptr->scrn_comment)
@@ -353,6 +361,9 @@ xf86printScreenSection(FILE * cf, XF86ConfScreenPtr ptr)
fprintf(cf, "\tDriver \"%s\"\n", ptr->scrn_obso_driver);
if (ptr->scrn_device_str)
fprintf(cf, "\tDevice \"%s\"\n", ptr->scrn_device_str);
+ for (i = 0; i < ptr->num_gpu_devices; i++)
+ if (ptr->scrn_gpu_device_str[i])
+ fprintf(cf, "\tGPUDevice \"%s\"\n", ptr->scrn_gpu_device_str[i]);
if (ptr->scrn_monitor_str)
fprintf(cf, "\tMonitor \"%s\"\n", ptr->scrn_monitor_str);
if (ptr->scrn_defaultdepth)
@@ -426,11 +437,13 @@ void
xf86freeScreenList(XF86ConfScreenPtr ptr)
{
XF86ConfScreenPtr prev;
-
+ int i;
while (ptr) {
TestFree(ptr->scrn_identifier);
TestFree(ptr->scrn_monitor_str);
TestFree(ptr->scrn_device_str);
+ for (i = 0; i < ptr->num_gpu_devices; i++)
+ TestFree(ptr->scrn_gpu_device_str[i]);
TestFree(ptr->scrn_comment);
xf86optionListFree(ptr->scrn_option_lst);
xf86freeAdaptorLinkList(ptr->scrn_adaptor_lst);
@@ -487,6 +500,7 @@ xf86validateScreen(XF86ConfigPtr p)
XF86ConfScreenPtr screen = p->conf_screen_lst;
XF86ConfMonitorPtr monitor;
XF86ConfAdaptorLinkPtr adaptor;
+ int i;
while (screen) {
if (screen->scrn_obso_driver && !screen->scrn_identifier)
@@ -505,6 +519,10 @@ xf86validateScreen(XF86ConfigPtr p)
screen->scrn_device =
xf86findDevice(screen->scrn_device_str, p->conf_device_lst);
+ for (i = 0; i < screen->num_gpu_devices; i++) {
+ screen->scrn_gpu_devices[i] =
+ xf86findDevice(screen->scrn_gpu_device_str[i], p->conf_device_lst);
+ }
adaptor = screen->scrn_adaptor_lst;
while (adaptor) {
adaptor->al_adaptor =
diff --git a/xorg-server/hw/xfree86/parser/xf86Parser.h b/xorg-server/hw/xfree86/parser/xf86Parser.h
index 43e17550c..b3a50e52f 100644
--- a/xorg-server/hw/xfree86/parser/xf86Parser.h
+++ b/xorg-server/hw/xfree86/parser/xf86Parser.h
@@ -259,6 +259,7 @@ typedef struct {
XF86ConfVideoAdaptorPtr al_adaptor;
} XF86ConfAdaptorLinkRec, *XF86ConfAdaptorLinkPtr;
+#define CONF_MAXGPUDEVICES 4
typedef struct {
GenericListRec list;
const char *scrn_identifier;
@@ -276,6 +277,10 @@ typedef struct {
char *scrn_comment;
int scrn_virtualX, scrn_virtualY;
char *match_seat;
+
+ int num_gpu_devices;
+ const char *scrn_gpu_device_str[CONF_MAXGPUDEVICES];
+ XF86ConfDevicePtr scrn_gpu_devices[CONF_MAXGPUDEVICES];
} XF86ConfScreenRec, *XF86ConfScreenPtr;
typedef struct {
diff --git a/xorg-server/hw/xfree86/parser/xf86tokens.h b/xorg-server/hw/xfree86/parser/xf86tokens.h
index 9c44970ea..bbd6b90d1 100644
--- a/xorg-server/hw/xfree86/parser/xf86tokens.h
+++ b/xorg-server/hw/xfree86/parser/xf86tokens.h
@@ -143,6 +143,7 @@ typedef enum {
/* Screen tokens */
OBSDRIVER,
MDEVICE,
+ GDEVICE,
MONITOR,
SCREENNO,
DEFAULTDEPTH,