diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2007-10-25 12:19:30 -0400 |
---|---|---|
committer | Eamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil> | 2007-10-25 12:19:30 -0400 |
commit | b633d54b94d746d26e13014634d9f63bbb7e8f7d (patch) | |
tree | 4832d035672164284ff8698d5875e9d5435f494a /hw | |
parent | 4b05f19cb9e42d8c8eff5ca4e463f5bc2a05433d (diff) | |
parent | 48ca5961caee62f2980017a6bdc96a1b4c747727 (diff) |
Merge branch 'master' into XACE-SELINUX
Conflicts:
GL/glx/glxscreens.c
hw/xnest/Screen.c
render/glyph.c
render/glyphstr.h
render/render.c
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/common/xf86AutoConfig.c | 48 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Config.c | 29 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Privstr.h | 9 | ||||
-rw-r--r-- | hw/xfree86/dixmods/glxmodule.c | 34 | ||||
-rw-r--r-- | hw/xfree86/doc/man/xorg.conf.man.pre | 11 | ||||
-rw-r--r-- | hw/xfree86/dri/dri.c | 40 | ||||
-rw-r--r-- | hw/xfree86/dri/xf86dri.c | 12 | ||||
-rw-r--r-- | hw/xfree86/loader/misym.c | 3 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 3 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86EdidModes.c | 29 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86RandR12.c | 14 | ||||
-rw-r--r-- | hw/xfree86/os-support/linux/lnx_acpi.c | 33 | ||||
-rw-r--r-- | hw/xnest/Screen.c | 15 |
13 files changed, 148 insertions, 132 deletions
diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index a6bfc0190..c5998bfb8 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -329,6 +329,11 @@ autoConfigDevice(GDevPtr preconf_device) return ptr; } +#ifdef __linux__ +/* This function is used to provide a workaround for binary drivers that + * don't export their PCI ID's properly. If distros don't end up using this + * feature it can and should be removed because the symbol-based resolution + * scheme should be the primary one */ static void matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip) { @@ -341,9 +346,10 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip char path_name[256], vendor_str[5], chip_str[5]; uint16_t vendor, chip; int i, j; - idsdir = opendir("/usr/share/xserver-xorg/pci"); + idsdir = opendir(PCI_TXT_IDS_PATH); if (idsdir) { + xf86Msg(X_INFO, "Scanning %s directory for additional PCI ID's supported by the drivers\n", PCI_TXT_IDS_PATH); direntry = readdir(idsdir); /* Read the directory */ while (direntry) { @@ -355,15 +361,20 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip /* A tiny bit of sanity checking. We should probably do better */ if (strncmp(&(direntry->d_name[len-4]), ".ids", 4) == 0) { /* We need the full path name to open the file */ - strncpy(path_name, "/usr/share/xserver-xorg/pci/", 256); - strncat(path_name, direntry->d_name, (256 - strlen(path_name))); + strncpy(path_name, PCI_TXT_IDS_PATH, 256); + strncat(path_name, "/", 1); + strncat(path_name, direntry->d_name, (256 - strlen(path_name) - 1)); fp = fopen(path_name, "r"); if (fp == NULL) { xf86Msg(X_ERROR, "Could not open %s for reading. Exiting.\n", path_name); goto end; } /* Read the file */ + #ifdef __GLIBC__ while ((read = getline(&line, &len, fp)) != -1) { + #else + while ((line = fgetln(fp, &len)) != (char *)NULL) { + #endif /* __GLIBC __ */ xchomp(line); if (isdigit(line[0])) { strncpy(vendor_str, line, 4); @@ -405,8 +416,7 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip matches[i][j] = direntry->d_name[j]; } } - xf86Msg(X_INFO, "Matched %s from file name %s in autoconfig\n", matches[i], direntry->d_name); - + xf86Msg(X_INFO, "Matched %s from file name %s\n", matches[i], direntry->d_name); } } else { /* TODO Handle driver overrides here */ @@ -421,6 +431,7 @@ matchDriverFromFiles (char** matches, uint16_t match_vendor, uint16_t match_chip xfree(line); closedir(idsdir); } +#endif /* __linux__ */ char* chooseVideoDriver(void) @@ -448,24 +459,27 @@ chooseVideoDriver(void) ErrorF("Primary device is not PCI\n"); } +#ifdef __linux__ matchDriverFromFiles(matches, info->vendor_id, info->device_id); +#endif /* __linux__ */ /* TODO Handle multiple drivers claiming to support the same PCI ID */ if (matches[0]) { chosen_driver = matches[0]; } else { - chosen_driver = videoPtrToDriverName(info); - #if 0 /* Save for later */ - #if defined __i386__ || defined __amd64__ || defined __hurd__ - chosen_driver = "vesa"; - #elif defined __alpha__ - chosen_driver = "vga"; - #elif defined __sparc__ - chosen_driver = "sunffb"; - #else - chosen_driver = "fbdev"; - #endif - #endif + if (info != NULL) + chosen_driver = videoPtrToDriverName(info); + if (chosen_driver == NULL) { +#if defined __i386__ || defined __amd64__ || defined __hurd__ + chosen_driver = "vesa"; +#elif defined __alpha__ + chosen_driver = "vga"; +#elif defined __sparc__ + chosen_driver = "sunffb"; +#else + chosen_driver = "fbdev"; +#endif + } } xf86Msg(X_DEFAULT, "Matched %s for the autoconfigured driver\n", chosen_driver); diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 96fadc9dd..35b62a244 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -792,6 +792,7 @@ typedef enum { FLAG_USE_DEFAULT_FONT_PATH, FLAG_AUTO_ADD_DEVICES, FLAG_AUTO_ENABLE_DEVICES, + FLAG_GLX_VISUALS, } FlagValues; static OptionInfoRec FlagOptions[] = { @@ -873,6 +874,8 @@ static OptionInfoRec FlagOptions[] = { {0}, TRUE }, { FLAG_AUTO_ENABLE_DEVICES, "AutoEnableDevices", OPTV_BOOLEAN, {0}, TRUE }, + { FLAG_GLX_VISUALS, "GlxVisuals", OPTV_STRING, + {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE }, }; @@ -904,6 +907,7 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) Pix24Flags pix24 = Pix24DontCare; Bool value; MessageType from; + const char *s; /* * Merge the ServerLayout and ServerFlags options. The former have @@ -1021,7 +1025,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) if (xf86GetOptValBool(FlagOptions, FLAG_NOPM, &value)) xf86Info.pmFlag = !value; { - const char *s; if ((s = xf86GetOptValString(FlagOptions, FLAG_LOG))) { if (!xf86NameCmp(s,"flush")) { xf86Msg(X_CONFIG, "Flushing logfile enabled\n"); @@ -1040,8 +1043,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) #ifdef RENDER { - const char *s; - if ((s = xf86GetOptValString(FlagOptions, FLAG_RENDER_COLORMAP_MODE))){ int policy = PictureParseCmapPolicy (s); if (policy == PictureCmapPolicyInvalid) @@ -1055,7 +1056,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) } #endif { - const char *s; if ((s = xf86GetOptValString(FlagOptions, FLAG_HANDLE_SPECIAL_KEYS))) { if (!xf86NameCmp(s,"always")) { xf86Msg(X_CONFIG, "Always handling special keys in DDX\n"); @@ -1093,6 +1093,27 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) xf86Info.aiglxFrom = X_CONFIG; } +#ifdef GLXEXT + xf86Info.glxVisuals = XF86_GlxVisualsAll; + xf86Info.glxVisualsFrom = X_DEFAULT; + if ((s = xf86GetOptValString(FlagOptions, FLAG_GLX_VISUALS))) { + if (!xf86NameCmp(s, "minimal")) { + xf86Info.glxVisuals = XF86_GlxVisualsMinimal; + } else if (!xf86NameCmp(s, "typical")) { + xf86Info.glxVisuals = XF86_GlxVisualsTypical; + } else if (!xf86NameCmp(s, "all")) { + xf86Info.glxVisuals = XF86_GlxVisualsAll; + } else { + xf86Msg(X_WARNING,"Unknown HandleSpecialKeys option\n"); + } + } + + if (xf86GetOptValBool(FlagOptions, FLAG_AIGLX, &value)) { + xf86Info.aiglx = value; + xf86Info.aiglxFrom = X_CONFIG; + } +#endif + xf86Info.allowEmptyInput = FALSE; if (xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &value)) xf86Info.allowEmptyInput = TRUE; diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h index 75d497471..92a6305a0 100644 --- a/hw/xfree86/common/xf86Privstr.h +++ b/hw/xfree86/common/xf86Privstr.h @@ -60,6 +60,12 @@ typedef enum { SKAlways } SpecialKeysInDDX; +typedef enum { + XF86_GlxVisualsMinimal, + XF86_GlxVisualsTypical, + XF86_GlxVisualsAll, +} XF86_GlxVisuals; + /* * xf86InfoRec contains global parameters which the video drivers never * need to access. Global parameters which the video drivers do need @@ -120,6 +126,9 @@ typedef struct { MessageType randRFrom; Bool aiglx; MessageType aiglxFrom; + XF86_GlxVisuals glxVisuals; + MessageType glxVisualsFrom; + Bool useDefaultFontPath; MessageType useDefaultFontPathFrom; Bool ignoreABI; diff --git a/hw/xfree86/dixmods/glxmodule.c b/hw/xfree86/dixmods/glxmodule.c index 5384f434b..847f0d4a2 100644 --- a/hw/xfree86/dixmods/glxmodule.c +++ b/hw/xfree86/dixmods/glxmodule.c @@ -41,18 +41,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "colormap.h" #include "micmap.h" #include "globals.h" - -typedef struct __GLXscreen __GLXscreen; -typedef struct __GLXprovider __GLXprovider; -struct __GLXprovider { - __GLXscreen *(*screenProbe)(ScreenPtr pScreen); - const char *name; - __GLXprovider *next; -}; - -extern void GlxPushProvider(__GLXprovider *provider); -extern void GlxExtensionInit(void); -extern void GlxWrapInitVisuals(miInitVisualsProcPtr *); +#include "glxserver.h" static MODULESETUPPROTO(glxSetup); @@ -114,7 +103,6 @@ static __GLXprovider __glXMesaProxyProvider = { NULL }; - static pointer glxSetup(pointer module, pointer opts, int *errmaj, int *errmin) { @@ -139,12 +127,22 @@ glxSetup(pointer module, pointer opts, int *errmaj, int *errmin) GlxPushProvider(provider); } + switch (xf86Info.glxVisuals) { + case XF86_GlxVisualsMinimal: + GlxSetVisualConfig(GLX_MINIMAL_VISUALS); + xf86Msg(xf86Info.aiglxFrom, "Exporting only minimal set of GLX visuals\n"); + break; + case XF86_GlxVisualsTypical: + GlxSetVisualConfig(GLX_TYPICAL_VISUALS); + xf86Msg(xf86Info.aiglxFrom, "Exporting typical set of GLX visuals\n"); + break; + case XF86_GlxVisualsAll: + GlxSetVisualConfig(GLX_ALL_VISUALS); + xf86Msg(xf86Info.aiglxFrom, "Exporting all GLX visuals\n"); + break; + } + LoadExtension(&GLXExt, FALSE); - /* Wrap the init visuals routine in micmap.c */ - GlxWrapInitVisuals(&miInitVisualsProc); - /* Make sure this gets wrapped each time InitVisualWrap is called */ - miHookInitVisuals(NULL, GlxWrapInitVisuals); - bail: return module; } diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre index 54d8eaa87..4064ef6d8 100644 --- a/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/hw/xfree86/doc/man/xorg.conf.man.pre @@ -700,6 +700,17 @@ 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 \*qGlxVisuals\*q \*q" string \*q +This option controls how many GLX visuals the GLX modules sets up. +The default value is +.BR "typical" , +which will setup up a typical subset of +the GLXFBConfigs provided by the driver as GLX visuals. Other options are +.BR "minimal" , +which will set up the minimal set allowed by the GLX specification and +.BR "all" +which will setup GLX visuals for all GLXFBConfigs. +.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 diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index c35386354..b736c6ae0 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -67,7 +67,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "dristruct.h" #include "xf86.h" #include "xf86drm.h" -#include "glxserver.h" #include "mi.h" #include "mipointer.h" #include "xf86_OSproc.h" @@ -953,24 +952,8 @@ static Bool DRICreateDummyContext(ScreenPtr pScreen, Bool needCtxPriv) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - __GLXscreen *pGLXScreen = glxGetScreen(pScreen); - __GLcontextModes *modes = pGLXScreen->modes; - void **pVisualConfigPriv = pGLXScreen->pVisualPriv; DRIContextPrivPtr pDRIContextPriv; void *contextStore; - VisualPtr visual; - int visNum; - - visual = pScreen->visuals; - - /* Find the X visual that corresponds the the first GLX visual */ - for (visNum = 0; - visNum < pScreen->numVisuals; - visNum++, visual++) { - if (modes->visualID == visual->vid) - break; - } - if (visNum == pScreen->numVisuals) return FALSE; if (!(pDRIContextPriv = DRICreateContextPriv(pScreen, @@ -980,9 +963,9 @@ DRICreateDummyContext(ScreenPtr pScreen, Bool needCtxPriv) contextStore = DRIGetContextStore(pDRIContextPriv); if (pDRIPriv->pDriverInfo->CreateContext && needCtxPriv) { - if (!pDRIPriv->pDriverInfo->CreateContext(pScreen, visual, + if (!pDRIPriv->pDriverInfo->CreateContext(pScreen, NULL, pDRIPriv->pSAREA->dummy_context, - *pVisualConfigPriv, + NULL, (DRIContextType)(long)contextStore)) { DRIDestroyContextPriv(pDRIContextPriv); return FALSE; @@ -1017,9 +1000,6 @@ DRICreateContext(ScreenPtr pScreen, VisualPtr visual, XID context, drm_context_t * pHWContext) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - __GLXscreen *pGLXScreen = glxGetScreen(pScreen); - __GLcontextModes *modes = pGLXScreen->modes; - void **pVisualConfigPriv = pGLXScreen->pVisualPriv; DRIContextPrivPtr pDRIContextPriv; void *contextStore; @@ -1031,26 +1011,14 @@ DRICreateContext(ScreenPtr pScreen, VisualPtr visual, } } - /* Find the GLX visual associated with the one requested */ - for (modes = pGLXScreen->modes; modes != NULL; modes = modes->next) { - if (modes->visualID == visual->vid) - break; - pVisualConfigPriv++; - } - - if (modes == NULL) { - /* No matching GLX visual found */ - return FALSE; - } - if (!(pDRIContextPriv = DRICreateContextPriv(pScreen, pHWContext, 0))) { return FALSE; } contextStore = DRIGetContextStore(pDRIContextPriv); if (pDRIPriv->pDriverInfo->CreateContext) { - if (!((*pDRIPriv->pDriverInfo->CreateContext)(pScreen, visual, - *pHWContext, *pVisualConfigPriv, + if (!((*pDRIPriv->pDriverInfo->CreateContext)(pScreen, NULL, + *pHWContext, NULL, (DRIContextType)(long)contextStore))) { DRIDestroyContextPriv(pDRIContextPriv); return FALSE; diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c index c658421e8..e01d6d9be 100644 --- a/hw/xfree86/dri/xf86dri.c +++ b/hw/xfree86/dri/xf86dri.c @@ -373,19 +373,9 @@ ProcXF86DRICreateContext( rep.sequenceNumber = client->sequence; pScreen = screenInfo.screens[stuff->screen]; - visual = pScreen->visuals; - - /* Find the requested X visual */ - for (i = 0; i < pScreen->numVisuals; i++, visual++) - if (visual->vid == stuff->visual) - break; - if (i == pScreen->numVisuals) { - /* No visual found */ - return BadValue; - } if (!DRICreateContext( pScreen, - visual, + NULL, stuff->context, (drm_context_t *)&rep.hHWContext)) { return BadValue; diff --git a/hw/xfree86/loader/misym.c b/hw/xfree86/loader/misym.c index e87d35408..aa712c03a 100644 --- a/hw/xfree86/loader/misym.c +++ b/hw/xfree86/loader/misym.c @@ -205,9 +205,6 @@ _X_HIDDEN void *miLookupTab[] = { SYMVAR(miPointerScreenKey) SYMVAR(miInstalledMaps) SYMVAR(miInitVisualsProc) -#ifdef RENDER - SYMFUNC(miGlyphExtents) -#endif #ifdef DAMAGE SYMFUNC(DamageDamageRegion) #endif diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 0a48d5bd3..bb416fddc 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -1417,9 +1417,8 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) output->probed_modes = mode; } mode->type |= (M_T_PREFERRED|M_T_USERPREF); + break; } - else - mode->type &= ~M_T_PREFERRED; } } diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c index 9fa5fef9e..2f26a6450 100644 --- a/hw/xfree86/modes/xf86EdidModes.c +++ b/hw/xfree86/modes/xf86EdidModes.c @@ -64,6 +64,8 @@ typedef enum { * maximum size and use that. */ DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE = 1 << 5, + /* Monitor forgot to set the first detailed is preferred bit. */ + DDC_QUIRK_FIRST_DETAILED_PREFERRED = 1 << 6, } ddc_quirk_t; static Bool quirk_prefer_large_60 (int scrnIndex, xf86MonPtr DDC) @@ -147,6 +149,16 @@ static Bool quirk_135_clock_too_high (int scrnIndex, xf86MonPtr DDC) return FALSE; } +static Bool quirk_first_detailed_preferred (int scrnIndex, xf86MonPtr DDC) +{ + /* Philips 107p5 CRT. Reported on xorg@ with pastebin. */ + if (memcmp (DDC->vendor.name, "PHL", 4) == 0 && + DDC->vendor.prod_id == 57364) + return TRUE; + + return FALSE; +} + typedef struct { Bool (*detect) (int scrnIndex, xf86MonPtr DDC); ddc_quirk_t quirk; @@ -178,6 +190,10 @@ static const ddc_quirk_map_t ddc_quirks[] = { quirk_detailed_use_maximum_size, DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE, "Detailed timings give sizes in cm." }, + { + quirk_first_detailed_preferred, DDC_QUIRK_FIRST_DETAILED_PREFERRED, + "First detailed timing was not marked as preferred." + }, { NULL, DDC_QUIRK_NONE, "No known quirks" @@ -257,7 +273,7 @@ DDCModesFromStandardTiming(int scrnIndex, struct std_timings *timing, */ static DisplayModePtr DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing, - int preferred, ddc_quirk_t quirks) + Bool preferred, ddc_quirk_t quirks) { DisplayModePtr Mode; @@ -470,9 +486,10 @@ xf86DDCSetPreferredRefresh(int scrnIndex, DisplayModePtr modes, _X_EXPORT DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC) { - int preferred, i; + int i; DisplayModePtr Modes = NULL, Mode; ddc_quirk_t quirks; + Bool preferred; xf86DrvMsg (scrnIndex, X_INFO, "EDID vendor \"%s\", prod id %d\n", DDC->vendor.name, DDC->vendor.prod_id); @@ -480,8 +497,10 @@ xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC) quirks = xf86DDCDetectQuirks(scrnIndex, DDC, TRUE); preferred = PREFERRED_TIMING_MODE(DDC->features.msc); - if (quirks & DDC_QUIRK_PREFER_LARGE_60) - preferred = 0; + if (quirks & DDC_QUIRK_FIRST_DETAILED_PREFERRED) + preferred = TRUE; + if (quirks & (DDC_QUIRK_PREFER_LARGE_60 | DDC_QUIRK_PREFER_LARGE_75)) + preferred = FALSE; for (i = 0; i < DET_TIMINGS; i++) { struct detailed_monitor_section *det_mon = &DDC->det_mon[i]; @@ -492,7 +511,7 @@ xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC) &det_mon->section.d_timings, preferred, quirks); - preferred = 0; + preferred = FALSE; Modes = xf86ModesAdd(Modes, Mode); break; case DS_STD_TIMINGS: diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index d58cc7070..2c0dc3120 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -426,8 +426,18 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen) xf86OutputPtr output = config->output[config->compat_output]; xf86CrtcPtr crtc = output->crtc; - if (crtc && crtc->mode.HDisplay && - output->mm_width && output->mm_height) + if (output->conf_monitor && + (output->conf_monitor->mon_width > 0 && + output->conf_monitor->mon_height > 0)) + { + /* + * Prefer user configured DisplaySize + */ + mmWidth = output->conf_monitor->mon_width; + mmHeight = output->conf_monitor->mon_height; + } + else if (crtc && crtc->mode.HDisplay && + output->mm_width && output->mm_height) { /* * If the output has a mode and a declared size, use that diff --git a/hw/xfree86/os-support/linux/lnx_acpi.c b/hw/xfree86/os-support/linux/lnx_acpi.c index 024e6ef09..bb975cc5d 100644 --- a/hw/xfree86/os-support/linux/lnx_acpi.c +++ b/hw/xfree86/os-support/linux/lnx_acpi.c @@ -23,11 +23,11 @@ #define ACPI_VIDEO_NOTIFY_NEXT_OUTPUT 0x83 #define ACPI_VIDEO_NOTIFY_PREV_OUTPUT 0x84 -#define ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS 0x82 -#define ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS 0x83 -#define ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS 0x84 -#define ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS 0x85 -#define ACPI_VIDEO_NOTIFY_DISPLAY_OFF 0x86 +#define ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS 0x85 +#define ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS 0x86 +#define ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS 0x87 +#define ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS 0x88 +#define ACPI_VIDEO_NOTIFY_DISPLAY_OFF 0x89 #define ACPI_VIDEO_HEAD_INVALID (~0u - 1) #define ACPI_VIDEO_HEAD_END (~0u) @@ -69,9 +69,11 @@ lnxACPIGetEventFromOs(int fd, pmEvent *events, int num) TimerSet(NULL, 0, ACPI_REOPEN_DELAY, lnxACPIReopen, NULL); return 0; } + /* FIXME: this only processes the first read ACPI event & might break + * with interrupted reads. */ /* Check that we have a video event */ - if (strstr(ev, "video") == ev) { + if (!strncmp(ev, "video", 5)) { char *video = NULL; char *GFX = NULL; char *notify = NULL; @@ -97,26 +99,19 @@ lnxACPIGetEventFromOs(int fd, pmEvent *events, int num) ErrorF("data: 0x%lx\n",data_l); #endif - /* We currently don't differentiate between any event */ + /* Differentiate between events */ switch (notify_l) { case ACPI_VIDEO_NOTIFY_SWITCH: - break; - case ACPI_VIDEO_NOTIFY_PROBE: - break; case ACPI_VIDEO_NOTIFY_CYCLE: - break; case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT: - break; case ACPI_VIDEO_NOTIFY_PREV_OUTPUT: - break; + events[0] = XF86_APM_CAPABILITY_CHANGED; + return 1; + case ACPI_VIDEO_NOTIFY_PROBE: + return 0; default: - break; + return 0; } - - /* Deal with all ACPI events as a capability change */ - events[0] = XF86_APM_CAPABILITY_CHANGED; - - return 1; } return 0; diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c index 83590bced..61a325f3c 100644 --- a/hw/xnest/Screen.c +++ b/hw/xnest/Screen.c @@ -45,10 +45,6 @@ is" without express or implied warranty. Window xnestDefaultWindows[MAXSCREENS]; Window xnestScreenSaverWindows[MAXSCREENS]; -#ifdef GLXEXT -extern void GlxWrapInitVisuals(miInitVisualsProcPtr *); -#endif - ScreenPtr xnestScreen(Window window) { @@ -220,17 +216,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) defaultVisual = visuals[xnestDefaultVisualIndex].vid; rootDepth = visuals[xnestDefaultVisualIndex].nplanes; -#ifdef GLXEXT - { - miInitVisualsProcPtr proc = NULL; - - GlxWrapInitVisuals(&proc); - /* GlxInitVisuals ignores the last three arguments. */ - proc(&visuals, &depths, &numVisuals, &numDepths, - &rootDepth, &defaultVisual, 0, 0, 0); - } -#endif - if (xnestParentWindow != 0) { XGetWindowAttributes(xnestDisplay, xnestParentWindow, &gattributes); xnestWidth = gattributes.width; |