aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/parser/Screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xfree86/parser/Screen.c')
-rw-r--r--xorg-server/hw/xfree86/parser/Screen.c22
1 files changed, 20 insertions, 2 deletions
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 =