diff options
author | Ian Romanick <idr@us.ibm.com> | 2007-06-18 16:51:13 -0700 |
---|---|---|
committer | Ian Romanick <idr@us.ibm.com> | 2007-06-18 16:51:13 -0700 |
commit | ab7a6d860d4a275a810a64b1ba7b13726ed10575 (patch) | |
tree | 1198628dab08c3989dff073b4bbe6920a1feca59 /hw/xfree86 | |
parent | e9130b8bac73a0843d5ff6b2216eccfb3e094a48 (diff) | |
parent | 2e7fef7d0837939e822c40b6ac77e7f0e66d57bd (diff) |
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-rework
Conflicts:
hw/xfree86/os-support/bus/Pci.c
hw/xfree86/os-support/bus/linuxPci.c
Diffstat (limited to 'hw/xfree86')
64 files changed, 2013 insertions, 2087 deletions
diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h index ea995eda1..becd3da25 100644 --- a/hw/xfree86/common/compiler.h +++ b/hw/xfree86/common/compiler.h @@ -1365,7 +1365,7 @@ do { \ # define write_mem_barrier() /* NOP */ # if !defined(__SUNPRO_C) -# if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) +# if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) # ifdef GCCUSESGAS /* diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index 89e2afabd..d2d1c6fd7 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -217,7 +217,7 @@ xf86AutoConfig(void) char buf[1024]; struct pci_device_iterator *iter; struct pci_device * info = NULL; - char *driver = NULL; + const char *driver = NULL; ConfigStatus ret; /* Find the primary device, and get some information about it. */ diff --git a/hw/xfree86/common/xf86Build.h.in b/hw/xfree86/common/xf86Build.h.in index 3f254133a..a4f56b0ae 100644 --- a/hw/xfree86/common/xf86Build.h.in +++ b/hw/xfree86/common/xf86Build.h.in @@ -1 +1,2 @@ #define BUILD_DATE @BUILD_DATE@ +#define BUILD_TIME @BUILD_TIME@ diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index 686e1eeac..537ddf7a4 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -3003,7 +3003,7 @@ xf86FindPrimaryDevice() } } -#if !defined(__sparc) && !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__) +#if !defined(__sparc) && !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__) && !defined(__arm__) #include "vgaHW.h" #include "compiler.h" #endif diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 986244557..6369d6dda 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -132,9 +132,9 @@ static Bool configInput(IDevPtr inputp, XF86ConfInputPtr conf_input, static Bool configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display); static Bool addDefaultModes(MonPtr monitorp); #ifdef XF86DRI -static Bool configDRI(XF86ConfDRIPtr drip); +static void configDRI(XF86ConfDRIPtr drip); #endif -static Bool configExtensions(XF86ConfExtensionsPtr conf_ext); +static void configExtensions(XF86ConfExtensionsPtr conf_ext); /* * xf86GetPathElem -- @@ -255,6 +255,7 @@ xf86ModulelistFromConfig(pointer **optlist) char *ignore[] = { "GLcore", "speedo", "bitmap", "drm", NULL }; pointer *optarray; XF86LoadPtr modp; + Bool found; /* * make sure the config file has been parsed and that we have a @@ -267,35 +268,76 @@ xf86ModulelistFromConfig(pointer **optlist) } if (xf86configptr->conf_modules) { - /* - * Walk the list of modules in the "Module" section to determine how - * many we have. - */ - modp = xf86configptr->conf_modules->mod_load_lst; - while (modp) { - for (i = 0; ignore[i]; i++) { - if (strcmp(modp->load_name, ignore[i]) == 0) - modp->ignore = 1; + /* Walk the disable list and let people know what we've parsed to + * not be loaded + */ + modp = xf86configptr->conf_modules->mod_disable_lst; + while (modp) { + xf86Msg(X_WARNING, "\"%s\" will not be loaded unless you've specified it to be loaded elsewhere.\n", modp->load_name); + modp = (XF86LoadPtr) modp->list.next; + } + /* + * Walk the default settings table. For each module listed to be + * loaded, make sure it's in the mod_load_lst. If it's not, make + * sure it's not in the mod_no_load_lst. If it's not disabled, + * append it to mod_load_lst + */ + for (i=0 ; ModuleDefaults[i].name != NULL ; i++) { + if (ModuleDefaults[i].toLoad == FALSE) { + xf86Msg(X_WARNING, "\"%s\" is not to be loaded by default. Skipping.\n", ModuleDefaults[i].name); + continue; } - if (!modp->ignore) - count++; - modp = (XF86LoadPtr) modp->list.next; - } + found = FALSE; + modp = xf86configptr->conf_modules->mod_load_lst; + while (modp) { + if (strcmp(modp->load_name, ModuleDefaults[i].name) == 0) { + xf86Msg(X_INFO, "\"%s\" will be loaded. This was enabled by default and also specified in the config file.\n", ModuleDefaults[i].name); + found = TRUE; + break; + } + modp = (XF86LoadPtr) modp->list.next; + } + if (found == FALSE) { + modp = xf86configptr->conf_modules->mod_disable_lst; + while (modp) { + if (strcmp(modp->load_name, ModuleDefaults[i].name) == 0) { + xf86Msg(X_INFO, "\"%s\" will be loaded even though the default is to disable it.\n", ModuleDefaults[i].name); + found = TRUE; + break; + } + modp = (XF86LoadPtr) modp->list.next; + } + } + if (found == FALSE) { + XF86ConfModulePtr ptr = xf86configptr->conf_modules; + ptr = xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt); + xf86Msg(X_INFO, "\"%s\" will be loaded by default.\n", ModuleDefaults[i].name); + } + } } else { xf86configptr->conf_modules = xnfcalloc(1, sizeof(XF86ConfModuleRec)); + for (i=0 ; ModuleDefaults[i].name != NULL ; i++) { + if (ModuleDefaults[i].toLoad == TRUE) { + XF86ConfModulePtr ptr = xf86configptr->conf_modules; + ptr = xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt); + } + } } - if (count == 0) { - XF86ConfModulePtr ptr = xf86configptr->conf_modules; - ptr = xf86addNewLoadDirective(ptr, "extmod", XF86_LOAD_MODULE, NULL); - ptr = xf86addNewLoadDirective(ptr, "dbe", XF86_LOAD_MODULE, NULL); - ptr = xf86addNewLoadDirective(ptr, "glx", XF86_LOAD_MODULE, NULL); - ptr = xf86addNewLoadDirective(ptr, "freetype", XF86_LOAD_MODULE, NULL); - ptr = xf86addNewLoadDirective(ptr, "type1", XF86_LOAD_MODULE, NULL); - ptr = xf86addNewLoadDirective(ptr, "record", XF86_LOAD_MODULE, NULL); - ptr = xf86addNewLoadDirective(ptr, "dri", XF86_LOAD_MODULE, NULL); - count = 7; - } + /* + * Walk the list of modules in the "Module" section to determine how + * many we have. + */ + modp = xf86configptr->conf_modules->mod_load_lst; + while (modp) { + for (i = 0; ignore[i]; i++) { + if (strcmp(modp->load_name, ignore[i]) == 0) + modp->ignore = 1; + } + if (!modp->ignore) + count++; + modp = (XF86LoadPtr) modp->list.next; + } /* * allocate the memory and walk the list again to fill in the pointers @@ -304,22 +346,22 @@ xf86ModulelistFromConfig(pointer **optlist) optarray = xnfalloc((count + 1) * sizeof(pointer)); count = 0; if (xf86configptr->conf_modules) { - modp = xf86configptr->conf_modules->mod_load_lst; - while (modp) { + modp = xf86configptr->conf_modules->mod_load_lst; + while (modp) { if (!modp->ignore) { - modulearray[count] = modp->load_name; - optarray[count] = modp->load_opt; - count++; + modulearray[count] = modp->load_name; + optarray[count] = modp->load_opt; + count++; } - modp = (XF86LoadPtr) modp->list.next; - } + modp = (XF86LoadPtr) modp->list.next; + } } modulearray[count] = NULL; optarray[count] = NULL; if (optlist) - *optlist = optarray; + *optlist = optarray; else - xfree(optarray); + xfree(optarray); return modulearray; } @@ -557,7 +599,7 @@ xf86ConfigError(char *msg, ...) return; } -static Bool +static void configFiles(XF86ConfFilesPtr fileconf) { MessageType pathFrom = X_DEFAULT; @@ -566,16 +608,24 @@ configFiles(XF86ConfFilesPtr fileconf) char *log_buf; /* FontPath */ - /* Try XF86Config FontPath first */ if (!xf86fpFlag) { if (fileconf) { if (fileconf->file_fontpath) { char *f = xf86ValidateFontPath(fileconf->file_fontpath); pathFrom = X_CONFIG; - if (*f) - defaultFontPath = f; - else { + if (*f) { + if (xf86Info.useDefaultFontPath) { + xf86Msg(X_DEFAULT, "Including the default font path %s.\n", defaultFontPath); + char *g = xnfalloc(strlen(defaultFontPath) + strlen(f) + 3); + strcpy(g, f); + strcat(g, ","); + defaultFontPath = strcat(g, defaultFontPath); + xfree(f); + } else { + defaultFontPath = f; + } + } else { xf86Msg(X_WARNING, "FontPath is completely invalid. Using compiled-in default.\n"); fontPath = NULL; @@ -583,7 +633,7 @@ configFiles(XF86ConfFilesPtr fileconf) } } } else { - xf86Msg(X_WARNING, + xf86Msg(X_DEFAULT, "No FontPath specified. Using compiled-in default.\n"); pathFrom = X_DEFAULT; } @@ -703,7 +753,7 @@ configFiles(XF86ConfFilesPtr fileconf) } #endif - return TRUE; + return; } typedef enum { @@ -743,6 +793,7 @@ typedef enum { FLAG_AIGLX, FLAG_IGNORE_ABI, FLAG_ALLOW_EMPTY_INPUT, + FLAG_USE_DEFAULT_FONT_PATH } FlagValues; static OptionInfoRec FlagOptions[] = { @@ -818,6 +869,8 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE }, { FLAG_IGNORE_ABI, "IgnoreABI", OPTV_BOOLEAN, {0}, FALSE }, + { FLAG_USE_DEFAULT_FONT_PATH, "UseDefaultFontPath", OPTV_BOOLEAN, + {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE }, }; @@ -1017,6 +1070,13 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) if (xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &value)) xf86Info.allowEmptyInput = TRUE; + xf86Info.useDefaultFontPath = TRUE; + xf86Info.useDefaultFontPathFrom = X_DEFAULT; + if (xf86GetOptValBool(FlagOptions, FLAG_USE_DEFAULT_FONT_PATH, &value)) { + xf86Info.useDefaultFontPath = value; + xf86Info.useDefaultFontPathFrom = X_CONFIG; + } + /* Make sure that timers don't overflow CARD32's after multiplying */ #define MAX_TIME_IN_MIN (0x7fffffff / MILLI_PER_MIN) @@ -1272,7 +1332,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) (count + 1) * sizeof(IDevRec)); indp[count - 1] = Pointer; indp[count - 1].extraOptions = - xf86addNewOption(NULL, "CorePointer", NULL); + xf86addNewOption(NULL, xnfstrdup("CorePointer"), NULL); indp[count].identifier = NULL; servlayoutp->inputs = indp; } @@ -1288,9 +1348,13 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) * always synthesize a 'mouse' section configured to send core * events, unless a 'void' section is found, in which case the user * probably wants to run footless. + * + * If you're using an evdev keyboard and expect a default mouse + * section ... deal. */ for (i = servlayoutp->inputs; i->identifier && i->driver; i++) { - if (!strcmp(i->driver, "void") || !strcmp(i->driver, "mouse")) { + if (!strcmp(i->driver, "void") || !strcmp(i->driver, "mouse") || + !strcmp(i->driver, "vmmouse") || !strcmp(i->driver, "evdev")) { found = 1; break; } } @@ -1307,7 +1371,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) (count + 1) * sizeof(IDevRec)); indp[count - 1] = Pointer; indp[count - 1].extraOptions = - xf86addNewOption(NULL, "AlwaysCore", NULL); + xf86addNewOption(NULL, xnfstrdup("AlwaysCore"), NULL); indp[count].identifier = NULL; servlayoutp->inputs = indp; } @@ -1398,7 +1462,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) (count + 1) * sizeof(IDevRec)); indp[count - 1] = Keyboard; indp[count - 1].extraOptions = - xf86addNewOption(NULL, "CoreKeyboard", NULL); + xf86addNewOption(NULL, xnfstrdup("CoreKeyboard"), NULL); indp[count].identifier = NULL; servlayoutp->inputs = indp; } @@ -1411,13 +1475,13 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) } if (pointerMsg) { - xf86Msg(X_WARNING, "The core pointer device wasn't specified " + xf86Msg(X_DEFAULT, "The core pointer device wasn't specified " "explicitly in the layout.\n" "\tUsing the %s.\n", pointerMsg); } if (keyboardMsg) { - xf86Msg(X_WARNING, "The core keyboard device wasn't specified " + xf86Msg(X_DEFAULT, "The core keyboard device wasn't specified " "explicitly in the layout.\n" "\tUsing the %s.\n", keyboardMsg); } @@ -1746,7 +1810,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen) indp = xnfalloc(sizeof(IDevRec)); indp->identifier = NULL; servlayoutp->inputs = indp; - if (!xf86Info.allowEmptyInput && checkCoreInputDevices(servlayoutp, TRUE)) + if (!xf86Info.allowEmptyInput && !checkCoreInputDevices(servlayoutp, TRUE)) return FALSE; return TRUE; @@ -1874,7 +1938,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum, } if (defaultMonitor) { - xf86Msg(X_WARNING, "No monitor specified for screen \"%s\".\n" + xf86Msg(X_DEFAULT, "No monitor specified for screen \"%s\".\n" "\tUsing a default monitor configuration.\n", screenp->id); } return TRUE; @@ -2165,7 +2229,7 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active) } #ifdef XF86DRI -static Bool +static void configDRI(XF86ConfDRIPtr drip) { int count = 0; @@ -2206,12 +2270,10 @@ configDRI(XF86ConfDRIPtr drip) xf86ConfigDRI.bufs[i].flags = 0; } } - - return TRUE; } #endif -static Bool +static void configExtensions(XF86ConfExtensionsPtr conf_ext) { XF86OptionPtr o; @@ -2246,11 +2308,9 @@ configExtensions(XF86ConfExtensionsPtr conf_ext) xf86NameCmp(val, "false") == 0) { enable = !enable; } else { - xf86Msg(X_ERROR, - "%s is not a valid value for the Extension option\n", - val); + xf86Msg(X_WARNING, "Ignoring unrecognized value \"%s\"\n", val); xfree(n); - return FALSE; + continue; } if (EnableDisableExtension(name, enable)) { @@ -2263,8 +2323,6 @@ configExtensions(XF86ConfExtensionsPtr conf_ext) xfree(n); } } - - return TRUE; } static Bool @@ -2394,7 +2452,7 @@ xf86HandleConfigFile(Bool autoconfig) if (xf86configptr->conf_layout_lst == NULL || xf86ScreenName != NULL) { if (xf86ScreenName == NULL) { - xf86Msg(X_WARNING, + xf86Msg(X_DEFAULT, "No Layout section. Using the first Screen section.\n"); } if (!configImpliedLayout(&xf86ConfigLayout, @@ -2448,19 +2506,17 @@ xf86HandleConfigFile(Bool autoconfig) } /* Now process everything else */ - - if (!configFiles(xf86configptr->conf_files) || - !configServerFlags(xf86configptr->conf_flags, - xf86ConfigLayout.options) || - !configExtensions(xf86configptr->conf_extensions) -#ifdef XF86DRI - || !configDRI(xf86configptr->conf_dri) -#endif - ) { + if (!configServerFlags(xf86configptr->conf_flags,xf86ConfigLayout.options)){ ErrorF ("Problem when converting the config data structures\n"); return CONFIG_PARSE_ERROR; } + configFiles(xf86configptr->conf_files); + configExtensions(xf86configptr->conf_extensions); +#ifdef XF86DRI + configDRI(xf86configptr->conf_dri); +#endif + checkInput(&xf86ConfigLayout); /* diff --git a/hw/xfree86/common/xf86Config.h b/hw/xfree86/common/xf86Config.h index 3787ba21e..7fc161d49 100644 --- a/hw/xfree86/common/xf86Config.h +++ b/hw/xfree86/common/xf86Config.h @@ -33,6 +33,8 @@ #ifndef _xf86_config_h #define _xf86_config_h +#include "xf86Optrec.h" + #ifdef HAVE_PARSER_DECLS /* * global structure that holds the result of parsing the config file @@ -46,6 +48,23 @@ typedef enum _ConfigStatus { CONFIG_NOFILE } ConfigStatus; +typedef struct _ModuleDefault { + char *name; + Bool toLoad; + XF86OptionPtr load_opt; +} ModuleDefault; + +static ModuleDefault ModuleDefaults[] = { + {.name = "extmod", .toLoad = TRUE, .load_opt=NULL}, + {.name = "dbe", .toLoad = TRUE, .load_opt=NULL}, + {.name = "glx", .toLoad = TRUE, .load_opt=NULL}, + {.name = "freetype", .toLoad = TRUE, .load_opt=NULL}, + {.name = "type1", .toLoad = TRUE, .load_opt=NULL}, + {.name = "record", .toLoad = TRUE, .load_opt=NULL}, + {.name = "dri", .toLoad = TRUE, .load_opt=NULL}, + {.name = NULL, .toLoad = FALSE, .load_opt=NULL} +}; + /* * prototypes */ diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index 0b7297511..536564a7c 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -312,13 +312,16 @@ configureInputSection (void) mouse->inp_identifier = "Mouse0"; mouse->inp_driver = "mouse"; mouse->inp_option_lst = - xf86addNewOption(mouse->inp_option_lst, "Protocol", DFLT_MOUSE_PROTO); + xf86addNewOption(mouse->inp_option_lst, xstrdup("Protocol"), + xstrdup(DFLT_MOUSE_PROTO)); #ifndef __SCO__ mouse->inp_option_lst = - xf86addNewOption(mouse->inp_option_lst, "Device", DFLT_MOUSE_DEV); + xf86addNewOption(mouse->inp_option_lst, xstrdup("Device"), + xstrdup(DFLT_MOUSE_DEV)); #endif mouse->inp_option_lst = - xf86addNewOption(mouse->inp_option_lst, "ZAxisMapping", "4 5 6 7"); + xf86addNewOption(mouse->inp_option_lst, xstrdup("ZAxisMapping"), + xstrdup("4 5 6 7")); ptr = (XF86ConfInputPtr)xf86addListItem((glp)ptr, (glp)mouse); return ptr; } @@ -522,7 +525,7 @@ configureLayoutSection (void) iptr->iref_option_lst = NULL; iptr->iref_inputdev_str = "Mouse0"; iptr->iref_option_lst = - xf86addNewOption (iptr->iref_option_lst, "CorePointer", NULL); + xf86addNewOption (iptr->iref_option_lst, xstrdup("CorePointer"), NULL); ptr->lay_input_lst = (XF86ConfInputrefPtr) xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr); } @@ -535,7 +538,7 @@ configureLayoutSection (void) iptr->iref_option_lst = NULL; iptr->iref_inputdev_str = "Keyboard0"; iptr->iref_option_lst = - xf86addNewOption (iptr->iref_option_lst, "CoreKeyboard", NULL); + xf86addNewOption (iptr->iref_option_lst, xstrdup("CoreKeyboard"), NULL); ptr->lay_input_lst = (XF86ConfInputrefPtr) xf86addListItem ((glp) ptr->lay_input_lst, (glp) iptr); } @@ -754,7 +757,7 @@ configureDDCMonitorSection (int screennum) } if (ConfiguredMonitor->features.dpms) { - ptr->mon_option_lst = xf86addNewOption(ptr->mon_option_lst, "DPMS", NULL); + ptr->mon_option_lst = xf86addNewOption(ptr->mon_option_lst, xstrdup("DPMS"), NULL); } return ptr; diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c index 43db1ee1a..9474ec8e0 100644 --- a/hw/xfree86/common/xf86DGA.c +++ b/hw/xfree86/common/xf86DGA.c @@ -249,14 +249,11 @@ DGACloseScreen(int i, ScreenPtr pScreen) DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); if (XDGAEventBase) { - OsBlockSignals(); - ProcessInputEvents(); mieqSetHandler(*XDGAEventBase + MotionNotify, NULL); mieqSetHandler(*XDGAEventBase + ButtonPress, NULL); mieqSetHandler(*XDGAEventBase + ButtonRelease, NULL); mieqSetHandler(*XDGAEventBase + KeyPress, NULL); mieqSetHandler(*XDGAEventBase + KeyRelease, NULL); - OsReleaseSignals(); } FreeMarkedVisuals(pScreen); diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 3610c17c0..4da74e556 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -1208,31 +1208,3 @@ _X_EXPORT void DDXRingBell(int volume, int pitch, int duration) { xf86OSRingBell(volume, pitch, duration); } - -#ifdef WSCONS_SUPPORT - -/* XXX Currently XKB is mandatory. */ - -extern int WSKbdToKeycode(int); - -void -xf86PostWSKbdEvent(struct wscons_event *event) -{ - int type = event->type; - int value = event->value; - unsigned int keycode; - int blocked; - - if (type == WSCONS_EVENT_KEY_UP || type == WSCONS_EVENT_KEY_DOWN) { - Bool down = (type == WSCONS_EVENT_KEY_DOWN ? TRUE : FALSE); - - /* map the scancodes to standard XFree86 scancode */ - keycode = WSKbdToKeycode(value); - if (!down) keycode |= 0x80; - /* It seems better to block SIGIO there */ - blocked = xf86BlockSIGIO(); - xf86PostKbdEvent(keycode); - xf86UnblockSIGIO(blocked); - } -} -#endif /* WSCONS_SUPPORT */ diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 5353a5758..e2da752d1 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -374,8 +374,11 @@ xf86DeleteInput(InputInfoPtr pInp, int flags) if (pInp->drv) pInp->drv->refCount--; + /* This should *really* be handled in drv->UnInit(dev) call instead */ +#if 0 if (pInp->private) xfree(pInp->private); +#endif /* Remove the entry from the list. */ if (pInp == xf86InputDevs) diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 17cc06bb4..0689a5c4b 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -1948,8 +1948,16 @@ xf86PrintBanner() t.tm_mday = BUILD_DATE % 100; t.tm_mon = (BUILD_DATE / 100) % 100 - 1; t.tm_year = BUILD_DATE / 10000 - 1900; +#if defined(BUILD_TIME) + t.tm_sec = BUILD_TIME % 100; + t.tm_min = (BUILD_TIME / 100) % 100; + t.tm_hour = (BUILD_TIME / 10000) % 100; + if (strftime(buf, sizeof(buf), "%d %B %Y %I:%M:%s%p", &t)) + ErrorF("Build Date: %s\n", buf); +#else if (strftime(buf, sizeof(buf), "%d %B %Y", &t)) ErrorF("Build Date: %s\n", buf); +#endif } #endif #if defined(CLOG_DATE) && (CLOG_DATE > 19000000) diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c index fc905dfac..b343788fc 100644 --- a/hw/xfree86/common/xf86Mode.c +++ b/hw/xfree86/common/xf86Mode.c @@ -1890,7 +1890,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, virtX, virtY, vx, vy); virtX = vx; virtY = vy; - linePitch = miScanLineWidth(vx, vy, linePitch, apertureSize, + linePitch = miScanLineWidth(vx, vy, minPitch, apertureSize, BankFormat, pitchInc); } } diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index 281183960..cdf3d1bea 100644 --- a/hw/xfree86/common/xf86Module.h +++ b/hw/xfree86/common/xf86Module.h @@ -84,8 +84,8 @@ typedef enum { * mask is 0xFFFF0000. */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 3) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(1, 2) -#define ABI_XINPUT_VERSION SET_ABI_VERSION(1, 0) +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(2, 0) +#define ABI_XINPUT_VERSION SET_ABI_VERSION(1, 1) #define ABI_EXTENSION_VERSION SET_ABI_VERSION(0, 3) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 5) diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c index 7afb63a4d..50a7d9cb9 100644 --- a/hw/xfree86/common/xf86Option.c +++ b/hw/xfree86/common/xf86Option.c @@ -289,7 +289,7 @@ xf86CheckBoolOption(pointer optlist, const char *name, int deflt) _X_EXPORT pointer xf86ReplaceIntOption(pointer optlist, const char *name, const int val) { - char *tmp = xnfalloc(16); + char tmp[16]; sprintf(tmp,"%i",val); return xf86AddNewOption(optlist,name,tmp); } @@ -297,7 +297,7 @@ xf86ReplaceIntOption(pointer optlist, const char *name, const int val) _X_EXPORT pointer xf86ReplaceRealOption(pointer optlist, const char *name, const double val) { - char *tmp = xnfalloc(32); + char tmp[32]; snprintf(tmp,32,"%f",val); return xf86AddNewOption(optlist,name,tmp); } diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h index 659e566e0..7ca0669a5 100644 --- a/hw/xfree86/common/xf86Privstr.h +++ b/hw/xfree86/common/xf86Privstr.h @@ -120,6 +120,8 @@ typedef struct { MessageType randRFrom; Bool aiglx; MessageType aiglxFrom; + Bool useDefaultFontPath; + MessageType useDefaultFontPathFrom; Bool ignoreABI; struct { Bool disabled; /* enable/disable deactivating diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 17ffed899..c08b15f7e 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -101,7 +101,7 @@ xf86SendDragEvents(DeviceIntPtr device) { LocalDevicePtr local = (LocalDevicePtr) device->public.devicePrivate; - if (device->button->buttonsDown > 0) + if (device->button && device->button->buttonsDown > 0) return (local->flags & XI86_SEND_DRAG_EVENTS); else return (TRUE); @@ -119,10 +119,12 @@ _X_EXPORT void xf86ProcessCommonOptions(LocalDevicePtr local, pointer list) { - if (!xf86SetBoolOption(list, "AlwaysCore", 0) || - xf86SetBoolOption(list, "SendCoreEvents", 0) || - xf86SetBoolOption(list, "CorePointer", 0) || - xf86SetBoolOption(list, "CoreKeyboard", 0)) { + if (xf86SetBoolOption(list, "AlwaysCore", 0) || + !xf86SetBoolOption(list, "SendCoreEvents", 1) || + !xf86SetBoolOption(list, "CorePointer", 1) || + !xf86SetBoolOption(list, "CoreKeyboard", 1)) { + xf86Msg(X_CONFIG, "%s: doesn't report core events\n", local->name); + } else { local->flags |= XI86_ALWAYS_CORE; xf86Msg(X_CONFIG, "%s: always reports core events\n", local->name); } @@ -315,78 +317,137 @@ AddOtherInputDevices() #endif int -NewInputDeviceRequest (InputOption *options) +NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev) { IDevRec *idev = NULL; InputDriverPtr drv = NULL; InputInfoPtr pInfo = NULL; InputOption *option = NULL; DeviceIntPtr dev = NULL; + int rval = Success; idev = xcalloc(sizeof(*idev), 1); if (!idev) return BadAlloc; for (option = options; option; option = option->next) { - if (strcmp(option->key, "driver") == 0) { - if (!xf86LoadOneModule(option->value, NULL)) - return BadName; + if (strcasecmp(option->key, "driver") == 0) { + if (idev->driver) { + rval = BadRequest; + goto unwind; + } + /* Memory leak for every attached device if we don't + * test if the module is already loaded first */ drv = xf86LookupInputDriver(option->value); + if (!drv) + if(xf86LoadOneModule(option->value, NULL)) + drv = xf86LookupInputDriver(option->value); if (!drv) { xf86Msg(X_ERROR, "No input driver matching `%s'\n", option->value); - return BadName; + rval = BadName; + goto unwind; } idev->driver = xstrdup(option->value); if (!idev->driver) { - xfree(idev); - return BadAlloc; + rval = BadAlloc; + goto unwind; } } - if (strcmp(option->key, "name") == 0 || - strcmp(option->key, "identifier") == 0) { + if (strcasecmp(option->key, "name") == 0 || + strcasecmp(option->key, "identifier") == 0) { + if (idev->identifier) { + rval = BadRequest; + goto unwind; + } idev->identifier = xstrdup(option->value); if (!idev->identifier) { - xfree(idev); - return BadAlloc; + rval = BadAlloc; + goto unwind; } } } + if(!idev->driver || !idev->identifier) { + xf86Msg(X_ERROR, "No input driver/identifier specified (ignoring)\n"); + rval = BadRequest; + goto unwind; + } if (!drv->PreInit) { xf86Msg(X_ERROR, "Input driver `%s' has no PreInit function (ignoring)\n", drv->driverName); - return BadImplementation; + rval = BadImplementation; + goto unwind; } - idev->commonOptions = NULL; - for (option = options; option; option = option->next) + for (option = options; option; option = option->next) { + /* Steal option key/value strings from the provided list. + * We need those strings, the InputOption list doesn't. */ idev->commonOptions = xf86addNewOption(idev->commonOptions, option->key, option->value); - idev->extraOptions = NULL; + option->key = NULL; + option->value = NULL; + } pInfo = drv->PreInit(drv, idev, 0); if (!pInfo) { xf86Msg(X_ERROR, "PreInit returned NULL for \"%s\"\n", idev->identifier); - return BadMatch; + rval = BadMatch; + goto unwind; } else if (!(pInfo->flags & XI86_CONFIGURED)) { xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n", idev->identifier); - xf86DeleteInput(pInfo, 0); - return BadMatch; + rval = BadMatch; + goto unwind; } xf86ActivateDevice(pInfo); dev = pInfo->dev; - dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success); - if (dev->inited && dev->startup) + ActivateDevice(dev); + if (dev->inited && dev->startup && xf86Screens[0]->vtSema) EnableDevice(dev); + *pdev = dev; return Success; + +unwind: + if(pInfo) { + if(drv->UnInit) + drv->UnInit(drv, pInfo, 0); + else + xf86DeleteInput(pInfo, 0); + } + if(idev->driver) + xfree(idev->driver); + if(idev->identifier) + xfree(idev->identifier); + xf86optionListFree(idev->commonOptions); + xfree(idev); + return rval; +} + +void +DeleteInputDeviceRequest(DeviceIntPtr pDev) +{ + LocalDevicePtr pInfo = (LocalDevicePtr) pDev->public.devicePrivate; + InputDriverPtr drv = pInfo->drv; + IDevRec *idev = pInfo->conf_idev; + + RemoveDevice(pDev); + + if(drv->UnInit) + drv->UnInit(drv, pInfo, 0); + else + xf86DeleteInput(pInfo, 0); + + xfree(idev->driver); + xfree(idev->identifier); + xf86optionListFree(idev->commonOptions); + xfree(idev); } /* @@ -401,25 +462,46 @@ xf86PostMotionEvent(DeviceIntPtr device, ...) { va_list var; + int i = 0; + static int *valuators = NULL; + static int n_valuators = 0; + + if (num_valuators > n_valuators) { + xfree (valuators); + valuators = NULL; + } + + if (!valuators) { + valuators = xcalloc(sizeof(int), num_valuators); + n_valuators = num_valuators; + } + + va_start(var, num_valuators); + for (i = 0; i < num_valuators; i++) + valuators[i] = va_arg(var, int); + va_end(var); + + xf86PostMotionEventP(device, is_absolute, first_valuator, num_valuators, valuators); +} + +_X_EXPORT void +xf86PostMotionEventP(DeviceIntPtr device, + int is_absolute, + int first_valuator, + int num_valuators, + int *valuators) +{ int i = 0, nevents = 0; int dx, dy; Bool drag = xf86SendDragEvents(device); - int *valuators = NULL; - int flags = 0; xEvent *xE = NULL; int index; + int flags = 0; if (is_absolute) flags = POINTER_ABSOLUTE; else flags = POINTER_RELATIVE | POINTER_ACCELERATE; - - valuators = xcalloc(sizeof(int), num_valuators); - - va_start(var, num_valuators); - for (i = 0; i < num_valuators; i++) - valuators[i] = va_arg(var, int); - va_end(var); #if XFreeXDGA if (first_valuator == 0 && num_valuators >= 2) { @@ -434,7 +516,7 @@ xf86PostMotionEvent(DeviceIntPtr device, dy = valuators[1]; } if (DGAStealMotionEvent(index, dx, dy)) - goto out; + return; } } #endif @@ -456,9 +538,6 @@ xf86PostMotionEvent(DeviceIntPtr device, mieqEnqueue(device, xf86Events + i); } } - -out: - xfree(valuators); } _X_EXPORT void @@ -705,4 +784,48 @@ xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum) } } + +/** + * Deactivate a device. Call this function from the driver if you receive a + * read error or something else that spoils your day. + * Device will be moved to the off_devices list, but it will still be there + * until you really clean up after it. + * Notifies the client about an inactive device. + * + * @param panic True if device is unrecoverable and needs to be removed. + */ +_X_EXPORT void +xf86DisableDevice(DeviceIntPtr dev, Bool panic) +{ + devicePresenceNotify ev; + DeviceIntRec dummyDev; + + if(!panic) + { + DisableDevice(dev); + } else + { + ev.type = DevicePresenceNotify; + ev.time = currentTime.milliseconds; + ev.devchange = DeviceUnrecoverable; + ev.deviceid = dev->id; + dummyDev.id = 0; + SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask, + (xEvent *) &ev, 1); + + DeleteInputDeviceRequest(dev); + } +} + +/** + * Reactivate a device. Call this function from the driver if you just found + * out that the read error wasn't quite that bad after all. + * Device will be re-activated, and an event sent to the client. + */ +_X_EXPORT void +xf86EnableDevice(DeviceIntPtr dev) +{ + EnableDevice(dev); +} + /* end of xf86Xinput.c */ diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h index b2bc8dec1..f882b2608 100644 --- a/hw/xfree86/common/xf86Xinput.h +++ b/hw/xfree86/common/xf86Xinput.h @@ -163,6 +163,8 @@ extern InputInfoPtr xf86InputDevs; void InitExtInput(void); void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute, int first_valuator, int num_valuators, ...); +void xf86PostMotionEventP(DeviceIntPtr device, int is_absolute, + int first_valuator, int num_valuators, int *valuators); void xf86PostProximityEvent(DeviceIntPtr device, int is_in, int first_valuator, int num_valuators, ...); void xf86PostButtonEvent(DeviceIntPtr device, int is_absolute, int button, @@ -187,6 +189,8 @@ void xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, int minval, void xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum); void xf86AddEnabledDevice(InputInfoPtr pInfo); void xf86RemoveEnabledDevice(InputInfoPtr pInfo); +void xf86DisableDevice(DeviceIntPtr dev, Bool panic); +void xf86EnableDevice(DeviceIntPtr dev); /* xf86Helper.c */ void xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags); @@ -204,6 +208,7 @@ int xf86GetMotionEvents(DeviceIntPtr dev, xTimecoord *buff, void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts, pointer extraOpts); + /* Legacy hatred */ #define SendCoreEvents 59 #define DontSendCoreEvents 60 diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c index 21a57ae75..13e13e980 100644 --- a/hw/xfree86/common/xf86pciBus.c +++ b/hw/xfree86/common/xf86pciBus.c @@ -539,7 +539,6 @@ initPciBusState(void) struct pci_device *dev; struct pci_device_iterator *iter; BusAccPtr pbap, pbap_tmp; - pciBusInfo_t *pBusInfo; iter = pci_id_match_iterator_create(& bridge_match); while((dev = pci_device_next(iter)) != NULL) { diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c index 2b097d2db..6abe31c2f 100644 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c @@ -979,6 +979,9 @@ xf86XVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) winPriv->next = PrivRoot; pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)winPriv; } + + portPriv->pDraw = (DrawablePtr)pWin; + return Success; } @@ -1375,7 +1378,6 @@ xf86XVPutVideo( result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv); if(result != Success) return result; - portPriv->pDraw = pDraw; portPriv->type = XvInputMask; /* save a copy of these parameters */ @@ -1479,7 +1481,6 @@ xf86XVPutStill( xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv); portPriv->isOn = XV_ON; - portPriv->pDraw = pDraw; portPriv->drw_x = drw_x; portPriv->drw_y = drw_y; portPriv->drw_w = drw_w; portPriv->drw_h = drw_h; portPriv->type = 0; /* no mask means it's transient and should @@ -1529,7 +1530,6 @@ xf86XVGetVideo( result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv); if(result != Success) return result; - portPriv->pDraw = pDraw; portPriv->type = XvOutputMask; /* save a copy of these parameters */ @@ -1784,7 +1784,6 @@ xf86XVPutImage( (portPriv->AdaptorRec->flags & VIDEO_OVERLAID_IMAGES)) { portPriv->isOn = XV_ON; - portPriv->pDraw = pDraw; portPriv->drw_x = drw_x; portPriv->drw_y = drw_y; portPriv->drw_w = drw_w; portPriv->drw_h = drw_h; portPriv->type = 0; /* no mask means it's transient and should @@ -1876,42 +1875,35 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes) _X_EXPORT void xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes) { - XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); DrawablePtr root = &WindowTable[pScreen->myNum]->drawable; XID pval[2]; BoxPtr pbox = REGION_RECTS(clipboxes); int i, nbox = REGION_NUM_RECTS(clipboxes); xRectangle *rects; + GCPtr gc; if(!xf86Screens[pScreen->myNum]->vtSema) return; - if(!ScreenPriv->videoGC) { - int status; - pval[0] = key; - pval[1] = IncludeInferiors; - ScreenPriv->videoGC = CreateGC(root, GCForeground | GCSubwindowMode, - pval, &status); - if(!ScreenPriv->videoGC) return; - ValidateGC(root, ScreenPriv->videoGC); - } else if (key != ScreenPriv->videoGC->fgPixel){ - pval[0] = key; - ChangeGC(ScreenPriv->videoGC, GCForeground, pval); - ValidateGC(root, ScreenPriv->videoGC); - } + gc = GetScratchGC(root->depth, pScreen); + pval[0] = key; + pval[1] = IncludeInferiors; + (void) ChangeGC(gc, GCForeground|GCSubwindowMode, pval); + ValidateGC(root, gc); - rects = ALLOCATE_LOCAL(nbox * sizeof(xRectangle)); + rects = xalloc (nbox * sizeof(xRectangle)); - for(i = 0; i < nbox; i++, pbox++) { + for(i = 0; i < nbox; i++, pbox++) + { rects[i].x = pbox->x1; rects[i].y = pbox->y1; rects[i].width = pbox->x2 - pbox->x1; rects[i].height = pbox->y2 - pbox->y1; } - - (*ScreenPriv->videoGC->ops->PolyFillRect)( - root, ScreenPriv->videoGC, nbox, rects); - - DEALLOCATE_LOCAL(rects); + + (*gc->ops->PolyFillRect)(root, gc, nbox, rects); + + xfree (rects); + FreeScratchGC (gc); } /* xf86XVClipVideoHelper - diff --git a/hw/xfree86/ddc/Makefile.am b/hw/xfree86/ddc/Makefile.am index 04d3e445c..cd146c5a3 100644 --- a/hw/xfree86/ddc/Makefile.am +++ b/hw/xfree86/ddc/Makefile.am @@ -1,9 +1,9 @@ -sdk_HEADERS = edid.h vdif.h xf86DDC.h +sdk_HEADERS = edid.h xf86DDC.h noinst_LIBRARIES = libddc.a libddc_a_SOURCES = xf86DDC.c edid.c interpret_edid.c print_edid.c \ - interpret_vdif.c print_vdif.c ddcProperty.c + ddcProperty.c INCLUDES = $(XORG_INCS) -I$(srcdir)/../i2c diff --git a/hw/xfree86/ddc/ddcProperty.c b/hw/xfree86/ddc/ddcProperty.c index 37efb5bd9..6ff0726d9 100644 --- a/hw/xfree86/ddc/ddcProperty.c +++ b/hw/xfree86/ddc/ddcProperty.c @@ -35,7 +35,6 @@ #define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA" #define EDID2_ATOM_NAME "XFree86_DDC_EDID2_RAWDATA" -#define VDIF_ATOM_NAME "XFree86_DDC_VDIF_RAWDATA" static void addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC) @@ -103,16 +102,6 @@ addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC) xf86RegisterRootWindowProperty(scrnIndex, EDID2Atom, XA_INTEGER, 8, 256, (unsigned char *)EDID2rawdata); } - -#if 0 - if (DDC->vdif) { -#define VDIF_DUMMY_STRING "setting dummy VDIF property - please insert correct values\n" - - VDIFAtom = MakeAtom(VDIF_ATOM_NAME, sizeof(VDIF_ATOM_NAME), TRUE); - xf86RegisterRootWindowProperty(scrnIndex, VDIFAtom, XA_STRING, 8, - strlen(VDIF_DUMMY_STRING), VDIF_DUMMY_STRING); - } -#endif } Bool diff --git a/hw/xfree86/ddc/edid.h b/hw/xfree86/ddc/edid.h index 30499a6da..0b6a15af0 100644 --- a/hw/xfree86/ddc/edid.h +++ b/hw/xfree86/ddc/edid.h @@ -12,8 +12,6 @@ #ifndef _EDID_H_ #define _EDID_H_ -#include "vdif.h" - /* read complete EDID record */ #define EDID1_LEN 128 #define BITS_PER_BYTE 9 @@ -453,7 +451,7 @@ typedef struct { struct established_timings timings1; struct std_timings timings2[8]; struct detailed_monitor_section det_mon[4]; - xf86vdifPtr vdif; + void *vdif; /* unused */ int no_sections; Uchar *rawData; } xf86Monitor, *xf86MonPtr; diff --git a/hw/xfree86/ddc/edid_modes.c b/hw/xfree86/ddc/edid_modes.c deleted file mode 100644 index 926bc8921..000000000 --- a/hw/xfree86/ddc/edid_modes.c +++ /dev/null @@ -1,361 +0,0 @@ -/* - * Copyright 2006 Luc Verhaegen. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sub license, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include "xf86.h" -#include "xf86DDC.h" -#include <X11/Xatom.h> -#include "property.h" -#include "propertyst.h" -#include "xf86DDC.h" - -/* - * TODO: - * - for those with access to the VESA DMT standard; review please. - */ -#define MODEPREFIX(name) NULL, NULL, name, 0,M_T_DRIVER -#define MODESUFFIX 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0 - -DisplayModeRec DDCEstablishedModes[17] = { - { MODEPREFIX("800x600"), 40000, 800, 840, 968, 1056, 0, 600, 601, 605, 628, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 800x600@60Hz */ - { MODEPREFIX("800x600"), 36000, 800, 824, 896, 1024, 0, 600, 601, 603, 625, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 800x600@56Hz */ - { MODEPREFIX("640x480"), 31500, 640, 656, 720, 840, 0, 480, 481, 484, 500, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 640x480@75Hz */ - { MODEPREFIX("640x480"), 31500, 640, 664, 704, 832, 0, 480, 489, 491, 520, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 640x480@72Hz */ - { MODEPREFIX("640x480"), 30240, 640, 704, 768, 864, 0, 480, 483, 486, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 640x480@67Hz */ - { MODEPREFIX("640x480"), 25200, 640, 656, 752, 800, 0, 480, 490, 492, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 640x480@60Hz */ - { MODEPREFIX("720x400"), 35500, 720, 738, 846, 900, 0, 400, 421, 423, 449, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 720x400@88Hz */ - { MODEPREFIX("720x400"), 28320, 720, 738, 846, 900, 0, 400, 412, 414, 449, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX }, /* 720x400@70Hz */ - { MODEPREFIX("1280x1024"), 135000, 1280, 1296, 1440, 1688, 0, 1024, 1025, 1028, 1066, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 1280x1024@75Hz */ - { MODEPREFIX("1024x768"), 78800, 1024, 1040, 1136, 1312, 0, 768, 769, 772, 800, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 1024x768@75Hz */ - { MODEPREFIX("1024x768"), 75000, 1024, 1048, 1184, 1328, 0, 768, 771, 777, 806, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 1024x768@70Hz */ - { MODEPREFIX("1024x768"), 65000, 1024, 1048, 1184, 1344, 0, 768, 771, 777, 806, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 1024x768@60Hz */ - { MODEPREFIX("1024x768"), 44900, 1024, 1032, 1208, 1264, 0, 768, 768, 776, 817, 0, V_PHSYNC | V_PVSYNC | V_INTERLACE, MODESUFFIX }, /* 1024x768@43Hz */ - { MODEPREFIX("832x624"), 57284, 832, 864, 928, 1152, 0, 624, 625, 628, 667, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 832x624@75Hz */ - { MODEPREFIX("800x600"), 49500, 800, 816, 896, 1056, 0, 600, 601, 604, 625, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 800x600@75Hz */ - { MODEPREFIX("800x600"), 50000, 800, 856, 976, 1040, 0, 600, 637, 643, 666, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 800x600@72Hz */ - { MODEPREFIX("1152x864"), 108000, 1152, 1216, 1344, 1600, 0, 864, 865, 868, 900, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 1152x864@75Hz */ -}; - -static DisplayModePtr -DDCModesFromEstablished(int scrnIndex, struct established_timings *timing) -{ - DisplayModePtr Modes = NULL, Mode = NULL; - CARD32 bits = (timing->t1) | (timing->t2 << 8) | - ((timing->t_manu & 0x80) << 9); - int i; - - for (i = 0; i < 17; i++) { - if (bits & (0x01 << i)) { - Mode = xf86DuplicateMode(&DDCEstablishedModes[i]); - Modes = xf86ModesAdd(Modes, Mode); - } - } - - return Modes; -} - -/* - * - */ -static DisplayModePtr -DDCModesFromStandardTiming(int scrnIndex, struct std_timings *timing) -{ - DisplayModePtr Modes = NULL, Mode = NULL; - int i; - - for (i = 0; i < STD_TIMINGS; i++) { - if (timing[i].hsize && timing[i].vsize && timing[i].refresh) { - Mode = xf86CVTMode(timing[i].hsize, timing[i].vsize, - timing[i].refresh, FALSE, FALSE); - Mode->type = M_T_DRIVER; - Modes = xf86ModesAdd(Modes, Mode); - } - } - - return Modes; -} - -/* - * - */ -static DisplayModePtr -DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing, - int preferred) -{ - DisplayModePtr Mode; - - /* - * Refuse to create modes that are insufficiently large. 64 is a random - * number, maybe the spec says something about what the minimum is. In - * particular I see this frequently with _old_ EDID, 1.0 or so, so maybe - * our parser is just being too aggresive there. - */ - if (timing->h_active < 64 || timing->v_active < 64) { - xf86DrvMsg(scrnIndex, X_INFO, - "%s: Ignoring tiny %dx%d mode\n", __func__, - timing->h_active, timing->v_active); - return NULL; - } - - /* We don't do stereo */ - if (timing->stereo) { - xf86DrvMsg(scrnIndex, X_INFO, - "%s: Ignoring: We don't handle stereo.\n", __func__); - return NULL; - } - - /* We only do seperate sync currently */ - if (timing->sync != 0x03) { - xf86DrvMsg(scrnIndex, X_INFO, - "%s: %dx%d Warning: We only handle seperate" - " sync.\n", __func__, timing->h_active, timing->v_active); - } - - Mode = xnfalloc(sizeof(DisplayModeRec)); - memset(Mode, 0, sizeof(DisplayModeRec)); - - Mode->type = M_T_DRIVER; - if (preferred) - Mode->type |= M_T_PREFERRED; - - Mode->Clock = timing->clock / 1000.0; - - Mode->HDisplay = timing->h_active; - Mode->HSyncStart = timing->h_active + timing->h_sync_off; - Mode->HSyncEnd = Mode->HSyncStart + timing->h_sync_width; - Mode->HTotal = timing->h_active + timing->h_blanking; - - Mode->VDisplay = timing->v_active; - Mode->VSyncStart = timing->v_active + timing->v_sync_off; - Mode->VSyncEnd = Mode->VSyncStart + timing->v_sync_width; - Mode->VTotal = timing->v_active + timing->v_blanking; - - xf86SetModeDefaultName(Mode); - - /* We ignore h/v_size and h/v_border for now. */ - - if (timing->interlaced) - Mode->Flags |= V_INTERLACE; - - if (timing->misc & 0x02) - Mode->Flags |= V_PHSYNC; - else - Mode->Flags |= V_NHSYNC; - - if (timing->misc & 0x01) - Mode->Flags |= V_PVSYNC; - else - Mode->Flags |= V_NVSYNC; - - return Mode; -} - -/* - * - */ -static void -DDCGuessRangesFromModes(int scrnIndex, MonPtr Monitor, DisplayModePtr Modes) -{ - DisplayModePtr Mode = Modes; - - if (!Monitor || !Modes) - return; - - /* set up the ranges for scanning through the modes */ - Monitor->nHsync = 1; - Monitor->hsync[0].lo = 1024.0; - Monitor->hsync[0].hi = 0.0; - - Monitor->nVrefresh = 1; - Monitor->vrefresh[0].lo = 1024.0; - Monitor->vrefresh[0].hi = 0.0; - - while (Mode) { - if (!Mode->HSync) - Mode->HSync = ((float) Mode->Clock ) / ((float) Mode->HTotal); - - if (!Mode->VRefresh) - Mode->VRefresh = (1000.0 * ((float) Mode->Clock)) / - ((float) (Mode->HTotal * Mode->VTotal)); - - if (Mode->HSync < Monitor->hsync[0].lo) - Monitor->hsync[0].lo = Mode->HSync; - - if (Mode->HSync > Monitor->hsync[0].hi) - Monitor->hsync[0].hi = Mode->HSync; - - if (Mode->VRefresh < Monitor->vrefresh[0].lo) - Monitor->vrefresh[0].lo = Mode->VRefresh; - - if (Mode->VRefresh > Monitor->vrefresh[0].hi) - Monitor->vrefresh[0].hi = Mode->VRefresh; - - Mode = Mode->next; - } -} - -DisplayModePtr -xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC) -{ - int preferred, i; - DisplayModePtr Modes = NULL, Mode; - - preferred = PREFERRED_TIMING_MODE(DDC->features.msc); - - /* Add established timings */ - Mode = DDCModesFromEstablished(scrnIndex, &DDC->timings1); - Modes = xf86ModesAdd(Modes, Mode); - - /* Add standard timings */ - Mode = DDCModesFromStandardTiming(scrnIndex, DDC->timings2); - Modes = xf86ModesAdd(Modes, Mode); - - for (i = 0; i < DET_TIMINGS; i++) { - struct detailed_monitor_section *det_mon = &DDC->det_mon[i]; - - switch (det_mon->type) { - case DT: - Mode = DDCModeFromDetailedTiming(scrnIndex, - &det_mon->section.d_timings, - preferred); - preferred = 0; - Modes = xf86ModesAdd(Modes, Mode); - break; - case DS_STD_TIMINGS: - Mode = DDCModesFromStandardTiming(scrnIndex, - det_mon->section.std_t); - Modes = xf86ModesAdd(Modes, Mode); - break; - default: - break; - } - } - - return Modes; -} - -/* - * Fill out MonPtr with xf86MonPtr information. - */ -void -xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC) -{ - DisplayModePtr Modes = NULL, Mode; - int i, clock; - Bool have_hsync = FALSE, have_vrefresh = FALSE; - - if (!Monitor || !DDC) - return; - - Monitor->DDC = DDC; - - Monitor->widthmm = 10 * DDC->features.hsize; - Monitor->heightmm = 10 * DDC->features.vsize; - - /* If this is a digital display, then we can use reduced blanking */ - if (DDC->features.input_type) - Monitor->reducedblanking = TRUE; - /* Allow the user to also enable this through config */ - - Modes = xf86DDCGetModes(scrnIndex, DDC); - - /* Skip EDID ranges if they were specified in the config file */ - have_hsync = (Monitor->nHsync != 0); - have_vrefresh = (Monitor->nVrefresh != 0); - - /* Go through the detailed monitor sections */ - for (i = 0; i < DET_TIMINGS; i++) { - switch (DDC->det_mon[i].type) { - case DS_RANGES: - if (!have_hsync) { - if (!Monitor->nHsync) - xf86DrvMsg(scrnIndex, X_INFO, - "Using EDID range info for horizontal sync\n"); - Monitor->hsync[Monitor->nHsync].lo = - DDC->det_mon[i].section.ranges.min_h; - Monitor->hsync[Monitor->nHsync].hi = - DDC->det_mon[i].section.ranges.max_h; - Monitor->nHsync++; - } else { - xf86DrvMsg(scrnIndex, X_INFO, - "Using hsync ranges from config file\n"); - } - - if (!have_vrefresh) { - if (!Monitor->nVrefresh) - xf86DrvMsg(scrnIndex, X_INFO, - "Using EDID range info for vertical refresh\n"); - Monitor->vrefresh[Monitor->nVrefresh].lo = - DDC->det_mon[i].section.ranges.min_v; - Monitor->vrefresh[Monitor->nVrefresh].hi = - DDC->det_mon[i].section.ranges.max_v; - Monitor->nVrefresh++; - } else { - xf86DrvMsg(scrnIndex, X_INFO, - "Using vrefresh ranges from config file\n"); - } - - clock = DDC->det_mon[i].section.ranges.max_clock * 1000; - if (clock > Monitor->maxPixClock) - Monitor->maxPixClock = clock; - - break; - default: - break; - } - } - - if (Modes) { - /* Print Modes */ - xf86DrvMsg(scrnIndex, X_INFO, "Printing DDC gathered Modelines:\n"); - - Mode = Modes; - while (Mode) { - xf86PrintModeline(scrnIndex, Mode); - Mode = Mode->next; - } - - /* Do we still need ranges to be filled in? */ - if (!Monitor->nHsync || !Monitor->nVrefresh) - DDCGuessRangesFromModes(scrnIndex, Monitor, Modes); - - /* look for last Mode */ - Mode = Modes; - - while (Mode->next) - Mode = Mode->next; - - /* add to MonPtr */ - if (Monitor->Modes) { - Monitor->Last->next = Modes; - Modes->prev = Monitor->Last; - Monitor->Last = Mode; - } else { - Monitor->Modes = Modes; - Monitor->Last = Mode; - } - } -} diff --git a/hw/xfree86/ddc/interpret_vdif.c b/hw/xfree86/ddc/interpret_vdif.c deleted file mode 100644 index 3a17e2f33..000000000 --- a/hw/xfree86/ddc/interpret_vdif.c +++ /dev/null @@ -1,132 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include <X11/Xarch.h> -#include "xf86DDC.h" -#include "vdif.h" - -static xf86VdifLimitsPtr* get_limits(CARD8 *c); -static xf86VdifGammaPtr* get_gamma(CARD8 *c); -static xf86VdifTimingPtr* get_timings(CARD8 *c); -#if X_BYTE_ORDER == X_BIG_ENDIAN -static CARD32 swap_byte_order(CARD32 c); -#endif - -xf86vdifPtr -xf86InterpretVdif(CARD8 *c) -{ - xf86VdifPtr p = (xf86VdifPtr)c; - xf86vdifPtr vdif; - int i; -#if X_BYTE_ORDER == X_BIG_ENDIAN - int length; -#endif - unsigned long l = 0; - - if (c == NULL) return NULL; -#if X_BYTE_ORDER == X_BIG_ENDIAN - length = swap_byte_order(p->FileLength); - for (i = 0; i < (length >>2); i++) - ((CARD32*)c)[i] = swap_byte_order(((CARD32*)c)[i]) ; -#endif - if (p->VDIFId[0] != 'V' || p->VDIFId[1] != 'D' || p->VDIFId[2] != 'I' - || p->VDIFId[3] != 'F') return NULL; - for ( i = 12; i < p->FileLength; i++) - l += c[i]; - if ( l != p->Checksum) return NULL; - vdif = xalloc(sizeof(xf86vdif)); - vdif->vdif = p; - vdif->limits = get_limits(c); - vdif->timings = get_timings(c); - vdif->gamma = get_gamma(c); - vdif->strings = VDIF_STRING(((xf86VdifPtr)c),0); - xfree(c); - return vdif; -} - -static xf86VdifLimitsPtr* -get_limits(CARD8 *c) -{ - int num, i, j; - xf86VdifLimitsPtr *pp; - xf86VdifLimitsPtr p; - - num = ((xf86VdifPtr)c)->NumberOperationalLimits; - pp = xalloc(sizeof(xf86VdifLimitsPtr) * (num+1)); - p = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr)c)); - j = 0; - for ( i = 0; i<num; i++) { - if (p->Header.ScnTag == VDIF_OPERATIONAL_LIMITS_TAG) - pp[j++] = p; - VDIF_NEXT_OPERATIONAL_LIMITS(p); - } - pp[j] = NULL; - return pp; -} - -static xf86VdifGammaPtr* -get_gamma(CARD8 *c) -{ - int num, i, j; - xf86VdifGammaPtr *pp; - xf86VdifGammaPtr p; - - num = ((xf86VdifPtr)c)->NumberOptions; - pp = xalloc(sizeof(xf86VdifGammaPtr) * (num+1)); - p = (xf86VdifGammaPtr)VDIF_OPTIONS(((xf86VdifPtr)c)); - j = 0; - for ( i = 0; i<num; i++) - { - if (p->Header.ScnTag == VDIF_GAMMA_TABLE_TAG) - pp[j++] = p; - VDIF_NEXT_OPTIONS(p); - } - pp[j] = NULL; - return pp; -} - -static xf86VdifTimingPtr* -get_timings(CARD8 *c) -{ - int num, num_limits; - int i,j,k; - xf86VdifLimitsPtr lp; - xf86VdifTimingPtr *pp; - xf86VdifTimingPtr p; - - num = ((xf86VdifPtr)c)->NumberOperationalLimits; - lp = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr)c)); - num_limits = 0; - for (i = 0; i < num; i++) { - if (lp->Header.ScnTag == VDIF_OPERATIONAL_LIMITS_TAG) - num_limits += lp->NumberPreadjustedTimings; - VDIF_NEXT_OPERATIONAL_LIMITS(lp); - } - pp = xalloc(sizeof(xf86VdifTimingPtr) - * (num_limits+1)); - j = 0; - lp = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr) c)); - for (i = 0; i < num; i++) { - p = VDIF_PREADJUSTED_TIMING(lp); - for (k = 0; k < lp->NumberPreadjustedTimings; k++) { - if (p->Header.ScnTag == VDIF_PREADJUSTED_TIMING_TAG) - pp[j++] = p; - VDIF_NEXT_PREADJUSTED_TIMING(p); - } - VDIF_NEXT_OPERATIONAL_LIMITS(lp); - } - pp[j] = NULL; - return pp; -} - -#if X_BYTE_ORDER == X_BIG_ENDIAN -static CARD32 -swap_byte_order(CARD32 c) -{ - return ((c & 0xFF000000) >> 24) | ((c & 0xFF0000) >> 8) - | ((c & 0xFF00) << 8) | ((c & 0xFF) << 24); -} - -#endif diff --git a/hw/xfree86/ddc/print_vdif.c b/hw/xfree86/ddc/print_vdif.c deleted file mode 100644 index 13cd3abad..000000000 --- a/hw/xfree86/ddc/print_vdif.c +++ /dev/null @@ -1,225 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include "vdif.h" -#include "misc.h" -#include "xf86DDC.h" - -static void print_vdif(xf86VdifPtr l, char *s); -static void print_timings(xf86VdifTimingPtr *pt); -static void print_limits(xf86VdifLimitsPtr *pl); -static void print_gamma(xf86VdifGammaPtr *pg); -static void print_type(CARD8 c); -static void print_polarity(CARD8 c); - -void -xf86print_vdif(xf86vdifPtr v) -{ - print_vdif(v->vdif,v->strings); - print_limits(v->limits); - print_timings(v->timings); - print_gamma(v->gamma); -} - -static void -print_vdif(xf86VdifPtr l, char *s) -{ - ErrorF("Version %i.%i",l->VDIFVersion,l->VDIFRevision); - ErrorF(" Date: %i/%i/%i, Manufactured: %i/%i/%i\n",l->Date[0], - l->Date[1],l->Date[2],l->DateManufactured[0], - l->DateManufactured[1],l->DateManufactured[2]); - ErrorF("File Revision: %i",l->FileRevision); - ErrorF("Manufacturer: %s\n",s + l->Manufacturer); - ErrorF("ModelNumber: %s\n",s + l->ModelNumber); - ErrorF("VDIFIndex: %s\n",s +l->MinVDIFIndex); - ErrorF("Version: %s\n",s + l->Version); - ErrorF("SerialNumber %s\n",s + l->SerialNumber); - ErrorF("MonitorType: "); - switch (l->MonitorType) { - case VDIF_MONITOR_MONOCHROME: - ErrorF("Mono\n"); - break; - case VDIF_MONITOR_COLOR: - ErrorF("Color\n"); - break; - } - ErrorF("CRT Size: %i inches\n",l->CRTSize); - switch (l->MonitorType) { - case VDIF_MONITOR_MONOCHROME: - ErrorF("Border: %i percent\n", - l->BorderRed); - ErrorF("Phosphor Decay: 1: %i,",l->RedPhosphorDecay); - if (l->GreenPhosphorDecay !=0) - ErrorF(" 2: %i,",l->GreenPhosphorDecay); - if (l->BluePhosphorDecay !=0) - ErrorF(" 3: %i",l->BluePhosphorDecay); - ErrorF(" ms\n"); - if (l->RedChromaticity_x) - ErrorF("Chromaticity: 1: x:%f, y:%f; ", - l->RedChromaticity_x/1000.0,l->RedChromaticity_y/1000.0); - if (l->GreenChromaticity_x) - ErrorF("Chromaticity: 2: x:%f, y:%f; ", - l->GreenChromaticity_x/1000.0,l->GreenChromaticity_y/1000.0); - if (l->BlueChromaticity_x) - ErrorF("Chromaticity: 3: x:%f, y:%f ", - l->BlueChromaticity_x/1000.0,l->BlueChromaticity_y/1000.0); - ErrorF("\n"); - ErrorF("Gamma: %f\n",l->RedGamma/1000.0); - break; - case VDIF_MONITOR_COLOR: - ErrorF("Border: Red: %i Green: %i Blue: %i percent\n", - l->BorderRed,l->BorderGreen,l->BorderBlue); - ErrorF("Phosphor Decay: Red: %i, Green: %i, Blue: %i ms\n", - l->RedPhosphorDecay,l->GreenPhosphorDecay,l->BluePhosphorDecay); - ErrorF("Chromaticity: Red: x:%f, y:%f; Green: x:%f, y:%f; " - "Blue: x:%f, y:%f\n", - l->RedChromaticity_x/1000.0,l->RedChromaticity_y/1000.0, - l->GreenChromaticity_x/1000.0,l->GreenChromaticity_y/1000.0, - l->BlueChromaticity_x/1000.0,l->BlueChromaticity_y/1000.0); - ErrorF("Gamma: Red:%f, Green:%f, Blue:%f\n",l->RedGamma/1000.0, - l->GreenGamma/1000.0,l->BlueGamma/1000.0); - break; - } - ErrorF("White Point: x: %f y: %f Y: %f\n",l->WhitePoint_x/1000.0, - l->WhitePoint_y/1000.0,l->WhitePoint_Y/1000.0); -} - -static void -print_limits(xf86VdifLimitsPtr *pl) -{ - int i = 0; - xf86VdifLimitsPtr l; - - while((l = pl[i]) != NULL) { - ErrorF("Max display resolution: %i x %i pixel\n",l->MaxHorPixel, - l->MaxVerPixel); - ErrorF("Size of active area: %i x %i millimeters\n",l->MaxHorActiveLength, - l->MaxVerActiveHeight); - ErrorF("Video Type: "); - print_type(l->VideoType); - ErrorF("Sync Type: "); - print_type(l->SyncType); - ErrorF("Sync Configuration "); - switch (l->SyncConfiguration) { - case VDIF_SYNC_SEPARATE: - ErrorF("separate\n"); - break; - case VDIF_SYNC_C: - ErrorF("composite C\n"); - break; - case VDIF_SYNC_CP: - ErrorF("composite CP\n"); - break; - case VDIF_SYNC_G: - ErrorF("composite G\n"); - break; - case VDIF_SYNC_GP: - ErrorF("composite GP\n"); - break; - case VDIF_SYNC_OTHER: - ErrorF("other\n"); - break; - } - ErrorF("Termination Resistance: %i\n",l->TerminationResistance); - ErrorF("Levels: white: %i, black: %i, blank: %i, sync: %i mV\n", - l->WhiteLevel,l->BlackLevel,l->BlankLevel,l->SyncLevel); - ErrorF("Max. Pixel Clock: %f MHz\n",l->MaxPixelClock/1000.0); - ErrorF("Freq. Range: Hor.: %f - %f kHz, Ver.: %f - %f Hz\n", - l->MaxHorFrequency/1000.0,l->MinHorFrequency/1000.0, - l->MaxVerFrequency/1000.0,l->MinVerFrequency/1000.0); - ErrorF("Retrace time: Hor: %f us, Ver: %f ms\n",l->MinHorRetrace/1000.0, - l->MinVerRetrace/1000.0); - } -} - -static void -print_timings(xf86VdifTimingPtr *pt) -{ - int i = 0; - xf86VdifTimingPtr t; - - while((t = pt[i]) != NULL) { - ErrorF("SVGA / SVPMI mode number: %i\n",t->PreadjustedTimingName); - ErrorF("Mode %i x %i\n",t->HorPixel,t->VerPixel); - ErrorF("Size: %i x %i mm\n",t->HorAddrLength,t->VerAddrHeight); - ErrorF("Ratios: %i/%i\n",t->PixelWidthRatio,t->PixelHeightRatio); - ErrorF("Character width: %i",t->CharacterWidth); - ErrorF("Clock: %f MHz HFreq.: %f kHz, VFreq: %f Hz\n",t->PixelClock/1000.0, - t->HorFrequency/1000.0,t->VerFrequency/1000.0); - ErrorF("Htotal: %f us, Vtotal %f ms\n", t->HorTotalTime/1000.0, - t->VerTotalTime/1000.0); - ErrorF("HDisp: %f, HBlankStart: %f, HBlankLength: %f, " - "HSyncStart: %f HSyncEnd: %f us\n",t->HorAddrTime/1000.0, - t->HorBlankStart/1000.0,t->HorBlankTime/1000.0, - t->HorSyncStart/1000.0,t->HorSyncTime/1000.0); - ErrorF("VDisp: %f, VBlankStart: %f, VBlankLength: %f, " - "VSyncStart: %f VSyncEnd: %f us\n",t->VerAddrTime/1000.0, - t->VerBlankStart/1000.0,t->VerBlankTime/1000.0, - t->VerSyncStart/1000.0,t->VerSyncTime/1000.0); - ErrorF("Scan Type: "); - switch (t->ScanType) { - case VDIF_SCAN_INTERLACED: - ErrorF("interlaced "); - break; - case VDIF_SCAN_NONINTERLACED: - ErrorF("non interlaced "); - break; - case VDIF_SCAN_OTHER: - ErrorF("other "); - break; - } - ErrorF("Polarity: H: "); - print_polarity(t->HorSyncPolarity); - ErrorF("V: "); - print_polarity(t->VerSyncPolarity); - ErrorF("\n"); - } -} - -static void -print_gamma(xf86VdifGammaPtr *pg) -{ - int i = 0; - xf86VdifGammaPtr g; - - while((g = pg[i]) != NULL) { - ErrorF("Gamma Table Entries: %i\n",g->GammaTableEntries); - } -} - -static void -print_type(CARD8 c) -{ - switch (c) { - case VDIF_VIDEO_TTL : - ErrorF("TTL\n"); - break; - case VDIF_VIDEO_ANALOG : - ErrorF("Analog\n"); - break; - case VDIF_VIDEO_ECL: - ErrorF("ECL\n"); - break; - case VDIF_VIDEO_DECL: - ErrorF("DECL\n"); - break; - case VDIF_VIDEO_OTHER: - ErrorF("other\n"); - break; - } -} - -static void -print_polarity(CARD8 c) -{ - switch (c) { - case VDIF_POLARITY_NEGATIVE: - ErrorF(" Neg."); - break; - case VDIF_POLARITY_POSITIVE: - ErrorF(" Pos."); - break; - } -} diff --git a/hw/xfree86/ddc/vdif.h b/hw/xfree86/ddc/vdif.h deleted file mode 100644 index 1777b68a7..000000000 --- a/hw/xfree86/ddc/vdif.h +++ /dev/null @@ -1,174 +0,0 @@ - -#ifndef _VDIF_H -#define _VDIF_H - -#define VDIF_MONITOR_MONOCHROME 0 -#define VDIF_MONITOR_COLOR 1 -#define VDIF_VIDEO_TTL 0 -#define VDIF_VIDEO_ANALOG 1 -#define VDIF_VIDEO_ECL 2 -#define VDIF_VIDEO_DECL 3 -#define VDIF_VIDEO_OTHER 4 -#define VDIF_SYNC_SEPARATE 0 -#define VDIF_SYNC_C 1 -#define VDIF_SYNC_CP 2 -#define VDIF_SYNC_G 3 -#define VDIF_SYNC_GP 4 -#define VDIF_SYNC_OTHER 5 -#define VDIF_SCAN_NONINTERLACED 0 -#define VDIF_SCAN_INTERLACED 1 -#define VDIF_SCAN_OTHER 2 -#define VDIF_POLARITY_NEGATIVE 0 -#define VDIF_POLARITY_POSITIVE 1 - -#include <X11/Xmd.h> - -#undef CARD32 -#define CARD32 unsigned int /* ... on all supported platforms */ - -typedef struct _VDIF { /* Monitor Description: */ - CARD8 VDIFId[4]; /* alway "VDIF" */ - CARD32 FileLength; /* lenght of the whole file */ - CARD32 Checksum; /* sum of all bytes in the file after*/ - /* this field */ - CARD16 VDIFVersion; /* structure version number */ - CARD16 VDIFRevision; /* structure revision number */ - CARD16 Date[3]; /* file date Year/Month/Day */ - CARD16 DateManufactured[3]; /* date Year/Month/Day */ - CARD32 FileRevision; /* file revision string */ - CARD32 Manufacturer; /* ASCII ID of the manufacturer */ - CARD32 ModelNumber; /* ASCII ID of the model */ - CARD32 MinVDIFIndex; /* ASCII ID of Minimum VDIF index */ - CARD32 Version; /* ASCII ID of the model version */ - CARD32 SerialNumber; /* ASCII ID of the serial number */ - CARD8 MonitorType; /* Monochrome or Color */ - CARD8 CRTSize; /* inches */ - CARD8 BorderRed; /* percent */ - CARD8 BorderGreen; /* percent */ - CARD8 BorderBlue; /* percent */ - CARD8 Reserved1; /* padding */ - CARD16 Reserved2; /* padding */ - CARD32 RedPhosphorDecay; /* microseconds */ - CARD32 GreenPhosphorDecay; /* microseconds */ - CARD32 BluePhosphorDecay; /* microseconds */ - CARD16 WhitePoint_x; /* WhitePoint in CIExyY (scale 1000) */ - CARD16 WhitePoint_y; - CARD16 WhitePoint_Y; - CARD16 RedChromaticity_x; /* Red chromaticity in x,y */ - CARD16 RedChromaticity_y; - CARD16 GreenChromaticity_x; /* Green chromaticity in x,y */ - CARD16 GreenChromaticity_y; - CARD16 BlueChromaticity_x; /* Blue chromaticity in x,y */ - CARD16 BlueChromaticity_y; - CARD16 RedGamma; /* Gamme curve exponent (scale 1000) */ - CARD16 GreenGamma; - CARD16 BlueGamma; - CARD32 NumberOperationalLimits; - CARD32 OffsetOperationalLimits; - CARD32 NumberOptions; /* optinal sections (gamma table) */ - CARD32 OffsetOptions; - CARD32 OffsetStringTable; -} xf86VdifRec, *xf86VdifPtr; - -typedef enum { /* Tags for section identification */ - VDIF_OPERATIONAL_LIMITS_TAG = 1, - VDIF_PREADJUSTED_TIMING_TAG, - VDIF_GAMMA_TABLE_TAG -} VDIFScnTag; - -typedef struct _VDIFScnHdr { /* Generic Section Header: */ - CARD32 ScnLength; /* lenght of section */ - CARD32 ScnTag; /* tag for section identification */ -} VDIFScnHdrRec, *VDIFScnHdrPtr; - -typedef struct _VDIFLimits { /* Operational Limits: */ - VDIFScnHdrRec Header; /* common section info */ - CARD16 MaxHorPixel; /* pixels */ - CARD16 MaxVerPixel; /* lines */ - CARD16 MaxHorActiveLength; /* millimeters */ - CARD16 MaxVerActiveHeight; /* millimeters */ - CARD8 VideoType; /* TTL / Analog / ECL / DECL */ - CARD8 SyncType; /* TTL / Analog / ECL / DECL */ - CARD8 SyncConfiguration; /* separate / composite / other */ - CARD8 Reserved1; /* padding */ - CARD16 Reserved2; /* padding */ - CARD16 TerminationResistance; /* */ - CARD16 WhiteLevel; /* millivolts */ - CARD16 BlackLevel; /* millivolts */ - CARD16 BlankLevel; /* millivolts */ - CARD16 SyncLevel; /* millivolts */ - CARD32 MaxPixelClock; /* kiloHertz */ - CARD32 MinHorFrequency; /* Hertz */ - CARD32 MaxHorFrequency; /* Hertz */ - CARD32 MinVerFrequency; /* milliHertz */ - CARD32 MaxVerFrequency; /* milliHertz */ - CARD16 MinHorRetrace; /* nanoseconds */ - CARD16 MinVerRetrace; /* microseconds */ - CARD32 NumberPreadjustedTimings; - CARD32 OffsetNextLimits; -} xf86VdifLimitsRec, *xf86VdifLimitsPtr; - -typedef struct _VDIFTiming { /* Preadjusted Timing: */ - VDIFScnHdrRec Header; /* common section info */ - CARD32 PreadjustedTimingName; /* SVGA/SVPMI mode number */ - CARD16 HorPixel; /* pixels */ - CARD16 VerPixel; /* lines */ - CARD16 HorAddrLength; /* millimeters */ - CARD16 VerAddrHeight; /* millimeters */ - CARD8 PixelWidthRatio; /* gives H:V */ - CARD8 PixelHeightRatio; - CARD8 Reserved1; /* padding */ - CARD8 ScanType; /* noninterlaced / interlaced / other*/ - CARD8 HorSyncPolarity; /* negative / positive */ - CARD8 VerSyncPolarity; /* negative / positive */ - CARD16 CharacterWidth; /* pixels */ - CARD32 PixelClock; /* kiloHertz */ - CARD32 HorFrequency; /* Hertz */ - CARD32 VerFrequency; /* milliHertz */ - CARD32 HorTotalTime; /* nanoseconds */ - CARD32 VerTotalTime; /* microseconds */ - CARD16 HorAddrTime; /* nanoseconds */ - CARD16 HorBlankStart; /* nanoseconds */ - CARD16 HorBlankTime; /* nanoseconds */ - CARD16 HorSyncStart; /* nanoseconds */ - CARD16 HorSyncTime; /* nanoseconds */ - CARD16 VerAddrTime; /* microseconds */ - CARD16 VerBlankStart; /* microseconds */ - CARD16 VerBlankTime; /* microseconds */ - CARD16 VerSyncStart; /* microseconds */ - CARD16 VerSyncTime; /* microseconds */ -} xf86VdifTimingRec, *xf86VdifTimingPtr; - -typedef struct _VDIFGamma { /* Gamma Table: */ - VDIFScnHdrRec Header; /* common section info */ - CARD16 GammaTableEntries; /* count of grays or RGB 3-tuples */ - CARD16 Unused1; -} xf86VdifGammaRec, *xf86VdifGammaPtr; - -/* access macros */ -#define VDIF_OPERATIONAL_LIMITS(vdif) \ -((xf86VdifLimitsPtr)((char*)(vdif) + (vdif)->OffsetOperationalLimits)) -#define VDIF_NEXT_OPERATIONAL_LIMITS(limits) limits = \ - ((xf86VdifLimitsPtr)((char*)(limits) + (limits)->OffsetNextLimits)) -#define VDIF_PREADJUSTED_TIMING(limits) \ -((xf86VdifTimingPtr)((char*)(limits) + (limits)->Header.ScnLength)) -#define VDIF_NEXT_PREADJUSTED_TIMING(timing) timing = \ - ((xf86VdifTimingPtr)((char*)(timing) + (timing)->Header.ScnLength)) -#define VDIF_OPTIONS(vdif) \ - ((VDIFScnHdrPtr)((char*)(vdif) + (vdif)->OffsetOptions)) -#define VDIF_NEXT_OPTIONS(options) options = \ - ((xf86VdifGammaPtr)((char*)(options) + (options)->Header.ScnLength)) -#define VDIF_STRING(vdif, string) \ - ((char*)((char*)vdif + vdif->OffsetStringTable + (string))) - -typedef struct _vdif { - xf86VdifPtr vdif; - xf86VdifLimitsPtr *limits; - xf86VdifTimingPtr *timings; - xf86VdifGammaPtr *gamma; - char * strings; -} xf86vdif, *xf86vdifPtr; - -#undef CARD32 - -#endif diff --git a/hw/xfree86/ddc/xf86DDC.c b/hw/xfree86/ddc/xf86DDC.c index 21984bc04..e47b8b80c 100644 --- a/hw/xfree86/ddc/xf86DDC.c +++ b/hw/xfree86/ddc/xf86DDC.c @@ -38,12 +38,6 @@ static unsigned char* EDID1Read_DDC2( I2CBusPtr pBus ); -static unsigned char * VDIFRead( - int scrnIndex, - I2CBusPtr pBus, - int start -); - static unsigned char * DDCRead_DDC2( int scrnIndex, I2CBusPtr pBus, @@ -138,7 +132,6 @@ xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; unsigned char *EDID_block = NULL; - unsigned char *VDIF_Block = NULL; xf86MonPtr tmp = NULL; /* Default DDC and DDC2 to enabled. */ Bool noddc = FALSE, noddc2 = FALSE; @@ -171,11 +164,6 @@ xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus) else ErrorF("Sections to follow: %i\n",tmp->no_sections); #endif - if (tmp) { - VDIF_Block = - VDIFRead(scrnIndex, pBus, EDID1_LEN * (tmp->no_sections + 1)); - tmp->vdif = xf86InterpretVdif(VDIF_Block); - } return tmp; } @@ -253,35 +241,6 @@ EDID1Read_DDC2(int scrnIndex, I2CBusPtr pBus) return DDCRead_DDC2(scrnIndex, pBus, 0, EDID1_LEN); } -static unsigned char* -VDIFRead(int scrnIndex, I2CBusPtr pBus, int start) -{ - unsigned char * Buffer, *v_buffer = NULL, *v_bufferp = NULL; - int i, num = 0; - - /* read VDIF length in 64 byte blocks */ - Buffer = DDCRead_DDC2(scrnIndex, pBus,start,64); - if (Buffer == NULL) - return NULL; -#ifdef DEBUG - ErrorF("number of 64 bit blocks: %i\n",Buffer[0]); -#endif - if ((num = Buffer[0]) > 0) - v_buffer = v_bufferp = xalloc(sizeof(unsigned char) * 64 * num); - - for (i = 0; i < num; i++) { - Buffer = DDCRead_DDC2(scrnIndex, pBus,start,64); - if (Buffer == NULL) { - xfree (v_buffer); - return NULL; - } - memcpy(v_bufferp,Buffer,63); /* 64th byte is checksum */ - xfree(Buffer); - v_bufferp += 63; - } - return v_buffer; -} - static unsigned char * DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len) { diff --git a/hw/xfree86/ddc/xf86DDC.h b/hw/xfree86/ddc/xf86DDC.h index 77994715e..3b072dda7 100644 --- a/hw/xfree86/ddc/xf86DDC.h +++ b/hw/xfree86/ddc/xf86DDC.h @@ -43,10 +43,6 @@ extern xf86MonPtr xf86InterpretEDID( int screenIndex, Uchar *block ); -extern xf86vdifPtr xf86InterpretVdif( - CARD8 *c -); - extern void xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC); @@ -55,10 +51,6 @@ extern Bool xf86SetDDCproperties( xf86MonPtr DDC ); -extern void xf86print_vdif( - xf86vdifPtr v -); - DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC); #endif diff --git a/hw/xfree86/dixmods/Makefile.am b/hw/xfree86/dixmods/Makefile.am index 58099bce9..06e6d4080 100644 --- a/hw/xfree86/dixmods/Makefile.am +++ b/hw/xfree86/dixmods/Makefile.am @@ -45,9 +45,6 @@ fontsmodule_LTLIBRARIES = libfreetype.la \ AM_CFLAGS = @XORG_CFLAGS@ @DIX_CFLAGS@ INCLUDES = @XORG_INCS@ \ - -I$(top_srcdir)/afb \ - -I$(top_srcdir)/cfb \ - -I$(top_srcdir)/mfb \ -I$(top_srcdir)/dbe \ -I$(top_srcdir)/hw/xfree86/loader \ -I$(top_srcdir)/miext/shadow \ @@ -75,13 +72,13 @@ libdbe_la_SOURCES = dbemodule.c libfb_la_LDFLAGS = -avoid-version libfb_la_LIBADD = $(top_builddir)/fb/libfb.la -libfb_la_SOURCES = $(top_builddir)/fb/fbcmap.c fbmodule.c -libfb_la_CFLAGS = -DXFree86Server $(AM_CFLAGS) +libfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c +libfb_la_CFLAGS = $(AM_CFLAGS) libwfb_la_LDFLAGS = -avoid-version libwfb_la_LIBADD = $(top_builddir)/fb/libwfb.la -libwfb_la_SOURCES = $(top_builddir)/fb/fbcmap.c fbmodule.c -libwfb_la_CFLAGS = -DXFree86Server $(AM_CFLAGS) -DFB_ACCESS_WRAPPER +libwfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c +libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER libglx_la_LDFLAGS = -avoid-version if AIGLX diff --git a/hw/xfree86/dixmods/afbmodule.c b/hw/xfree86/dixmods/afbmodule.c index ee8cf2037..b0aea6ddc 100644 --- a/hw/xfree86/dixmods/afbmodule.c +++ b/hw/xfree86/dixmods/afbmodule.c @@ -29,7 +29,6 @@ #endif #include "xf86Module.h" -#include "afb.h" static MODULESETUPPROTO(afbSetup); diff --git a/hw/xfree86/dixmods/cfb32module.c b/hw/xfree86/dixmods/cfb32module.c index 1451594e5..23708e4c2 100644 --- a/hw/xfree86/dixmods/cfb32module.c +++ b/hw/xfree86/dixmods/cfb32module.c @@ -28,10 +28,7 @@ #include <xorg-config.h> #endif -#define PSZ 32 - #include "xf86Module.h" -#include "cfb.h" static MODULESETUPPROTO(cfb32Setup); diff --git a/hw/xfree86/dixmods/cfbmodule.c b/hw/xfree86/dixmods/cfbmodule.c index 693fd6177..07074c158 100644 --- a/hw/xfree86/dixmods/cfbmodule.c +++ b/hw/xfree86/dixmods/cfbmodule.c @@ -28,10 +28,7 @@ #include <xorg-config.h> #endif -#define PSZ 8 - #include "xf86Module.h" -#include "cfb.h" static MODULESETUPPROTO(cfbSetup); diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre index cc60d0754..4103974c1 100644 --- a/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/hw/xfree86/doc/man/xorg.conf.man.pre @@ -3,7 +3,7 @@ .ds q \N'34' .TH __xconfigfile__ __filemansuffix__ __vendorversion__ .SH NAME -__xconfigfile__ - Configuration File for __xservername__ +__xconfigfile__ \- configuration File for __xservername__ X server .SH INTRODUCTION .B __xservername__ supports several mechanisms for supplying/obtaining configuration and @@ -21,9 +21,10 @@ manual page. .SH DESCRIPTION .B __xservername__ uses a configuration file called -.B __xconfigfile__ -for its initial setup. This configuration file is searched for in the -following places when the server is started as a normal user: +.I __xconfigfile__ +for its initial setup. +This configuration file is searched for in the following places when the +server is started as a normal user: .PP .RS 4 .nf @@ -31,30 +32,31 @@ following places when the server is started as a normal user: .IR __projectroot__/etc/X11/ <cmdline> .IB /etc/X11/ $XORGCONFIG .IB __projectroot__/etc/X11/ $XORGCONFIG -.I /etc/X11/__xconfigfile__-4 +.I /etc/X11/__xconfigfile__\-4 .I /etc/X11/__xconfigfile__ .I /etc/__xconfigfile__ .IR __projectroot__/etc/X11/__xconfigfile__. <hostname> -.I __projectroot__/etc/X11/__xconfigfile__-4 +.I __projectroot__/etc/X11/__xconfigfile__\-4 .I __projectroot__/etc/X11/__xconfigfile__ .IR __projectroot__/lib/X11/__xconfigfile__. <hostname> -.I __projectroot__/lib/X11/__xconfigfile__-4 +.I __projectroot__/lib/X11/__xconfigfile__\-4 .I __projectroot__/lib/X11/__xconfigfile__ .fi .RE .PP where .I <cmdline> -is a relative path (with no ".." components) specified with the +is a relative path (with no \(lq..\(rq components) specified with the .B \-config command line option, .B $XORGCONFIG -is the relative path (with no ".." components) specified by that +is the relative path (with no \(lq..\(rq components) specified by that environment variable, and .I <hostname> -is the machine's hostname as reported by gethostname(3). +is the machine's hostname as reported by +.BR gethostname (__oslibmansuffix__). .PP -When the __xservername__ server is started by the "root" user, the config file +When the __xservername__ server is started by the \(lqroot\(rq user, the config file search locations are as follows: .PP .RS 4 @@ -66,14 +68,14 @@ search locations are as follows: .IB /etc/X11/ $XORGCONFIG .IB __projectroot__/etc/X11/ $XORGCONFIG .BI $HOME /__xconfigfile__ -.I /etc/X11/__xconfigfile__-4 +.I /etc/X11/__xconfigfile__\-4 .I /etc/X11/__xconfigfile__ .I /etc/__xconfigfile__ .IR __projectroot__/etc/X11/__xconfigfile__. <hostname> -.I __projectroot__/etc/X11/__xconfigfile__-4 +.I __projectroot__/etc/X11/__xconfigfile__\-4 .I __projectroot__/etc/X11/__xconfigfile__ .IR __projectroot__/lib/X11/__xconfigfile__. <hostname> -.I __projectroot__/lib/X11/__xconfigfile__-4 +.I __projectroot__/lib/X11/__xconfigfile__\-4 .I __projectroot__/lib/X11/__xconfigfile__ .fi .RE @@ -90,13 +92,13 @@ environment variable (absolute or relative), is the path specified by that environment variable (usually the home directory), and .I <hostname> -is the machine's hostname as reported by gethostname(3). +is the machine's hostname as reported by +.BR gethostname (__oslibmansuffix__). .PP The -.B __xconfigfile__ -file is composed of a number of sections which may be present in any -order. Each section has -the form: +.I __xconfigfile__ +file is composed of a number of sections which may be present in any order. +Each section has the form: .PP .RS 4 .nf @@ -121,13 +123,14 @@ The section names are: .BR "Modes " "Video modes descriptions" .BR "Screen " "Screen configuration" .BR "ServerLayout " "Overall layout" -.BR "DRI " "DRI-specific configuration" -.BR "Vendor " "Vendor-specific configuration" +.BR "DRI " "DRI\-specific configuration" +.BR "Vendor " "Vendor\-specific configuration" .fi .RE .PP The following obsolete section names are still recognised for compatibility -purposes. In new config files, the +purposes. +In new config files, the .B InputDevice section should be used instead. .PP @@ -144,35 +147,38 @@ section is no longer recognised. .PP The .B ServerLayout -sections are at the highest level. They bind together the input and -output devices that will be used in a session. The input devices -are described in the +sections are at the highest level. +They bind together the input and output devices that will be used in a session. +The input devices are described in the .B InputDevice -sections. Output devices usually consist of multiple independent -components (e.g., a graphics board and a monitor). These multiple -components are bound together in the +sections. +Output devices usually consist of multiple independent components (e.g., +a graphics board and a monitor). +These multiple components are bound together in the .B Screen sections, and it is these that are referenced by the .B ServerLayout -section. Each +section. +Each .B Screen -section binds together a graphics board and a monitor. The graphics -boards are described in the +section binds together a graphics board and a monitor. +The graphics boards are described in the .B Device sections, and the monitors are described in the .B Monitor sections. .PP -Config file keywords are case-insensitive, and "_" characters are -ignored. Most strings (including +Config file keywords are case\-insensitive, and \(lq_\(rq characters are +ignored. +Most strings (including .B Option names) are also case-insensitive, and insensitive to white space and -"_" characters. +\(lq_\(rq characters. .PP -Each config file entry usually takes up a single line in the file. -They consist of a keyword, which is possibly followed by one or -more arguments, with the number and types of the arguments depending -on the keyword. The argument types are: +Each config file entry usually takes up a single line in the file. They +consist of a keyword, which is possibly followed by one or more arguments, +with the number and types of the arguments depending on the keyword. +The argument types are: .PP .RS 4 .nf @@ -182,17 +188,18 @@ on the keyword. The argument types are: .fi .RE .PP -Note: hex integer values must be prefixed with "0x", and octal values -with "0". +Note: hex integer values must be prefixed with \(lq0x\(rq, and octal values +with \(lq0\(rq. .PP A special keyword called .B Option -may be used to provide free-form data to various components of the server. +may be used to provide free\-form data to various components of the server. The .B Option -keyword takes either one or two string arguments. The first is the option -name, and the optional second argument is the option value. Some commonly -used option value types include: +keyword takes either one or two string arguments. +The first is the option name, and the optional second argument is the +option value. +Some commonly used option value types include: .PP .RS 4 .nf @@ -209,8 +216,8 @@ Note that .B Option values, not just strings, must be enclosed in quotes. .PP -Boolean options may optionally have a value specified. When no value -is specified, the option's value is +Boolean options may optionally have a value specified. +When no value is specified, the option's value is .BR TRUE . The following boolean option values are recognised as .BR TRUE : @@ -263,30 +270,35 @@ When the unit name is omitted, the correct units will be determined from the value and the expectations of the appropriate range of the value. It is recommended that the units always be specified when using frequency option values to avoid any errors in determining the value. -.SH FILES SECTION +.SH "FILES SECTION" The .B Files section is used to specify some path names required by the server. -Some of these paths can also be set from the command line (see Xserver(__appmansuffix__) -and __xservername__(__appmansuffix__)). The command line settings override the values specified -in the config file. The +Some of these paths can also be set from the command line (see +.BR Xserver (__appmansuffix__) +and +.BR __xservername__ (__appmansuffix__)). +The command line settings override the values specified in the config +file. +The .B Files section is optional, as are all of the entries that may appear in it. .PP The entries that can appear in this section are: .TP 7 .BI "FontPath \*q" path \*q -sets the search path for fonts. This path is a comma separated list of -font path elements which the __xservername__ server searches for font databases. +sets the search path for fonts. +This path is a comma separated list of font path elements which the __xservername__ +server searches for font databases. Multiple .B FontPath entries may be specified, and they will be concatenated to build up the fontpath used by the server. Font path elements may be either absolute -directory paths, or a font server identifier. Font server identifiers -have the form: +directory paths, or a font server identifier. +Font server identifiers have the form: .PP .RS 11 -.IR <trans> / <hostname> : <port-number> +.IR <trans> / <hostname> : <port\-number> .RE .PP .RS 7 @@ -294,16 +306,16 @@ where .I <trans> is the transport type to use to connect to the font server (e.g., .B unix -for UNIX-domain sockets or +for UNIX\-domain sockets or .B tcp for a TCP/IP connection), .I <hostname> is the hostname of the machine running the font server, and -.I <port-number> +.I <port\-number> is the port number that the font server is listening on (usually 7100). .PP When this entry is not specified in the config file, the server falls back -to the compiled-in default font path, which contains the following +to the compiled\-in default font path, which contains the following font path elements: .PP .RS 4 @@ -338,7 +350,7 @@ font path when the server starts up. .BI "RGBPath \*q" path \*q sets the path name for the RGB color database. When this entry is not specified in the config file, the server falls back -to the compiled-in default RGB path, which is: +to the compiled\-in default RGB path, which is: .PP .RS 11 .I __projectroot__/share/X11/rgb @@ -350,9 +362,10 @@ is added to this path if the server was compiled to use text rather than binary format RGB color databases. .TP 7 .BI "ModulePath \*q" path \*q -sets the search path for loadable __xservername__ server modules. This path is -a comma separated list of directories which the __xservername__ server searches -for loadable modules loading in the order specified. Multiple +sets the search path for loadable __xservername__ server modules. +This path is a comma separated list of directories which the __xservername__ server +searches for loadable modules loading in the order specified. +Multiple .B ModulePath entries may be specified, and they will be concatenated to build the module search path used by the server. @@ -360,8 +373,8 @@ module search path used by the server. .ig .TP 7 .BI "LogFile \*q" path \*q -sets the name of the __xservername__ server log file. The default log file name -is +sets the name of the __xservername__ server log file. +The default log file name is .PP .RS 11 .RI __logdir__/__xservername__. <n> .log @@ -372,15 +385,18 @@ where .I <n> is the display number for the __xservername__ server. .. -.SH SERVERFLAGS SECTION +.SH "SERVERFLAGS SECTION" In addition to options specific to this section (described below), the .B ServerFlags section is used to specify some global -__xservername__ server options. All of the entries in this section are +__xservername__ server options. +All of the entries in this section are .BR Options , although for compatibility purposes some of the old style entries are -still recognised. Those old style entries are not documented here, and -using them is discouraged. The +still recognised. +Those old style entries are not documented here, and using them is +discouraged. +The .B ServerFlags section is optional, as are the entries that may be specified in it. .PP @@ -392,11 +408,12 @@ may be overridden by .B Options specified in the active .B ServerLayout -section. Options with command line equivalents are overridden when their -command line equivalent is used. The options recognised by this section -are: +section. +Options with command line equivalents are overridden when their command +line equivalent is used. +The options recognised by this section are: .TP 7 -.BI "Option \*qDefaultServerLayout\*q \*q" layout-id \*q +.BI "Option \*qDefaultServerLayout\*q \*q" layout\-id \*q This specifies the default .B ServerLayout section to use in the absence of the @@ -404,148 +421,185 @@ section to use in the absence of the command line option. .TP 7 .BI "Option \*qNoTrapSignals\*q \*q" boolean \*q -This prevents the __xservername__ server from trapping a range of unexpected -fatal signals and exiting cleanly. Instead, the __xservername__ server will die -and drop core where the fault occurred. The default behaviour is -for the __xservername__ server to exit cleanly, but still drop a core file. In -general you never want to use this option unless you are debugging -an __xservername__ server problem and know how to deal with the consequences. +This prevents the __xservername__ server from trapping a range of unexpected fatal +signals and exiting cleanly. +Instead, the __xservername__ server will die and drop core where the fault occurred. +The default behaviour is for the __xservername__ server to exit cleanly, but still drop a +core file. +In general you never want to use this option unless you are debugging an __xservername__ +server problem and know how to deal with the consequences. .TP 7 .BI "Option \*qDontVTSwitch\*q \*q" boolean \*q This disallows the use of the .BI Ctrl+Alt+F n sequence (where .RI F n -refers to one of the numbered function keys). That sequence is normally -used to switch to another \*qvirtual terminal\*q on operating systems -that have this feature. When this option is enabled, that key sequence has -no special meaning and is passed to clients. Default: off. +refers to one of the numbered function keys). +That sequence is normally used to switch to another \*qvirtual terminal\*q +on operating systems that have this feature. +When this option is enabled, that key sequence has no special meaning and +is passed to clients. +Default: off. .TP 7 .BI "Option \*qDontZap\*q \*q" boolean \*q This disallows the use of the .B Ctrl+Alt+Backspace -sequence. That sequence is normally used to terminate the __xservername__ server. -When this option is enabled, that key sequence has no special meaning -and is passed to clients. Default: off. +sequence. +That sequence is normally used to terminate the __xservername__ server. +When this option is enabled, that key sequence has no special meaning and +is passed to clients. +Default: off. .TP 7 .BI "Option \*qDontZoom\*q \*q" boolean \*q This disallows the use of the -.B Ctrl+Alt+Keypad-Plus +.B Ctrl+Alt+Keypad\-Plus and -.B Ctrl+Alt+Keypad-Minus -sequences. These sequences allows you to switch between video modes. +.B Ctrl+Alt+Keypad\-Minus +sequences. +These sequences allows you to switch between video modes. When this option is enabled, those key sequences have no special meaning -and are passed to clients. Default: off. +and are passed to clients. +Default: off. .TP 7 .BI "Option \*qDisableVidModeExtension\*q \*q" boolean \*q This disables the parts of the VidMode extension used by the xvidtune client -that can be used to change the video modes. Default: the VidMode extension -is enabled. +that can be used to change the video modes. +Default: the VidMode extension is enabled. .TP 7 .BI "Option \*qAllowNonLocalXvidtune\*q \*q" boolean \*q This allows the xvidtune client (and other clients that use the VidMode -extension) to connect from another host. Default: off. +extension) to connect from another host. +Default: off. .TP 7 .BI "Option \*qDisableModInDev\*q \*q" boolean \*q -This disables the parts of the __xservername__-Misc extension that can be used to -modify the input device settings dynamically. Default: that functionality -is enabled. +This disables the parts of the __xservername__\-Misc extension that can be used to +modify the input device settings dynamically. +Default: that functionality is enabled. .TP 7 .BI "Option \*qAllowNonLocalModInDev\*q \*q" boolean \*q This allows a client to connect from another host and change keyboard -and mouse settings in the running server. Default: off. +and mouse settings in the running server. +Default: off. .TP 7 .BI "Option \*qAllowMouseOpenFail\*q \*q" boolean \*q This allows the server to start up even if the mouse device can't be -opened/initialised. Default: false. +opened/initialised. +Default: false. .TP 7 .BI "Option \*qVTInit\*q \*q" command \*q Runs .I command after the VT used by the server has been opened. -The command string is passed to "/bin/sh -c", and is run with the -real user's id with stdin and stdout set to the VT. The purpose -of this option is to allow system dependent VT initialisation -commands to be run. This option should rarely be needed. Default: not set. +The command string is passed to \*q/bin/sh \-c\*q, and is run with the real +user's id with stdin and stdout set to the VT. +The purpose of this option is to allow system dependent VT initialisation +commands to be run. +This option should rarely be needed. +Default: not set. .TP 7 .BI "Option \*qVTSysReq\*q \*q" boolean \*q -enables the SYSV-style VT switch sequence for non-SYSV systems -which support VT switching. This sequence is -.B Alt-SysRq -followed -by a function key +enables the SYSV\-style VT switch sequence for non\-SYSV systems +which support VT switching. +This sequence is +.B Alt\-SysRq +followed by a function key .RB ( Fn ). This prevents the __xservername__ server trapping the keys used for the default VT switch sequence, which means that clients can -access them. Default: off. +access them. +Default: off. .TP 7 .BI "Option \*qXkbDisable\*q \*q" boolean \*q -disable/enable the XKEYBOARD extension. The \-kb command line -option overrides this config file option. Default: XKB is enabled. +disable/enable the XKEYBOARD extension. +The \-kb command line option overrides this config file option. +Default: XKB is enabled. .\" The following four options are "undocumented". .ig .TP 7 .BI "Option \*qPciProbe1\*q" -Use PCI probe method 1. Default: set. +Use PCI probe method 1. +Default: set. .TP 7 .BI "Option \*qPciProbe2\*q" -Use PCI probe method 2. Default: not set. +Use PCI probe method 2. +Default: not set. .TP 7 .BI "Option \*qPciForceConfig1\*q" -Force the use PCI config type 1. Default: not set. +Force the use PCI config type 1. +Default: not set. .TP 7 .BI "Option \*qPciForceConfig2\*q" -Force the use PCI config type 2. Default: not set. +Force the use PCI config type 2. +Default: not set. .. .TP 7 .BI "Option \*qBlankTime\*q \*q" time \*q -sets the inactivity timeout for the blanking phase of the screensaver. +sets the inactivity timeout for the +.B blank +phase of the screensaver. .I time -is in minutes. This is equivalent to the __xservername__ server's `-s' flag, -and the value can be changed at run-time with xset(__appmansuffix__). Default: 10 -minutes. +is in minutes. +This is equivalent to the __xservername__ server's +.B \-s +flag, and the value can be changed at run\-time with +.BR xset(__appmansuffix__). +Default: 10 minutes. .TP 7 .BI "Option \*qStandbyTime\*q \*q" time \*q -sets the inactivity timeout for the "standby" phase of DPMS mode. +sets the inactivity timeout for the +.B standby +phase of DPMS mode. .I time -is in minutes, and the value can be changed at run-time with xset(__appmansuffix__). -Default: 20 minutes. This is only suitable for VESA DPMS compatible -monitors, and may not be supported by all video drivers. It is only -enabled for screens that have the +is in minutes, and the value can be changed at run\-time with +.BR xset(__appmansuffix__). +Default: 20 minutes. +This is only suitable for VESA DPMS compatible monitors, and may not be +supported by all video drivers. +It is only enabled for screens that have the .B \*qDPMS\*q option set (see the MONITOR section below). .TP 7 .BI "Option \*qSuspendTime\*q \*q" time \*q -sets the inactivity timeout for the "suspend" phase of DPMS mode. +sets the inactivity timeout for the +.B suspend +phase of DPMS mode. .I time -is in minutes, and the value can be changed at run-time with xset(__appmansuffix__). -Default: 30 minutes. This is only suitable for VESA DPMS compatible -monitors, and may not be supported by all video drivers. It is only -enabled for screens that have the +is in minutes, and the value can be changed at run\-time with +.BR xset(__appmansuffix__). +Default: 30 minutes. +This is only suitable for VESA DPMS compatible monitors, and may not be +supported by all video drivers. +It is only enabled for screens that have the .B \*qDPMS\*q option set (see the MONITOR section below). .TP 7 .BI "Option \*qOffTime\*q \*q" time \*q -sets the inactivity timeout for the "off" phase of DPMS mode. +sets the inactivity timeout for the +.B off +phase of DPMS mode. .I time -is in minutes, and the value can be changed at run-time with xset(__appmansuffix__). -Default: 40 minutes. This is only suitable for VESA DPMS compatible -monitors, and may not be supported by all video drivers. It is only -enabled for screens that have the +is in minutes, and the value can be changed at run\-time with +.BR xset(__appmansuffix__). +Default: 40 minutes. +This is only suitable for VESA DPMS compatible monitors, and may not be +supported by all video drivers. +It is only enabled for screens that have the .B \*qDPMS\*q option set (see the MONITOR section below). .TP 7 .BI "Option \*qPixmap\*q \*q" bpp \*q -This sets the pixmap format to use for depth 24. Allowed values for +This sets the pixmap format to use for depth 24. +Allowed values for .I bpp -are 24 and 32. Default: 32 unless driver constraints don't allow this -(which is rare). Note: some clients don't behave well when this value -is set to 24. +are 24 and 32. +Default: 32 unless driver constraints don't allow this (which is rare). +Note: some clients don't behave well when this value is set to 24. .TP 7 .BI "Option \*qPC98\*q \*q" boolean \*q -Specify that the machine is a Japanese PC-98 machine. This should not -be enabled for anything other than the Japanese-specific PC-98 -architecture. Default: auto-detected. +Specify that the machine is a Japanese PC\-98 machine. +This should not be enabled for anything other than the Japanese\-specific +PC\-98 architecture. +Default: auto\-detected. .\" Doubt this should be documented. .ig .TP 7 @@ -555,48 +609,54 @@ Default: 0. .. .TP 7 .BI "Option \*qNoPM\*q \*q" boolean \*q -Disables something to do with power management events. Default: PM -enabled on platforms that support it. +Disables something to do with power management events. +Default: PM enabled on platforms that support it. .TP 7 .BI "Option \*qXinerama\*q \*q" boolean \*q -enable or disable XINERAMA extension. Default is disabled. +enable or disable XINERAMA extension. +Default is disabled. .TP 7 .BI "Option \*qAllowDeactivateGrabs\*q \*q" boolean \*q This option enables the use of the -.B Ctrl+Alt+Keypad-Divide -key sequence to deactivate any active keyboard and mouse grabs. Default: -off. +.B Ctrl+Alt+Keypad\-Divide +key sequence to deactivate any active keyboard and mouse grabs. +Default: off. .TP 7 .BI "Option \*qAllowClosedownGrabs\*q \*q" boolean \*q This option enables the use of the -.B Ctrl+Alt+Keypad-Multiply -key sequence to kill clients with an active keyboard or mouse grab as -well as killing any application that may have locked the server, normally -using the XGrabServer(__libmansuffix__) Xlib function. Default: off. +.B Ctrl+Alt+Keypad\-Multiply +key sequence to kill clients with an active keyboard or mouse grab as well +as killing any application that may have locked the server, normally using +the +.BR XGrabServer(__libmansuffix__) +Xlib function. +Default: off. .br Note that the options -.BI AllowDeactivateGrabs +.B AllowDeactivateGrabs and -.BI AllowClosedownGrabs +.B AllowClosedownGrabs will allow users to remove the grab used by screen saver/locker programs. -An API was written to such cases. If you enable this option, make sure -your screen saver/locker is updated. +An API was written to such cases. +If you enable this option, make sure your screen saver/locker is updated. +Default: off. .TP 7 .BI "Option \*qHandleSpecialKeys\*q \*q" when \*q This option controls when the server uses the builtin handler to process special key combinations (such as .BR Ctrl+Alt+Backspace ). -Normally the XKEYBOARD extension keymaps will provide mappings for each -of the special key combinations, so the builtin handler is not needed -unless the XKEYBOARD extension is disabled. The value of +Normally the XKEYBOARD extension keymaps will provide mappings for each of +the special key combinations, so the builtin handler is not needed unless +the XKEYBOARD extension is disabled. +The value of .I when can be .BR Always , .BR Never , or .BR WhenNeeded . -Default: Use the builtin handler only if needed. The server will scan -the keymap for a mapping to the +Default: Use the builtin handler only if needed. +The server will scan the keymap for a mapping to the .B Terminate action and, if found, use XKEYBOARD for processing actions, otherwise the builtin handler will be used. @@ -604,24 +664,30 @@ the builtin handler will be used. .BI "Option \*qAIGLX\*q \*q" boolean \*q enable or disable AIGLX. AIGLX is enabled by default. .TP 7 +.BI "Option \*qUseDefaultFontPath\*q \*q" boolean \*q +Include the default font path even if other paths are specified in +xorg.conf. If enabled, other font paths are included as well. Enabled by +default. +.TP 7 .BI "Option \*qIgnoreABI\*q \*q" boolean \*q Allow modules built for a different, potentially incompatible version of the X server to load. Disabled by default. -.SH MODULE SECTION +.SH "MODULE SECTION" The .B Module section is used to specify which __xservername__ server modules should be loaded. This section is ignored when the __xservername__ server is built in static form. The types of modules normally loaded in this section are __xservername__ server -extension modules, and font rasteriser modules. Most other module types -are loaded automatically when they are needed via other mechanisms. +extension modules, and font rasteriser modules. +Most other module types are loaded automatically when they are needed via +other mechanisms. The .B Module section is optional, as are all of the entries that may be specified in it. .PP -Entries in this section may be in two forms. The first and most commonly -used form is an entry that uses the +Entries in this section may be in two forms. +The first and most commonly used form is an entry that uses the .B Load keyword, as described here: .TP 7 @@ -629,8 +695,9 @@ keyword, as described here: This instructs the server to load the module called .IR modulename . The module name given should be the module's standard name, not the -module file name. The standard name is case-sensitive, and does not -include the "lib" prefix, or the ".a", ".o", or ".so" suffixes. +module file name. +The standard name is case\-sensitive, and does not include the \(lqlib\(rq +prefix, or the \(lq.a\(rq, \(lq.o\(rq, or \(lq.so\(rq suffixes. .PP .RS 7 Example: the Type 1 font rasteriser can be loaded with the following entry: @@ -639,6 +706,20 @@ Example: the Type 1 font rasteriser can be loaded with the following entry: .B "Load \*qtype1\*q" .RE .RE +.TP 7 +.BI "Disable \*q" modulename \*q +This instructs the server to not load the module called +.IR modulename . +Some modules are loaded by default in the server, and this overrides that +default. If a +.B Load +instruction is given for the same module, it overrides the +.B Disable +instruction and the module is loaded. The module name given should be the +module's standard name, not the module file name. As with the +.B Load +instruction, the standard name is case-sensitive, and does not include the +"lib" prefix, or the ".a", ".o", or ".so" suffixes. .PP The second form of entry is a .BR SubSection, @@ -649,13 +730,13 @@ being that are passed to the module when it is loaded. .PP Example: the extmod module (which contains a miscellaneous group of -server extensions) can be loaded, with the XFree86-DGA extension +server extensions) can be loaded, with the XFree86\-DGA extension disabled by using the following entry: .PP .RS 4 .nf .B "SubSection \*qextmod\*q" -.B " Option \*qomit XFree86-DGA\*q" +.B " Option \*qomit XFree86\-DGA\*q" .B EndSubSection .fi .RE @@ -677,17 +758,20 @@ __projectroot__/lib/modules/extensions .fi .RE .PP -The "bitmap" font modules is loaded automatically. It is recommended -that at very least the "extmod" extension module be loaded. If it isn't -some commonly used server extensions (like the SHAPE extension) will not be -available. -.SH INPUTDEVICE SECTION +The \(lqbitmap\(rq font module is loaded automatically. +It is recommended +that at very least the \(lqextmod\(rq extension module be loaded. +If it isn't, some commonly used server extensions (like the SHAPE +extension) will not be available. +.SH "INPUTDEVICE SECTION" The config file may have multiple .B InputDevice -sections. There will normally be at least two: one for the core (primary) -keyboard, and one of the core pointer. If either of these two is missing, -a default configuration for the missing ones will be used. Currently the -default configuration may not work as expected on all platforms. +sections. +There will normally be at least two: one for the core (primary) keyboard, +and one of the core pointer. +If either of these two is missing, a default configuration for the missing +ones will be used. +Currently the default configuration may not work as expected on all platforms. .PP .B InputDevice sections have the following format: @@ -709,18 +793,21 @@ and .B Driver entries are required in all .B InputDevice -sections. All other entries are optional. +sections. +All other entries are optional. .PP The .B Identifier -entry specifies the unique name for this input device. The +entry specifies the unique name for this input device. +The .B Driver entry specifies the name of the driver to use for this input device. When using the loadable server, the input driver module .RI \*q inputdriver \*q will be loaded for each active .B InputDevice -section. An +section. +An .B InputDevice section is considered active if it is referenced by an active .B ServerLayout @@ -730,7 +817,10 @@ or .B \-pointer command line options, or if it is selected implicitly as the core pointer or keyboard device in the absence of such explicit references. -The most commonly used input drivers are "keyboard" and "mouse". +The most commonly used input drivers are +.BR keyboard (__drivermansuffix__) +and +.BR mouse (__drivermansuffix__). .PP In the absence of an explicitly specified core input device, the first .B InputDevice @@ -738,21 +828,24 @@ marked as .B CorePointer (or .BR CoreKeyboard ) -is used. If there is no match there, the first +is used. +If there is no match there, the first .B InputDevice -that uses the "mouse" (or "keyboard" or "kbd") driver is used. The final -fallback is to use built-in default configurations. +that uses the \(lqmouse\(rq (or \(lqkeyboard\(rq or \(lqkbd\(rq) driver is used. +The final fallback is to use built\-in default configurations. .PP .B InputDevice -sections recognise some driver-independent +sections recognise some driver\-independent .BR Options , -which are described here. See the individual input driver manual pages -for a description of the device-specific options. +which are described here. +See the individual input driver manual pages for a description of the +device\-specific options. .TP 7 .BI "Option \*qCorePointer\*q" When this is set, the input device is installed as the core (primary) -pointer device. There must be exactly one core pointer. If this option -is not set here, or in the +pointer device. +There must be exactly one core pointer. +If this option is not set here, or in the .B ServerLayout section, or from the .B \-pointer @@ -764,8 +857,9 @@ section is used. .TP 7 .BI "Option \*qCoreKeyboard\*q" When this is set, the input device is to be installed as the core -(primary) keyboard device. There must be exactly one core keyboard. If -this option is not set here, in the +(primary) keyboard device. +There must be exactly one core keyboard. +If this option is not set here, in the .B ServerLayout section, or from the .B \-keyboard @@ -779,19 +873,21 @@ section is used. .TP 7 .BI "Option \*qSendCoreEvents\*q \*q" boolean \*q Both of these options are equivalent, and when enabled cause the -input device to always report core events. This can be used, for -example, to allow an additional pointer device to generate core -pointer events (like moving the cursor, etc). +input device to always report core events. +This can be used, for example, to allow an additional pointer device to +generate core pointer events (like moving the cursor, etc). .TP 4 .BI "Option \*qHistorySize\*q \*q" number \*q -Sets the motion history size. Default: 0. +Sets the motion history size. +Default: 0. .TP 7 .BI "Option \*qSendDragEvents\*q \*q" boolean \*q ??? -.SH DEVICE SECTION +.SH "DEVICE SECTION" The config file may have multiple .B Device -sections. There must be at least one, for the video card being used. +sections. +There must be at least one, for the video card being used. .PP .B Device sections have the following format: @@ -817,27 +913,30 @@ sections. All other entries are optional. .PP The .B Identifier -entry specifies the unique name for this graphics device. The +entry specifies the unique name for this graphics device. +The .B Driver entry specifies the name of the driver to use for this graphics device. When using the loadable server, the driver module .RI \*q driver \*q will be loaded for each active .B Device -section. A +section. +A .B Device section is considered active if it is referenced by an active .B Screen section. .PP .B Device -sections recognise some driver-independent entries and +sections recognise some driver\-independent entries and .BR Options , -which are described here. Not all drivers make use of these -driver-independent entries, and many of those that do don't require them -to be specified because the information is auto-detected. See the -individual graphics driver manual pages for further information about -this, and for a description of the device-specific options. +which are described here. +Not all drivers make use of these +driver\-independent entries, and many of those that do don't require them +to be specified because the information is auto\-detected. +See the individual graphics driver manual pages for further information +about this, and for a description of the device\-specific options. Note that most of the .B Options listed here (but not the other entries) may be specified in the @@ -846,118 +945,137 @@ section instead of here in the .B Device section. .TP 7 -.BI "BusID \*q" bus-id \*q -This specifies the bus location of the graphics card. For PCI/AGP cards, +.BI "BusID \*q" bus\-id \*q +This specifies the bus location of the graphics card. +For PCI/AGP cards, the -.I bus-id +.I bus\-id string has the form .BI PCI: bus : device : function -(e.g., "PCI:1:0:0" might be appropriate for an AGP card). +(e.g., \(lqPCI:1:0:0\(rq might be appropriate for an AGP card). This field is usually optional in single-head configurations when using -the primary graphics card. In multi-head configurations, or when using -a secondary graphics card in a single-head configuration, this entry is -mandatory. Its main purpose is to make an unambiguous connection between -the device section and the hardware it is representing. This information -can usually be found by running the __xservername__ server with the +the primary graphics card. +In multi-head configurations, or when using a secondary graphics card in a +single-head configuration, this entry is mandatory. +Its main purpose is to make an unambiguous connection between the device +section and the hardware it is representing. +This information can usually be found by running the __xservername__ server +with the .B \-scanpci command line option. .TP 7 .BI "Screen " number This option is mandatory for cards where a single PCI entity can drive more than one display (i.e., multiple CRTCs sharing a single graphics accelerator -and video memory). One +and video memory). +One .B Device section is required for each head, and this parameter determines which head each of the .B Device -sections applies to. The legal values of +sections applies to. +The legal values of .I number range from 0 to one less than the total number of heads per entity. Most drivers require that the primary screen (0) be present. .TP 7 .BI "Chipset \*q" chipset \*q This usually optional entry specifies the chipset used on the graphics -board. In most cases this entry is not required because the drivers -will probe the hardware to determine the chipset type. Don't -specify it unless the driver-specific documentation recommends that you +board. +In most cases this entry is not required because the drivers will probe the +hardware to determine the chipset type. +Don't specify it unless the driver-specific documentation recommends that you do. .TP 7 -.BI "Ramdac \*q" ramdac-type \*q +.BI "Ramdac \*q" ramdac\-type \*q This optional entry specifies the type of RAMDAC used on the graphics -board. This is only used by a few of the drivers, and in most cases it -is not required because the drivers will probe the hardware to determine -the RAMDAC type where possible. Don't specify it unless the -driver-specific documentation recommends that you do. +board. +This is only used by a few of the drivers, and in most cases it is not +required because the drivers will probe the hardware to determine the +RAMDAC type where possible. +Don't specify it unless the driver-specific documentation recommends that you +do. .TP 7 .BI "DacSpeed " speed .TP 7 -.BI "DacSpeed " "speed-8 speed-16 speed-24 speed-32" +.BI "DacSpeed " "speed\-8 speed\-16 speed\-24 speed\-32" This optional entry specifies the RAMDAC speed rating (which is usually -printed on the RAMDAC chip). The speed is in MHz. When one value is -given, it applies to all framebuffer pixel sizes. When multiple values -are give, they apply to the framebuffer pixel sizes 8, 16, 24 and 32 -respectively. This is not used by many drivers, and only needs to be -specified when the speed rating of the RAMDAC is different from the -defaults built in to driver, or when the driver can't auto-detect the -correct defaults. Don't specify it unless the driver-specific -documentation recommends that you do. +printed on the RAMDAC chip). +The speed is in MHz. +When one value is given, it applies to all framebuffer pixel sizes. +When multiple values are given, they apply to the framebuffer pixel sizes +8, 16, 24 and 32 respectively. +This is not used by many drivers, and only needs to be specified when the +speed rating of the RAMDAC is different from the defaults built in to +driver, or when the driver can't auto-detect the correct defaults. +Don't specify it unless the driver-specific documentation recommends that you +do. .TP 7 .BI "Clocks " "clock ..." -specifies the pixel that are on your graphics board. The clocks are in -MHz, and may be specified as a floating point number. The value is -stored internally to the nearest kHz. The ordering of the clocks is -important. It must match the order in which they are selected on the -graphics board. Multiple +specifies the pixel that are on your graphics board. +The clocks are in MHz, and may be specified as a floating point number. +The value is stored internally to the nearest kHz. +The ordering of the clocks is important. +It must match the order in which they are selected on the graphics board. +Multiple .B Clocks -lines may be specified, and each is concatenated to form the list. Most -drivers do not use this entry, and it is only required for some older -boards with non-programmable clocks. Don't specify this entry unless -the driver-specific documentation explicitly recommends that you do. +lines may be specified, and each is concatenated to form the list. +Most drivers do not use this entry, and it is only required for some older +boards with non-programmable clocks. +Don't specify this entry unless the driver-specific documentation explicitly +recommends that you do. .TP -.BI "ClockChip \*q" clockchip-type \*q +.BI "ClockChip \*q" clockchip\-type \*q This optional entry is used to specify the clock chip type on graphics -boards which have a programmable clock generator. Only a few __xservername__ -drivers support programmable clock chips. For details, see the appropriate -driver manual page. +boards which have a programmable clock generator. +Only a few __xservername__ drivers support programmable clock chips. +For details, see the appropriate driver manual page. .TP 7 .BI "VideoRam " "mem" This optional entry specifies the amount of video ram that is installed -on the graphics board. This is measured in kBytes. In most cases this -is not required because the __xservername__ server probes the graphics board to -determine this quantity. The driver-specific documentation should -indicate when it might be needed. +on the graphics board. +This is measured in kBytes. +In most cases this is not required because the __xservername__ server probes +the graphics board to determine this quantity. +The driver-specific documentation should indicate when it might be needed. .TP 7 .BI "BiosBase " "baseaddress" This optional entry specifies the base address of the video BIOS for -the VGA board. This address is normally auto-detected, and should only -be specified if the driver-specific documentation recommends it. +the VGA board. +This address is normally auto-detected, and should only be specified if the +driver-specific documentation recommends it. .TP 7 .BI "MemBase " "baseaddress" This optional entry specifies the memory base address of a graphics -board's linear frame buffer. This entry is not used by many drivers, -and it should only be specified if the driver-specific documentation -recommends it. +board's linear frame buffer. +This entry is not used by many drivers, and it should only be specified if +the driver-specific documentation recommends it. .TP 7 .BI "IOBase " "baseaddress" -This optional entry specifies the IO base address. This entry is not -used by many drivers, and it should only be specified if the -driver-specific documentation recommends it. +This optional entry specifies the IO base address. +This entry is not used by many drivers, and it should only be specified if +the driver-specific documentation recommends it. .TP 7 .BI "ChipID " "id" This optional entry specifies a numerical ID representing the chip type. -For PCI cards, it is usually the device ID. This can be used to override -the auto-detection, but that should only be done when the driver-specific -documentation recommends it. +For PCI cards, it is usually the device ID. +This can be used to override the auto-detection, but that should only be done +when the driver-specific documentation recommends it. .TP 7 .BI "ChipRev " "rev" -This optional entry specifies the chip revision number. This can be -used to override the auto-detection, but that should only be done when -the driver-specific documentation recommends it. +This optional entry specifies the chip revision number. +This can be used to override the auto-detection, but that should only be done +when the driver-specific documentation recommends it. .TP 7 .BI "TextClockFreq " "freq" This optional entry specifies the pixel clock frequency that is used -for the regular text mode. The frequency is specified in MHz. This is -rarely used. +for the regular text mode. +The frequency is specified in MHz. +This is rarely used. +.TP 7 +.BI "Option \*qModeDebug\*q \*q" boolean \*q +Enable printing of additional debugging information about modesetting to +the server log. .ig .TP 7 This optional entry allows an IRQ number to be specified. @@ -966,19 +1084,22 @@ This optional entry allows an IRQ number to be specified. .B Options Option flags may be specified in the .B Device -sections. These include driver-specific options and driver-independent -options. The former are described in the driver-specific documentation. +sections. +These include driver\-specific options and driver\-independent options. +The former are described in the driver\-specific documentation. Some of the latter are described below in the section about the .B Screen section, and they may also be included here. -.SH VIDEOADAPTOR SECTION -Nobody wants to say how this works. Maybe nobody knows ... +.SH "VIDEOADAPTOR SECTION" +Nobody wants to say how this works. +Maybe nobody knows ... -.SH MONITOR SECTION +.SH "MONITOR SECTION" The config file may have multiple .B Monitor -sections. There should normally be at least one, for the monitor being used, +sections. +There should normally be at least one, for the monitor being used, but a default configuration will be created when one isn't specified. .PP .B Monitor @@ -1002,7 +1123,8 @@ entry. .PP The .B Identifier -entry specifies the unique name for this monitor. The +entry specifies the unique name for this monitor. +The .B Monitor section may be used to provide information about the specifications of the monitor, monitor-specific @@ -1010,8 +1132,8 @@ monitor, monitor-specific and information about the video modes to use with the monitor. .PP With RandR 1.2-enabled drivers, monitor sections are tied to specific outputs -of the video card. Each output has a name, and the server will look for a -Monitor named +of the video card. +Each output has a name, and the server will look for a Monitor named .B \*qMonitor-outputname\*q for configuration of that output (for example, .B \*qMonitor-VGA\*q @@ -1019,16 +1141,17 @@ for a VGA output) .PP Specifying video modes is optional because the server will use the DDC or other information provided by the monitor to automatically configure the list of -modes available. When modes are specified explicitly in the +modes available. +When modes are specified explicitly in the .B Monitor section (with the .BR Modes , .BR ModeLine , or .B UseModes -keywords), built-in modes with the same names are not included. Built-in -modes with different names are, however, still implicitly included, when they -meet the requirements of the monitor. +keywords), built-in modes with the same names are not included. +Built-in modes with different names are, however, still implicitly included, +when they meet the requirements of the monitor. .PP The entries that may be used in .B Monitor @@ -1040,69 +1163,79 @@ This optional entry specifies the monitor's manufacturer. .BI "ModelName \*q" model \*q This optional entry specifies the monitor's model. .TP 7 -.BI "HorizSync " "horizsync-range" +.BI "HorizSync " "horizsync\-range" gives the range(s) of horizontal sync frequencies supported by the monitor. -.I horizsync-range +.I horizsync\-range may be a comma separated list of either discrete values or ranges of -values. A range of values is two values separated by a dash. By default -the values are in units of kHz. They may be specified in MHz or Hz if +values. +A range of values is two values separated by a dash. +By default the values are in units of kHz. +They may be specified in MHz or Hz +if .B MHz or .B Hz -is added to the end of the line. The data given here is used by the -__xservername__ server to determine if video modes are within the specifications -of the monitor. This information should be available in the monitor's -handbook. If this entry is omitted, a default range of 28\-33kHz is -used. +is added to the end of the line. +The data given here is used by the __xservername__ server to determine if video +modes are within the specifications of the monitor. +This information should be available in the monitor's handbook. +If this entry is omitted, a default range of 28\-33kHz is used. .TP 7 -.BI "VertRefresh " "vertrefresh-range" +.BI "VertRefresh " "vertrefresh\-range" gives the range(s) of vertical refresh frequencies supported by the monitor. -.I vertrefresh-range +.I vertrefresh\-range may be a comma separated list of either discrete values or ranges of -values. A range of values is two values separated by a dash. By default -the values are in units of Hz. They may be specified in MHz or kHz if +values. +A range of values is two values separated by a dash. +By default the values are in units of Hz. +They may be specified in MHz or kHz +if .B MHz or .B kHz -is added to the end of the line. The data given here is used by the -__xservername__ server to determine if video modes are within the specifications -of the monitor. This information should be available in the monitor's -handbook. If this entry is omitted, a default range of 43-72Hz is used. +is added to the end of the line. +The data given here is used by the __xservername__ server to determine if video +modes are within the specifications of the monitor. +This information should be available in the monitor's handbook. +If this entry is omitted, a default range of 43\-72Hz is used. .TP 7 .BI "DisplaySize " "width height" This optional entry gives the width and height, in millimetres, of the -picture area of the monitor. If given this is used to calculate the -horizontal and vertical pitch (DPI) of the screen. +picture area of the monitor. +If given this is used to calculate the horizontal and vertical pitch (DPI) of +the screen. .TP 7 -.BI "Gamma " "gamma-value" +.BI "Gamma " "gamma\-value" .TP 7 -.BI "Gamma " "red-gamma green-gamma blue-gamma" +.BI "Gamma " "red\-gamma green\-gamma blue\-gamma" This is an optional entry that can be used to specify the gamma correction -for the monitor. It may be specified as either a single value or as -three separate RGB values. The values should be in the range 0.1 to -10.0, and the default is 1.0. Not all drivers are capable of using this -information. +for the monitor. +It may be specified as either a single value or as three separate RGB values. +The values should be in the range 0.1 to 10.0, and the default is 1.0. +Not all drivers are capable of using this information. .TP 7 -.BI "UseModes \*q" modesection-id \*q +.BI "UseModes \*q" modesection\-id \*q Include the set of modes listed in the .B Modes section called -.IR modesection-id. +.IR modesection\-id. This makes all of the modes defined in that section available for use by this monitor. .TP 7 .BI "Mode \*q" name \*q This is an optional multi-line entry that can be used to provide -definitions for video modes for the monitor. In most cases this isn't -necessary because the built-in set of VESA standard modes will be -sufficient. The +definitions for video modes for the monitor. +In most cases this isn't necessary because the built-in set of VESA standard +modes will be sufficient. +The .B Mode keyword indicates the start of a multi-line video mode description. The mode description is terminated with the .B EndMode -keyword. The mode description consists of the following entries: +keyword. +The mode description consists of the following entries: .RS 7 .TP 4 .BI "DotClock " clock @@ -1138,52 +1271,60 @@ and may be used to select the composite sync polarity. .TP 4 .BI "HSkew " hskew -specifies the number of pixels (towards the right edge of the screen) -by which the display enable signal is to be skewed. Not all drivers -use this information. This option might become necessary to override -the default value supplied by the server (if any). "Roving" horizontal -lines indicate this value needs to be increased. If the last few pixels -on a scan line appear on the left of the screen, this value should be -decreased. +specifies the number of pixels (towards the right edge of the screen) by +which the display enable signal is to be skewed. +Not all drivers use this information. +This option might become necessary to override the default value supplied +by the server (if any). +\(lqRoving\(rq horizontal lines indicate this value needs to be increased. +If the last few pixels on a scan line appear on the left of the screen, +this value should be decreased. .TP 4 .BI "VScan " vscan specifies the number of times each scanline is painted on the screen. -Not all drivers use this information. Values less than 1 are treated -as 1, which is the default. Generally, the +Not all drivers use this information. +Values less than 1 are treated as 1, which is the default. +Generally, the .B \*qDoubleScan\*q .B Flag mentioned above doubles this value. .RE .TP 7 -.BI "ModeLine \*q" name \*q " mode-description" +.BI "ModeLine \*q" name \*q " mode\-description" This entry is a more compact version of the .B Mode entry, and it also can be used to specify video modes for the monitor. -is a single line format for specifying video modes. In most cases this -isn't necessary because the built-in set of VESA standard modes will be -sufficient. +is a single line format for specifying video modes. +In most cases this isn't necessary because the built\-in set of VESA +standard modes will be sufficient. .PP .RS 7 The -.I mode-description -is in four sections, the first three of which are mandatory. The first -is the dot (pixel) clock. This is a single number specifying the pixel -clock rate for the mode in MHz. The second section is a list of four -numbers specifying the horizontal timings. These numbers are the +.I mode\-description +is in four sections, the first three of which are mandatory. +The first is the dot (pixel) clock. +This is a single number specifying the pixel clock rate for the mode in +MHz. +The second section is a list of four numbers specifying the horizontal +timings. +These numbers are the .IR hdisp , .IR hsyncstart , .IR hsyncend , and .I htotal -values. The third section is a list of four numbers specifying the -vertical timings. These numbers are the +values. +The third section is a list of four numbers specifying the vertical +timings. +These numbers are the .IR vdisp , .IR vsyncstart , .IR vsyncend , and .I vtotal -values. The final section is a list of flags specifying other -characteristics of the mode. +values. +The final section is a list of flags specifying other characteristics of +the mode. .B Interlace indicates that the mode is interlaced. .B DoubleScan @@ -1202,7 +1343,8 @@ Additionally, on some hardware, .B +CSync and .B \-CSync -may be used to select the composite sync polarity. The +may be used to select the composite sync polarity. +The .B HSkew and .B VScan @@ -1282,20 +1424,22 @@ Valid values for rotation are \*qnormal\*q, \*qleft\*q, \*qright\*q, and \*qinverted\*q. (RandR 1.2-supporting drivers only) -.SH MODES SECTION +.SH "MODES SECTION" The config file may have multiple .B Modes -sections, or none. These sections provide a way of defining sets of -video modes independently of the +sections, or none. +These sections provide a way of defining sets of video modes independently +of the .B Monitor sections. .B Monitor sections may include the definitions provided in these sections by using the .B UseModes -keyword. In most cases the +keyword. +In most cases the .B Modes -sections are not necessary because the built-in set of VESA standard modes +sections are not necessary because the built\-in set of VESA standard modes will be sufficient. .PP .B Modes @@ -1323,21 +1467,24 @@ and entries that are described above in the .B Monitor section. -.SH SCREEN SECTION +.SH "SCREEN SECTION" The config file may have multiple .B Screen -sections. There must be at least one, for the "screen" being used. -A "screen" represents the binding of a graphics device +sections. +There must be at least one, for the \(lqscreen\(rq being used. +A \(lqscreen\(rq represents the binding of a graphics device .RB ( Device section) and a monitor .RB ( Monitor -section). A +section). +A .B Screen -section is considered "active" if it is referenced by an active +section is considered \(lqactive\(rq if it is referenced by an active .B ServerLayout section or by the .B \-screen -command line option. If neither of those is present, the first +command line option. +If neither of those is present, the first .B Screen section found in the config file is considered the active one. .PP @@ -1365,94 +1512,104 @@ The .B Identifier and .B Device -entries are mandatory. All others are optional. +entries are mandatory. +All others are optional. .PP The .B Identifier -entry specifies the unique name for this screen. The +entry specifies the unique name for this screen. +The .B Screen section provides information specific to the whole screen, including -screen-specific +screen\-specific .BR Options . -In multi-head configurations, there will be multiple active +In multi\-head configurations, there will be multiple active .B Screen sections, one for each head. The entries available for this section are: .TP 7 -.BI "Device \*q" device-id \*q +.BI "Device \*q" device\-id \*q This mandatory entry specifies the .B Device -section to be used for this screen. This is what ties a specific -graphics card to a screen. The -.I device-id +section to be used for this screen. +This is what ties a specific graphics card to a screen. +The +.I device\-id must match the .B Identifier of a .B Device section in the config file. .TP 7 -.BI "Monitor \*q" monitor-id \*q +.BI "Monitor \*q" monitor\-id \*q specifies which monitor description is to be used for this screen. If a .B Monitor -name is not specified, a default configuration is used. Currently the default -configuration may not function as expected on all platforms. +name is not specified, a default configuration is used. +Currently the default configuration may not function as expected on all +platforms. .TP 7 -.BI "VideoAdaptor \*q" xv-id \*q +.BI "VideoAdaptor \*q" xv\-id \*q specifies an optional Xv video adaptor description to be used with this screen. .TP 7 .BI "DefaultDepth " depth -specifies which color depth the server should use by default. The +specifies which color depth the server should use by default. +The .B \-depth -command line option can be used to override this. If neither is specified, -the default depth is driver-specific, but in most cases is 8. +command line option can be used to override this. +If neither is specified, the default depth is driver\-specific, but in most +cases is 8. .TP 7 .BI "DefaultFbBpp " bpp -specifies which framebuffer layout to use by default. The +specifies which framebuffer layout to use by default. +The .B \-fbbpp -command line option can be used to override this. In most cases the -driver will chose the best default value for this. The only case where -there is even a choice in this value is for depth 24, where some hardware -supports both a packed 24 bit framebuffer layout and a sparse 32 bit -framebuffer layout. +command line option can be used to override this. +In most cases the driver will chose the best default value for this. +The only case where there is even a choice in this value is for depth 24, +where some hardware supports both a packed 24 bit framebuffer layout and a +sparse 32 bit framebuffer layout. .TP 7 .B Options Various .B Option flags may be specified in the .B Screen -section. Some are driver-specific and are described in the driver -documentation. Others are driver-independent, and will eventually be -described here. +section. +Some are driver\-specific and are described in the driver documentation. +Others are driver\-independent, and will eventually be described here. .\" XXX These should really be in an xaa man page. .TP 7 .BI "Option \*qAccel\*q" Enables XAA (X Acceleration Architecture), a mechanism that makes video -cards' 2D hardware acceleration available to the -__xservername__ server. This -option is on by default, but it may be necessary to turn it off if there -are bugs in the driver. There are many options to disable specific -accelerated operations, listed below. Note that disabling an operation -will have no effect if the operation is not accelerated (whether due to -lack of support in the hardware or in the driver). +cards' 2D hardware acceleration available to the __xservername__ server. +This option is on by default, but it may be necessary to turn it off if +there are bugs in the driver. +There are many options to disable specific accelerated operations, listed +below. +Note that disabling an operation will have no effect if the operation is +not accelerated (whether due to lack of support in the hardware or in the +driver). .TP 7 .BI "Option \*qBiosLocation\*q \*q" address \*q Set the location of the BIOS for the Int10 module. One may select a BIOS of another card for posting or the legacy V_BIOS range located at 0xc0000 -or an alternative address (BUS_ISA). This is only useful under very -special circumstances and should be used with extreme care. +or an alternative address (BUS_ISA). +This is only useful under very special circumstances and should be used with +extreme care. .TP 7 .BI "Option \*qInitPrimary\*q \*q" boolean \*q -Use the Int10 module to initialize the primary graphics card. Normally, -only secondary cards are soft-booted using the Int10 module, as the +Use the Int10 module to initialize the primary graphics card. +Normally, only secondary cards are soft-booted using the Int10 module, as the primary card has already been initialized by the BIOS at boot time. Default: false. .TP 7 .BI "Option \*qNoInt10\*q \*q" boolean \*q Disables the Int10 module, a module that uses the int10 call to the BIOS -of the graphics card to initialize it. Default: false. +of the graphics card to initialize it. +Default: false. .TP 7 .BI "Option \*qNoMTRR\*q" Disables MTRR (Memory Type Range Register) support, a feature of modern @@ -1462,14 +1619,14 @@ known to exhibit problems when MTRR's are used. .TP 7 .BI "Option \*qXaaNoCPUToScreenColorExpandFill\*q" Disables accelerated rectangular expansion blits from source patterns -stored in system memory (using a memory-mapped aperture). +stored in system memory (using a memory\-mapped aperture). .TP 7 .BI "Option \*qXaaNoColor8x8PatternFillRect\*q" -Disables accelerated fills of a rectangular region with a full-color +Disables accelerated fills of a rectangular region with a full\-color pattern. .TP 7 .BI "Option \*qXaaNoColor8x8PatternFillTrap\*q" -Disables accelerated fills of a trapezoidal region with a full-color +Disables accelerated fills of a trapezoidal region with a full\-color pattern. .TP 7 .BI "Option \*qXaaNoDashedBresenhamLine\*q" @@ -1479,8 +1636,8 @@ Disables accelerated dashed Bresenham line draws. Disables accelerated dashed line draws between two arbitrary points. .TP 7 .BI "Option \*qXaaNoImageWriteRect\*q" -Disables accelerated transfers of full-color rectangular patterns from -system memory to video memory (using a memory-mapped aperture). +Disables accelerated transfers of full\-color rectangular patterns from +system memory to video memory (using a memory\-mapped aperture). .TP 7 .BI "Option \*qXaaNoMono8x8PatternFillRect\*q" Disables accelerated fills of a rectangular region with a monochrome @@ -1501,7 +1658,7 @@ Disables accelerated rectangular expansion blits from source patterns stored in system memory (one scan line at a time). .TP 7 .BI "Option \*qXaaNoScanlineImageWriteRect\*q" -Disables accelerated transfers of full-color rectangular patterns from +Disables accelerated transfers of full\-color rectangular patterns from system memory to video memory (one scan line at a time). .TP 7 .BI "Option \*qXaaNoScreenToScreenColorExpandFill\*q" @@ -1516,10 +1673,10 @@ video memory to another part of video memory. Disables accelerated solid Bresenham line draws. .TP 7 .BI "Option \*qXaaNoSolidFillRect\*q" -Disables accelerated solid-color fills of rectangles. +Disables accelerated solid\-color fills of rectangles. .TP 7 .BI "Option \*qXaaNoSolidFillTrap\*q" -Disables accelerated solid-color fills of Bresenham trapezoids. +Disables accelerated solid\-color fills of Bresenham trapezoids. .TP 7 .BI "Option \*qXaaNoSolidHorVertLine\*q" Disables accelerated solid horizontal and vertical line draws. @@ -1531,27 +1688,30 @@ Each .B Screen section may optionally contain one or more .B Display -subsections. Those subsections provide depth/fbbpp specific configuration -information, and the one chosen depends on the depth and/or fbbpp that -is being used for the screen. The +subsections. +Those subsections provide depth/fbbpp specific configuration information, +and the one chosen depends on the depth and/or fbbpp that is being used for +the screen. +The .B Display subsection format is described in the section below. -.SH DISPLAY SUBSECTION +.SH "DISPLAY SUBSECTION" Each .B Screen section may have multiple .B Display -subsections. -The "active" +subsections. +The \(lqactive\(rq .B Display subsection is the first that matches the depth and/or fbbpp values being used, or failing that, the first that has neither a depth or fbbpp value -specified. The +specified. +The .B Display -subsections are optional. When there isn't one that matches the depth -and/or fbbpp values being used, all the parameters that can be specified -here fall back to their defaults. +subsections are optional. +When there isn't one that matches the depth and/or fbbpp values being used, +all the parameters that can be specified here fall back to their defaults. .PP .B Display subsections have the following format: @@ -1565,78 +1725,88 @@ subsections have the following format: .B " EndSubSection" .fi .RE -.PP .TP 7 .BI "Depth " depth This entry specifies what colour depth the .B Display -subsection is to be used for. This entry is usually specified, -but it may be omitted to create a match-all +subsection is to be used for. +This entry is usually specified, but it may be omitted to create a match\-all .B Display subsection or when wishing to match only against the .B FbBpp -parameter. The range of +parameter. +The range of .I depth -values that are allowed depends on the driver. Most driver support -8, 15, 16 and 24. Some also support 1 and/or 4, and some may support -other values (like 30). Note: +values that are allowed depends on the driver. +Most drivers support 8, 15, 16 and 24. +Some also support 1 and/or 4, and some may support other values (like 30). +Note: .I depth means the number of bits in a pixel that are actually used to determine -the pixel colour. 32 is not a valid +the pixel colour. +32 is not a valid .I depth -value. Most hardware that uses 32 bits per pixel only uses 24 of them -to hold the colour information, which means that the colour depth is -24, not 32. +value. +Most hardware that uses 32 bits per pixel only uses 24 of them to hold the +colour information, which means that the colour depth is 24, not 32. .TP 7 .BI "FbBpp " bpp This entry specifies the framebuffer format this .B Display -subsection is to be used for. This entry is only needed when providing -depth 24 configurations that allow a choice between a 24 bpp packed -framebuffer format and a 32bpp sparse framebuffer format. In most cases -this entry should not be used. +subsection is to be used for. +This entry is only needed when providing depth 24 configurations that allow +a choice between a 24 bpp packed framebuffer format and a 32bpp sparse +framebuffer format. +In most cases this entry should not be used. .TP 7 -.BI "Weight " "red-weight green-weight blue-weight" +.BI "Weight " "red\-weight green\-weight blue\-weight" This optional entry specifies the relative RGB weighting to be used for a screen is being used at depth 16 for drivers that allow multiple -formats. This may also be specified from the command line with the +formats. +This may also be specified from the command line with the .B \-weight -option (see __xservername__(__appmansuffix__)). +option (see +.BR __xservername__(__appmansuffix__)). .TP 7 .BI "Virtual " "xdim ydim" This optional entry specifies the virtual screen resolution to be used. .I xdim must be a multiple of either 8 or 16 for most drivers, and a multiple -of 32 when running in monochrome mode. The given value will be rounded -down if this is not the case. Video modes which are too large for the -specified virtual size will be rejected. If this entry is not present, -the virtual screen resolution will be set to accommodate all the valid -video modes given in the +of 32 when running in monochrome mode. +The given value will be rounded down if this is not the case. +Video modes which are too large for the specified virtual size will be +rejected. +If this entry is not present, the virtual screen resolution will be set to +accommodate all the valid video modes given in the .B Modes -entry. Some drivers/hardware combinations do not support virtual screens. -Refer to the appropriate driver-specific documentation for details. +entry. +Some drivers/hardware combinations do not support virtual screens. +Refer to the appropriate driver\-specific documentation for details. .TP 7 .BI "ViewPort " "x0 y0" This optional entry sets the upper left corner of the initial display. This is only relevant when the virtual screen resolution is different -from the resolution of the initial video mode. If this entry is not -given, then the initial display will be centered in the virtual display -area. -.TP 7 -.BI "Modes \*q" mode-name \*q " ..." -This optional entry specifies the list of video modes to use. Each -.I mode-name -specified must be in double quotes. They must correspond to those -specified or referenced in the appropriate +from the resolution of the initial video mode. +If this entry is not given, then the initial display will be centered in +the virtual display area. +.TP 7 +.BI "Modes \*q" mode\-name \*q " ..." +This optional entry specifies the list of video modes to use. +Each +.I mode\-name +specified must be in double quotes. +They must correspond to those specified or referenced in the appropriate .B Monitor -section (including implicitly referenced built-in VESA standard modes). +section (including implicitly referenced built\-in VESA standard modes). The server will delete modes from this list which don't satisfy various -requirements. The first valid mode in this list will be the default -display mode for startup. The list of valid modes is converted internally -into a circular list. It is possible to switch to the next mode with -.B Ctrl+Alt+Keypad-Plus +requirements. +The first valid mode in this list will be the default display mode for +startup. +The list of valid modes is converted internally into a circular list. +It is possible to switch to the next mode with +.B Ctrl+Alt+Keypad\-Plus and to the previous mode with -.BR Ctrl+Alt+Keypad-Minus . +.BR Ctrl+Alt+Keypad\-Minus . When this entry is omitted, the valid modes referenced by the appropriate .B Monitor section will be used. If the @@ -1644,10 +1814,12 @@ section will be used. If the section contains no modes, then the selection will be taken from the built-in VESA standard modes. .TP 7 -.BI "Visual \*q" visual-name \*q -This optional entry sets the default root visual type. This may also -be specified from the command line (see the Xserver(__appmansuffix__) man page). The -visual types available for depth 8 are (default is +.BI "Visual \*q" visual\-name \*q +This optional entry sets the default root visual type. +This may also be specified from the command line (see the +.BR Xserver(__appmansuffix__) +man page). +The visual types available for depth 8 are (default is .BR PseudoColor ): .PP .RS 11 @@ -1693,43 +1865,48 @@ The visual type available for the depth 1 (monochrome) is .RE .TP 7 .BI "Black " "red green blue" -This optional entry allows the "black" colour to be specified. This -is only supported at depth 1. The default is black. +This optional entry allows the \(lqblack\(rq colour to be specified. +This is only supported at depth 1. +The default is black. .TP 7 .BI "White " "red green blue" -This optional entry allows the "white" colour to be specified. This -is only supported at depth 1. The default is white. +This optional entry allows the \(lqwhite\(rq colour to be specified. +This is only supported at depth 1. +The default is white. .TP 7 .B Options Option flags may be specified in the .B Display -subsections. These may include driver-specific options and -driver-independent options. The former are described in the -driver-specific documentation. Some of the latter are described above -in the section about the +subsections. +These may include driver\-specific options and driver\-independent options. +The former are described in the driver\-specific documentation. +Some of the latter are described above in the section about the .B Screen section, and they may also be included here. -.SH SERVERLAYOUT SECTION +.SH "SERVERLAYOUT SECTION" The config file may have multiple .B ServerLayout -sections. -A "server layout" represents the binding of one or more screens +sections. +A \(lqserver layout\(rq represents the binding of one or more screens .RB ( Screen sections) and one or more input devices .RB ( InputDevice -sections) to form a complete configuration. In multi-head configurations, -it also specifies the relative layout of the heads. A +sections) to form a complete configuration. +In multi\-head configurations, it also specifies the relative layout of the +heads. +A .B ServerLayout -section is considered "active" if it is referenced by the +section is considered \(lqactive\(rq if it is referenced by the .B \-layout command line option or by an .B "Option \*qDefaultServerLayout\*q" entry in the .B ServerFlags -section (the former takes precedence over the latter). If those options are -not used, the first +section (the former takes precedence over the latter). +If those options are not used, the first .B ServerLayout -section found in the config file is considered the active one. If no +section found in the config file is considered the active one. +If no .B ServerLayout sections are present, the single active screen and two active (core) input devices are selected as described in the relevant sections above. @@ -1741,9 +1918,9 @@ sections have the following format: .nf .B "Section \*qServerLayout\*q" .BI " Identifier \*q" name \*q -.BI " Screen \*q" screen-id \*q +.BI " Screen \*q" screen\-id \*q .I " ..." -.BI " InputDevice \*q" idev-id \*q +.BI " InputDevice \*q" idev\-id \*q .I " ..." .I " options" .I " ..." @@ -1761,10 +1938,11 @@ entry. .PP The .B Identifier -entry specifies the unique name for this server layout. The +entry specifies the unique name for this server layout. +The .B ServerLayout section provides information specific to the whole session, including -session-specific +session\-specific .BR Options . The .B ServerFlags @@ -1775,21 +1953,25 @@ section. .PP The entries that may be used in this section are described here. .TP 7 -.BI "Screen " "screen-num" " \*qscreen-id\*q " "position-information" +.BI "Screen " "screen\-num" " \*qscreen\-id\*q " "position\-information" One of these entries must be given for each screen being used in -a session. The -.I screen-id +a session. +The +.I screen\-id field is mandatory, and specifies the .B Screen -section being referenced. The -.I screen-num +section being referenced. +The +.I screen\-num field is optional, and may be used to specify the screen number -in multi-head configurations. When this field is omitted, the -screens will be numbered in the order that they are listed in. -The numbering starts from 0, and must be consecutive. The -.I position-information -field describes the way multiple screens are positioned. There are -a number of different ways that this information can be provided: +in multi\-head configurations. +When this field is omitted, the screens will be numbered in the order that +they are listed in. +The numbering starts from 0, and must be consecutive. +The +.I position\-information +field describes the way multiple screens are positioned. +There are a number of different ways that this information can be provided: .RS 7 .TP 4 .I "x y" @@ -1799,48 +1981,53 @@ These both specify that the upper left corner's coordinates are .RI ( x , y ). The .B Absolute -keyword is optional. Some older versions of __xservername__ (4.2 and earlier) don't -recognise the +keyword is optional. +Some older versions of __xservername__ (4.2 and earlier) don't recognise the .B Absolute keyword, so it's safest to just specify the coordinates without it. .TP 4 -.BI "RightOf \*q" screen-id \*q +.BI "RightOf \*q" screen\-id \*q .TP 4 -.BI "LeftOf \*q" screen-id \*q +.BI "LeftOf \*q" screen\-id \*q .TP 4 -.BI "Above \*q" screen-id \*q +.BI "Above \*q" screen\-id \*q .TP 4 -.BI "Below \*q" screen-id \*q +.BI "Below \*q" screen\-id \*q .TP 4 -.BI "Relative \*q" screen-id \*q " x y" -These give the screen's location relative to another screen. The first four -position the screen immediately to the right, left, above or below the -other screen. When positioning to the right or left, the top edges are -aligned. When positioning above or below, the left edges are aligned. +.BI "Relative \*q" screen\-id \*q " x y" +These give the screen's location relative to another screen. +The first four position the screen immediately to the right, left, above or +below the other screen. +When positioning to the right or left, the top edges are aligned. +When positioning above or below, the left edges are aligned. The .B Relative form specifies the offset of the screen's origin (upper left corner) relative to the origin of another screen. .RE .TP 7 -.BI "InputDevice \*q" idev-id "\*q \*q" option \*q " ..." +.BI "InputDevice \*q" idev\-id "\*q \*q" option \*q " ..." One of these entries should be given for each input device being used in -a session. Normally at least two are required, one each for the core -pointer and keyboard devices. If either of those is missing, suitable +a session. +Normally at least two are required, one each for the core pointer and +keyboard devices. +If either of those is missing, suitable .B InputDevice entries are searched for using the method described above in the .B INPUTDEVICE section. The -.I idev-id +.I idev\-id field is mandatory, and specifies the name of the .B InputDevice -section being referenced. Multiple +section being referenced. +Multiple .I option -fields may be specified, each in double quotes. The options permitted -here are any that may also be given in the +fields may be specified, each in double quotes. +The options permitted here are any that may also be given in the .B InputDevice -sections. Normally only session-specific input device options would be -used here. The most commonly used options are: +sections. +Normally only session\-specific input device options would be used here. +The most commonly used options are: .PP .RS 11 .nf @@ -1858,8 +2045,9 @@ and core keyboard devices respectively. .B Options In addition to the following, any option permitted in the .B ServerFlags -section may also be specified here. When the same option appears in both -places, the value given here overrides the one given in the +section may also be specified here. +When the same option appears in both places, the value given here overrides +the one given in the .B ServerFlags section. .TP 7 @@ -1872,9 +2060,11 @@ option (described in .BR "DEVICE SECTION" , above) for the format of the .I bus\-id -parameter. This option overrides +parameter. +This option overrides .BR SingleCard , -if specified. At present, only PCI devices can be isolated in this manner. +if specified. +At present, only PCI devices can be isolated in this manner. .TP 7 .BI "Option \*qSingleCard\*q \*q" boolean \*q As @@ -1898,68 +2088,97 @@ section for a dual headed configuration with two mice: .B "EndSection" .fi .RE -.SH DRI SECTION +.SH "DRI SECTION" This optional section is used to provide some information for the -Direct Rendering Infrastructure. Details about the format of this section -can be found on-line at +Direct Rendering Infrastructure. +Details about the format of this section +can be found in the README.DRI document, which is also available on-line at .IR <http://dri.freedesktop.org/> . -.SH VENDOR SECTION +.SH "VENDOR SECTION" The optional .B Vendor -section may be used to provide vendor-specific configuration information. +section may be used to provide vendor\-specific configuration information. Multiple .B Vendor sections may be present, and they may contain an .B Identifier entry and multiple .B Option -flags. The data therein is not used in this release. +flags. +The data therein is not used in this release. .PP -.SH FILES -For an example of an __xconfigfile__ file, see the file installed as -__projectroot__/lib/X11/__xconfigfile__.eg. -.fi .SH "SEE ALSO" -X(__miscmansuffix__), -Xserver(__appmansuffix__), -__xservername__(__appmansuffix__), -apm(__drivermansuffix__), -.\" .IR ati(__drivermansuffix__), -chips(__drivermansuffix__), -cirrus(__drivermansuffix__), -cyrix(__drivermansuffix__), -fbdev(__drivermansuffix__), -glide(__drivermansuffix__), -glint(__drivermansuffix__), -i128(__drivermansuffix__), -i740(__drivermansuffix__), -i810(__drivermansuffix__), -imstt(__drivermansuffix__), -mga(__drivermansuffix__), -neomagic(__drivermansuffix__), -nv(__drivermansuffix__), -r128(__drivermansuffix__), -rendition(__drivermansuffix__), -savage(__drivermansuffix__), -s3virge(__drivermansuffix__), -.\" .IR shadowfb(__drivermansuffix__), -siliconmotion(__drivermansuffix__), -sis(__drivermansuffix__), -sunbw2(__drivermansuffix__), -suncg14(__drivermansuffix__), -suncg3(__drivermansuffix__), -suncg6(__drivermansuffix__), -sunffb(__drivermansuffix__), -sunleo(__drivermansuffix__), -suntcx(__drivermansuffix__), -tdfx(__drivermansuffix__), -tga(__drivermansuffix__), -trident(__drivermansuffix__), -tseng(__drivermansuffix__), -v4l(__drivermansuffix__), -vesa(__drivermansuffix__), -vga(__drivermansuffix__), -vmware(__drivermansuffix__), +General: +.BR X (__miscmansuffix__), +.BR Xserver (__appmansuffix__), +.BR __xservername__ (__appmansuffix__). +.PP +.B Not all modules or interfaces are available on all platforms. +.PP +Display drivers: +.BR apm (__drivermansuffix__), +.\" .BR ati (__drivermansuffix__), +.BR chips (__drivermansuffix__), +.BR cirrus (__drivermansuffix__), +.BR cyrix (__drivermansuffix__), +.BR fbdev (__drivermansuffix__), +.BR glide (__drivermansuffix__), +.BR glint (__drivermansuffix__), +.BR i128 (__drivermansuffix__), +.BR i740 (__drivermansuffix__), +.BR i810 (__drivermansuffix__), +.BR imstt (__drivermansuffix__), +.BR mga (__drivermansuffix__), +.BR neomagic (__drivermansuffix__), +.BR nv (__drivermansuffix__), +.BR r128 (__drivermansuffix__), +.BR rendition (__drivermansuffix__), +.BR savage (__drivermansuffix__), +.BR s3virge (__drivermansuffix__), +.BR siliconmotion (__drivermansuffix__), +.BR sis (__drivermansuffix__), +.BR sunbw2 (__drivermansuffix__), +.BR suncg14 (__drivermansuffix__), +.BR suncg3 (__drivermansuffix__), +.BR suncg6 (__drivermansuffix__), +.BR sunffb (__drivermansuffix__), +.BR sunleo (__drivermansuffix__), +.BR suntcx (__drivermansuffix__), +.BR tdfx (__drivermansuffix__), +.BR tga (__drivermansuffix__), +.BR trident (__drivermansuffix__), +.BR tseng (__drivermansuffix__), +.BR vesa (__drivermansuffix__), +.BR vga (__drivermansuffix__), +.BR via (__drivermansuffix__), +.BR vmware (__drivermansuffix__). +.PP +Input drivers: +.\" .BR acecad (__drivermansuffix__), +.\" .BR calcomp (__drivermansuffix__), +.BR citron (__drivermansuffix__), +.BR dmc (__drivermansuffix__), +.BR dynapro (__drivermansuffix__), +.BR elographics (__drivermansuffix__), +.BR fpit (__drivermansuffix__), +.BR js_x (__drivermansuffix__), +.BR kbd (__drivermansuffix__), +.BR keyboard (__drivermansuffix__), +.\" .BR magictouch (__drivermansuffix__), +.BR microtouch (__drivermansuffix__), +.BR mouse (__drivermansuffix__), +.BR mutouch (__drivermansuffix__), +.BR palmax (__drivermansuffix__), +.BR penmount (__drivermansuffix__), +.BR tek4957 (__drivermansuffix__), +.\" .BR ur98 (__drivermansuffix__), +.BR void (__drivermansuffix__), +.BR wacom (__drivermansuffix__). +.PP +Other modules and interfaces: +.BR fbdevhw (__drivermansuffix__), +.\" .BR shadowfb (__drivermansuffix__), +.BR v4l (__drivermansuffix__). .br .SH AUTHORS This manual page was largely rewritten by David Dawes diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index a9ca4cc80..12504d0d0 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -43,6 +43,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <string.h> #include <stdio.h> #include <sys/ioctl.h> +#include <errno.h> #define NEED_REPLIES #define NEED_EVENTS @@ -77,6 +78,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. extern Bool noPanoramiXExtension; #endif +static int DRIEntPrivIndex = -1; static int DRIScreenPrivIndex = -1; static int DRIWindowPrivIndex = -1; static unsigned long DRIGeneration = 0; @@ -112,18 +114,203 @@ DRIDrvMsg(int scrnIndex, MessageType type, const char *format, ...) } +static void +DRIOpenDRMCleanup(DRIEntPrivPtr pDRIEntPriv) +{ + if (pDRIEntPriv->pLSAREA != NULL) { + drmUnmap(pDRIEntPriv->pLSAREA, pDRIEntPriv->sAreaSize); + pDRIEntPriv->pLSAREA = NULL; + } + if (pDRIEntPriv->hLSAREA != 0) { + drmRmMap(pDRIEntPriv->drmFD, pDRIEntPriv->hLSAREA); + } + if (pDRIEntPriv->drmFD >= 0) { + drmClose(pDRIEntPriv->drmFD); + pDRIEntPriv->drmFD = 0; + } +} + +int +DRIMasterFD(ScrnInfoPtr pScrn) +{ + return DRI_ENT_PRIV(pScrn)->drmFD; +} + +void * +DRIMasterSareaPointer(ScrnInfoPtr pScrn) +{ + return DRI_ENT_PRIV(pScrn)->pLSAREA; +} + +drm_handle_t +DRIMasterSareaHandle(ScrnInfoPtr pScrn) +{ + return DRI_ENT_PRIV(pScrn)->hLSAREA; +} + + +Bool +DRIOpenDRMMaster(ScrnInfoPtr pScrn, + unsigned long sAreaSize, + const char *busID, + const char *drmDriverName) +{ + drmSetVersion saveSv, sv; + Bool drmWasAvailable; + DRIEntPrivPtr pDRIEntPriv; + DRIEntPrivRec tmp; + drmVersionPtr drmlibv; + int drmlibmajor, drmlibminor; + const char *openBusID; + int count; + int err; + + if (DRIEntPrivIndex == -1) + DRIEntPrivIndex = xf86AllocateEntityPrivateIndex(); + + pDRIEntPriv = DRI_ENT_PRIV(pScrn); + + if (pDRIEntPriv && pDRIEntPriv->drmFD != -1) + return TRUE; + + drmWasAvailable = drmAvailable(); + + memset(&tmp, 0, sizeof(tmp)); + + /* Check the DRM lib version. + * drmGetLibVersion was not supported in version 1.0, so check for + * symbol first to avoid possible crash or hang. + */ + + drmlibmajor = 1; + drmlibminor = 0; + if (xf86LoaderCheckSymbol("drmGetLibVersion")) { + drmlibv = drmGetLibVersion(-1); + if (drmlibv != NULL) { + drmlibmajor = drmlibv->version_major; + drmlibminor = drmlibv->version_minor; + drmFreeVersion(drmlibv); + } + } + + /* Check if the libdrm can handle falling back to loading based on name + * if a busid string is passed. + */ + openBusID = (drmlibmajor == 1 && drmlibminor >= 2) ? busID : NULL; + + tmp.drmFD = -1; + sv.drm_di_major = 1; + sv.drm_di_minor = 1; + sv.drm_dd_major = -1; + + saveSv = sv; + count = 10; + while (count--) { + tmp.drmFD = drmOpen(drmDriverName, openBusID); + + if (tmp.drmFD < 0) { + DRIDrvMsg(-1, X_ERROR, "[drm] drmOpen failed.\n"); + goto out_err; + } + + err = drmSetInterfaceVersion(tmp.drmFD, &sv); + + if (err != -EPERM) + break; + + sv = saveSv; + drmClose(tmp.drmFD); + tmp.drmFD = -1; + usleep(100000); + } + + if (tmp.drmFD <= 0) { + DRIDrvMsg(-1, X_ERROR, "[drm] DRM was busy with another master.\n"); + goto out_err; + } + + if (!drmWasAvailable) { + DRIDrvMsg(-1, X_INFO, + "[drm] loaded kernel module for \"%s\" driver.\n", + drmDriverName); + } + + if (err != 0) { + sv.drm_di_major = 1; + sv.drm_di_minor = 0; + } + + DRIDrvMsg(-1, X_INFO, "[drm] DRM interface version %d.%d\n", + sv.drm_di_major, sv.drm_di_minor); + + if (sv.drm_di_major == 1 && sv.drm_di_minor >= 1) + err = 0; + else + err = drmSetBusid(tmp.drmFD, busID); + + if (err) { + DRIDrvMsg(-1, X_ERROR, "[drm] Could not set DRM device bus ID.\n"); + goto out_err; + } + + /* + * Create a lock-containing sarea. + */ + + if (drmAddMap( tmp.drmFD, 0, sAreaSize, DRM_SHM, + DRM_CONTAINS_LOCK, &tmp.hLSAREA) < 0) { + DRIDrvMsg(-1, X_INFO, "[drm] Could not create SAREA for DRM lock.\n"); + tmp.hLSAREA = 0; + goto out_err; + } + + if (drmMap( tmp.drmFD, tmp.hLSAREA, sAreaSize, + (drmAddressPtr)(&tmp.pLSAREA)) < 0) { + DRIDrvMsg(-1, X_INFO, "[drm] Mapping SAREA for DRM lock failed.\n"); + tmp.pLSAREA = NULL; + goto out_err; + } + + memset(tmp.pLSAREA, 0, sAreaSize); + + /* + * Reserved contexts are handled by the first opened screen. + */ + + tmp.resOwner = NULL; + + if (!pDRIEntPriv) + pDRIEntPriv = xnfcalloc(sizeof(*pDRIEntPriv), 1); + + if (!pDRIEntPriv) { + DRIDrvMsg(-1, X_INFO, "[drm] Failed to allocate memory for " + "DRM device.\n"); + goto out_err; + } + *pDRIEntPriv = tmp; + xf86GetEntityPrivate((pScrn)->entityList[0],DRIEntPrivIndex)->ptr = + pDRIEntPriv; + + DRIDrvMsg(-1, X_INFO, "[drm] DRM open master succeeded.\n"); + return TRUE; + + out_err: + + DRIOpenDRMCleanup(&tmp); + return FALSE; +} + + Bool DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) { DRIScreenPrivPtr pDRIPriv; drm_context_t * reserved; int reserved_count; - int i, fd, drmWasAvailable; + int i; Bool xineramaInCore = FALSE; - int err = 0; - char *openbusid; - drmVersionPtr drmlibv; - int drmlibmajor, drmlibminor, drmdimajor, drmdiminor; + DRIEntPrivPtr pDRIEntPriv; + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; if (DRIGeneration != serverGeneration) { if ((DRIScreenPrivIndex = AllocateScreenPrivateIndex()) < 0) @@ -153,47 +340,12 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) } } - drmWasAvailable = drmAvailable(); - - /* Check the DRM lib version. - * drmGetLibVersion was not supported in version 1.0, so check for - * symbol first to avoid possible crash or hang. - */ - drmlibmajor = 1; - drmlibminor = 0; - if (xf86LoaderCheckSymbol("drmGetLibVersion")) { - drmlibv = drmGetLibVersion(-1); - if (drmlibv != NULL) { - drmlibmajor = drmlibv->version_major; - drmlibminor = drmlibv->version_minor; - drmFreeVersion(drmlibv); - } - } - - /* Check if the libdrm can handle falling back to loading based on name - * if a busid string is passed. - */ - if (drmlibmajor == 1 && drmlibminor >= 2) - openbusid = pDRIInfo->busIdString; - else - openbusid = NULL; - - /* Note that drmOpen will try to load the kernel module, if needed. */ - fd = drmOpen(pDRIInfo->drmDriverName, openbusid); - if (fd < 0) { - /* failed to open DRM */ - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] drmOpen failed\n"); - return FALSE; - } + if (!DRIOpenDRMMaster(pScrn, pDRIInfo->SAREASize, + pDRIInfo->busIdString, + pDRIInfo->drmDriverName)) + return FALSE; - if (!drmWasAvailable) { - /* drmOpen loaded the kernel module, print a message to say so */ - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] loaded kernel module for \"%s\" driver\n", - pDRIInfo->drmDriverName); - } + pDRIEntPriv = DRI_ENT_PRIV(pScrn); pDRIPriv = (DRIScreenPrivPtr) xcalloc(1, sizeof(DRIScreenPrivRec)); if (!pDRIPriv) { @@ -202,7 +354,7 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) } pScreen->devPrivates[DRIScreenPrivIndex].ptr = (pointer) pDRIPriv; - pDRIPriv->drmFD = fd; + pDRIPriv->drmFD = pDRIEntPriv->drmFD; pDRIPriv->directRenderingSupport = TRUE; pDRIPriv->pDriverInfo = pDRIInfo; pDRIPriv->nrWindows = 0; @@ -214,89 +366,54 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) pDRIPriv->grabbedDRILock = FALSE; pDRIPriv->drmSIGIOHandlerInstalled = FALSE; - - if (drmlibmajor == 1 && drmlibminor >= 2) { - drmSetVersion sv; - - /* Get the interface version, asking for 1.1. */ - sv.drm_di_major = 1; - sv.drm_di_minor = 1; - sv.drm_dd_major = -1; - err = drmSetInterfaceVersion(pDRIPriv->drmFD, &sv); - if (err == 0) { - drmdimajor = sv.drm_di_major; - drmdiminor = sv.drm_di_minor; - } else { - /* failure, so set it to 1.0.0. */ - drmdimajor = 1; - drmdiminor = 0; - } - } - else { - /* We can't check the DI DRM interface version, so set it to 1.0.0. */ - drmdimajor = 1; - drmdiminor = 0; - } - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] DRM interface version %d.%d\n", drmdimajor, drmdiminor); - - /* If the interface minor number is 1.1, then we've opened a DRM device - * that already had the busid set through drmOpen. - */ - if (drmdimajor == 1 && drmdiminor >= 1) - err = 0; - else - err = drmSetBusid(pDRIPriv->drmFD, pDRIPriv->pDriverInfo->busIdString); - - if (err < 0) { - pDRIPriv->directRenderingSupport = FALSE; - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - drmClose(pDRIPriv->drmFD); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] drmSetBusid failed (%d, %s), %s\n", - pDRIPriv->drmFD, pDRIPriv->pDriverInfo->busIdString, strerror(-err)); - return FALSE; - } - *pDRMFD = pDRIPriv->drmFD; - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] created \"%s\" driver at busid \"%s\"\n", - pDRIPriv->pDriverInfo->drmDriverName, - pDRIPriv->pDriverInfo->busIdString); - if (drmAddMap( pDRIPriv->drmFD, - 0, - pDRIPriv->pDriverInfo->SAREASize, - DRM_SHM, - DRM_CONTAINS_LOCK, - &pDRIPriv->hSAREA) < 0) - { - pDRIPriv->directRenderingSupport = FALSE; - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - drmClose(pDRIPriv->drmFD); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] drmAddMap failed\n"); - return FALSE; + if (pDRIEntPriv->sAreaGrabbed || pDRIInfo->allocSarea) { + + if (drmAddMap( pDRIPriv->drmFD, + 0, + pDRIPriv->pDriverInfo->SAREASize, + DRM_SHM, + 0, + &pDRIPriv->hSAREA) < 0) + { + pDRIPriv->directRenderingSupport = FALSE; + pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; + drmClose(pDRIPriv->drmFD); + DRIDrvMsg(pScreen->myNum, X_INFO, + "[drm] drmAddMap failed\n"); + return FALSE; + } + DRIDrvMsg(pScreen->myNum, X_INFO, + "[drm] added %d byte SAREA at %p\n", + pDRIPriv->pDriverInfo->SAREASize, pDRIPriv->hSAREA); + + /* Backwards compat. */ + if (drmMap( pDRIPriv->drmFD, + pDRIPriv->hSAREA, + pDRIPriv->pDriverInfo->SAREASize, + (drmAddressPtr)(&pDRIPriv->pSAREA)) < 0) + { + pDRIPriv->directRenderingSupport = FALSE; + pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; + drmClose(pDRIPriv->drmFD); + DRIDrvMsg(pScreen->myNum, X_INFO, + "[drm] drmMap failed\n"); + return FALSE; + } + DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] mapped SAREA %p to %p\n", + pDRIPriv->hSAREA, pDRIPriv->pSAREA); + memset(pDRIPriv->pSAREA, 0, pDRIPriv->pDriverInfo->SAREASize); + } else { + DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] Using the DRM lock " + "SAREA also for drawables.\n"); + pDRIPriv->hSAREA = pDRIEntPriv->hLSAREA; + pDRIPriv->pSAREA = (XF86DRISAREAPtr) pDRIEntPriv->pLSAREA; + pDRIEntPriv->sAreaGrabbed = TRUE; } - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] added %d byte SAREA at %p\n", - pDRIPriv->pDriverInfo->SAREASize, pDRIPriv->hSAREA); - if (drmMap( pDRIPriv->drmFD, - pDRIPriv->hSAREA, - pDRIPriv->pDriverInfo->SAREASize, - (drmAddressPtr)(&pDRIPriv->pSAREA)) < 0) - { - pDRIPriv->directRenderingSupport = FALSE; - pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; - drmClose(pDRIPriv->drmFD); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] drmMap failed\n"); - return FALSE; - } - memset(pDRIPriv->pSAREA, 0, pDRIPriv->pDriverInfo->SAREASize); - DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] mapped SAREA %p to %p\n", - pDRIPriv->hSAREA, pDRIPriv->pSAREA); + pDRIPriv->hLSAREA = pDRIEntPriv->hLSAREA; + pDRIPriv->pLSAREA = pDRIEntPriv->pLSAREA; if (drmAddMap( pDRIPriv->drmFD, (drm_handle_t)pDRIPriv->pDriverInfo->frameBufferPhysicalAddress, @@ -316,22 +433,26 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) DRIDrvMsg(pScreen->myNum, X_INFO, "[drm] framebuffer handle = %p\n", pDRIPriv->hFrameBuffer); - /* Add tags for reserved contexts */ - if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD, - &reserved_count))) { - int i; - void *tag; - - for (i = 0; i < reserved_count; i++) { - tag = DRICreateContextPrivFromHandle(pScreen, - reserved[i], - DRI_CONTEXT_RESERVED); - drmAddContextTag(pDRIPriv->drmFD, reserved[i], tag); + if (pDRIEntPriv->resOwner == NULL) { + pDRIEntPriv->resOwner = pScreen; + + /* Add tags for reserved contexts */ + if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD, + &reserved_count))) { + int i; + void *tag; + + for (i = 0; i < reserved_count; i++) { + tag = DRICreateContextPrivFromHandle(pScreen, + reserved[i], + DRI_CONTEXT_RESERVED); + drmAddContextTag(pDRIPriv->drmFD, reserved[i], tag); + } + drmFreeReservedContextList(reserved); + DRIDrvMsg(pScreen->myNum, X_INFO, + "[drm] added %d reserved context%s for kernel\n", + reserved_count, reserved_count > 1 ? "s" : ""); } - drmFreeReservedContextList(reserved); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] added %d reserved context%s for kernel\n", - reserved_count, reserved_count > 1 ? "s" : ""); } /* validate max drawable table entry set by driver */ @@ -349,6 +470,14 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) pDRIPriv->pSAREA->drawableTable[i].flags = 0; } + pDRIPriv->pLockRefCount = &pDRIEntPriv->lockRefCount; + pDRIPriv->pLockingContext = &pDRIEntPriv->lockingContext; + + if (!pDRIEntPriv->keepFDOpen) + pDRIEntPriv->keepFDOpen = pDRIInfo->keepFDOpen; + + pDRIEntPriv->refCount++; + return TRUE; } @@ -490,6 +619,9 @@ DRICloseScreen(ScreenPtr pScreen) DRIInfoPtr pDRIInfo; drm_context_t * reserved; int reserved_count; + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + DRIEntPrivPtr pDRIEntPriv = DRI_ENT_PRIV(pScrn); + Bool closeMaster; if (pDRIPriv && pDRIPriv->directRenderingSupport) { @@ -542,38 +674,55 @@ DRICloseScreen(ScreenPtr pScreen) } /* Remove tags for reserved contexts */ - if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD, + if (pDRIEntPriv->resOwner == pScreen) { + pDRIEntPriv->resOwner = NULL; + + if ((reserved = drmGetReservedContextList(pDRIPriv->drmFD, &reserved_count))) { - int i; + int i; - for (i = 0; i < reserved_count; i++) { - DRIDestroyContextPriv(drmGetContextTag(pDRIPriv->drmFD, - reserved[i])); + for (i = 0; i < reserved_count; i++) { + DRIDestroyContextPriv(drmGetContextTag(pDRIPriv->drmFD, + reserved[i])); + } + drmFreeReservedContextList(reserved); + DRIDrvMsg(pScreen->myNum, X_INFO, + "[drm] removed %d reserved context%s for kernel\n", + reserved_count, reserved_count > 1 ? "s" : ""); } - drmFreeReservedContextList(reserved); - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] removed %d reserved context%s for kernel\n", - reserved_count, reserved_count > 1 ? "s" : ""); } /* Make sure signals get unblocked etc. */ drmUnlock(pDRIPriv->drmFD, pDRIPriv->myContext); - pDRIPriv->lockRefCount = 0; - DRIDrvMsg(pScreen->myNum, X_INFO, - "[drm] unmapping %d bytes of SAREA %p at %p\n", - pDRIInfo->SAREASize, - pDRIPriv->hSAREA, - pDRIPriv->pSAREA); - if (drmUnmap(pDRIPriv->pSAREA, pDRIInfo->SAREASize)) { - DRIDrvMsg(pScreen->myNum, X_ERROR, - "[drm] unable to unmap %d bytes" - " of SAREA %p at %p\n", + pDRIPriv->pLockRefCount = NULL; + closeMaster = (--pDRIEntPriv->refCount == 0) && + !pDRIEntPriv->keepFDOpen; + if (closeMaster || pDRIPriv->hSAREA != pDRIEntPriv->hLSAREA) { + DRIDrvMsg(pScreen->myNum, X_INFO, + "[drm] unmapping %d bytes of SAREA %p at %p\n", pDRIInfo->SAREASize, pDRIPriv->hSAREA, pDRIPriv->pSAREA); + if (drmUnmap(pDRIPriv->pSAREA, pDRIInfo->SAREASize)) { + DRIDrvMsg(pScreen->myNum, X_ERROR, + "[drm] unable to unmap %d bytes" + " of SAREA %p at %p\n", + pDRIInfo->SAREASize, + pDRIPriv->hSAREA, + pDRIPriv->pSAREA); + } + } else { + pDRIEntPriv->sAreaGrabbed = FALSE; } - drmClose(pDRIPriv->drmFD); + if (closeMaster || (pDRIEntPriv->drmFD != pDRIPriv->drmFD)) { + drmClose(pDRIPriv->drmFD); + if (pDRIEntPriv->drmFD == pDRIPriv->drmFD) { + DRIDrvMsg(pScreen->myNum, X_INFO, + "[drm] Closed DRM master.\n"); + pDRIEntPriv->drmFD = -1; + } + } xfree(pDRIPriv); pScreen->devPrivates[DRIScreenPrivIndex].ptr = NULL; @@ -1369,13 +1518,18 @@ DRIGetDrawableInfo(ScreenPtr pScreen, if (x1 > pScreen->width) x1 = pScreen->width; if (y1 > pScreen->height) y1 = pScreen->height; - pDRIPriv->private_buffer_rect.x1 = x0; - pDRIPriv->private_buffer_rect.y1 = y0; - pDRIPriv->private_buffer_rect.x2 = x1; - pDRIPriv->private_buffer_rect.y2 = y1; - - *numBackClipRects = 1; - *pBackClipRects = &(pDRIPriv->private_buffer_rect); + if (y0 >= y1 || x0 >= x1) { + *numBackClipRects = 0; + *pBackClipRects = NULL; + } else { + pDRIPriv->private_buffer_rect.x1 = x0; + pDRIPriv->private_buffer_rect.y1 = y0; + pDRIPriv->private_buffer_rect.x2 = x1; + pDRIPriv->private_buffer_rect.y2 = y1; + + *numBackClipRects = 1; + *pBackClipRects = &(pDRIPriv->private_buffer_rect); + } } else { /* Use the frontbuffer cliprects for back buffers. */ *numBackClipRects = 0; @@ -1714,11 +1868,15 @@ DRITreeTraversal(WindowPtr pWin, pointer data) if(pDRIDrawablePriv) { ScreenPtr pScreen = pWin->drawable.pScreen; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - RegionPtr reg = (RegionPtr)data; - REGION_UNION(pScreen, reg, reg, &(pWin->clipList)); + if(REGION_NUM_RECTS(&(pWin->clipList)) > 0) { + RegionPtr reg = (RegionPtr)data; - if(pDRIPriv->nrWindows == 1) + REGION_UNION(pScreen, reg, reg, &(pWin->clipList)); + pDRIPriv->nrWalked++; + } + + if(pDRIPriv->nrWindows == pDRIPriv->nrWalked) return WT_STOPWALKING; } return WT_WALKCHILDREN; @@ -1736,6 +1894,7 @@ DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) RegionRec reg; REGION_NULL(pScreen, ®); + pDRIPriv->nrWalked = 0; TraverseTree(pWin, DRITreeTraversal, (pointer)(®)); if(REGION_NOTEMPTY(pScreen, ®)) { @@ -2001,28 +2160,46 @@ void DRILock(ScreenPtr pScreen, int flags) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - if(!pDRIPriv) return; - if (!pDRIPriv->lockRefCount) - DRM_LOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext, flags); - pDRIPriv->lockRefCount++; + if(!pDRIPriv || !pDRIPriv->pLockRefCount) return; + + if (!*pDRIPriv->pLockRefCount) { + DRM_LOCK(pDRIPriv->drmFD, pDRIPriv->pLSAREA, pDRIPriv->myContext, flags); + *pDRIPriv->pLockingContext = pDRIPriv->myContext; + } else if (*pDRIPriv->pLockingContext != pDRIPriv->myContext) { + DRIDrvMsg(pScreen->myNum, X_ERROR, + "[DRI] Locking deadlock.\n" + "\tAlready locked with context %d,\n" + "\ttrying to lock with context %d.\n", + pDRIPriv->pLockingContext, + pDRIPriv->myContext); + } + (*pDRIPriv->pLockRefCount)++; } void DRIUnlock(ScreenPtr pScreen) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - if(!pDRIPriv) return; - if (pDRIPriv->lockRefCount > 0) { - pDRIPriv->lockRefCount--; - } - else { - ErrorF("DRIUnlock called when not locked\n"); + if(!pDRIPriv || !pDRIPriv->pLockRefCount) return; + + if (*pDRIPriv->pLockRefCount > 0) { + if (pDRIPriv->myContext != *pDRIPriv->pLockingContext) { + DRIDrvMsg(pScreen->myNum, X_ERROR, + "[DRI] Unlocking inconsistency:\n" + "\tContext %d trying to unlock lock held by context %d\n", + pDRIPriv->pLockingContext, + pDRIPriv->myContext); + } + (*pDRIPriv->pLockRefCount)--; + } else { + DRIDrvMsg(pScreen->myNum, X_ERROR, + "DRIUnlock called when not locked.\n"); return; } - if (!pDRIPriv->lockRefCount) - DRM_UNLOCK(pDRIPriv->drmFD, pDRIPriv->pSAREA, pDRIPriv->myContext); + if (! *pDRIPriv->pLockRefCount) + DRM_UNLOCK(pDRIPriv->drmFD, pDRIPriv->pLSAREA, pDRIPriv->myContext); } void * @@ -2043,6 +2220,19 @@ DRIGetContext(ScreenPtr pScreen) return pDRIPriv->myContext; } +void +DRIGetTexOffsetFuncs(ScreenPtr pScreen, + DRITexOffsetStartProcPtr *texOffsetStartFunc, + DRITexOffsetFinishProcPtr *texOffsetFinishFunc) +{ + DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); + + if (!pDRIPriv) return; + + *texOffsetStartFunc = pDRIPriv->pDriverInfo->texOffsetStart; + *texOffsetFinishFunc = pDRIPriv->pDriverInfo->texOffsetFinish; +} + /* This lets get at the unwrapped functions so that they can correctly * call the lowerlevel functions, and choose whether they will be * called at every level of recursion (eg in validatetree). diff --git a/hw/xfree86/dri/dri.h b/hw/xfree86/dri/dri.h index 395b4f1b3..c81500dc4 100644 --- a/hw/xfree86/dri/dri.h +++ b/hw/xfree86/dri/dri.h @@ -109,9 +109,12 @@ typedef struct { */ #define DRIINFO_MAJOR_VERSION 5 -#define DRIINFO_MINOR_VERSION 1 +#define DRIINFO_MINOR_VERSION 3 #define DRIINFO_PATCH_VERSION 0 +typedef unsigned long long (*DRITexOffsetStartProcPtr)(PixmapPtr pPix); +typedef void (*DRITexOffsetFinishProcPtr)(PixmapPtr pPix); + typedef struct { /* driver call back functions * @@ -178,9 +181,21 @@ typedef struct { /* New with DRI version 5.1.0 */ void (*ClipNotify)(ScreenPtr pScreen, WindowPtr *ppWin, int num); + + /* New with DRI version 5.2.0 */ + Bool allocSarea; + Bool keepFDOpen; + + /* New with DRI version 5.3.0 */ + DRITexOffsetStartProcPtr texOffsetStart; + DRITexOffsetFinishProcPtr texOffsetFinish; } DRIInfoRec, *DRIInfoPtr; +extern Bool DRIOpenDRMMaster(ScrnInfoPtr pScrn, unsigned long sAreaSize, + const char *busID, + const char *drmDriverName); + extern Bool DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD); @@ -346,6 +361,16 @@ extern char *DRICreatePCIBusID(const struct pci_device *PciInfo); extern int drmInstallSIGIOHandler(int fd, void (*f)(int, void *, void *)); extern int drmRemoveSIGIOHandler(int fd); +extern int DRIMasterFD(ScrnInfoPtr pScrn); + +extern void *DRIMasterSareaPointer(ScrnInfoPtr pScrn); + +extern drm_handle_t DRIMasterSareaHandle(ScrnInfoPtr pScrn); + +extern void DRIGetTexOffsetFuncs(ScreenPtr pScreen, + DRITexOffsetStartProcPtr *texOffsetStartFunc, + DRITexOffsetFinishProcPtr *texOffsetFinishFunc); + #define _DRI_H_ #endif diff --git a/hw/xfree86/dri/drimodule.c b/hw/xfree86/dri/drimodule.c index 0e3d84eb8..3aa9245b9 100644 --- a/hw/xfree86/dri/drimodule.c +++ b/hw/xfree86/dri/drimodule.c @@ -88,6 +88,6 @@ driSetup(pointer module, pointer opts, int *errmaj, int *errmin) drmSetServerInfo(&DRIDRMServerInfo); /* Need a non-NULL return value to indicate success */ - return 1; + return (pointer)1; } diff --git a/hw/xfree86/dri/dristruct.h b/hw/xfree86/dri/dristruct.h index 9c42ff9cc..a3bac8556 100644 --- a/hw/xfree86/dri/dristruct.h +++ b/hw/xfree86/dri/dristruct.h @@ -73,6 +73,11 @@ struct _DRIContextPrivRec #define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \ (screenInfo.screens[screenIndex]->devPrivates[DRIScreenPrivIndex].ptr)) +#define DRI_ENT_PRIV(pScrn) \ + ((DRIEntPrivIndex < 0) ? \ + NULL: \ + ((DRIEntPrivPtr)(xf86GetEntityPrivate((pScrn)->entityList[0], \ + DRIEntPrivIndex)->ptr))) typedef struct _DRIScreenPrivRec { @@ -103,6 +108,25 @@ typedef struct _DRIScreenPrivRec Bool wrapped; Bool windowsTouched; int lockRefCount; + drm_handle_t hLSAREA; /* Handle to SAREA containing lock, for mapping */ + XF86DRILSAREAPtr pLSAREA; /* Mapped pointer to SAREA containing lock */ + int* pLockRefCount; + int* pLockingContext; } DRIScreenPrivRec, *DRIScreenPrivPtr; + +typedef struct _DRIEntPrivRec { + int drmFD; + Bool drmOpened; + Bool sAreaGrabbed; + drm_handle_t hLSAREA; + XF86DRILSAREAPtr pLSAREA; + unsigned long sAreaSize; + int lockRefCount; + int lockingContext; + ScreenPtr resOwner; + Bool keepFDOpen; + int refCount; +} DRIEntPrivRec, *DRIEntPrivPtr; + #endif /* DRI_STRUCT_H */ diff --git a/hw/xfree86/dri/sarea.h b/hw/xfree86/dri/sarea.h index a0d6084f3..1528cc191 100644 --- a/hw/xfree86/dri/sarea.h +++ b/hw/xfree86/dri/sarea.h @@ -89,4 +89,9 @@ typedef struct _XF86DRISAREA { drm_context_t dummy_context; } XF86DRISAREARec, *XF86DRISAREAPtr; +typedef struct _XF86DRILSAREA { + drmLock lock; + drmLock otherLocks[31]; +} XF86DRILSAREARec, *XF86DRILSAREAPtr; + #endif diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c index 933cd3e18..9690e8895 100644 --- a/hw/xfree86/dri/xf86dri.c +++ b/hw/xfree86/dri/xf86dri.c @@ -452,7 +452,7 @@ ProcXF86DRIGetDrawableInfo( xXF86DRIGetDrawableInfoReply rep; DrawablePtr pDrawable; int X, Y, W, H; - drm_clip_rect_t * pClipRects; + drm_clip_rect_t * pClipRects, *pClippedRects; drm_clip_rect_t * pBackClipRects; int backX, backY, rc; @@ -502,8 +502,35 @@ ProcXF86DRIGetDrawableInfo( if (rep.numBackClipRects) rep.length += sizeof(drm_clip_rect_t) * rep.numBackClipRects; - if (rep.numClipRects) + pClippedRects = pClipRects; + + if (rep.numClipRects) { + /* Clip cliprects to screen dimensions (redirected windows) */ + pClippedRects = xalloc(rep.numClipRects * sizeof(drm_clip_rect_t)); + + if (pClippedRects) { + ScreenPtr pScreen = screenInfo.screens[stuff->screen]; + int i, j; + + for (i = 0, j = 0; i < rep.numClipRects; i++) { + pClippedRects[j].x1 = max(pClipRects[i].x1, 0); + pClippedRects[j].y1 = max(pClipRects[i].y1, 0); + pClippedRects[j].x2 = min(pClipRects[i].x2, pScreen->width); + pClippedRects[j].y2 = min(pClipRects[i].y2, pScreen->height); + + if (pClippedRects[j].x1 < pClippedRects[j].x2 && + pClippedRects[j].y1 < pClippedRects[j].y2) { + j++; + } + } + + rep.numClipRects = j; + } else { + rep.numClipRects = 0; + } + rep.length += sizeof(drm_clip_rect_t) * rep.numClipRects; + } rep.length = ((rep.length + 3) & ~3) >> 2; @@ -512,7 +539,8 @@ ProcXF86DRIGetDrawableInfo( if (rep.numClipRects) { WriteToClient(client, sizeof(drm_clip_rect_t) * rep.numClipRects, - (char *)pClipRects); + (char *)pClippedRects); + xfree(pClippedRects); } if (rep.numBackClipRects) { diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c index db12da466..6a1c65e4a 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c @@ -869,7 +869,7 @@ doLoadModule(const char *module, const char *path, const char **subdirlist, for (cim = compiled_in_modules; *cim; cim++) if (!strcmp (module, *cim)) { - xf86MsgVerb(X_INFO, 3, "Module already built-in\n"); + xf86MsgVerb(X_INFO, 0, "Module already built-in\n"); return (ModuleDescPtr) 1; } diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c index 1900e00af..712ba8d1e 100644 --- a/hw/xfree86/loader/xf86sym.c +++ b/hw/xfree86/loader/xf86sym.c @@ -94,6 +94,11 @@ #endif #include "xf86DDC.h" #include "edid.h" +#include "xf86Cursor.h" +#include "xf86RamDac.h" +#include "BT.h" +#include "IBM.h" +#include "TI.h" #ifndef HAS_GLIBC_SIGSETJMP #if defined(setjmp) && defined(__GNU_LIBRARY__) && \ @@ -1202,8 +1207,6 @@ _X_HIDDEN void *xfree86LookupTab[] = { SYMFUNC(xf86DoEDID_DDC2) SYMFUNC(xf86InterpretEDID) SYMFUNC(xf86PrintEDID) - SYMFUNC(xf86InterpretVdif) - SYMFUNC(xf86print_vdif) SYMFUNC(xf86DDCMonitorSet) SYMFUNC(xf86SetDDCproperties) @@ -1226,4 +1229,50 @@ _X_HIDDEN void *xfree86LookupTab[] = { SYMFUNC(xf86I2CWriteRead) SYMFUNC(xf86I2CWriteVec) SYMFUNC(xf86I2CWriteWord) + + /* ramdac/xf86RamDac.c */ + SYMFUNC(RamDacCreateInfoRec) + SYMFUNC(RamDacHelperCreateInfoRec) + SYMFUNC(RamDacDestroyInfoRec) + SYMFUNC(RamDacHelperDestroyInfoRec) + SYMFUNC(RamDacInit) + SYMFUNC(RamDacHandleColormaps) + SYMFUNC(RamDacFreeRec) + SYMFUNC(RamDacGetHWIndex) + SYMVAR(RamDacHWPrivateIndex) + SYMVAR(RamDacScreenPrivateIndex) + + /* ramdac/xf86Cursor.c */ + SYMFUNC(xf86InitCursor) + SYMFUNC(xf86CreateCursorInfoRec) + SYMFUNC(xf86DestroyCursorInfoRec) + SYMFUNC(xf86ForceHWCursor) + + /* ramdac/BT.c */ + SYMFUNC(BTramdacProbe) + SYMFUNC(BTramdacSave) + SYMFUNC(BTramdacRestore) + SYMFUNC(BTramdacSetBpp) + + /* ramdac/IBM.c */ + SYMFUNC(IBMramdacProbe) + SYMFUNC(IBMramdacSave) + SYMFUNC(IBMramdacRestore) + SYMFUNC(IBMramdac526SetBpp) + SYMFUNC(IBMramdac640SetBpp) + SYMFUNC(IBMramdac526CalculateMNPCForClock) + SYMFUNC(IBMramdac640CalculateMNPCForClock) + SYMFUNC(IBMramdac526HWCursorInit) + SYMFUNC(IBMramdac640HWCursorInit) + SYMFUNC(IBMramdac526SetBppWeak) + + /* ramdac/TI.c */ + SYMFUNC(TIramdacCalculateMNPForClock) + SYMFUNC(TIramdacProbe) + SYMFUNC(TIramdacSave) + SYMFUNC(TIramdacRestore) + SYMFUNC(TIramdac3026SetBpp) + SYMFUNC(TIramdac3030SetBpp) + SYMFUNC(TIramdacHWCursorInit) + SYMFUNC(TIramdacLoadPalette) }; diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 7d86b6606..d20a3a338 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -233,8 +233,6 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, int saved_x, saved_y; Rotation saved_rotation; - adjusted_mode = xf86DuplicateMode(mode); - crtc->enabled = xf86CrtcInUse (crtc); if (!crtc->enabled) @@ -243,6 +241,8 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, return TRUE; } + adjusted_mode = xf86DuplicateMode(mode); + didLock = crtc->funcs->lock (crtc); saved_mode = crtc->mode; @@ -377,6 +377,15 @@ static OptionInfoRec xf86OutputOptions[] = { {-1, NULL, OPTV_NONE, {0}, FALSE }, }; +enum { + OPTION_MODEDEBUG, +}; + +static OptionInfoRec xf86DeviceOptions[] = { + {OPTION_MODEDEBUG, "ModeDebug", OPTV_STRING, {0}, FALSE }, + {-1, NULL, OPTV_NONE, {0}, FALSE }, +}; + static void xf86OutputSetMonitor (xf86OutputPtr output) { @@ -405,22 +414,51 @@ xf86OutputSetMonitor (xf86OutputPtr output) xfree (option_name); output->conf_monitor = xf86findMonitor (monitor, xf86configptr->conf_monitor_lst); + /* + * Find the monitor section of the screen and use that + */ + if (!output->conf_monitor && output->use_screen_monitor) + output->conf_monitor = xf86findMonitor (output->scrn->monitor->id, + xf86configptr->conf_monitor_lst); if (output->conf_monitor) + { + xf86DrvMsg (output->scrn->scrnIndex, X_INFO, + "Output %s using monitor section %s\n", + output->name, output->conf_monitor->mon_identifier); xf86ProcessOptions (output->scrn->scrnIndex, output->conf_monitor->mon_option_lst, output->options); + } + else + xf86DrvMsg (output->scrn->scrnIndex, X_INFO, + "Output %s has no monitor section\n", + output->name); } static Bool -xf86OutputEnabled (xf86OutputPtr output) +xf86OutputEnabled (xf86OutputPtr output) { - /* Check to see if this output was disabled in the config file */ - if (xf86ReturnOptValBool (output->options, OPTION_ENABLE, TRUE) == FALSE || - xf86ReturnOptValBool (output->options, OPTION_DISABLE, FALSE) == TRUE) + Bool enable, disable; + + /* check to see if this output was enabled in the config file */ + if (xf86GetOptValBool (output->options, OPTION_ENABLE, &enable) && enable) { + xf86DrvMsg (output->scrn->scrnIndex, X_INFO, + "Output %s enabled by config file\n", output->name); + return TRUE; + } + /* or if this output was disabled in the config file */ + if (xf86GetOptValBool (output->options, OPTION_DISABLE, &disable) && disable) + { + xf86DrvMsg (output->scrn->scrnIndex, X_INFO, + "Output %s disabled by config file\n", output->name); return FALSE; } - return TRUE; + /* otherwise, enable if it is not disconnected */ + enable = output->status != XF86OutputStatusDisconnected; + xf86DrvMsg (output->scrn->scrnIndex, X_INFO, + "Output %s %sconnected\n", output->name, enable ? "" : "dis"); + return enable; } static Bool @@ -454,7 +492,7 @@ xf86OutputInitialRotation (xf86OutputPtr output) xf86OutputPtr xf86OutputCreate (ScrnInfoPtr scrn, - const xf86OutputFuncsRec *funcs, + const xf86OutputFuncsRec *funcs, const char *name) { xf86OutputPtr output, *outputs; @@ -477,6 +515,10 @@ xf86OutputCreate (ScrnInfoPtr scrn, strcpy (output->name, name); } output->subpixel_order = SubPixelUnknown; + /* + * Use the old per-screen monitor section for the first output + */ + output->use_screen_monitor = (xf86_config->num_output == 0); #ifdef RANDR_12_INTERFACE output->randr_output = NULL; #endif @@ -528,6 +570,16 @@ xf86OutputRename (xf86OutputPtr output, const char *name) } void +xf86OutputUseScreenMonitor (xf86OutputPtr output, Bool use_screen_monitor) +{ + if (use_screen_monitor != output->use_screen_monitor) + { + output->use_screen_monitor = use_screen_monitor; + xf86OutputSetMonitor (output); + } +} + +void xf86OutputDestroy (xf86OutputPtr output) { ScrnInfoPtr scrn = output->scrn; @@ -589,7 +641,6 @@ xf86CrtcCloseScreen (int index, ScreenPtr screen) { xf86OutputPtr output = config->output[o]; - output->crtc = NULL; output->randr_output = NULL; } for (c = 0; c < config->num_crtc; c++) @@ -1160,16 +1211,21 @@ xf86SortModes (DisplayModePtr input) return output; } -#define DEBUG_REPROBE 1 - void xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int o; - if (maxX == 0 || maxY == 0) - xf86RandR12GetOriginalVirtualSize (scrn, &maxX, &maxY); + /* When canGrow was TRUE in the initial configuration we have to + * compare against the maximum values so that we don't drop modes. + * When canGrow was FALSE, the maximum values would have been clamped + * anyway. + */ + if (maxX == 0 || maxY == 0) { + maxX = config->maxWidth; + maxY = config->maxHeight; + } /* Elide duplicate modes before defaulting code uses them */ xf86PruneDuplicateMonitorModes (scrn->monitor); @@ -1197,7 +1253,7 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) */ output->status = (*output->funcs->detect)(output); - if (output->status == XF86OutputStatusDisconnected) + if (!xf86OutputEnabled (output)) { xf86OutputSetEDID (output, NULL); continue; @@ -1330,7 +1386,8 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) if (mode->status == MODE_OK) mode->status = (*output->funcs->mode_valid)(output, mode); - xf86PruneInvalidModes(scrn, &output->probed_modes, TRUE); + xf86PruneInvalidModes(scrn, &output->probed_modes, + config->debug_modes); output->probed_modes = xf86SortModes (output->probed_modes); @@ -1363,17 +1420,17 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) output->initial_rotation = xf86OutputInitialRotation (output); -#ifdef DEBUG_REPROBE - if (output->probed_modes != NULL) { - xf86DrvMsg(scrn->scrnIndex, X_INFO, - "Printing probed modes for output %s\n", - output->name); - } else { - xf86DrvMsg(scrn->scrnIndex, X_INFO, - "No remaining probed modes for output %s\n", - output->name); + if (config->debug_modes) { + if (output->probed_modes != NULL) { + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "Printing probed modes for output %s\n", + output->name); + } else { + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "No remaining probed modes for output %s\n", + output->name); + } } -#endif for (mode = output->probed_modes; mode != NULL; mode = mode->next) { /* The code to choose the best mode per pipe later on will require @@ -1382,9 +1439,8 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) mode->VRefresh = xf86ModeVRefresh(mode); xf86SetModeCrtc(mode, INTERLACE_HALVE_V); -#ifdef DEBUG_REPROBE - xf86PrintModeline(scrn->scrnIndex, mode); -#endif + if (config->debug_modes) + xf86PrintModeline(scrn->scrnIndex, mode); } } } @@ -1479,6 +1535,15 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) int width; int height; + /* Set up the device options */ + config->options = xnfalloc (sizeof (xf86DeviceOptions)); + memcpy (config->options, xf86DeviceOptions, sizeof (xf86DeviceOptions)); + xf86ProcessOptions (scrn->scrnIndex, + scrn->options, + config->options); + config->debug_modes = xf86ReturnOptValBool (config->options, + OPTION_MODEDEBUG, FALSE); + if (scrn->display->virtualX) width = scrn->display->virtualX; else @@ -1499,8 +1564,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) xf86OutputPtr output = config->output[o]; modes[o] = NULL; - enabled[o] = (xf86OutputEnabled (output) && - output->status != XF86OutputStatusDisconnected); + enabled[o] = xf86OutputEnabled (output); } /* @@ -1545,8 +1609,20 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) { xf86OutputPtr output = config->output[o]; - if (enabled[o] && !modes[o]) - modes[o] = xf86ClosestMode (output, target_mode, target_rotation, width, height); + if (enabled[o]) + { + if (!modes[o]) + modes[o] = xf86ClosestMode (output, target_mode, + target_rotation, width, height); + if (!modes[o]) + xf86DrvMsg (scrn->scrnIndex, X_ERROR, + "Output %s enabled but has no modes\n", + output->name); + else + xf86DrvMsg (scrn->scrnIndex, X_INFO, + "Output %s using initial mode %s\n", + output->name, modes[o]->name); + } } /* @@ -1654,8 +1730,26 @@ Bool xf86SetDesiredModes (ScrnInfoPtr scrn) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int c; + int c, o; + /* + * Turn off everything so mode setting is done + * with hardware in a consistent state + */ + for (o = 0; o < config->num_output; o++) + { + xf86OutputPtr output = config->output[o]; + (*output->funcs->dpms)(output, DPMSModeOff); + } + + for (c = 0; c < config->num_crtc; c++) + { + xf86CrtcPtr crtc = config->crtc[c]; + + crtc->funcs->dpms(crtc, DPMSModeOff); + memset(&crtc->mode, 0, sizeof(crtc->mode)); + } + for (c = 0; c < config->num_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c]; @@ -1818,6 +1912,11 @@ xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation) else crtc_mode = xf86OutputFindClosestMode (output, desired); } + if (!crtc_mode) + { + crtc->enabled = FALSE; + continue; + } if (!xf86CrtcSetMode (crtc, crtc_mode, rotation, 0, 0)) ok = FALSE; else @@ -1829,6 +1928,9 @@ xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation) } } xf86DisableUnusedFunctions(pScrn); +#if RANDR_12_INTERFACE + xf86RandR12TellChanged (pScrn->pScreen); +#endif return ok; } @@ -1962,10 +2064,12 @@ xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) output->MonInfo = edid_mon; - /* Debug info for now, at least */ - xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n", output->name); - xf86PrintEDID(edid_mon); - + if (config->debug_modes) { + xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n", + output->name); + xf86PrintEDID(edid_mon); + } + /* Set the DDC properties for the 'compat' output */ if (output == config->output[config->compat_output]) xf86SetDDCproperties(scrn, edid_mon); diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index 42daf6079..2d6260030 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -479,6 +479,9 @@ struct _xf86Output { /** driver private information */ void *driver_private; + /** Whether to use the old per-screen Monitor config section */ + Bool use_screen_monitor; + #ifdef RANDR_12_INTERFACE /** * RandR 1.2 output structure. @@ -552,6 +555,17 @@ typedef struct _xf86CrtcConfig { CARD8 *cursor_image; Bool cursor_on; CARD32 cursor_fg, cursor_bg; + + /** + * Options parsed from the related device section + */ + OptionInfoPtr options; + + Bool debug_modes; + + /* wrap screen BlockHandler for rotation */ + ScreenBlockHandlerProcPtr BlockHandler; + } xf86CrtcConfigRec, *xf86CrtcConfigPtr; extern int xf86CrtcConfigPrivateIndex; @@ -611,9 +625,12 @@ xf86CrtcInUse (xf86CrtcPtr crtc); * Output functions */ xf86OutputPtr -xf86OutputCreate (ScrnInfoPtr scrn, - const xf86OutputFuncsRec *funcs, - const char *name); +xf86OutputCreate (ScrnInfoPtr scrn, + const xf86OutputFuncsRec *funcs, + const char *name); + +void +xf86OutputUseScreenMonitor (xf86OutputPtr output, Bool use_screen_monitor); Bool xf86OutputRename (xf86OutputPtr output, const char *name); diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c index 7a8ec1935..a9f9ddc9c 100644 --- a/hw/xfree86/modes/xf86EdidModes.c +++ b/hw/xfree86/modes/xf86EdidModes.c @@ -71,7 +71,11 @@ static Bool quirk_dt_sync_hm_vp (int scrnIndex, xf86MonPtr DDC) if (memcmp (DDC->vendor.name, "VSC", 4) == 0 && DDC->vendor.prod_id == 58653) return TRUE; - + /* Samsung SyncMaster 205BW */ + if (memcmp (DDC->vendor.name, "SAM", 4) == 0 && + DDC->vendor.prod_id == 541) + return TRUE; + return FALSE; } @@ -82,6 +86,16 @@ static Bool quirk_prefer_large_60 (int scrnIndex, xf86MonPtr DDC) DDC->vendor.prod_id == 1516) return TRUE; + /* Acer AL1706 */ + if (memcmp (DDC->vendor.name, "ACR", 4) == 0 && + DDC->vendor.prod_id == 44358) + return TRUE; + + /* Samsung SyncMaster 226BW */ + if (memcmp (DDC->vendor.name, "SAM", 4) == 0 && + DDC->vendor.prod_id == 638) + return TRUE; + return FALSE; } diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 6f52ee2d9..db912745f 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -337,6 +337,7 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen, ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); WindowPtr pRoot = WindowTable[pScreen->myNum]; + PixmapPtr pScrnPix = (*pScreen->GetScreenPixmap)(pScreen); Bool ret = FALSE; if (randrp->virtualX == -1 || randrp->virtualY == -1) @@ -353,8 +354,8 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen, ret = TRUE; - pScreen->width = width; - pScreen->height = height; + pScreen->width = pScrnPix->drawable.width = width; + pScreen->height = pScrnPix->drawable.height = height; pScreen->mmWidth = mmWidth; pScreen->mmHeight = mmHeight; @@ -1048,6 +1049,28 @@ xf86RandR12CreateScreenResources12 (ScreenPtr pScreen) return TRUE; } +/* + * Something happened within the screen configuration due + * to DGA, VidMode or hot key. Tell RandR + */ + +void +xf86RandR12TellChanged (ScreenPtr pScreen) +{ + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); + int c; + + if (!randrp) + return; + xf86RandR12SetInfo12 (pScreen); + for (c = 0; c < config->num_crtc; c++) + xf86RandR12CrtcNotify (config->crtc[c]->randr_crtc); + + RRTellChanged (pScreen); +} + static void xf86RandR12PointerMoved (int scrnIndex, int x, int y) { diff --git a/hw/xfree86/modes/xf86RandR12.h b/hw/xfree86/modes/xf86RandR12.h index 8a4668b46..4fd855cf5 100644 --- a/hw/xfree86/modes/xf86RandR12.h +++ b/hw/xfree86/modes/xf86RandR12.h @@ -24,6 +24,9 @@ #define _XF86_RANDR_H_ #include <randrstr.h> #include <X11/extensions/render.h> +#if XF86_MODES_RENAME +#include "xf86Rename.h" +#endif Bool xf86RandR12CreateScreenResources (ScreenPtr pScreen); Bool xf86RandR12Init(ScreenPtr pScreen); @@ -33,5 +36,6 @@ Bool xf86RandR12SetConfig(ScreenPtr pScreen, Rotation rotation, int rate, Rotation xf86RandR12GetRotation(ScreenPtr pScreen); void xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y); Bool xf86RandR12PreInit (ScrnInfoPtr pScrn); +void xf86RandR12TellChanged (ScreenPtr pScreen); #endif /* _XF86_RANDR_H_ */ diff --git a/hw/xfree86/modes/xf86Rename.h b/hw/xfree86/modes/xf86Rename.h index 9dcfef5da..b8c1d70ef 100644 --- a/hw/xfree86/modes/xf86Rename.h +++ b/hw/xfree86/modes/xf86Rename.h @@ -25,6 +25,12 @@ #include "local_xf86Rename.h" +#define xf86_cursors_fini XF86NAME(xf86_cursors_fini) +#define xf86_cursors_init XF86NAME(xf86_cursors_init) +#define xf86_hide_cursors XF86NAME(xf86_hide_cursors) +#define xf86_reload_cursors XF86NAME(xf86_reload_cursors) +#define xf86_show_cursors XF86NAME(xf86_show_cursors) +#define xf86ConnectorGetName XF86NAME(xf86ConnectorGetName) #define xf86CrtcConfigInit XF86NAME(xf86CrtcConfigInit) #define xf86CrtcConfigPrivateIndex XF86NAME(xf86CrtcConfigPrivateIndex) #define xf86CrtcCreate XF86NAME(xf86CrtcCreate) @@ -35,6 +41,7 @@ #define xf86CrtcSetMode XF86NAME(xf86CrtcSetMode) #define xf86CrtcSetSizeRange XF86NAME(xf86CrtcSetSizeRange) #define xf86CVTMode XF86NAME(xf86CVTMode) +#define xf86DDCMonitorSet XF86NAME(xf86DDCMonitorSet) #define xf86DisableUnusedFunctions XF86NAME(xf86DisableUnusedFunctions) #define xf86DPMSSet XF86NAME(xf86DPMSSet) #define xf86DuplicateMode XF86NAME(xf86DuplicateMode) @@ -52,9 +59,11 @@ #define xf86OutputGetEDIDModes XF86NAME(xf86OutputGetEDIDModes) #define xf86OutputRename XF86NAME(xf86OutputRename) #define xf86OutputSetEDID XF86NAME(xf86OutputSetEDID) +#define xf86OutputUseScreenMonitor XF86NAME(xf86OutputUseScreenMonitor) #define xf86PrintModeline XF86NAME(xf86PrintModeline) #define xf86ProbeOutputModes XF86NAME(xf86ProbeOutputModes) #define xf86PruneInvalidModes XF86NAME(xf86PruneInvalidModes) +#define xf86RotateCloseScreen XF86NAME(xf86RotateCloseScreen) #define xf86SetModeCrtc XF86NAME(xf86SetModeCrtc) #define xf86SetModeDefaultName XF86NAME(xf86SetModeDefaultName) #define xf86SetScrnInfoModes XF86NAME(xf86SetScrnInfoModes) diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index e8fafd073..137993926 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -264,7 +264,7 @@ xf86RotatePrepare (ScreenPtr pScreen) } } -static void +static Bool xf86RotateRedisplay(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; @@ -273,18 +273,28 @@ xf86RotateRedisplay(ScreenPtr pScreen) RegionPtr region; if (!damage) - return; + return FALSE; xf86RotatePrepare (pScreen); region = DamageRegion(damage); if (REGION_NOTEMPTY(pScreen, region)) { - int c; - + int c; + SourceValidateProcPtr SourceValidate; + + /* + * SourceValidate is used by the software cursor code + * to pull the cursor off of the screen when reading + * bits from the frame buffer. Bypassing this function + * leaves the software cursor in place + */ + SourceValidate = pScreen->SourceValidate; + pScreen->SourceValidate = NULL; + for (c = 0; c < xf86_config->num_crtc; c++) { xf86CrtcPtr crtc = xf86_config->crtc[c]; - if (crtc->rotation != RR_Rotate_0) + if (crtc->rotation != RR_Rotate_0 && crtc->enabled) { BoxRec box; RegionRec crtc_damage; @@ -304,21 +314,28 @@ xf86RotateRedisplay(ScreenPtr pScreen) REGION_UNINIT (pScreen, &crtc_damage); } } + pScreen->SourceValidate = SourceValidate; DamageEmpty(damage); } + return TRUE; } static void -xf86RotateBlockHandler(pointer data, OSTimePtr pTimeout, pointer pRead) +xf86RotateBlockHandler(int screenNum, pointer blockData, + pointer pTimeout, pointer pReadmask) { - ScreenPtr pScreen = (ScreenPtr) data; - - xf86RotateRedisplay(pScreen); -} + ScreenPtr pScreen = screenInfo.screens[screenNum]; + ScrnInfoPtr pScrn = xf86Screens[screenNum]; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); -static void -xf86RotateWakeupHandler(pointer data, int i, pointer LastSelectMask) -{ + pScreen->BlockHandler = xf86_config->BlockHandler; + (*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask); + if (xf86RotateRedisplay(pScreen)) + { + /* Re-wrap if rotation is still happening */ + xf86_config->BlockHandler = pScreen->BlockHandler; + pScreen->BlockHandler = xf86RotateBlockHandler; + } } static void @@ -338,7 +355,8 @@ xf86RotateDestroy (xf86CrtcPtr crtc) } for (c = 0; c < xf86_config->num_crtc; c++) - if (crtc->rotatedPixmap || crtc->rotatedData) + if (xf86_config->crtc[c]->rotatedPixmap || + xf86_config->crtc[c]->rotatedData) return; /* @@ -355,10 +373,6 @@ xf86RotateDestroy (xf86CrtcPtr crtc) } DamageDestroy (xf86_config->rotation_damage); xf86_config->rotation_damage = NULL; - /* Free block/wakeup handler */ - RemoveBlockAndWakeupHandlers (xf86RotateBlockHandler, - xf86RotateWakeupHandler, - (pointer) pScreen); } } @@ -428,20 +442,12 @@ xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation) if (!xf86_config->rotation_damage) goto bail2; - /* Assign block/wakeup handler */ - if (!RegisterBlockAndWakeupHandlers (xf86RotateBlockHandler, - xf86RotateWakeupHandler, - (pointer) pScreen)) - { - goto bail3; - } + /* Wrap block handler */ + xf86_config->BlockHandler = pScreen->BlockHandler; + pScreen->BlockHandler = xf86RotateBlockHandler; } if (0) { -bail3: - DamageDestroy (xf86_config->rotation_damage); - xf86_config->rotation_damage = NULL; - bail2: if (shadow || shadowData) { diff --git a/hw/xfree86/os-support/bsd/Makefile.am b/hw/xfree86/os-support/bsd/Makefile.am index 099240467..0432ba931 100644 --- a/hw/xfree86/os-support/bsd/Makefile.am +++ b/hw/xfree86/os-support/bsd/Makefile.am @@ -38,8 +38,7 @@ ARCH_SOURCES = i386_video.c endif if PPC_VIDEO -ARCH_SOURCES = ppc_video.c \ - $(srcdir)/../shared/ioperm_noop.c +ARCH_SOURCES = ppc_video.c endif if SPARC64_VIDEO diff --git a/hw/xfree86/os-support/bsd/bsd_bell.c b/hw/xfree86/os-support/bsd/bsd_bell.c index b7a0c486e..0d2420102 100644 --- a/hw/xfree86/os-support/bsd/bsd_bell.c +++ b/hw/xfree86/os-support/bsd/bsd_bell.c @@ -27,7 +27,7 @@ #include <xorg-config.h> #endif -#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) +#if defined (SYSCONS_SUPPORT) #include <sys/kbio.h> #endif @@ -77,7 +77,7 @@ xf86OSRingBell(int loudness, int pitch, int duration) wsb.pitch = pitch; wsb.period = duration; wsb.volume = loudness; - ioctl(KBD_FD(xf86Info), WSKBDIO_COMPLEXBELL, + ioctl(xf86Info.consoleFd, WSKBDIO_COMPLEXBELL, &wsb); break; #endif diff --git a/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c index f4ea3f5c9..ae16b78aa 100644 --- a/hw/xfree86/os-support/bsd/i386_video.c +++ b/hw/xfree86/os-support/bsd/i386_video.c @@ -50,6 +50,11 @@ #include <machine/mtrr.h> #include <machine/sysarch.h> #include <sys/queue.h> +#ifdef __x86_64__ +#define i386_set_mtrr x86_64_set_mtrr +#define i386_get_mtrr x86_64_get_mtrr +#define i386_iopl x86_64_iopl +#endif #endif #if defined(__OpenBSD__) && defined(__amd64__) diff --git a/hw/xfree86/os-support/bsd/ppc_video.c b/hw/xfree86/os-support/bsd/ppc_video.c index ae65c8f15..6a23b4e5c 100644 --- a/hw/xfree86/os-support/bsd/ppc_video.c +++ b/hw/xfree86/os-support/bsd/ppc_video.c @@ -56,6 +56,9 @@ static pointer ppcMapVidMem(int, unsigned long, unsigned long, int flags); static void ppcUnmapVidMem(int, pointer, unsigned long); +Bool xf86EnableIO(void); +void xf86DisableIO(void); + void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { @@ -63,6 +66,7 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem) pVidMem->mapMem = ppcMapVidMem; pVidMem->unmapMem = ppcUnmapVidMem; pVidMem->initialised = TRUE; + xf86EnableIO(); } @@ -138,3 +142,32 @@ xf86EnableInterrupts() return; } + +Bool xf86EnableIO() +{ + int fd = xf86Info.screenFd; + + xf86MsgVerb(X_WARNING, 3, "xf86EnableIO %d\n", fd); + if (ioBase == MAP_FAILED) + { + ioBase=mmap(NULL, 0x10000, PROT_READ|PROT_WRITE, MAP_SHARED, fd, + 0xf2000000); + xf86MsgVerb(X_INFO, 3, "xf86EnableIO: %08x\n", ioBase); + if (ioBase == MAP_FAILED) { + xf86MsgVerb(X_WARNING, 3, "Can't map IO space!\n"); + return FALSE; + } + } + return TRUE; +} + +void xf86DisableIO() +{ + + if (ioBase != MAP_FAILED) + { + munmap(__UNVOLATILE(ioBase), 0x10000); + ioBase = MAP_FAILED; + } +} + diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h index 9eb536d23..a9b9cf79d 100644 --- a/hw/xfree86/os-support/bus/Pci.h +++ b/hw/xfree86/os-support/bus/Pci.h @@ -265,7 +265,7 @@ # define ARCH_PCI_INIT freebsdPciInit # define INCLUDE_XF86_NO_DOMAIN # endif -# if !defined(__FreeBSD__) +# if !defined(__FreeBSD__) && !defined(linux) # define ARCH_PCI_PCI_BRIDGE sparcPciPciBridge # endif #elif defined(__amd64__) || defined(__amd64) diff --git a/hw/xfree86/os-support/hurd/hurd_video.c b/hw/xfree86/os-support/hurd/hurd_video.c index 45e9a094b..b8892831c 100644 --- a/hw/xfree86/os-support/hurd/hurd_video.c +++ b/hw/xfree86/os-support/hurd/hurd_video.c @@ -117,49 +117,29 @@ xf86LinearVidMem() /************************************************************************** * I/O Permissions section ***************************************************************************/ -mach_port_t io_port; + +/* + * Due to conflicts with "compiler.h", don't rely on <sys/io.h> to declare + * this. + */ +extern int ioperm(unsigned long __from, unsigned long __num, int __turn_on); Bool xf86EnableIO() { - mach_port_t device; - kern_return_t err; - - err = get_privileged_ports(NULL, &device); - if( err ) - { - errno = err; - FatalError("xf86EnableIO() can't get_privileged_ports. (%s)\n",strerror(errno)); - } - err = device_open(device,D_READ|D_WRITE,"io",&io_port); - mach_port_deallocate(mach_task_self(), device); - if( err ) - { - errno = err; - FatalError("xf86EnableIO() can't device_open. (%s)\n",strerror(errno)); - } - - err = i386_io_port_add(mach_thread_self (), io_port); - if( err ) - { - errno = err; - FatalError("xf86EnableIO() can't i386_io_port_add.(io_port) (%s)\n",strerror(errno)); + if (ioperm(0, 0xffff, 1)) { + FatalError("xf86EnableIO: ioperm() failed (%s)\n", strerror(errno)); + return FALSE; } + ioperm(0x40,4,0); /* trap access to the timer chip */ + ioperm(0x60,4,0); /* trap access to the keyboard controller */ return TRUE; } void xf86DisableIO() { - kern_return_t err; - - err = i386_io_port_remove(mach_thread_self (), io_port); - if( err ) - { - errno = err; - FatalError("xf86DisableIO() can't i386_io_port_remove.(io_port) (%s)\n",strerror(errno)); - } - mach_port_deallocate(mach_task_self(), io_port); + ioperm(0,0xffff,0); return; } diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c index 85b6def56..9775180a8 100644 --- a/hw/xfree86/os-support/linux/lnx_init.c +++ b/hw/xfree86/os-support/linux/lnx_init.c @@ -245,15 +245,15 @@ xf86OpenConsole(void) lnx_savefont(); #endif /* - * now get the VT + * now get the VT. This _must_ succeed, or else fail completely. */ if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) < 0) - xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed: %s\n", - strerror(errno)); + FatalError("xf86OpenConsole: VT_ACTIVATE failed: %s\n", + strerror(errno)); if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) < 0) - xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed: %s\n", - strerror(errno)); + FatalError("xf86OpenConsole: VT_WAITACTIVE failed: %s\n", + strerror(errno)); if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0) FatalError("xf86OpenConsole: VT_GETMODE failed %s\n", @@ -350,6 +350,10 @@ xf86CloseConsole() if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, activeVT) < 0) xf86Msg(X_WARNING, "xf86CloseConsole: VT_ACTIVATE failed: %s\n", strerror(errno)); + if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, activeVT) < 0) + xf86Msg(X_WARNING, + "xf86CloseConsole: VT_WAITACTIVE failed: %s\n", + strerror(errno)); activeVT = -1; } diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c index 4b580464f..0bc99b038 100644 --- a/hw/xfree86/os-support/linux/lnx_video.c +++ b/hw/xfree86/os-support/linux/lnx_video.c @@ -62,7 +62,8 @@ static Bool ExtendedEnabled = FALSE; #elif !defined(__powerpc__) && \ !defined(__mc68000__) && \ !defined(__sparc__) && \ - !defined(__mips__) + !defined(__mips__) && \ + !defined(__arm__) /* * Due to conflicts with "compiler.h", don't rely on <sys/io.h> to declare @@ -567,7 +568,7 @@ xf86EnableIO(void) #endif } close(fd); -#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) +#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__arm__) if (ioperm(0, 1024, 1) || iopl(3)) { if (errno == ENODEV) ErrorF("xf86EnableIOPorts: no I/O ports found\n"); @@ -603,73 +604,21 @@ xf86DisableIO(void) return; } - -/***************************************************************************/ -/* Interrupt Handling section */ -/***************************************************************************/ - -/* XXX The #ifdefs should be made simpler. */ +/* + * Don't use these two functions. They can't possibly work. If you actually + * need interrupts off for something, you ought to be doing it in the kernel + * anyway. + */ _X_EXPORT Bool xf86DisableInterrupts() { -#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__) - if (!ExtendedEnabled) - if (iopl(3) || ioperm(0, 1024, 1)) - return (FALSE); -#endif -#if defined(__alpha__) || defined(__mc68000__) || defined(__powerpc__) || defined(__sparc__) || defined(__mips__) || defined(__arm__) || defined(__sh__) || defined(__ia64__) || defined(__hppa__) || defined(__s390__) -#else -# ifdef __GNUC__ -# if defined(__ia64__) -# if 0 - __asm__ __volatile__ (";; rsm psr.i;; srlz.d" ::: "memory"); -# endif -# else - __asm__ __volatile__("cli"); -# endif -# else - asm("cli"); -# endif -#endif -#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__ia64__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__) - if (!ExtendedEnabled) { - iopl(0); - ioperm(0, 1024, 0); - } - -#endif return (TRUE); } _X_EXPORT void xf86EnableInterrupts() { -#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__) - if (!ExtendedEnabled) - if (iopl(3) || ioperm(0, 1024, 1)) - return; -#endif -#if defined(__alpha__) || defined(__mc68000__) || defined(__powerpc__) || defined(__sparc__) || defined(__mips__) || defined(__arm__) || defined(__sh__) || defined(__ia64__) || defined(__hppa__) || defined(__s390__) -#else -# ifdef __GNUC__ -# if defined(__ia64__) -# if 0 - __asm__ __volatile__ (";; ssm psr.i;; srlz.d" ::: "memory"); -# endif -# else - __asm__ __volatile__("sti"); -# endif -# else - asm("sti"); -# endif -#endif -#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__ia64__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__) - if (!ExtendedEnabled) { - iopl(0); - ioperm(0, 1024, 0); - } -#endif return; } diff --git a/hw/xfree86/os-support/misc/SlowBcopy.c b/hw/xfree86/os-support/misc/SlowBcopy.c index 1fda7fc10..f0ad61132 100644 --- a/hw/xfree86/os-support/misc/SlowBcopy.c +++ b/hw/xfree86/os-support/misc/SlowBcopy.c @@ -35,7 +35,8 @@ xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len) #if !defined(__sparc__) && \ !defined(__powerpc__) && \ !defined(__mips__) && \ - !defined(__ia64__) + !defined(__ia64__) && \ + !defined(__arm__) outb(0x80, 0x00); #endif } diff --git a/hw/xfree86/parser/Flags.c b/hw/xfree86/parser/Flags.c index 4adea1ade..5b60a5155 100644 --- a/hw/xfree86/parser/Flags.c +++ b/hw/xfree86/parser/Flags.c @@ -198,21 +198,21 @@ addNewOption2 (XF86OptionPtr head, char *name, char *val, int used) { XF86OptionPtr new, old = NULL; - /* Don't allow duplicates */ - if (head != NULL && (old = xf86findOption(head, name)) != NULL) - new = old; - else { + /* Don't allow duplicates, free old strings */ + if (head != NULL && (old = xf86findOption(head, name)) != NULL) { + new = old; + xf86conffree(new->opt_name); + xf86conffree(new->opt_val); + } + else new = xf86confcalloc (1, sizeof (XF86OptionRec)); - new->list.next = NULL; - } - new->opt_name = name; - new->opt_val = val; - new->opt_used = used; - - if (old == NULL) - return ((XF86OptionPtr) xf86addListItem ((glp) head, (glp) new)); - else - return head; + new->opt_name = name; + new->opt_val = val; + new->opt_used = used; + + if (old) + return head; + return ((XF86OptionPtr) xf86addListItem ((glp) head, (glp) new)); } XF86OptionPtr diff --git a/hw/xfree86/parser/Module.c b/hw/xfree86/parser/Module.c index 81eff18ae..2012ce6d2 100644 --- a/hw/xfree86/parser/Module.c +++ b/hw/xfree86/parser/Module.c @@ -76,6 +76,7 @@ static xf86ConfigSymTabRec ModuleTab[] = { {ENDSECTION, "endsection"}, {LOAD, "load"}, + {DISABLE, "disable"}, {LOAD_DRIVER, "loaddriver"}, {SUBSECTION, "subsection"}, {-1, ""}, @@ -141,6 +142,13 @@ xf86parseModuleSection (void) xf86addNewLoadDirective (ptr->mod_load_lst, val.str, XF86_LOAD_MODULE, NULL); break; + case DISABLE: + if (xf86getSubToken (&(ptr->mod_comment)) != STRING) + Error (QUOTE_MSG, "Disable"); + ptr->mod_disable_lst = + xf86addNewLoadDirective (ptr->mod_disable_lst, val.str, + XF86_DISABLE_MODULE, NULL); + break; case LOAD_DRIVER: if (xf86getSubToken (&(ptr->mod_comment)) != STRING) Error (QUOTE_MSG, "LoadDriver"); @@ -257,6 +265,15 @@ xf86freeModules (XF86ConfModulePtr ptr) lptr = lptr->list.next; xf86conffree (prev); } + lptr = ptr->mod_disable_lst; + while (lptr) + { + TestFree (lptr->load_name); + TestFree (lptr->load_comment); + prev = lptr; + lptr = lptr->list.next; + xf86conffree (prev); + } TestFree (ptr->mod_comment); xf86conffree (ptr); } diff --git a/hw/xfree86/parser/write.c b/hw/xfree86/parser/write.c index 1869f56a6..3924001f7 100644 --- a/hw/xfree86/parser/write.c +++ b/hw/xfree86/parser/write.c @@ -107,13 +107,19 @@ doWriteConfigFile (const char *filename, XF86ConfigPtr cptr) xf86printLayoutSection (cf, cptr->conf_layout_lst); - fprintf (cf, "Section \"Files\"\n"); - xf86printFileSection (cf, cptr->conf_files); - fprintf (cf, "EndSection\n\n"); + if (cptr->conf_files != NULL) + { + fprintf (cf, "Section \"Files\"\n"); + xf86printFileSection (cf, cptr->conf_files); + fprintf (cf, "EndSection\n\n"); + } - fprintf (cf, "Section \"Module\"\n"); - xf86printModuleSection (cf, cptr->conf_modules); - fprintf (cf, "EndSection\n\n"); + if (cptr->conf_modules != NULL) + { + fprintf (cf, "Section \"Module\"\n"); + xf86printModuleSection (cf, cptr->conf_modules); + fprintf (cf, "EndSection\n\n"); + } xf86printVendorSection (cf, cptr->conf_vendor_lst); diff --git a/hw/xfree86/parser/xf86Parser.h b/hw/xfree86/parser/xf86Parser.h index 89de97bbb..dc30823cc 100644 --- a/hw/xfree86/parser/xf86Parser.h +++ b/hw/xfree86/parser/xf86Parser.h @@ -82,6 +82,7 @@ XF86ConfFilesRec, *XF86ConfFilesPtr; /* Values for load_type */ #define XF86_LOAD_MODULE 0 #define XF86_LOAD_DRIVER 1 +#define XF86_DISABLE_MODULE 2 typedef struct { @@ -97,6 +98,7 @@ XF86LoadRec, *XF86LoadPtr; typedef struct { XF86LoadPtr mod_load_lst; + XF86LoadPtr mod_disable_lst; char *mod_comment; } XF86ConfModuleRec, *XF86ConfModulePtr; diff --git a/hw/xfree86/parser/xf86tokens.h b/hw/xfree86/parser/xf86tokens.h index d5948dd5b..822bbb9b7 100644 --- a/hw/xfree86/parser/xf86tokens.h +++ b/hw/xfree86/parser/xf86tokens.h @@ -170,6 +170,7 @@ typedef enum { /* Module tokens */ LOAD, LOAD_DRIVER, + DISABLE, /* Device tokens */ DRIVER, diff --git a/hw/xfree86/utils/xorgcfg/text-mode.c b/hw/xfree86/utils/xorgcfg/text-mode.c index 9797ca283..8800c29d7 100644 --- a/hw/xfree86/utils/xorgcfg/text-mode.c +++ b/hw/xfree86/utils/xorgcfg/text-mode.c @@ -2111,7 +2111,7 @@ LayoutConfig(void) else iref->iref_option_lst = xf86addNewOption(iref->iref_option_lst, - "CorePointer", NULL); + XtNewString("CorePointer"), NULL); option = xf86findOption(mref->iref_option_lst, "CorePointer"); XtFree(option->opt_name); @@ -2209,7 +2209,7 @@ LayoutConfig(void) else iref->iref_option_lst = xf86addNewOption(iref->iref_option_lst, - "CoreKeyboard", NULL); + XtNewString("CoreKeyboard"), NULL); option = xf86findOption(kref->iref_option_lst, "CoreKeyboard"); XtFree(option->opt_name); diff --git a/hw/xfree86/xaa/xaaWideLine.c b/hw/xfree86/xaa/xaaWideLine.c index 9479b0d7a..a684d6676 100644 --- a/hw/xfree86/xaa/xaaWideLine.c +++ b/hw/xfree86/xaa/xaaWideLine.c @@ -32,10 +32,6 @@ Original mi code written by Keith Packard. #include "xaa.h" #include "xaalocal.h" -#ifdef ICEILTEMPDECL -ICEILTEMPDECL -#endif - #define DRAW_POINT(pScrn, x, y) \ if(hardClip) (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, 1, 1); \ else XAAPointHelper(pScrn, x, y) |