summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-04-11 11:09:13 -0400
committerKristian Høgsberg <krh@redhat.com>2008-04-14 15:23:57 -0400
commit35982bc109d424c464551ab22ec90af69908c884 (patch)
tree2187795ea878d4e83d82e9c9d43de1eebc882813
parentf133d85778462134f366389bde7673bff7845fa8 (diff)
Make DRI2 a serverlayout/serverflags option.
Add xf86DRI2Enabled() to export the value of the setting.
-rw-r--r--hw/xfree86/common/xf86.h1
-rw-r--r--hw/xfree86/common/xf86Config.c25
-rw-r--r--hw/xfree86/common/xf86Privstr.h3
3 files changed, 25 insertions, 4 deletions
diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 4b3e10463..065102fb5 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -71,6 +71,7 @@ extern Bool sbusSlotClaimed;
#endif
extern confDRIRec xf86ConfigDRI;
extern Bool xf86inSuspend;
+extern Bool xf86DRI2Enabled(void);
#define XF86SCRNINFO(p) ((ScrnInfoPtr)dixLookupPrivate(&(p)->devPrivates, \
xf86ScreenKey))
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 3cc04f0a1..8e412b56d 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -766,6 +766,7 @@ typedef enum {
FLAG_AUTO_ADD_DEVICES,
FLAG_AUTO_ENABLE_DEVICES,
FLAG_GLX_VISUALS,
+ FLAG_DRI2,
} FlagValues;
static OptionInfoRec FlagOptions[] = {
@@ -837,16 +838,18 @@ static OptionInfoRec FlagOptions[] = {
{0}, FALSE },
{ FLAG_ALLOW_EMPTY_INPUT, "AllowEmptyInput", OPTV_BOOLEAN,
{0}, FALSE },
- { FLAG_IGNORE_ABI, "IgnoreABI", OPTV_BOOLEAN,
+ { FLAG_IGNORE_ABI, "IgnoreABI", OPTV_BOOLEAN,
{0}, FALSE },
- { FLAG_USE_DEFAULT_FONT_PATH, "UseDefaultFontPath", OPTV_BOOLEAN,
+ { FLAG_USE_DEFAULT_FONT_PATH, "UseDefaultFontPath", OPTV_BOOLEAN,
{0}, FALSE },
- { FLAG_AUTO_ADD_DEVICES, "AutoAddDevices", OPTV_BOOLEAN,
+ { FLAG_AUTO_ADD_DEVICES, "AutoAddDevices", OPTV_BOOLEAN,
{0}, TRUE },
- { FLAG_AUTO_ENABLE_DEVICES, "AutoEnableDevices", OPTV_BOOLEAN,
+ { FLAG_AUTO_ENABLE_DEVICES, "AutoEnableDevices", OPTV_BOOLEAN,
{0}, TRUE },
{ FLAG_GLX_VISUALS, "GlxVisuals", OPTV_STRING,
{0}, FALSE },
+ { FLAG_DRI2, "DRI2", OPTV_BOOLEAN,
+ {0}, FALSE },
{ -1, NULL, OPTV_NONE,
{0}, FALSE },
};
@@ -1179,9 +1182,23 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
xf86Msg(from, "Xinerama: enabled\n");
#endif
+#ifdef DRI2
+ xf86Info.dri2 = FALSE;
+ xf86Info.dri2From = X_DEFAULT;
+ if (xf86GetOptValBool(FlagOptions, FLAG_DRI2, &value)) {
+ xf86Info.dri2 = value;
+ xf86Info.dri2From = X_CONFIG;
+ }
+#endif
+
return TRUE;
}
+Bool xf86DRI2Enabled(void)
+{
+ return xf86Info.dri2;
+}
+
/*
* Locate the core input devices. These can be specified/located in
* the following ways, in order of priority:
diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
index d97ca440e..8cab56ec8 100644
--- a/hw/xfree86/common/xf86Privstr.h
+++ b/hw/xfree86/common/xf86Privstr.h
@@ -149,6 +149,9 @@ typedef struct {
Bool autoAddDevices; /* Whether to succeed NIDR, or ignore. */
Bool autoEnableDevices; /* Whether to enable, or let the client
* control. */
+
+ Bool dri2;
+ MessageType dri2From;
} xf86InfoRec, *xf86InfoPtr;
#ifdef DPMSExtension