Commit 74b786f7 authored by Dave Airlie's avatar Dave Airlie

xfree86: add autoAddGPU option (v2)

This option is to stop the X server adding non-primary devices as
gpu screens.

v2: fix per Keith's suggestion.
Reviewed-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent ef668648
......@@ -712,7 +712,8 @@ typedef enum {
FLAG_AUTO_ENABLE_DEVICES,
FLAG_GLX_VISUALS,
FLAG_DRI2,
FLAG_USE_SIGIO
FLAG_USE_SIGIO,
FLAG_AUTO_ADD_GPU,
} FlagValues;
/**
......@@ -770,6 +771,8 @@ static OptionInfoRec FlagOptions[] = {
{0}, FALSE},
{FLAG_USE_SIGIO, "UseSIGIO", OPTV_BOOLEAN,
{0}, FALSE},
{FLAG_AUTO_ADD_GPU, "AutoAddGPU", OPTV_BOOLEAN,
{0}, FALSE},
{-1, NULL, OPTV_NONE,
{0}, FALSE},
};
......@@ -862,6 +865,16 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
xf86Msg(from, "%sutomatically enabling devices\n",
xf86Info.autoEnableDevices ? "A" : "Not a");
if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ADD_GPU)) {
xf86GetOptValBool(FlagOptions, FLAG_AUTO_ADD_GPU,
&xf86Info.autoAddGPU);
from = X_CONFIG;
}
else {
from = X_DEFAULT;
}
xf86Msg(from, "%sutomatically adding GPU devices\n",
xf86Info.autoAddGPU ? "A" : "Not a");
/*
* Set things up based on the config file information. Some of these
* settings may be overridden later when the command line options are
......
......@@ -126,11 +126,16 @@ xf86InfoRec xf86Info = {
#if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS)
.forceInputDevices = FALSE,
.autoAddDevices = TRUE,
.autoEnableDevices = TRUE
.autoEnableDevices = TRUE,
#else
.forceInputDevices = TRUE,
.autoAddDevices = FALSE,
.autoEnableDevices = FALSE
.autoEnableDevices = FALSE,
#endif
#if defined(CONFIG_UDEV_KMS)
.autoAddGPU = TRUE,
#else
.autoAddGPU = FALSE,
#endif
};
......
......@@ -110,6 +110,8 @@ typedef struct {
Bool dri2;
MessageType dri2From;
Bool autoAddGPU;
} xf86InfoRec, *xf86InfoPtr;
#ifdef DPMSExtension
......
......@@ -373,6 +373,13 @@ xf86platformProbeDev(DriverPtr drvp)
continue;
}
/* if autoaddgpu devices is enabled then go find a few more and add them as GPU screens */
if (xf86Info.autoAddGPU && numDevs) {
for (j = 0; j < xf86_num_platform_devices; j++) {
probeSingleDevice(&xf86_platform_devices[j], drvp, devList[0], PLATFORM_PROBE_GPU_SCREEN);
}
}
return foundScreen;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment