diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2015-10-28 19:12:47 +0000 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2015-10-28 19:12:47 +0000 |
commit | a30f0cf0b8ea474000ba7aac685581f69c917223 (patch) | |
tree | f575ca1f3a68515bbca9d19161aba57118055258 | |
parent | fb4e99d8ae5a25c8775a56b3c8a78fd37a8dd7bd (diff) | |
parent | 780022a8a5d6f8abd02f8b568f522ce5aed99839 (diff) |
Merge tag 'xorg-server-1.17.3' into cygwin-release-1.17
xorg-server-1.17.3
123 files changed, 633 insertions, 654 deletions
diff --git a/Xext/xace.c b/Xext/xace.c index d77b3126a..b3c67f632 100644 --- a/Xext/xace.c +++ b/Xext/xace.c @@ -213,6 +213,21 @@ XaceHook(int hook, ...) return prv ? *prv : Success; } +/* XaceHookIsSet + * + * Utility function to determine whether there are any callbacks listening on a + * particular XACE hook. + * + * Returns non-zero if there is a callback, zero otherwise. + */ +int +XaceHookIsSet(int hook) +{ + if (hook < 0 || hook >= XACE_NUM_HOOKS) + return 0; + return XaceHooks[hook] != NULL; +} + /* XaceCensorImage * * Called after pScreen->GetImage to prevent pieces or trusted windows from diff --git a/Xext/xace.h b/Xext/xace.h index 5e6cb0437..3303f76bc 100644 --- a/Xext/xace.h +++ b/Xext/xace.h @@ -65,6 +65,9 @@ extern _X_EXPORT int XaceHook(int /*hook */ , ... /*appropriate args for hook */ ); +/* determine whether any callbacks are present for the XACE hook */ +extern _X_EXPORT int XaceHookIsSet(int hook); + /* Special-cased hook functions */ extern _X_EXPORT int XaceHookDispatch(ClientPtr ptr, int major); diff --git a/Xext/xselinux_hooks.c b/Xext/xselinux_hooks.c index 48219a9e0..e69bfe7ae 100644 --- a/Xext/xselinux_hooks.c +++ b/Xext/xselinux_hooks.c @@ -147,7 +147,7 @@ SELinuxLabelClient(ClientPtr client) strncpy(subj->command, cmdname, COMMAND_LEN - 1); if (!cached) - free(cmdname); /* const char * */ + free((void *) cmdname); /* const char * */ } finish: @@ -295,6 +295,9 @@ SELinuxAudit(void *auditdata, } static int +SELinuxLog(int type, const char *fmt, ...) _X_ATTRIBUTE_PRINTF(2, 3); + +static int SELinuxLog(int type, const char *fmt, ...) { va_list ap; @@ -316,6 +319,7 @@ SELinuxLog(int type, const char *fmt, ...) va_start(ap, fmt); vsnprintf(buf, MAX_AUDIT_MESSAGE_LENGTH, fmt, ap); rc = audit_log_user_avc_message(audit_fd, aut, buf, NULL, NULL, NULL, 0); + (void) rc; va_end(ap); LogMessageVerb(X_WARNING, 0, "%s", buf); return 0; @@ -476,7 +480,7 @@ SELinuxExtension(CallbackListPtr *pcbl, void *unused, void *calldata) } /* Perform the security check */ - auditdata.extension = rec->ext->name; + auditdata.extension = (char *) rec->ext->name; rc = SELinuxDoCheck(subj, obj, SECCLASS_X_EXTENSION, rec->access_mode, &auditdata); if (rc != Success) diff --git a/Xi/exevents.c b/Xi/exevents.c index 0857bcee6..21fb69696 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1730,6 +1730,18 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device) break; } + /* send KeyPress and KeyRelease events to XACE plugins */ + if (XaceHookIsSet(XACE_KEY_AVAIL) && + (event->type == ET_KeyPress || event->type == ET_KeyRelease)) { + xEvent *core; + int count; + + if (EventToCore(ev, &core, &count) == Success && count > 0) { + XaceHook(XACE_KEY_AVAIL, core, device, 0); + free(core); + } + } + if (DeviceEventCallback && !syncEvents.playingEvents) { DeviceEventInfoRec eventinfo; SpritePtr pSprite = device->spriteInfo->sprite; diff --git a/configure.ac b/configure.ac index d89a6c089..cb6df31bd 100644 --- a/configure.ac +++ b/configure.ac @@ -26,9 +26,9 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.60) -AC_INIT([xorg-server], 1.17.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2015-06-16" -RELEASE_NAME="lambic" +AC_INIT([xorg-server], 1.17.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2015-10-26" +RELEASE_NAME="Pumpkin Spice Latte" AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) diff --git a/dix/Xserver.d b/dix/Xserver.d index 248d48e24..f4f229d84 100644 --- a/dix/Xserver.d +++ b/dix/Xserver.d @@ -31,6 +31,9 @@ #include <sys/types.h> #endif +typedef const uint8_t *const_uint8_p; +typedef const double *const_double_p; + provider Xserver { /* reqType, data, length, client id, request buffer */ probe request__start(string, uint8_t, uint16_t, int, void *); @@ -49,7 +52,7 @@ provider Xserver { /* client id, event type, event* */ probe send__event(int, uint8_t, void *); /* deviceid, type, button/keycode/touchid, flags, nvalues, mask, values */ - probe input__event(int, int, uint32_t, uint32_t, int8_t, uint8_t*, double*); + probe input__event(int, int, uint32_t, uint32_t, int8_t, const_uint8_p, const_double_p); }; #pragma D attributes Unstable/Unstable/Common provider Xserver provider diff --git a/dix/dispatch.c b/dix/dispatch.c index 106d5f4c2..d77d37c4e 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -131,10 +131,7 @@ int ProcInitialConnection(); #ifdef XSERVER_DTRACE #include "registry.h" -#include <sys/types.h> -typedef const char *string; - -#include "Xserver-dtrace.h" +#include "probes.h" #endif #define mskcnt ((MAXCLIENTS + 31) / 32) diff --git a/dix/dixfonts.c b/dix/dixfonts.c index bc2732fb9..ddcb18bc1 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -314,8 +314,6 @@ doOpenFont(ClientPtr client, OFclosurePtr c) if (err == Suspended) { if (!ClientIsAsleep(client)) ClientSleep(client, (ClientSleepProcPtr) doOpenFont, c); - else - goto xinerama_sleep; return TRUE; } break; @@ -363,7 +361,6 @@ doOpenFont(ClientPtr client, OFclosurePtr c) c->fontid, FontToXError(err)); } ClientWakeup(c->client); - xinerama_sleep: for (i = 0; i < c->num_fpes; i++) { FreeFPE(c->fpe_list[i]); } @@ -596,8 +593,6 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) if (!ClientIsAsleep(client)) ClientSleep(client, (ClientSleepProcPtr) doListFontsAndAliases, c); - else - goto xinerama_sleep; return TRUE; } @@ -623,8 +618,6 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) ClientSleep(client, (ClientSleepProcPtr) doListFontsAndAliases, c); - else - goto xinerama_sleep; return TRUE; } if (err == Successful) @@ -642,8 +635,6 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) ClientSleep(client, (ClientSleepProcPtr) doListFontsAndAliases, c); - else - goto xinerama_sleep; return TRUE; } if (err == FontNameAlias) { @@ -788,7 +779,6 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) bail: ClientWakeup(client); - xinerama_sleep: for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); free(c->fpe_list); @@ -888,8 +878,6 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) if (!ClientIsAsleep(client)) ClientSleep(client, (ClientSleepProcPtr) doListFontsWithInfo, c); - else - goto xinerama_sleep; return TRUE; } if (err == Successful) @@ -905,8 +893,6 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) if (!ClientIsAsleep(client)) ClientSleep(client, (ClientSleepProcPtr) doListFontsWithInfo, c); - else - goto xinerama_sleep; return TRUE; } } @@ -1040,7 +1026,6 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) WriteSwappedDataToClient(client, length, &finalReply); bail: ClientWakeup(client); - xinerama_sleep: for (i = 0; i < c->num_fpes; i++) FreeFPE(c->fpe_list[i]); free(c->reply); @@ -1297,8 +1282,6 @@ doPolyText(ClientPtr client, PTclosurePtr c) client_state = START_SLEEP; continue; /* on to steps 3 and 4 */ } - else - goto xinerama_sleep; return TRUE; } else if (lgerr != Successful) { @@ -1352,7 +1335,6 @@ doPolyText(ClientPtr client, PTclosurePtr c) } if (ClientIsAsleep(client)) { ClientWakeup(c->client); - xinerama_sleep: ChangeGC(NullClient, c->pGC, clearGCmask, clearGC); /* Unreference the font from the scratch GC */ @@ -1477,8 +1459,6 @@ doImageText(ClientPtr client, ITclosurePtr c) ClientSleep(client, (ClientSleepProcPtr) doImageText, c); } - else - goto xinerama_sleep; return TRUE; } else if (lgerr != Successful) { @@ -1501,7 +1481,6 @@ doImageText(ClientPtr client, ITclosurePtr c) } if (ClientIsAsleep(client)) { ClientWakeup(c->client); - xinerama_sleep: ChangeGC(NullClient, c->pGC, clearGCmask, clearGC); /* Unreference the font from the scratch GC */ diff --git a/dix/events.c b/dix/events.c index 250061568..150620f59 100644 --- a/dix/events.c +++ b/dix/events.c @@ -125,13 +125,7 @@ Equipment Corporation. #include <X11/extensions/XKBproto.h> #include "xkbsrv.h" #include "xace.h" - -#ifdef XSERVER_DTRACE -#include <sys/types.h> -typedef const char *string; - -#include "Xserver-dtrace.h" -#endif +#include "probes.h" #include <X11/extensions/XIproto.h> #include <X11/extensions/XI2proto.h> diff --git a/dix/getevents.c b/dix/getevents.c index 6fb12c5c1..bc7ffa63b 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -68,12 +68,7 @@ #include "exevents.h" #include "extnsionst.h" #include "listdev.h" /* for sizing up DeviceClassesChangedEvent */ - -#if XSERVER_DTRACE -#include <sys/types.h> -typedef const char *string; -#include <Xserver-dtrace.h> -#endif +#include "probes.h" /* Number of motion history events to store. */ #define MOTION_HISTORY_SIZE 256 diff --git a/dix/main.c b/dix/main.c index 09f9504b8..7c6ac943f 100644 --- a/dix/main.c +++ b/dix/main.c @@ -337,6 +337,7 @@ dix_main(int argc, char *argv[], char *envp[]) for (i = screenInfo.numGPUScreens - 1; i >= 0; i--) { ScreenPtr pScreen = screenInfo.gpuscreens[i]; FreeScratchPixmapsForScreen(pScreen); + dixFreeScreenSpecificPrivates(pScreen); (*pScreen->CloseScreen) (pScreen); dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN); free(pScreen); diff --git a/dix/privates.c b/dix/privates.c index e03b2255b..969d0141c 100644 --- a/dix/privates.c +++ b/dix/privates.c @@ -642,6 +642,15 @@ dixRegisterScreenSpecificPrivateKey(ScreenPtr pScreen, DevPrivateKey key, void dixFreeScreenSpecificPrivates(ScreenPtr pScreen) { + DevPrivateType t; + + for (t = PRIVATE_XSELINUX; t < PRIVATE_LAST; t++) { + DevPrivateKey key; + + for (key = pScreen->screenSpecificPrivates[t].key; key; key = key->next) { + key->initialized = FALSE; + } + } } /* Initialize screen-specific privates in AddScreen */ diff --git a/dix/protocol.txt b/dix/protocol.txt index c22379581..731844c15 100644 --- a/dix/protocol.txt +++ b/dix/protocol.txt @@ -6,20 +6,6 @@ # # This is a security-sensitive file, please set permissions as appropriate. # -R001 Adobe-DPS-Extension:Init -R002 Adobe-DPS-Extension:CreateContext -R003 Adobe-DPS-Extension:CreateSpace -R004 Adobe-DPS-Extension:GiveInput -R005 Adobe-DPS-Extension:GetStatus -R006 Adobe-DPS-Extension:DestroySpace -R007 Adobe-DPS-Extension:Reset -R008 Adobe-DPS-Extension:NotifyContext -R009 Adobe-DPS-Extension:CreateContextFromID -R010 Adobe-DPS-Extension:XIDFromContext -R011 Adobe-DPS-Extension:ContextFromXID -R012 Adobe-DPS-Extension:SetStatusMask -R013 Adobe-DPS-Extension:CreateSecureContext -R014 Adobe-DPS-Extension:NotifyWhenReady R000 Apple-DRI:QueryVersion R001 Apple-DRI:QueryDirectRenderingCapable R002 Apple-DRI:CreateSurface @@ -65,22 +51,6 @@ R003 DAMAGE:Subtract R004 DAMAGE:Add V000 DAMAGE:Notify E000 DAMAGE:BadDamage -R000 DEC-XTRAP:Reset -R001 DEC-XTRAP:GetAvailable -R002 DEC-XTRAP:Config -R003 DEC-XTRAP:StartTrap -R004 DEC-XTRAP:StopTrap -R005 DEC-XTRAP:GetCurrent -R006 DEC-XTRAP:GetStatistics -R007 DEC-XTRAP:SimulateXEvent -R008 DEC-XTRAP:GetVersion -R009 DEC-XTRAP:GetLastInpTime -V000 DEC-XTRAP:Event -E002 DEC-XTRAP:BadIO -E004 DEC-XTRAP:BadStatistics -E005 DEC-XTRAP:BadDevices -E007 DEC-XTRAP:BadScreen -E008 DEC-XTRAP:BadSwapReq R000 DMX:DMXQueryVersion R001 DMX:DMXGetScreenCount R002 DMX:DMXGetScreenInfoDEPRECATED @@ -124,6 +94,19 @@ R004 DRI2:DestroyDrawable R005 DRI2:GetBuffers R006 DRI2:CopyRegion R007 DRI2:GetBuffersWithFormat +R008 DRI2:SwapBuffers +R009 DRI2:GetMSC +R010 DRI2:WaitMSC +R011 DRI2:WaitSBC +R012 DRI2:SwapInterval +V000 DRI2:BufferSwapComplete +V001 DRI2:InvalidateBuffers +R000 DRI3:QueryVersion +R001 DRI3:Open +R002 DRI3:PixmapFromBuffer +R003 DRI3:BufferFromPixmap +R004 DRI3:FenceFromFD +R005 DRI3:FDFromFence R000 Extended-Visual-Information:QueryVersion R001 Extended-Visual-Information:GetVisualInfo R000 FontCache:QueryVersion @@ -152,6 +135,20 @@ R017 GLX:VendorPrivateWithReply R018 GLX:QueryExtensionsString R019 GLX:QueryServerString R020 GLX:ClientInfo +R021 GLX:GetFBConfigs +R022 GLX:CreatePixmap +R023 GLX:DestroyPixmap +R024 GLX:CreateNewContext +R025 GLX:QueryContext +R026 GLX:MakeContextCurrent +R027 GLX:CreatePbuffer +R028 GLX:DestroyPbuffer +R029 GLX:GetDrawableAttributes +R030 GLX:ChangeDrawableAttributes +R031 GLX:CreateWindow +R032 GLX:DeleteWindow +R033 GLX:SetClientInfoARB +R034 GLX:CreateContextAttribsARB R101 GLX:NewList R102 GLX:EndList R103 GLX:DeleteLists @@ -194,6 +191,26 @@ R139 GLX:GetTexLevelParameteriv R140 GLX:IsEnabled R141 GLX:IsList R142 GLX:Flush +R143 GLX:AreTexturesResident +R144 GLX:DeleteTextures +R145 GLX:GenTextures +R146 GLX:IsTexture +R147 GLX:GetColorTable +R148 GLX:GetColorTableParameterfv +R149 GLX:GetColorTableParameterfv +R150 GLX:GetConvolutionFilter +R151 GLX:GetConvolutionParameterfv +R152 GLX:GetConvolutionParameteriv +R153 GLX:GetSeparableFilter +R154 GLX:GetHistogram +R155 GLX:GetHistogramParameterfv +R156 GLX:GetHistogramParameteriv +R157 GLX:GetMinmax +R158 GLX:GetMinmaxParameterfv +R159 GLX:GetMinmaxParameteriv +R160 GLX:GetCompressedTexImage +V000 GLX:PbufferClobber +V001 GLX:BufferSwapComplete E000 GLX:BadContext E001 GLX:BadContextState E002 GLX:BadDrawable @@ -203,51 +220,10 @@ E005 GLX:BadCurrentWindow E006 GLX:BadRenderRequest E007 GLX:BadLargeRequest E008 GLX:UnsupportedPrivateRequest -R000 LBX:QueryVersion -R001 LBX:StartProxy -R002 LBX:StopProxy -R003 LBX:Switch -R004 LBX:NewClient -R005 LBX:CloseClient -R006 LBX:ModifySequence -R007 LBX:AllowMotion -R008 LBX:IncrementPixel -R009 LBX:Delta -R010 LBX:GetModifierMapping -R011 LBX:QueryTag -R012 LBX:InvalidateTag -R013 LBX:PolyPoint -R014 LBX:PolyLine -R015 LBX:PolySegment -R016 LBX:PolyRectangle -R017 LBX:PolyArc -R018 LBX:FillPoly -R019 LBX:PolyFillRectangle -R020 LBX:PolyFillArc -R021 LBX:GetKeyboardMapping -R022 LBX:QueryFont -R023 LBX:ChangeProperty -R024 LBX:GetProperty -R025 LBX:TagData -R026 LBX:CopyArea -R027 LBX:CopyPlane -R028 LBX:PolyText8 -R029 LBX:PolyText16 -R030 LBX:ImageText8 -R031 LBX:ImageText16 -R032 LBX:QueryExtension -R033 LBX:PutImage -R034 LBX:GetImage -R035 LBX:BeginLargeRequest -R036 LBX:LargeRequestData -R037 LBX:EndLargeRequest -R038 LBX:InternAtoms -R039 LBX:GetWinAttrAndGeom -R040 LBX:GrabCmap -R041 LBX:ReleaseCmap -R042 LBX:AllocColor -R043 LBX:Sync -E000 LBX:BadLbxClient +E009 GLX:BadFBConfig +E010 GLX:BadPbuffer +E011 GLX:BadCurrentDrawable +E012 GLX:BadWindow R000 MIT-SCREEN-SAVER:QueryVersion R001 MIT-SCREEN-SAVER:QueryInfo R002 MIT-SCREEN-SAVER:SelectInput @@ -261,24 +237,17 @@ R002 MIT-SHM:Detach R003 MIT-SHM:PutImage R004 MIT-SHM:GetImage R005 MIT-SHM:CreatePixmap +R006 MIT-SHM:AttachFd +R007 MIT-SHM:CreateSegment V000 MIT-SHM:Completion E000 MIT-SHM:BadShmSeg R000 MIT-SUNDRY-NONSTANDARD:SetBugMode R001 MIT-SUNDRY-NONSTANDARD:GetBugMode -R000 Multi-Buffering:GetBufferVersion -R001 Multi-Buffering:CreateImageBuffers -R002 Multi-Buffering:DestroyImageBuffers -R003 Multi-Buffering:DisplayImageBuffers -R004 Multi-Buffering:SetMBufferAttributes -R005 Multi-Buffering:GetMBufferAttributes -R006 Multi-Buffering:SetBufferAttributes -R007 Multi-Buffering:GetBufferAttributes -R008 Multi-Buffering:GetBufferInfo -R009 Multi-Buffering:CreateStereoWindow -R010 Multi-Buffering:ClearImageBufferArea -V000 Multi-Buffering:ClobberNotify -V001 Multi-Buffering:UpdateNotify -E000 Multi-Buffering:BadBuffer +R000 Present:QueryVersion +R001 Present:Pixmap +R002 Present:NotifyMSC +R003 Present:SelectInput +R004 Present:QueryCapabilities R000 RANDR:QueryVersion R001 RANDR:OldGetScreenInfo R002 RANDR:SetScreenConfig @@ -628,125 +597,6 @@ E014 X11:BadIDChoice E015 X11:BadName E016 X11:BadLength E017 X11:BadImplementation -R001 X3D-PEX:GetExtensionInfo -R002 X3D-PEX:GetEnumeratedTypeInfo -R003 X3D-PEX:GetImpDepConstants -R004 X3D-PEX:CreateLookupTable -R005 X3D-PEX:CopyLookupTable -R006 X3D-PEX:FreeLookupTable -R007 X3D-PEX:GetTableInfo -R008 X3D-PEX:GetPredefinedEntries -R009 X3D-PEX:GetDefinedIndices -R010 X3D-PEX:GetTableEntry -R011 X3D-PEX:GetTableEntries -R012 X3D-PEX:SetTableEntries -R013 X3D-PEX:DeleteTableEntries -R014 X3D-PEX:CreatePipelineContext -R015 X3D-PEX:CopyPipelineContext -R016 X3D-PEX:FreePipelineContext -R017 X3D-PEX:GetPipelineContext -R018 X3D-PEX:ChangePipelineContext -R019 X3D-PEX:CreateRenderer -R020 X3D-PEX:FreeRenderer -R021 X3D-PEX:ChangeRenderer -R022 X3D-PEX:GetRendererAttributes -R023 X3D-PEX:GetRendererDynamics -R024 X3D-PEX:BeginRendering -R025 X3D-PEX:EndRendering -R026 X3D-PEX:BeginStructure -R027 X3D-PEX:EndStructure -R028 X3D-PEX:OutputCommands -R029 X3D-PEX:Network -R030 X3D-PEX:CreateStructure -R031 X3D-PEX:CopyStructure -R032 X3D-PEX:DestroyStructures -R033 X3D-PEX:GetStructureInfo -R034 X3D-PEX:GetElementInfo -R035 X3D-PEX:GetStructuresInNetwork -R036 X3D-PEX:GetAncestors -R037 X3D-PEX:GetDescendants -R038 X3D-PEX:FetchElements -R039 X3D-PEX:SetEditingMode -R040 X3D-PEX:SetElementPointer -R041 X3D-PEX:SetElementPointerAtLabel -R042 X3D-PEX:ElementSearch -R043 X3D-PEX:StoreElements -R044 X3D-PEX:DeleteElements -R045 X3D-PEX:DeleteElementsToLabel -R046 X3D-PEX:DeleteBetweenLabels -R047 X3D-PEX:CopyElements -R048 X3D-PEX:ChangeStructureRefs -R049 X3D-PEX:CreateNameSet -R050 X3D-PEX:CopyNameSet -R051 X3D-PEX:FreeNameSet -R052 X3D-PEX:GetNameSet -R053 X3D-PEX:ChangeNameSet -R054 X3D-PEX:CreateSearchContext -R055 X3D-PEX:CopySearchContext -R056 X3D-PEX:FreeSearchContext -R057 X3D-PEX:GetSearchContext -R058 X3D-PEX:ChangeSearchContext -R059 X3D-PEX:SearchNetwork -R060 X3D-PEX:CreatePhigsWks -R061 X3D-PEX:FreePhigsWks -R062 X3D-PEX:GetWksInfo -R063 X3D-PEX:GetDynamics -R064 X3D-PEX:GetViewRep -R065 X3D-PEX:RedrawAllStructures -R066 X3D-PEX:UpdateWorkstation -R067 X3D-PEX:RedrawClipRegion -R068 X3D-PEX:ExecuteDeferredActions -R069 X3D-PEX:SetViewPriority -R070 X3D-PEX:SetDisplayUpdateMode -R071 X3D-PEX:MapDCtoWC -R072 X3D-PEX:MapWCtoDC -R073 X3D-PEX:SetViewRep -R074 X3D-PEX:SetWksWindow -R075 X3D-PEX:SetWksViewport -R076 X3D-PEX:SetHlhsrMode -R077 X3D-PEX:SetWksBufferMode -R078 X3D-PEX:PostStructure -R079 X3D-PEX:UnpostStructure -R080 X3D-PEX:UnpostAllStructures -R081 X3D-PEX:GetWksPostings -R082 X3D-PEX:GetPickDevice -R083 X3D-PEX:ChangePickDevice -R084 X3D-PEX:CreatePickMeasure -R085 X3D-PEX:FreePickMeasure -R086 X3D-PEX:GetPickMeasure -R087 X3D-PEX:UpdatePickMeasure -R088 X3D-PEX:OpenFont -R089 X3D-PEX:CloseFont -R090 X3D-PEX:QueryFont -R091 X3D-PEX:ListFonts -R092 X3D-PEX:ListFontsWithInfo -R093 X3D-PEX:QueryTextExtents -R094 X3D-PEX:MatchRenderingTargets -R095 X3D-PEX:Escape -R096 X3D-PEX:EscapeWithReply -R097 X3D-PEX:Elements -R098 X3D-PEX:AccumulateState -R099 X3D-PEX:BeginPickOne -R100 X3D-PEX:EndPickOne -R101 X3D-PEX:PickOne -R102 X3D-PEX:BeginPickAll -R103 X3D-PEX:EndPickAll -R104 X3D-PEX:PickAll -E000 X3D-PEX:ColorTypeError -E001 X3D-PEX:erStateError -E002 X3D-PEX:FloatingPointFormatError -E003 X3D-PEX:LabelError -E004 X3D-PEX:LookupTableError -E005 X3D-PEX:NameSetError -E006 X3D-PEX:PathError -E007 X3D-PEX:FontError -E008 X3D-PEX:PhigsWksError -E009 X3D-PEX:PickMeasureError -E010 X3D-PEX:PipelineContextError -E011 X3D-PEX:erError -E012 X3D-PEX:SearchContextError -E013 X3D-PEX:StructureError -E014 X3D-PEX:OutputCommandError R000 XC-APPGROUP:QueryVersion R001 XC-APPGROUP:Create R002 XC-APPGROUP:Destroy @@ -890,39 +740,6 @@ E003 XFree86-VidModeExtension:ModeUnsuitable E004 XFree86-VidModeExtension:ExtensionDisabled E005 XFree86-VidModeExtension:ClientNotLocal E006 XFree86-VidModeExtension:ZoomLocked -R001 XIE:QueryImageExtension -R002 XIE:QueryTechniques -R003 XIE:CreateColorList -R004 XIE:DestroyColorList -R005 XIE:PurgeColorList -R006 XIE:QueryColorList -R007 XIE:CreateLUT -R008 XIE:DestroyLUT -R009 XIE:CreatePhotomap -R010 XIE:DestroyPhotomap -R011 XIE:QueryPhotomap -R012 XIE:CreateROI -R013 XIE:DestroyROI -R014 XIE:CreatePhotospace -R015 XIE:DestroyPhotospace -R016 XIE:ExecuteImmediate -R017 XIE:CreatePhotoflo -R018 XIE:DestroyPhotoflo -R019 XIE:ExecutePhotoflo -R020 XIE:ModifyPhotoflo -R021 XIE:RedefinePhotoflo -R022 XIE:PutClientData -R023 XIE:GetClientData -R024 XIE:QueryPhotoflo -R025 XIE:Await -R026 XIE:Abort -E000 XIE:ColorListError -E001 XIE:LUTError -E002 XIE:PhotofloError -E003 XIE:PhotomapError -E004 XIE:PhotospaceError -E005 XIE:ROIError -E006 XIE:FloError R000 XINERAMA:QueryVersion R001 XINERAMA:GetState R002 XINERAMA:GetScreenCount diff --git a/dix/resource.c b/dix/resource.c index 26debdb00..964f0b306 100644 --- a/dix/resource.c +++ b/dix/resource.c @@ -144,10 +144,7 @@ Equipment Corporation. #include "gcstruct.h" #ifdef XSERVER_DTRACE -#include <sys/types.h> -typedef const char *string; - -#include "Xserver-dtrace.h" +#include "probes.h" #define TypeNameString(t) LookupResourceName(t) #endif diff --git a/exa/exa_render.c b/exa/exa_render.c index e3e552697..fc3ddea79 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -636,7 +636,7 @@ exaTryDriverComposite(CARD8 op, RegionRec region; BoxPtr pbox; int nbox; - int src_off_x, src_off_y, mask_off_x, mask_off_y, dst_off_x, dst_off_y; + int src_off_x, src_off_y, mask_off_x = 0, mask_off_y = 0, dst_off_x, dst_off_y; PixmapPtr pSrcPix = NULL, pMaskPix = NULL, pDstPix; ExaPixmapPrivPtr pSrcExaPix = NULL, pMaskExaPix = NULL, pDstExaPix; @@ -472,13 +472,8 @@ typedef struct { #define fbGetWindowPixmap(pWin) ((PixmapPtr)\ dixLookupPrivate(&((WindowPtr)(pWin))->devPrivates, fbGetWinPrivateKey(pWin))) -#ifdef ROOTLESS #define __fbPixDrawableX(pPix) ((pPix)->drawable.x) #define __fbPixDrawableY(pPix) ((pPix)->drawable.y) -#else -#define __fbPixDrawableX(pPix) 0 -#define __fbPixDrawableY(pPix) 0 -#endif #ifdef COMPOSITE #define __fbPixOffXWin(pPix) (__fbPixDrawableX(pPix) - (pPix)->screen_x) diff --git a/fb/fbpict.c b/fb/fbpict.c index c8378ad90..5f6c88ec8 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -345,6 +345,11 @@ static pixman_image_t *image_from_pict_internal(PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map); +static void image_destroy(pixman_image_t *image, void *data) +{ + fbFinishAccess((DrawablePtr)data); +} + static void set_image_properties(pixman_image_t * image, PicturePtr pict, Bool has_clip, int *xoff, int *yoff, Bool is_alpha_map) @@ -429,6 +434,10 @@ set_image_properties(pixman_image_t * image, PicturePtr pict, Bool has_clip, break; } + if (pict->pDrawable) + pixman_image_set_destroy_function(image, &image_destroy, + pict->pDrawable); + pixman_image_set_filter(image, filter, (pixman_fixed_t *) pict->filter_params, pict->filter_nparams); @@ -481,8 +490,8 @@ image_from_pict(PicturePtr pict, Bool has_clip, int *xoff, int *yoff) void free_pixman_pict(PicturePtr pict, pixman_image_t * image) { - if (image && pixman_image_unref(image) && pict->pDrawable) - fbFinishAccess(pict->pDrawable); + if (image) + pixman_image_unref(image); } Bool diff --git a/glamor/glamor.c b/glamor/glamor.c index a8cc810d1..6c2ff28d9 100644 --- a/glamor/glamor.c +++ b/glamor/glamor.c @@ -207,7 +207,6 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth, if (fbo == NULL) { fbDestroyPixmap(pixmap); - free(pixmap_priv); return fbCreatePixmap(screen, w, h, depth, usage); } @@ -379,6 +378,20 @@ glamor_init(ScreenPtr screen, unsigned int flags) goto fail; } + glamor_priv->saved_procs.close_screen = screen->CloseScreen; + screen->CloseScreen = glamor_close_screen; + + /* If we are using egl screen, call egl screen init to + * register correct close screen function. */ + if (flags & GLAMOR_USE_EGL_SCREEN) { + glamor_egl_screen_init(screen, &glamor_priv->ctx); + } else { + if (!glamor_glx_screen_init(&glamor_priv->ctx)) + goto fail; + } + + glamor_make_current(glamor_priv); + if (epoxy_is_desktop_gl()) glamor_priv->gl_flavor = GLAMOR_GL_DESKTOP; else @@ -463,18 +476,6 @@ glamor_init(ScreenPtr screen, unsigned int flags) glamor_set_debug_level(&glamor_debug_level); - glamor_priv->saved_procs.close_screen = screen->CloseScreen; - screen->CloseScreen = glamor_close_screen; - - /* If we are using egl screen, call egl screen init to - * register correct close screen function. */ - if (flags & GLAMOR_USE_EGL_SCREEN) { - glamor_egl_screen_init(screen, &glamor_priv->ctx); - } else { - if (!glamor_glx_screen_init(&glamor_priv->ctx)) - goto fail; - } - glamor_priv->saved_procs.create_screen_resources = screen->CreateScreenResources; screen->CreateScreenResources = glamor_create_screen_resources; diff --git a/glamor/glamor_font.c b/glamor/glamor_font.c index cc0fecf7a..6b3a16abc 100644 --- a/glamor/glamor_font.c +++ b/glamor/glamor_font.c @@ -45,6 +45,7 @@ glamor_font_get(ScreenPtr screen, FontPtr font) unsigned char c[2]; CharInfoPtr glyph; unsigned long count; + char *bits; if (glamor_priv->glsl_version < 130) return NULL; @@ -62,8 +63,6 @@ glamor_font_get(ScreenPtr screen, FontPtr font) if (glamor_font->realized) return glamor_font; - glamor_font->realized = TRUE; - /* Figure out how many glyphs are in the font */ num_cols = font->info.lastCol - font->info.firstCol + 1; num_rows = font->info.lastRow - font->info.firstRow + 1; @@ -81,6 +80,10 @@ glamor_font_get(ScreenPtr screen, FontPtr font) overall_width = glyph_width_bytes * num_cols; overall_height = glyph_height * num_rows; + bits = malloc(overall_width * overall_height); + if (!bits) + return NULL; + /* Check whether the font has a default character */ c[0] = font->info.lastRow + 1; c[1] = font->info.lastCol + 1; @@ -100,12 +103,6 @@ glamor_font_get(ScreenPtr screen, FontPtr font) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - /* Allocate storage */ - glTexImage2D(GL_TEXTURE_2D, 0, GL_R8UI, overall_width, overall_height, - 0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, NULL); - - glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - /* Paint all of the glyphs */ for (row = 0; row < num_rows; row++) { for (col = 0; col < num_cols; col++) { @@ -114,13 +111,29 @@ glamor_font_get(ScreenPtr screen, FontPtr font) (*font->get_glyphs)(font, 1, c, TwoD16Bit, &count, &glyph); - if (count) - glTexSubImage2D(GL_TEXTURE_2D, 0, col * glyph_width_bytes, row * glyph_height, - GLYPHWIDTHBYTES(glyph), GLYPHHEIGHTPIXELS(glyph), - GL_RED_INTEGER, GL_UNSIGNED_BYTE, glyph->bits); + if (count) { + char *dst = bits + row * glyph_height * overall_width + + col * glyph_width_bytes; + char *src = glyph->bits; + unsigned y; + + for (y = 0; y < GLYPHHEIGHTPIXELS(glyph); y++) { + memcpy(dst, src, GLYPHWIDTHBYTES(glyph)); + dst += overall_width; + src += GLYPHWIDTHBYTESPADDED(glyph); + } + } } } + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glTexImage2D(GL_TEXTURE_2D, 0, GL_R8UI, overall_width, overall_height, + 0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, bits); + + free(bits); + + glamor_font->realized = TRUE; + return glamor_font; } diff --git a/glamor/glamor_image.c b/glamor/glamor_image.c index b38b41212..90fda4079 100644 --- a/glamor/glamor_image.c +++ b/glamor/glamor_image.c @@ -88,7 +88,7 @@ static void glamor_put_image_bail(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, int w, int h, int leftPad, int format, char *bits) { - if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) + if (glamor_prepare_access_box(drawable, GLAMOR_ACCESS_RW, x, y, w, h)) fbPutImage(drawable, gc, depth, x, y, w, h, leftPad, format, bits); glamor_finish_access(drawable); } @@ -150,7 +150,7 @@ static void glamor_get_image_bail(DrawablePtr drawable, int x, int y, int w, int h, unsigned int format, unsigned long plane_mask, char *d) { - if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RO)) + if (glamor_prepare_access_box(drawable, GLAMOR_ACCESS_RO, x, y, w, h)) fbGetImage(drawable, x, y, w, h, format, plane_mask, d); glamor_finish_access(drawable); } diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c index fb85d9082..40b7b4feb 100644 --- a/glamor/glamor_prepare.c +++ b/glamor/glamor_prepare.c @@ -45,6 +45,8 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box) if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(priv)) return TRUE; + glamor_make_current(glamor_priv); + RegionInit(®ion, box, 1); /* See if it's already mapped */ diff --git a/glx/createcontext.c b/glx/createcontext.c index cbeddec26..d06bc1f7f 100644 --- a/glx/createcontext.c +++ b/glx/createcontext.c @@ -87,6 +87,9 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) int minor_version = 0; uint32_t flags = 0; uint32_t render_type = GLX_RGBA_TYPE; +#ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB + uint32_t flush = GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB; +#endif __GLXcontext *ctx = NULL; __GLXcontext *shareCtx = NULL; __GLXscreen *glxScreen; @@ -194,6 +197,15 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) break; +#ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB + case GLX_CONTEXT_RELEASE_BEHAVIOR_ARB: + flush = attribs[2 * i + 1]; + if (flush != GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB + && flush != GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB) + return BadValue; + break; +#endif + default: return BadValue; } @@ -333,6 +345,9 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) ctx->drawPriv = NULL; ctx->readPriv = NULL; ctx->resetNotificationStrategy = reset; +#ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB + ctx->releaseBehavior = flush; +#endif /* Add the new context to the various global tables of GLX contexts. */ diff --git a/glx/extension_string.c b/glx/extension_string.c index 4bef96f0b..e881d2109 100644 --- a/glx/extension_string.c +++ b/glx/extension_string.c @@ -72,6 +72,7 @@ struct extension_info { static const struct extension_info known_glx_extensions[] = { /* GLX_ARB_get_proc_address is implemented on the client. */ /* *INDENT-OFF* */ + { GLX(ARB_context_flush_control), VER(0,0), N, }, { GLX(ARB_create_context), VER(0,0), N, }, { GLX(ARB_create_context_profile), VER(0,0), N, }, { GLX(ARB_create_context_robustness), VER(0,0), N, }, diff --git a/glx/extension_string.h b/glx/extension_string.h index e7d393297..bac7b0624 100644 --- a/glx/extension_string.h +++ b/glx/extension_string.h @@ -36,7 +36,8 @@ enum { /* GLX_ARB_get_proc_address is implemented on the client. */ - ARB_create_context_bit = 0, + ARB_context_flush_control_bit = 0, + ARB_create_context_bit, ARB_create_context_profile_bit, ARB_create_context_robustness_bit, ARB_fbconfig_float_bit, diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 049b54f92..1247cf0f5 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -334,6 +334,19 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId, */ glxc->resetNotificationStrategy = GLX_NO_RESET_NOTIFICATION_ARB; +#ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB + /* The GLX_ARB_context_flush_control spec says: + * + * "The default value [for GLX_CONTEXT_RELEASE_BEHAVIOR] is + * CONTEXT_RELEASE_BEHAVIOR_FLUSH, and may in some cases be changed + * using platform-specific context creation extensions." + * + * Without using glXCreateContextAttribsARB, there is no way to specify a + * non-default release behavior. + */ + glxc->releaseBehavior = GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB; +#endif + /* Add the new context to the various global tables of GLX contexts. */ if (!__glXAddContext(glxc)) { @@ -626,7 +639,12 @@ DoMakeCurrent(__GLXclientState * cl, /* ** Flush the previous context if needed. */ - if (prevglxc->hasUnflushedCommands) { + Bool need_flush = GL_TRUE; +#ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB + if (prevglxc->releaseBehavior == GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB) + need_flush = GL_FALSE; +#endif + if (prevglxc->hasUnflushedCommands && need_flush) { if (__glXForceCurrent(cl, tag, (int *) &error)) { glFlush(); prevglxc->hasUnflushedCommands = GL_FALSE; @@ -2164,7 +2182,7 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc) __GLXrenderSizeData entry; int extra = 0; int left = (req->length << 2) - sz_xGLXRenderLargeReq; - size_t cmdlen; + int cmdlen; int err; /* diff --git a/glx/glxcontext.h b/glx/glxcontext.h index 677898a67..0733281d7 100644 --- a/glx/glxcontext.h +++ b/glx/glxcontext.h @@ -108,6 +108,11 @@ struct __GLXcontext { */ GLenum resetNotificationStrategy; + /** + * Context release behavior + */ + GLenum releaseBehavior; + /* ** Buffers for feedback and selection. */ diff --git a/glx/glxdri2.c b/glx/glxdri2.c index bcd57a4a3..6fb3d9278 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -921,6 +921,13 @@ initializeExtensions(__GLXDRIscreen * screen) "AIGLX: enabled GLX_ARB_create_context_robustness\n"); } +#ifdef __DRI2_FLUSH_CONTROL + if (strcmp(extensions[i]->name, __DRI2_FLUSH_CONTROL) == 0) { + __glXEnableExtension(screen->glx_enable_bits, + "GLX_ARB_context_flush_control\n"); + } +#endif + /* Ignore unknown extensions */ } } diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c index 0b5f839f6..503f2a122 100644 --- a/glx/glxdriswrast.c +++ b/glx/glxdriswrast.c @@ -396,6 +396,23 @@ initializeExtensions(__GLXDRIscreen * screen) const __DRIextension **extensions; int i; + __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_copy_sub_buffer"); + LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n"); + + if (screen->swrast->base.version >= 3) { + __glXEnableExtension(screen->glx_enable_bits, + "GLX_ARB_create_context"); + __glXEnableExtension(screen->glx_enable_bits, + "GLX_ARB_create_context_profile"); + __glXEnableExtension(screen->glx_enable_bits, + "GLX_EXT_create_context_es2_profile"); + } + + /* these are harmless to enable unconditionally */ + __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_framebuffer_sRGB"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_fbconfig_float"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_SGI_make_current_read"); + extensions = screen->core->getExtensions(screen->driScreen); /* GLX_MESA_copy_sub_buffer is always enabled. */ @@ -412,10 +429,6 @@ initializeExtensions(__GLXDRIscreen * screen) if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) { screen->copySubBuffer = (const __DRIcopySubBufferExtension *) extensions[i]; - __glXEnableExtension(screen->glx_enable_bits, - "GLX_MESA_copy_sub_buffer"); - - LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n"); } if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) { @@ -424,7 +437,13 @@ initializeExtensions(__GLXDRIscreen * screen) LogMessage(X_INFO, "AIGLX: enabled GLX_EXT_texture_from_pixmap\n"); } - /* Ignore unknown extensions */ +#ifdef __DRI2_FLUSH_CONTROL + if (strcmp(extensions[i]->name, __DRI2_FLUSH_CONTROL) == 0) { + __glXEnableExtension(screen->glx_enable_bits, + "GLX_ARB_context_flush_control\n"); + } +#endif + } } diff --git a/hw/dmx/config/dmxparse.h b/hw/dmx/config/dmxparse.h index 7d31b6309..cc2f0eb71 100644 --- a/hw/dmx/config/dmxparse.h +++ b/hw/dmx/config/dmxparse.h @@ -38,6 +38,7 @@ #define _DMXPARSE_H_ #include <stdio.h> /* For FILE */ +#include <X11/Xfuncproto.h> /* For _X_ATTRIBUTE_PRINTF */ /** Stores tokens not stored in other structures (e.g., keywords and ;) */ typedef struct _DMXConfigToken { @@ -203,7 +204,7 @@ extern int yylex(void); extern int yydebug; extern void yyerror(const char *message); -extern void dmxConfigLog(const char *format, ...); +extern void dmxConfigLog(const char *format, ...) _X_ATTRIBUTE_PRINTF(1,0); extern void *dmxConfigAlloc(unsigned long bytes); extern void *dmxConfigRealloc(void *orig, unsigned long orig_bytes, unsigned long bytes); diff --git a/hw/dmx/config/dmxprint.c b/hw/dmx/config/dmxprint.c index 9dec52b5c..c80e830e4 100644 --- a/hw/dmx/config/dmxprint.c +++ b/hw/dmx/config/dmxprint.c @@ -130,7 +130,7 @@ dmxConfigPopState(void) dmxConfigNewline(); } -static void +static void _X_ATTRIBUTE_PRINTF(4, 5) dmxConfigOutput(int addSpace, int doNewline, const char *comment, const char *format, ...) { @@ -261,32 +261,20 @@ dmxConfigPrintString(DMXConfigStringPtr p, int quote) static int dmxConfigPrintPair(DMXConfigPairPtr p, int addSpace) { - const char *format = NULL; - if (!p) return 0; - switch (p->token) { - case T_ORIGIN: - format = "@%dx%d"; - break; - case T_DIMENSION: - format = "%dx%d"; - break; - case T_OFFSET: - format = "%c%d%c%d"; - break; - } if (p->token == T_OFFSET) { if (!p->comment && !p->x && !p->y && p->xsign >= 0 && p->ysign >= 0) return 0; - dmxConfigOutput(addSpace, 0, p->comment, format, + dmxConfigOutput(addSpace, 0, p->comment, "%c%d%c%d", p->xsign < 0 ? '-' : '+', p->x, p->ysign < 0 ? '-' : '+', p->y); } else { if (!p->comment && !p->x && !p->y) return 0; - dmxConfigOutput(addSpace, 0, p->comment, format, p->x, p->y); + dmxConfigOutput(addSpace, 0, p->comment, "%s%dx%d", + (p->token == T_ORIGIN) ? "@" : "", p->x, p->y); } return 1; } diff --git a/hw/dmx/dmx.c b/hw/dmx/dmx.c index 99e970cb9..2988df33a 100644 --- a/hw/dmx/dmx.c +++ b/hw/dmx/dmx.c @@ -55,6 +55,7 @@ #include "extinit.h" #include "opaque.h" +#include "dmx.h" #include "dmxextension.h" #include <X11/extensions/dmxproto.h> #include <X11/extensions/dmx.h> diff --git a/hw/dmx/dmxcb.c b/hw/dmx/dmxcb.c index 86015f395..cca5702ee 100644 --- a/hw/dmx/dmxcb.c +++ b/hw/dmx/dmxcb.c @@ -47,9 +47,6 @@ extern int connBlockScreenStart; #ifdef PANORAMIX #include "panoramiXsrv.h" -extern int PanoramiXPixWidth; -extern int PanoramiXPixHeight; -extern int PanoramiXNumScreens; #endif int dmxGlobalWidth, dmxGlobalHeight; diff --git a/hw/dmx/dmxfont.h b/hw/dmx/dmxfont.h index 8575ca953..66c663377 100644 --- a/hw/dmx/dmxfont.h +++ b/hw/dmx/dmxfont.h @@ -54,6 +54,4 @@ extern Bool dmxUnrealizeFont(ScreenPtr pScreen, FontPtr pFont); extern Bool dmxBELoadFont(ScreenPtr pScreen, FontPtr pFont); extern Bool dmxBEFreeFont(ScreenPtr pScreen, FontPtr pFont); -extern int dmxFontPrivateIndex; - #endif /* DMXFONT_H */ diff --git a/hw/dmx/dmxgc.c b/hw/dmx/dmxgc.c index 234316797..ec15d27aa 100644 --- a/hw/dmx/dmxgc.c +++ b/hw/dmx/dmxgc.c @@ -49,7 +49,7 @@ #include "pixmapstr.h" #include "migc.h" -static GCFuncs dmxGCFuncs = { +static const GCFuncs dmxGCFuncs = { dmxValidateGC, dmxChangeGC, dmxCopyGC, @@ -59,7 +59,7 @@ static GCFuncs dmxGCFuncs = { dmxCopyClip, }; -static GCOps dmxGCOps = { +static const GCOps dmxGCOps = { dmxFillSpans, dmxSetSpans, dmxPutImage, diff --git a/hw/dmx/dmxgc.h b/hw/dmx/dmxgc.h index c8ecb53a0..c5c6b7732 100644 --- a/hw/dmx/dmxgc.h +++ b/hw/dmx/dmxgc.h @@ -41,8 +41,8 @@ /** GC private area. */ typedef struct _dmxGCPriv { - GCOps *ops; - GCFuncs *funcs; + const GCOps *ops; + const GCFuncs *funcs; XlibGC gc; Bool msc; } dmxGCPrivRec, *dmxGCPrivPtr; diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c index fd2ade0ef..025dc8637 100644 --- a/hw/dmx/dmxinit.c +++ b/hw/dmx/dmxinit.c @@ -164,23 +164,23 @@ dmxErrorHandler(Display * dpy, XErrorEvent * ev) switch (ev->error_code) { case BadValue: dmxLog(dmxWarning, " Value: 0x%x\n", - ev->resourceid); + (unsigned int) ev->resourceid); break; case BadAtom: dmxLog(dmxWarning, " AtomID: 0x%x\n", - ev->resourceid); + (unsigned int) ev->resourceid); break; default: dmxLog(dmxWarning, " ResourceID: 0x%x\n", - ev->resourceid); + (unsigned int) ev->resourceid); break; } /* Provide serial number information */ dmxLog(dmxWarning, " Failed serial number: %d\n", - ev->serial); + (unsigned int) ev->serial); dmxLog(dmxWarning, " Current serial number: %d\n", - dpy->request); + (unsigned int) dpy->request); return 0; } @@ -634,7 +634,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) if (major > 0 && minor > 0) year += 2000; - dmxLog(dmxInfo, "Generation: %d\n", dmxGeneration); + dmxLog(dmxInfo, "Generation: %lu\n", dmxGeneration); dmxLog(dmxInfo, "DMX version: %d.%d.%02d%02d%02d (%s)\n", major, minor, year, month, day, VENDOR_STRING); @@ -762,7 +762,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) dmxGlxVisualPrivate **configprivs = NULL; int nconfigs = 0; int (*oldErrorHandler) (Display *, XErrorEvent *); - int i; /* Catch errors if when using an older GLX w/o FBconfigs */ oldErrorHandler = XSetErrorHandler(dmxNOPErrorHandler); @@ -797,28 +796,29 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) configprivs = malloc(nconfigs * sizeof(dmxGlxVisualPrivate *)); if (configs != NULL && configprivs != NULL) { + int j; /* Initialize our private info for each visual * (currently only x_visual_depth and x_visual_class) */ - for (i = 0; i < nconfigs; i++) { + for (j = 0; j < nconfigs; j++) { - configprivs[i] = (dmxGlxVisualPrivate *) + configprivs[j] = (dmxGlxVisualPrivate *) malloc(sizeof(dmxGlxVisualPrivate)); - configprivs[i]->x_visual_depth = 0; - configprivs[i]->x_visual_class = 0; + configprivs[j]->x_visual_depth = 0; + configprivs[j]->x_visual_class = 0; /* Find the visual depth */ - if (configs[i].vid > 0) { - int j; - - for (j = 0; j < dmxScreen->beNumVisuals; j++) { - if (dmxScreen->beVisuals[j].visualid == - configs[i].vid) { - configprivs[i]->x_visual_depth = - dmxScreen->beVisuals[j].depth; - configprivs[i]->x_visual_class = - dmxScreen->beVisuals[j].class; + if (configs[j].vid > 0) { + int k; + + for (k = 0; k < dmxScreen->beNumVisuals; k++) { + if (dmxScreen->beVisuals[k].visualid == + configs[j].vid) { + configprivs[j]->x_visual_depth = + dmxScreen->beVisuals[k].depth; + configprivs[j]->x_visual_class = + dmxScreen->beVisuals[k].class; break; } } diff --git a/hw/dmx/dmxpict.c b/hw/dmx/dmxpict.c index 64d0ae150..aaca178b9 100644 --- a/hw/dmx/dmxpict.c +++ b/hw/dmx/dmxpict.c @@ -57,7 +57,6 @@ #include "mipict.h" #include "fbpict.h" -extern int RenderErrBase; extern int (*ProcRenderVector[RenderNumberRequests]) (ClientPtr); static int (*dmxSaveRenderVector[RenderNumberRequests]) (ClientPtr); diff --git a/hw/dmx/dmxprop.c b/hw/dmx/dmxprop.c index 4be2dbd4c..5e306d286 100644 --- a/hw/dmx/dmxprop.c +++ b/hw/dmx/dmxprop.c @@ -220,7 +220,7 @@ dmxPropertyCheckOtherWindows(DMXScreenInfo * dmxScreen, Atom atom) if (XGetTextProperty(dpy, win, &tp, atom) && tp.nitems) { dmxLog(dmxDebug, "On %s/%lu: %s\n", - dmxScreen->name, win, tp.value); + dmxScreen->name, (unsigned long) win, tp.value); if (!strncmp((char *) tp.value, (char *) id, strlen((char *) id))) { int idx; @@ -360,8 +360,8 @@ dmxPropertyWindow(DMXScreenInfo * dmxScreen) dmxScreen->next = (other->next ? other->next : other); other->next = (tmp ? tmp : dmxScreen); dmxLog(dmxDebug, "%d/%s/%lu and %d/%s/%lu are on the same backend\n", - dmxScreen->index, dmxScreen->name, dmxScreen->scrnWin, - other->index, other->name, other->scrnWin); + dmxScreen->index, dmxScreen->name, (unsigned long) dmxScreen->scrnWin, + other->index, other->name, (unsigned long) other->scrnWin); } snprintf(buf, sizeof(buf), ".%d,%lu", dmxScreen->index, diff --git a/hw/dmx/dmxscrinit.c b/hw/dmx/dmxscrinit.c index 963d3a9de..097418d05 100644 --- a/hw/dmx/dmxscrinit.c +++ b/hw/dmx/dmxscrinit.c @@ -80,7 +80,6 @@ dmxBEScreenInit(ScreenPtr pScreen) { DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; XSetWindowAttributes attribs; - XGCValues gcvals; unsigned long mask; int i, j; diff --git a/hw/dmx/dmxwindow.c b/hw/dmx/dmxwindow.c index c75373534..c157e1099 100644 --- a/hw/dmx/dmxwindow.c +++ b/hw/dmx/dmxwindow.c @@ -857,13 +857,9 @@ dmxResizeWindow(WindowPtr pWindow, int x, int y, ScreenPtr pScreen = pWindow->drawable.pScreen; DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow); - dmxWinPrivPtr pSibPriv; unsigned int m; XWindowChanges c; - if (pSib) - pSibPriv = DMX_GET_WINDOW_PRIV(pSib); - DMX_UNWRAP(ResizeWindow, dmxScreen, pScreen); #if 1 if (pScreen->ResizeWindow) diff --git a/hw/dmx/glxProxy/compsize.h b/hw/dmx/glxProxy/compsize.h index 360966233..5e759b0a0 100644 --- a/hw/dmx/glxProxy/compsize.h +++ b/hw/dmx/glxProxy/compsize.h @@ -48,4 +48,11 @@ extern GLint __glTexGeniv_size(GLenum e); extern GLint __glTexParameterfv_size(GLenum e); extern GLint __glTexParameteriv_size(GLenum e); +extern GLint __glCallLists_size(GLsizei n, GLenum type); +extern GLint __glDrawPixels_size(GLenum format, GLenum type, GLsizei w, GLsizei h); +extern GLint __glBitmap_size(GLsizei w, GLsizei h); +extern GLint __glTexImage1D_size(GLenum format, GLenum type, GLsizei w); +extern GLint __glTexImage2D_size(GLenum format, GLenum type, GLsizei w, GLsizei h); +extern GLint __glTexImage3D_size(GLenum format, GLenum type, GLsizei w, GLsizei h, GLsizei d); + #endif /* !__compsize_h__ */ diff --git a/hw/dmx/glxProxy/g_disptab.h b/hw/dmx/glxProxy/g_disptab.h index 530338798..783f87a54 100644 --- a/hw/dmx/glxProxy/g_disptab.h +++ b/hw/dmx/glxProxy/g_disptab.h @@ -655,7 +655,6 @@ extern void __glXDispSwap_CopyConvolutionFilter2D(GLbyte *); extern void __glXDispSwap_SeparableFilter2D(GLbyte *); extern void __glXDispSwap_TexImage3D(GLbyte *); extern void __glXDispSwap_TexSubImage3D(GLbyte *); -extern void __glXDispSwap_DrawArrays(GLbyte *); extern void __glXDispSwap_PrioritizeTextures(GLbyte *); extern void __glXDispSwap_CopyTexImage1D(GLbyte *); extern void __glXDispSwap_CopyTexImage2D(GLbyte *); @@ -663,6 +662,26 @@ extern void __glXDispSwap_CopyTexSubImage1D(GLbyte *); extern void __glXDispSwap_CopyTexSubImage2D(GLbyte *); extern void __glXDispSwap_CopyTexSubImage3D(GLbyte *); +extern void __glXDispSwap_BindTexture(GLbyte *); +extern void __glXDispSwap_BlendColor(GLbyte *); +extern void __glXDispSwap_BlendEquation(GLbyte *); +extern void __glXDispSwap_ColorTable(GLbyte *); +extern void __glXDispSwap_ColorTableParameterfv(GLbyte *); +extern void __glXDispSwap_ColorTableParameteriv(GLbyte *); +extern void __glXDispSwap_CopyColorTable(GLbyte *); +extern void __glXDispSwap_ConvolutionParameterf(GLbyte *); +extern void __glXDispSwap_ConvolutionParameteri(GLbyte *); +extern void __glXDispSwap_Histogram(GLbyte *); +extern void __glXDispSwap_Minmax(GLbyte *); +extern void __glXDispSwap_ResetHistogram(GLbyte *); +extern void __glXDispSwap_ResetMinmax(GLbyte *); + +extern int __glXSwapCreateContextWithConfigSGIX(__GLXclientState *, GLbyte *); +extern int __glXSwapBindSwapBarrierSGIX(__GLXclientState *, GLbyte *); +extern int __glXSwapJoinSwapGroupSGIX(__GLXclientState *, GLbyte *); +extern int __glXSwapQueryMaxSwapBarriersSGIX(__GLXclientState *, GLbyte *); +extern int __glXSwapMakeCurrentReadSGI(__GLXclientState *, GLbyte *); + #define __GLX_MIN_GLXCMD_OPCODE 1 #define __GLX_MAX_GLXCMD_OPCODE 20 #define __GLX_MIN_RENDER_OPCODE 1 diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c index fb4d5acce..4c500c93d 100644 --- a/hw/dmx/glxProxy/glxcmds.c +++ b/hw/dmx/glxProxy/glxcmds.c @@ -61,7 +61,6 @@ extern __GLXFBConfig **__glXFBConfigs; extern int __glXNumFBConfigs; -extern int glxIsExtensionSupported(char *ext); extern int __glXGetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc); #define BE_TO_CLIENT_ERROR(x) \ @@ -3394,11 +3393,11 @@ __glXCreatePbuffer(__GLXclientState * cl, GLbyte * pc) /* Send attributes */ if (attr != NULL) { - CARD32 *pc = (CARD32 *) (be_req + 1); + CARD32 *pca = (CARD32 *) (be_req + 1); while (numAttribs-- > 0) { - *pc++ = *attr++; /* token */ - *pc++ = *attr++; /* value */ + *pca++ = *attr++; /* token */ + *pca++ = *attr++; /* value */ } } diff --git a/hw/dmx/glxProxy/glxcmds.h b/hw/dmx/glxProxy/glxcmds.h index b0745927e..689e33485 100644 --- a/hw/dmx/glxProxy/glxcmds.h +++ b/hw/dmx/glxProxy/glxcmds.h @@ -33,5 +33,11 @@ extern int __glXCreateContextWithConfigSGIX(__GLXclientState * cl, GLbyte * pc); extern int __glXJoinSwapGroupSGIX(__GLXclientState * cl, GLbyte * pc); extern int __glXMakeCurrentReadSGI(__GLXclientState * cl, GLbyte * pc); extern int __glXQueryMaxSwapBarriersSGIX(__GLXclientState * cl, GLbyte * pc); +extern int __glXDoSwapBuffers(__GLXclientState * cl, XID drawId, + GLXContextTag tag); + +extern Display *GetBackEndDisplay(__GLXclientState * cl, int s); +extern int GetCurrentBackEndTag(__GLXclientState * cl, GLXContextTag tag, + int s); #endif /* !__GLX_cmds_h__ */ diff --git a/hw/dmx/glxProxy/glxcmdsswap.c b/hw/dmx/glxProxy/glxcmdsswap.c index ab3e7edc1..5b1722d57 100644 --- a/hw/dmx/glxProxy/glxcmdsswap.c +++ b/hw/dmx/glxProxy/glxcmdsswap.c @@ -39,8 +39,6 @@ #include "glxext.h" #include "glxvendor.h" -extern int glxIsExtensionSupported(char *ext); - int __glXSwapGetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc); /************************************************************************/ @@ -440,7 +438,7 @@ __glXSwapUseXFont(__GLXclientState * cl, GLbyte * pc) int __glXSwapQueryExtensionsString(__GLXclientState * cl, GLbyte * pc) { - xGLXQueryExtensionsStringReq *req = NULL; + xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; diff --git a/hw/dmx/glxProxy/glxext.h b/hw/dmx/glxProxy/glxext.h index 47cec15cf..b96ebc1f4 100644 --- a/hw/dmx/glxProxy/glxext.h +++ b/hw/dmx/glxProxy/glxext.h @@ -53,6 +53,7 @@ extern void __glXFlushContextCache(void); extern void __glXFreeGLXWindow(__glXWindow * pGlxWindow); extern void __glXFreeGLXPixmap(__GLXpixmap * pGlxPixmap); +extern void __glXFreeGLXPbuffer(__glXPbuffer * pGlxPbuffer); extern void __glXNoSuchRenderOpcode(GLbyte *); extern int __glXNoSuchSingleOpcode(__GLXclientState *, GLbyte *); diff --git a/hw/dmx/glxProxy/glxscreens.c b/hw/dmx/glxProxy/glxscreens.c index 138afedf2..15bb1e862 100644 --- a/hw/dmx/glxProxy/glxscreens.c +++ b/hw/dmx/glxProxy/glxscreens.c @@ -65,8 +65,6 @@ static void CalcServerVersionAndExtensions(void) { int s; - xGLXQueryVersionReq *req; - xGLXQueryVersionReply reply; char **be_extensions; char *ext; char *denied_extensions; @@ -80,6 +78,8 @@ CalcServerVersionAndExtensions(void) for (s = 0; s < __glXNumActiveScreens; s++) { DMXScreenInfo *dmxScreen = &dmxScreens[s]; Display *dpy = dmxScreen->beDisplay; + xGLXQueryVersionReq *req; + xGLXQueryVersionReply reply; /* Send the glXQueryVersion request */ LockDisplay(dpy); @@ -335,7 +335,7 @@ __glXGetServerString(unsigned int name) } int -glxIsExtensionSupported(char *ext) +glxIsExtensionSupported(const char *ext) { return (strstr(ExtensionsString, ext) != NULL); } diff --git a/hw/dmx/glxProxy/glxscreens.h b/hw/dmx/glxProxy/glxscreens.h index a9fe2a9db..bb7477bc7 100644 --- a/hw/dmx/glxProxy/glxscreens.h +++ b/hw/dmx/glxProxy/glxscreens.h @@ -50,4 +50,6 @@ extern void __glXScreenReset(void); extern char *__glXGetServerString(unsigned int name); +extern int glxIsExtensionSupported(const char *ext); + #endif /* !__GLX_screens_h__ */ diff --git a/hw/dmx/glxProxy/glxserver.h b/hw/dmx/glxProxy/glxserver.h index 754ad30a0..7aa5ad2f2 100644 --- a/hw/dmx/glxProxy/glxserver.h +++ b/hw/dmx/glxProxy/glxserver.h @@ -149,9 +149,7 @@ extern __GLXclientState *__glXClients[]; typedef void (*__GLXdispatchRenderProcPtr) (GLbyte *); typedef int (*__GLXdispatchSingleProcPtr) (__GLXclientState *, GLbyte *); typedef int (*__GLXdispatchVendorPrivProcPtr) (__GLXclientState *, GLbyte *); -extern __GLXdispatchSingleProcPtr __glXSingleTable[]; extern __GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[]; -extern __GLXdispatchSingleProcPtr __glXSwapSingleTable[]; extern __GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[]; extern __GLXdispatchRenderProcPtr __glXSwapRenderTable[]; @@ -193,9 +191,6 @@ extern RESTYPE __glXPbufferRes; extern char *__glXcombine_strings(const char *, const char *); -extern void __glXDisp_DrawArrays(GLbyte *); -extern void __glXDispSwap_DrawArrays(GLbyte *); - /* ** Routines for sending swapped replies. */ @@ -287,9 +282,6 @@ extern int __glXConvolutionParameterfvSize(GLenum pname); extern int __glXColorTableParameterfvSize(GLenum pname); extern int __glXColorTableParameterivSize(GLenum pname); -extern void __glXFreeGLXWindow(__glXWindow * pGlxWindow); -extern void __glXFreeGLXPbuffer(__glXPbuffer * pGlxPbuffer); - extern int __glXVersionMajor; extern int __glXVersionMinor; diff --git a/hw/dmx/glxProxy/glxsingle.c b/hw/dmx/glxProxy/glxsingle.c index 034497315..79d426bbf 100644 --- a/hw/dmx/glxProxy/glxsingle.c +++ b/hw/dmx/glxProxy/glxsingle.c @@ -45,6 +45,8 @@ /* #include "g_disptab_EXT.h" */ #include "unpack.h" #include "glxutil.h" +#include "glxcmds.h" +#include "glxsingle.h" #include "GL/glxproto.h" @@ -81,10 +83,6 @@ #define X_GLXSingle 0 /* needed by GetReqExtra */ -extern Display *GetBackEndDisplay(__GLXclientState * cl, int s); -extern int GetCurrentBackEndTag(__GLXclientState * cl, GLXContextTag tag, - int s); - static int swap_vec_element_size = 0; static void diff --git a/hw/dmx/glxProxy/glxsingle.h b/hw/dmx/glxProxy/glxsingle.h index 32a9d4921..6126177fa 100644 --- a/hw/dmx/glxProxy/glxsingle.h +++ b/hw/dmx/glxProxy/glxsingle.h @@ -47,8 +47,4 @@ extern int __glXForwardAllWithReplySwapsv(__GLXclientState * cl, GLbyte * pc); extern int __glXForwardAllWithReplySwapiv(__GLXclientState * cl, GLbyte * pc); extern int __glXForwardAllWithReplySwapdv(__GLXclientState * cl, GLbyte * pc); -extern int __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc); -extern int __glXDispSwap_GetTexImage(__GLXclientState * cl, GLbyte * pc); -extern int __glXDispSwap_GetColorTable(__GLXclientState * cl, GLbyte * pc); - #endif diff --git a/hw/dmx/glxProxy/glxswap.c b/hw/dmx/glxProxy/glxswap.c index 5f565010d..bc18e5518 100644 --- a/hw/dmx/glxProxy/glxswap.c +++ b/hw/dmx/glxProxy/glxswap.c @@ -39,9 +39,7 @@ #include "dmxwindow.h" #include "glxserver.h" #include "glxswap.h" - -extern int __glXDoSwapBuffers(__GLXclientState * cl, XID drawId, - GLXContextTag tag); +#include "glxcmds.h" typedef struct _SwapGroup *SwapGroupPtr; diff --git a/hw/dmx/glxProxy/glxvendor.c b/hw/dmx/glxProxy/glxvendor.c index fc8aff0cc..52d70eb70 100644 --- a/hw/dmx/glxProxy/glxvendor.c +++ b/hw/dmx/glxProxy/glxvendor.c @@ -44,6 +44,8 @@ /* #include "g_disptab_EXT.h" */ #include "unpack.h" #include "glxutil.h" +#include "glxcmds.h" +#include "glxvendor.h" #include "GL/glxproto.h" @@ -78,10 +80,6 @@ dpy->request++ #endif -extern Display *GetBackEndDisplay(__GLXclientState * cl, int s); -extern int GetCurrentBackEndTag(__GLXclientState * cl, GLXContextTag tag, - int s); - static int swap_vec_element_size = 0; static void diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c index abb6a8551..56a39df8c 100644 --- a/hw/dmx/input/dmxinputinit.c +++ b/hw/dmx/input/dmxinputinit.c @@ -874,17 +874,17 @@ dmxInputScanForExtensions(DMXInputInfo * dmxInput, int doXI) { XExtensionVersion *ext; XDeviceInfo *devices; - Display *display; + Display *dsp; int num; int i, j; XextErrorHandler handler; - if (!(display = XOpenDisplay(dmxInput->name))) + if (!(dsp = XOpenDisplay(dmxInput->name))) return; /* Print out information about the XInput Extension. */ handler = XSetExtensionErrorHandler(dmxInputExtensionErrorHandler); - ext = XGetExtensionVersion(display, INAME); + ext = XGetExtensionVersion(dsp, INAME); XSetExtensionErrorHandler(handler); if (!ext || ext == (XExtensionVersion *) NoSuchExtension) { @@ -894,7 +894,7 @@ dmxInputScanForExtensions(DMXInputInfo * dmxInput, int doXI) dmxLogInput(dmxInput, "Locating devices on %s (%s version %d.%d)\n", dmxInput->name, INAME, ext->major_version, ext->minor_version); - devices = XListInputDevices(display, &num); + devices = XListInputDevices(dsp, &num); XFree(ext); ext = NULL; @@ -956,7 +956,7 @@ dmxInputScanForExtensions(DMXInputInfo * dmxInput, int doXI) } XFreeDeviceList(devices); } - XCloseDisplay(display); + XCloseDisplay(dsp); } /** Re-initialize all the devices described in \a dmxInput. Called from diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index 71c1691c4..e19f57b2c 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -1039,11 +1039,13 @@ hostx_paint_rect(KdScreenInfo *screen, sx, sy, dx, dy, width, height, FALSE); } else { - /* This is slow and could be done better */ - xcb_image_t *img = xcb_image_native (HostX.conn, scrpriv->ximg, 1); - xcb_image_put(HostX.conn, scrpriv->win, HostX.gc, img, 0, 0, 0); - if (scrpriv->ximg != img) + xcb_image_t *subimg = xcb_image_subimage(scrpriv->ximg, sx, sy, + width, height, 0, 0, 0); + xcb_image_t *img = xcb_image_native(HostX.conn, subimg, 1); + xcb_image_put(HostX.conn, scrpriv->win, HostX.gc, img, dx, dy, 0); + if (subimg != img) xcb_image_destroy(img); + xcb_image_destroy(subimg); } xcb_aux_sync(HostX.conn); diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c index 221ec530b..520b7cfb8 100644 --- a/hw/xfree86/dri2/dri2ext.c +++ b/hw/xfree86/dri2/dri2ext.c @@ -269,9 +269,11 @@ ProcDRI2GetBuffers(ClientPtr client) int status, width, height, count; unsigned int *attachments; - REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * 4); - if (stuff->count > (INT_MAX / 4)) + REQUEST_AT_LEAST_SIZE(xDRI2GetBuffersReq); + /* stuff->count is a count of CARD32 attachments that follows */ + if (stuff->count > (INT_MAX / sizeof(CARD32))) return BadLength; + REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * sizeof(CARD32)); if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess, &pDrawable, &status)) @@ -297,7 +299,13 @@ ProcDRI2GetBuffersWithFormat(ClientPtr client) int status, width, height, count; unsigned int *attachments; - REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, stuff->count * (2 * 4)); + REQUEST_AT_LEAST_SIZE(xDRI2GetBuffersReq); + /* stuff->count is a count of pairs of CARD32s (attachments & formats) + that follows */ + if (stuff->count > (INT_MAX / (2 * sizeof(CARD32)))) + return BadLength; + REQUEST_FIXED_SIZE(xDRI2GetBuffersReq, + stuff->count * (2 * sizeof(CARD32))); if (!validDrawable(client, stuff->drawable, DixReadAccess | DixWriteAccess, &pDrawable, &status)) return status; diff --git a/hw/xfree86/man/Xorg.man b/hw/xfree86/man/Xorg.man index 3ff6aef89..d88cc24dc 100644 --- a/hw/xfree86/man/Xorg.man +++ b/hw/xfree86/man/Xorg.man @@ -46,7 +46,7 @@ On most platforms, the "Local" connection type is a UNIX-domain socket. On some System V platforms, the "local" connection types also include STREAMS pipes, named pipes, and some other mechanisms. .TP 4 -.I TCP\/IP +.I TCP/IP .B Xorg listens on port .RI 6000+ n , diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c index 6fb0f9b92..f24294ee3 100644 --- a/hw/xfree86/modes/xf86EdidModes.c +++ b/hw/xfree86/modes/xf86EdidModes.c @@ -713,7 +713,7 @@ static const struct { {1600, 1200, 75, 0}, {1600, 1200, 85, 0}, {1792, 1344, 60, 0}, - {1792, 1344, 85, 0}, + {1792, 1344, 75, 0}, {1856, 1392, 60, 0}, {1856, 1392, 75, 0}, {1920, 1200, 60, 1}, diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index b1c306a88..5c1ba71da 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -683,11 +683,9 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen, Bool ret = FALSE; int c; - if (xf86RandR12Key) { - if (randrp->virtualX == -1 || randrp->virtualY == -1) { - randrp->virtualX = pScrn->virtualX; - randrp->virtualY = pScrn->virtualY; - } + if (randrp->virtualX == -1 || randrp->virtualY == -1) { + randrp->virtualX = pScrn->virtualX; + randrp->virtualY = pScrn->virtualY; } if (pRoot && pScrn->vtSema) (*pScrn->EnableDisableFBAccess) (pScrn, FALSE); @@ -730,7 +728,7 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen, if (pRoot && pScrn->vtSema) (*pScrn->EnableDisableFBAccess) (pScrn, TRUE); #if RANDR_12_INTERFACE - if (xf86RandR12Key && pScreen->root && ret) + if (pScreen->root && ret) RRScreenSizeNotify(pScreen); #endif return ret; @@ -826,9 +824,6 @@ xf86RandR12CreateScreenResources(ScreenPtr pScreen) xf86RandR12ScreenSetSize(pScreen, width, height, mmWidth, mmHeight); } - if (xf86RandR12Key == NULL) - return TRUE; - if (randrp->virtualX == -1 || randrp->virtualY == -1) { randrp->virtualX = pScrn->virtualX; randrp->virtualY = pScrn->virtualY; diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c index 94853070d..4acaf33d1 100644 --- a/hw/xfree86/os-support/linux/lnx_init.c +++ b/hw/xfree86/os-support/linux/lnx_init.c @@ -62,18 +62,24 @@ drain_console(int fd, void *closure) } } -static void +static int switch_to(int vt, const char *from) { int ret; SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt)); - if (ret < 0) - FatalError("%s: VT_ACTIVATE failed: %s\n", from, strerror(errno)); + if (ret < 0) { + xf86Msg(X_WARNING, "%s: VT_ACTIVATE failed: %s\n", from, strerror(errno)); + return 0; + } SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt)); - if (ret < 0) - FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); + if (ret < 0) { + xf86Msg(X_WARNING, "%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno)); + return 0; + } + + return 1; } #pragma GCC diagnostic push @@ -208,7 +214,8 @@ xf86OpenConsole(void) /* * now get the VT. This _must_ succeed, or else fail completely. */ - switch_to(xf86Info.vtno, "xf86OpenConsole"); + if (!switch_to(xf86Info.vtno, "xf86OpenConsole")) + FatalError("xf86OpenConsole: Switching VT failed\n"); SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_GETMODE, &VT)); if (ret < 0) @@ -269,7 +276,8 @@ xf86OpenConsole(void) else { /* serverGeneration != 1 */ if (!xf86Info.ShareVTs && xf86Info.autoVTSwitch) { /* now get the VT */ - switch_to(xf86Info.vtno, "xf86OpenConsole"); + if (!switch_to(xf86Info.vtno, "xf86OpenConsole")) + FatalError("xf86OpenConsole: Switching VT failed\n"); } } } diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c index de4244bdf..d4f09e56c 100644 --- a/hw/xfree86/os-support/shared/sigio.c +++ b/hw/xfree86/os-support/shared/sigio.c @@ -179,7 +179,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure) } sigemptyset(&sa.sa_mask); sigaddset(&sa.sa_mask, SIGIO); - sa.sa_flags = 0; + sa.sa_flags = SA_RESTART; sa.sa_handler = xf86SIGIO; sigaction(SIGIO, &sa, &osa); xf86SigIOFuncs[i].fd = fd; diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h index 6190fe6a0..95c3a7365 100644 --- a/hw/xfree86/os-support/xf86_OSlib.h +++ b/hw/xfree86/os-support/xf86_OSlib.h @@ -183,11 +183,7 @@ extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX]; #include <sys/types.h> #include <assert.h> -#ifdef __linux__ -#include <termio.h> -#else /* __GLIBC__ */ #include <termios.h> -#endif #ifdef __sparc__ #include <sys/param.h> #endif diff --git a/hw/xfree86/x86emu/debug.c b/hw/xfree86/x86emu/debug.c index cbea9947f..72a06ffb8 100644 --- a/hw/xfree86/x86emu/debug.c +++ b/hw/xfree86/x86emu/debug.c @@ -233,9 +233,7 @@ X86EMU_dump_memory(u16 seg, u16 off, u32 amt) u32 start = off & 0xfffffff0; u32 end = (off + 16) & 0xfffffff0; u32 i; - u32 current; - current = start; while (end <= off + amt) { printk("%04x:%04x ", seg, start); for (i = start; i < off; i++) @@ -261,8 +259,6 @@ x86emu_single_step(void) static int breakpoint; static int noDecode = 1; - char *p; - if (DEBUG_BREAK()) { if (M.x86.saved_ip != breakpoint) { return; @@ -279,7 +275,7 @@ x86emu_single_step(void) offset = M.x86.saved_ip; while (!done) { printk("-"); - p = fgets(s, 1023, stdin); + (void)fgets(s, 1023, stdin); cmd = parse_line(s, ps, &ntok); switch (cmd) { case 'u': diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c index 19b7d86e7..4e6ab3d13 100644 --- a/hw/xquartz/GL/indirect.c +++ b/hw/xquartz/GL/indirect.c @@ -52,6 +52,7 @@ #include "visualConfigs.h" #include "dri.h" +#include "extension_string.h" #include "darwin.h" #define GLAQUA_DEBUG_MSG(msg, args ...) ASL_LOG(ASL_LEVEL_DEBUG, "GLXAqua", \ @@ -111,6 +112,10 @@ typedef struct __GLXAquaDrawable __GLXAquaDrawable; */ struct __GLXAquaScreen { __GLXscreen base; + + /* Supported GLX extensions */ + unsigned char glx_enable_bits[__GLX_EXT_BYTES]; + int index; int num_vis; }; @@ -541,13 +546,33 @@ __glXAquaScreenProbe(ScreenPtr pScreen) screen->base.GLXmajor = 1; screen->base.GLXminor = 4; - screen->base.GLXextensions = strdup("GLX_SGIX_fbconfig " - "GLX_SGIS_multisample " - "GLX_ARB_multisample " - "GLX_EXT_visual_info " - "GLX_EXT_import_context "); - /*We may be able to add more GLXextensions at a later time. */ + memset(screen->glx_enable_bits, 0, __GLX_EXT_BYTES); + + __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_visual_info"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_visual_rating"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_EXT_import_context"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_OML_swap_method"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_SGIX_fbconfig"); + + __glXEnableExtension(screen->glx_enable_bits, "GLX_SGIS_multisample"); + __glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_multisample"); + + //__glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context"); + //__glXEnableExtension(screen->glx_enable_bits, "GLX_ARB_create_context_profile"); + + // Generate the GLX extensions string (overrides that set by __glXScreenInit()) + { + unsigned int buffer_size = + __glXGetExtensionString(screen->glx_enable_bits, NULL); + if (buffer_size > 0) { + free(screen->base.GLXextensions); + + screen->base.GLXextensions = xnfalloc(buffer_size); + __glXGetExtensionString(screen->glx_enable_bits, + screen->base.GLXextensions); + } + } return &screen->base; } diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 2efbd658b..d2c5d3083 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -1069,12 +1069,12 @@ X11ApplicationCanEnterRandR(void) if (!XQuartzIsRootless) QuartzShowFullscreen(FALSE); - switch (NSRunAlertPanel(title, msg, + switch (NSRunAlertPanel(title, @"%@", NSLocalizedString(@"Allow", @""), NSLocalizedString(@"Cancel", @""), - NSLocalizedString(@"Always Allow", @""))) { + NSLocalizedString(@"Always Allow", @""), msg)) { case NSAlertOtherReturn: [X11App prefs_set_boolean:@PREFS_NO_RANDR_ALERT value:YES]; [X11App prefs_synchronize]; @@ -1122,10 +1122,10 @@ X11ApplicationFatalError(const char *f, va_list args) */ dispatch_sync(dispatch_get_main_queue(), ^{ if (NSAlertDefaultReturn == - NSRunAlertPanel (title, msg, + NSRunAlertPanel (title, @"%@", NSLocalizedString (@"Quit", @""), - NSLocalizedString ( - @"Report...", @""), nil)) { + NSLocalizedString (@"Report...", @""), + nil, msg)) { exit (EXIT_FAILURE); } }); @@ -1160,9 +1160,8 @@ check_xinitrc(void) @"Startup xinitrc dialog"); if (NSAlertDefaultReturn == - NSRunAlertPanel(nil, msg, NSLocalizedString(@"Yes", @""), - NSLocalizedString(@"No", - @""), nil)) { + NSRunAlertPanel(nil, @"%@", NSLocalizedString(@"Yes", @""), + NSLocalizedString(@"No", @""), nil, msg)) { char buf2[1024]; int i = -1; @@ -1239,8 +1238,16 @@ X11ApplicationMain(int argc, char **argv, char **envp) QuartzModeBundleInit(); /* Calculate the height of the menubar so we can avoid it. */ - aquaMenuBarHeight = NSHeight([[NSScreen mainScreen] frame]) - - NSMaxY([[NSScreen mainScreen] visibleFrame]); + aquaMenuBarHeight = [[NSApp mainMenu] menuBarHeight]; +#if ! __LP64__ + if (!aquaMenuBarHeight) { + aquaMenuBarHeight = [NSMenuView menuBarHeight]; + } +#endif + if (!aquaMenuBarHeight) { + NSScreen* primaryScreen = [[NSScreen screens] objectAtIndex:0]; + aquaMenuBarHeight = NSHeight([primaryScreen frame]) - NSMaxY([primaryScreen visibleFrame]); + } #ifdef HAVE_LIBDISPATCH eventTranslationQueue = dispatch_queue_create( diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m index 022e83258..c75493c42 100644 --- a/hw/xquartz/X11Controller.m +++ b/hw/xquartz/X11Controller.m @@ -364,7 +364,7 @@ extern char *bundle_id_prefix; } #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 - if (asl_log_descriptor) { + if (&asl_log_descriptor) { char *asl_sender; aslmsg amsg = asl_new(ASL_TYPE_MSG); assert(amsg); @@ -414,7 +414,7 @@ extern char *bundle_id_prefix; case 0: /* child2 */ #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 - if (asl_log_descriptor) { + if (&asl_log_descriptor) { /* Replace our stdout/stderr */ dup2(stdout_pipe[1], STDOUT_FILENO); dup2(stderr_pipe[1], STDERR_FILENO); @@ -443,7 +443,7 @@ extern char *bundle_id_prefix; } #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 - if (asl_log_descriptor) { + if (&asl_log_descriptor) { /* Close the write ends of the pipe */ close(stdout_pipe[1]); close(stderr_pipe[1]); @@ -929,14 +929,13 @@ extern char *bundle_id_prefix; * and then run the alert on a timer? It seems to work here, so.. */ - return (NSRunAlertPanel(title, msg, NSLocalizedString(@"Quit", @""), - NSLocalizedString(@"Cancel", @""), nil) - == NSAlertDefaultReturn) ? NSTerminateNow : NSTerminateCancel; + NSInteger result = NSRunAlertPanel(title, @"%@", NSLocalizedString(@"Quit", @""), + NSLocalizedString(@"Cancel", @""), nil, msg); + return (result == NSAlertDefaultReturn) ? NSTerminateNow : NSTerminateCancel; } - (void) applicationWillTerminate:(NSNotification *)aNotification _X_NORETURN { - int remain; [X11App prefs_synchronize]; /* shutdown the X server, it will exit () for us. */ diff --git a/hw/xquartz/bundle/Info.plist.cpp b/hw/xquartz/bundle/Info.plist.cpp index a0d9050ac..06e33f871 100644 --- a/hw/xquartz/bundle/Info.plist.cpp +++ b/hw/xquartz/bundle/Info.plist.cpp @@ -35,6 +35,19 @@ <string>sparkle.pem</string> <key>SUFeedURL</key> <string>http://xquartz.macosforge.org/downloads/sparkle/release.xml</string> + <key>NSAppTransportSecurity</key> + <dict> + <key>NSExceptionDomains</key> + <dict> + <key>macosforge.org</key> + <dict> + <key>NSIncludesSubdomains</key> + <true/> + <key>NSExceptionAllowsInsecureHTTPLoads</key> + <true/> + </dict> + </dict> + </dict> #endif <key>LSApplicationCategoryType</key> <string>public.app-category.utilities</string> diff --git a/hw/xquartz/bundle/Makefile.am b/hw/xquartz/bundle/Makefile.am index 87392b423..074075209 100644 --- a/hw/xquartz/bundle/Makefile.am +++ b/hw/xquartz/bundle/Makefile.am @@ -30,153 +30,123 @@ EXTRA_DIST = \ Info.plist.cpp \ PkgInfo \ $(resource_DATA) \ - Resources/ar.lproj/InfoPlist.strings \ Resources/ar.lproj/Localizable.strings \ Resources/ar.lproj/locversion.plist \ Resources/ar.lproj/main.nib/designable.nib \ Resources/ar.lproj/main.nib/keyedobjects.nib \ - Resources/ca.lproj/InfoPlist.strings \ Resources/ca.lproj/Localizable.strings \ Resources/ca.lproj/locversion.plist \ Resources/ca.lproj/main.nib/designable.nib \ Resources/ca.lproj/main.nib/keyedobjects.nib \ - Resources/cs.lproj/InfoPlist.strings \ Resources/cs.lproj/Localizable.strings \ Resources/cs.lproj/locversion.plist \ Resources/cs.lproj/main.nib/designable.nib \ Resources/cs.lproj/main.nib/keyedobjects.nib \ - Resources/da.lproj/InfoPlist.strings \ Resources/da.lproj/Localizable.strings \ Resources/da.lproj/locversion.plist \ Resources/da.lproj/main.nib/designable.nib \ Resources/da.lproj/main.nib/keyedobjects.nib \ - Resources/Dutch.lproj/InfoPlist.strings \ Resources/Dutch.lproj/Localizable.strings \ Resources/Dutch.lproj/locversion.plist \ Resources/Dutch.lproj/main.nib/designable.nib \ Resources/Dutch.lproj/main.nib/keyedobjects.nib \ - Resources/el.lproj/InfoPlist.strings \ Resources/el.lproj/Localizable.strings \ Resources/el.lproj/locversion.plist \ Resources/el.lproj/main.nib/designable.nib \ Resources/el.lproj/main.nib/keyedobjects.nib \ - Resources/English.lproj/InfoPlist.strings \ Resources/English.lproj/Localizable.strings \ Resources/English.lproj/locversion.plist \ Resources/English.lproj/main.nib/designable.nib \ Resources/English.lproj/main.nib/keyedobjects.nib \ - Resources/fi.lproj/InfoPlist.strings \ Resources/fi.lproj/Localizable.strings \ Resources/fi.lproj/locversion.plist \ Resources/fi.lproj/main.nib/designable.nib \ Resources/fi.lproj/main.nib/keyedobjects.nib \ - Resources/French.lproj/InfoPlist.strings \ Resources/French.lproj/Localizable.strings \ Resources/French.lproj/locversion.plist \ Resources/French.lproj/main.nib/designable.nib \ Resources/French.lproj/main.nib/keyedobjects.nib \ - Resources/German.lproj/InfoPlist.strings \ Resources/German.lproj/Localizable.strings \ Resources/German.lproj/locversion.plist \ Resources/German.lproj/main.nib/designable.nib \ Resources/German.lproj/main.nib/keyedobjects.nib \ - Resources/he.lproj/InfoPlist.strings \ Resources/he.lproj/Localizable.strings \ Resources/he.lproj/locversion.plist \ Resources/he.lproj/main.nib/designable.nib \ Resources/he.lproj/main.nib/keyedobjects.nib \ - Resources/hr.lproj/InfoPlist.strings \ Resources/hr.lproj/Localizable.strings \ Resources/hr.lproj/locversion.plist \ Resources/hr.lproj/main.nib/designable.nib \ Resources/hr.lproj/main.nib/keyedobjects.nib \ - Resources/hu.lproj/InfoPlist.strings \ Resources/hu.lproj/Localizable.strings \ Resources/hu.lproj/locversion.plist \ Resources/hu.lproj/main.nib/designable.nib \ Resources/hu.lproj/main.nib/keyedobjects.nib \ - Resources/Italian.lproj/InfoPlist.strings \ Resources/Italian.lproj/Localizable.strings \ Resources/Italian.lproj/locversion.plist \ Resources/Italian.lproj/main.nib/designable.nib \ Resources/Italian.lproj/main.nib/keyedobjects.nib \ - Resources/Japanese.lproj/InfoPlist.strings \ Resources/Japanese.lproj/Localizable.strings \ Resources/Japanese.lproj/locversion.plist \ Resources/Japanese.lproj/main.nib/designable.nib \ Resources/Japanese.lproj/main.nib/keyedobjects.nib \ - Resources/ko.lproj/InfoPlist.strings \ Resources/ko.lproj/Localizable.strings \ Resources/ko.lproj/locversion.plist \ Resources/ko.lproj/main.nib/designable.nib \ Resources/ko.lproj/main.nib/keyedobjects.nib \ - Resources/no.lproj/InfoPlist.strings \ Resources/no.lproj/Localizable.strings \ Resources/no.lproj/locversion.plist \ Resources/no.lproj/main.nib/designable.nib \ Resources/no.lproj/main.nib/keyedobjects.nib \ - Resources/pl.lproj/InfoPlist.strings \ Resources/pl.lproj/Localizable.strings \ Resources/pl.lproj/locversion.plist \ Resources/pl.lproj/main.nib/designable.nib \ Resources/pl.lproj/main.nib/keyedobjects.nib \ - Resources/pt.lproj/InfoPlist.strings \ Resources/pt.lproj/Localizable.strings \ Resources/pt.lproj/locversion.plist \ Resources/pt.lproj/main.nib/designable.nib \ Resources/pt.lproj/main.nib/keyedobjects.nib \ - Resources/pt_PT.lproj/InfoPlist.strings \ Resources/pt_PT.lproj/Localizable.strings \ Resources/pt_PT.lproj/locversion.plist \ Resources/pt_PT.lproj/main.nib/designable.nib \ Resources/pt_PT.lproj/main.nib/keyedobjects.nib \ - Resources/ro.lproj/InfoPlist.strings \ Resources/ro.lproj/Localizable.strings \ Resources/ro.lproj/locversion.plist \ Resources/ro.lproj/main.nib/designable.nib \ Resources/ro.lproj/main.nib/keyedobjects.nib \ - Resources/ru.lproj/InfoPlist.strings \ Resources/ru.lproj/Localizable.strings \ Resources/ru.lproj/locversion.plist \ Resources/ru.lproj/main.nib/designable.nib \ Resources/ru.lproj/main.nib/keyedobjects.nib \ - Resources/sk.lproj/InfoPlist.strings \ Resources/sk.lproj/Localizable.strings \ Resources/sk.lproj/locversion.plist \ Resources/sk.lproj/main.nib/designable.nib \ Resources/sk.lproj/main.nib/keyedobjects.nib \ - Resources/Spanish.lproj/InfoPlist.strings \ Resources/Spanish.lproj/Localizable.strings \ Resources/Spanish.lproj/locversion.plist \ Resources/Spanish.lproj/main.nib/designable.nib \ Resources/Spanish.lproj/main.nib/keyedobjects.nib \ - Resources/sv.lproj/InfoPlist.strings \ Resources/sv.lproj/Localizable.strings \ Resources/sv.lproj/locversion.plist \ Resources/sv.lproj/main.nib/designable.nib \ Resources/sv.lproj/main.nib/keyedobjects.nib \ - Resources/th.lproj/InfoPlist.strings \ Resources/th.lproj/Localizable.strings \ Resources/th.lproj/locversion.plist \ Resources/th.lproj/main.nib/designable.nib \ Resources/th.lproj/main.nib/keyedobjects.nib \ - Resources/tr.lproj/InfoPlist.strings \ Resources/tr.lproj/Localizable.strings \ Resources/tr.lproj/locversion.plist \ Resources/tr.lproj/main.nib/designable.nib \ Resources/tr.lproj/main.nib/keyedobjects.nib \ - Resources/uk.lproj/InfoPlist.strings \ Resources/uk.lproj/Localizable.strings \ Resources/uk.lproj/locversion.plist \ Resources/uk.lproj/main.nib/designable.nib \ Resources/uk.lproj/main.nib/keyedobjects.nib \ Resources/X11.icns \ - Resources/zh_CN.lproj/InfoPlist.strings \ Resources/zh_CN.lproj/Localizable.strings \ Resources/zh_CN.lproj/locversion.plist \ Resources/zh_CN.lproj/main.nib/designable.nib \ Resources/zh_CN.lproj/main.nib/keyedobjects.nib \ - Resources/zh_TW.lproj/InfoPlist.strings \ Resources/zh_TW.lproj/Localizable.strings \ Resources/zh_TW.lproj/locversion.plist \ Resources/zh_TW.lproj/main.nib/designable.nib \ diff --git a/hw/xquartz/bundle/Resources/Dutch.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/Dutch.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 8f978d63f..000000000 --- a/hw/xquartz/bundle/Resources/Dutch.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/English.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/English.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 88e1f04ac..000000000 --- a/hw/xquartz/bundle/Resources/English.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/French.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/French.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 88e1f04ac..000000000 --- a/hw/xquartz/bundle/Resources/French.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/German.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/German.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index aa37e7555..000000000 --- a/hw/xquartz/bundle/Resources/German.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/Italian.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/Italian.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 412169880..000000000 --- a/hw/xquartz/bundle/Resources/Italian.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/Japanese.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/Japanese.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 2d6330fa7..000000000 --- a/hw/xquartz/bundle/Resources/Japanese.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/Spanish.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/Spanish.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 0e4287d14..000000000 --- a/hw/xquartz/bundle/Resources/Spanish.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/ar.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/ar.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 88e1f04ac..000000000 --- a/hw/xquartz/bundle/Resources/ar.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/ca.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/ca.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 95214ff3e..000000000 --- a/hw/xquartz/bundle/Resources/ca.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/cs.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/cs.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 0f74e7c57..000000000 --- a/hw/xquartz/bundle/Resources/cs.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/da.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/da.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 88e1f04ac..000000000 --- a/hw/xquartz/bundle/Resources/da.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/el.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/el.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 72eb2b165..000000000 --- a/hw/xquartz/bundle/Resources/el.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/fi.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/fi.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 8e4f6474f..000000000 --- a/hw/xquartz/bundle/Resources/fi.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/he.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/he.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 3dd6946e1..000000000 --- a/hw/xquartz/bundle/Resources/he.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/hr.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/hr.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 7baab082c..000000000 --- a/hw/xquartz/bundle/Resources/hr.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/hu.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/hu.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 842ef04ae..000000000 --- a/hw/xquartz/bundle/Resources/hu.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/ko.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/ko.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 4c738f8b2..000000000 --- a/hw/xquartz/bundle/Resources/ko.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/no.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/no.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index eb1cfb002..000000000 --- a/hw/xquartz/bundle/Resources/no.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/pl.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/pl.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index b9c950214..000000000 --- a/hw/xquartz/bundle/Resources/pl.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/pt.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/pt.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 33c637448..000000000 --- a/hw/xquartz/bundle/Resources/pt.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/pt_PT.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/pt_PT.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 33c637448..000000000 --- a/hw/xquartz/bundle/Resources/pt_PT.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/ro.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/ro.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index dba225f56..000000000 --- a/hw/xquartz/bundle/Resources/ro.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/ru.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/ru.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 7f722e4b6..000000000 --- a/hw/xquartz/bundle/Resources/ru.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/sk.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/sk.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 53b3005ed..000000000 --- a/hw/xquartz/bundle/Resources/sk.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/sv.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/sv.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 1522655dd..000000000 --- a/hw/xquartz/bundle/Resources/sv.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/th.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/th.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 51d294bde..000000000 --- a/hw/xquartz/bundle/Resources/th.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/tr.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/tr.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 2e003a768..000000000 --- a/hw/xquartz/bundle/Resources/tr.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/uk.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/uk.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index 1153eafe5..000000000 --- a/hw/xquartz/bundle/Resources/uk.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/zh_CN.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/zh_CN.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index b5df36885..000000000 --- a/hw/xquartz/bundle/Resources/zh_CN.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/Resources/zh_TW.lproj/InfoPlist.strings b/hw/xquartz/bundle/Resources/zh_TW.lproj/InfoPlist.strings Binary files differdeleted file mode 100644 index d56e1de43..000000000 --- a/hw/xquartz/bundle/Resources/zh_TW.lproj/InfoPlist.strings +++ /dev/null diff --git a/hw/xquartz/bundle/mk_bundke.sh b/hw/xquartz/bundle/mk_bundke.sh index 288c6a9de..632e5f76b 100755 --- a/hw/xquartz/bundle/mk_bundke.sh +++ b/hw/xquartz/bundle/mk_bundke.sh @@ -12,7 +12,7 @@ for lang in ${localities} ; do mkdir -p ${BUNDLE_ROOT}/Contents/Resources/${lang}.lproj/main.nib [ -d ${BUNDLE_ROOT}/Contents/Resources/${lang}.lproj/main.nib ] || exit 1 - for f in InfoPlist.strings Localizable.strings main.nib/keyedobjects.nib ; do + for f in Localizable.strings main.nib/keyedobjects.nib ; do install -m 644 ${SRCDIR}/Resources/${lang}.lproj/$f ${BUNDLE_ROOT}/Contents/Resources/${lang}.lproj/${f} done done diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c index 5a5e4dad2..6964e2009 100644 --- a/hw/xquartz/darwinEvents.c +++ b/hw/xquartz/darwinEvents.c @@ -178,7 +178,7 @@ static int darwin_x11_modifier_mask_list[] = { 0 }; -static int darwin_all_modifier_mask_additions[] = { NX_SECONDARYFNMASK, }; +static int darwin_all_modifier_mask_additions[] = { NX_SECONDARYFNMASK, 0 }; static void DarwinUpdateModifiers(int pressed, // KeyPress or KeyRelease @@ -367,14 +367,12 @@ DarwinEQInit(void) { int *p; - for (p = darwin_x11_modifier_mask_list, darwin_all_modifier_mask = 0; *p; - p++) { + for (p = darwin_x11_modifier_mask_list; *p; p++) { darwin_x11_modifier_mask |= *p; } - for (p = darwin_all_modifier_mask_additions, - darwin_all_modifier_mask = darwin_x11_modifier_mask; - *p; p++) { + darwin_all_modifier_mask = darwin_x11_modifier_mask; + for (p = darwin_all_modifier_mask_additions; *p; p++) { darwin_all_modifier_mask |= *p; } @@ -387,7 +385,6 @@ DarwinEQInit(void) */ if (!darwinEvents) { darwinEvents = InitEventList(GetMaximumEventsNum()); - ; if (!darwinEvents) FatalError("Couldn't allocate event buffer\n"); diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c index 84e34d916..2fed59306 100644 --- a/hw/xquartz/quartzKeyboard.c +++ b/hw/xquartz/quartzKeyboard.c @@ -737,6 +737,7 @@ LegalModifier(unsigned int key, DeviceIntPtr pDev) return 1; } +#if !defined(__LP64__) || MAC_OS_X_VERSION_MIN_REQUIRED < 1050 static inline UniChar macroman2ucs(unsigned char c) { @@ -782,6 +783,7 @@ macroman2ucs(unsigned char c) if (c < 128) return c; else return table[c - 128]; } +#endif static KeySym make_dead_key(KeySym in) diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index 4639048d9..f4d8fabd4 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -565,8 +565,6 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id) void xwl_seat_destroy(struct xwl_seat *xwl_seat) { - RemoveDevice(xwl_seat->pointer, FALSE); - RemoveDevice(xwl_seat->keyboard, FALSE); wl_seat_destroy(xwl_seat->seat); wl_surface_destroy(xwl_seat->cursor); if (xwl_seat->cursor_frame_cb) diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c index 155cbc109..7e5484c7d 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c @@ -188,8 +188,6 @@ void xwl_output_destroy(struct xwl_output *xwl_output) { wl_output_destroy(xwl_output->output); - RRCrtcDestroy(xwl_output->randr_crtc); - RROutputDestroy(xwl_output->randr_output); free(xwl_output); } diff --git a/include/Makefile.am b/include/Makefile.am index 6578038a5..168b00f70 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -71,6 +71,7 @@ EXTRA_DIST = \ busfault.h dbus-core.h \ dix-config-apple-verbatim.h \ dixfontstubs.h eventconvert.h eventstr.h inpututils.h \ + probes.h \ protocol-versions.h \ systemd-logind.h \ xsha1.h diff --git a/include/probes.h b/include/probes.h new file mode 100644 index 000000000..e9cdd3e8e --- /dev/null +++ b/include/probes.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * + * 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, sublicense, + * 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 NONINFRINGEMENT. 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. + */ + +#ifndef XORG_PROBES_H +#define XORG_PROBES_H + +#ifdef HAVE_DIX_CONFIG_H +#include <dix-config.h> +#endif + +/* definitions needed to include Dtrace probes in a source file */ + +#if XSERVER_DTRACE +#include <sys/types.h> +typedef const char *string; +typedef const uint8_t *const_uint8_p; +typedef const double *const_double_p; +#include "../dix/Xserver-dtrace.h" +#endif + +#endif /* XORG_PROBES_H */ diff --git a/man/Xserver.man b/man/Xserver.man index 0349c364c..8b8f0af0f 100644 --- a/man/Xserver.man +++ b/man/Xserver.man @@ -238,7 +238,7 @@ turns off auto-repeat. turns on auto-repeat. .TP 8 .B -retro -starts the stipple with the classic stipple and cursor visible. The default +starts the server with the classic stipple and cursor visible. The default is to start with a black root window, and to suppress display of the cursor until the first time an application calls XDefineCursor(). For kdrive servers, this implies -zap. @@ -391,7 +391,7 @@ ends. .B \-class \fIdisplay-class\fP XDMCP has an additional display qualifier used in resource lookup for display-specific options. This option sets that value, by default it -is "MIT-Unspecified" (not a very useful value). +is "MIT-unspecified" (not a very useful value). .TP 8 .B \-cookie \fIxdm-auth-bits\fP When testing XDM-AUTHENTICATION-1, a private key is shared between the @@ -428,7 +428,7 @@ elapse between autorepeat-generated keystrokes). loads keyboard description in \fIfilename\fP on server startup. .SH "NETWORK CONNECTIONS" The X server supports client connections via a platform-dependent subset of -the following transport types: TCP\/IP, Unix Domain sockets, DECnet, +the following transport types: TCP/IP, Unix Domain sockets, and several varieties of SVR4 local connections. See the DISPLAY NAMES section of the \fIX\fP(__miscmansuffix__) manual page to learn how to specify which transport type clients should try to use. @@ -457,8 +457,8 @@ If no other authorization mechanism is being used, this list initially consists of the host on which the server is running as well as any machines listed in the file \fI/etc/X\fBn\fI.hosts\fR, where \fBn\fP is the display number of the server. Each line of the file should -contain either an Internet hostname (e.g. expo.lcs.mit.edu) or a DECnet -hostname in double colon format (e.g. hydra::) or a complete name in the format +contain either an Internet hostname (e.g. expo.lcs.mit.edu) +or a complete name in the format \fIfamily\fP:\fIname\fP as described in the \fIxhost\fP(1) manual page. There should be no leading or trailing spaces on any lines. For example: .sp @@ -466,7 +466,6 @@ There should be no leading or trailing spaces on any lines. For example: .nf joesworkstation corporate.company.com -star:: inet:bigcpu local: .fi diff --git a/mi/miarc.c b/mi/miarc.c index e8bc87e3e..d26f67486 100644 --- a/mi/miarc.c +++ b/mi/miarc.c @@ -1712,7 +1712,7 @@ miGetArcPts(SppArcPtr parc, /* points to an arc */ y1 = y2; } /* adjust the last point */ - if (abs(parc->angle2) >= 360.0) + if (fabs(parc->angle2) >= 360.0) poly[cpt + i - 1] = poly[0]; else { poly[cpt + i - 1].x = (miDcos(st + et) * parc->width / 2.0 + xc); @@ -599,7 +599,7 @@ mieqProcessInputEvents(void) ErrorF("[mi] EQ processing has resumed after %lu dropped events.\n", (unsigned long) miEventQueue.dropped); ErrorF - ("[mi] This may be caused my a misbehaving driver monopolizing the server's resources.\n"); + ("[mi] This may be caused by a misbehaving driver monopolizing the server's resources.\n"); miEventQueue.dropped = 0; } diff --git a/mi/miexpose.c b/mi/miexpose.c index 329532b4f..b65aaa77f 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -454,14 +454,21 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) else { PixmapPtr pixmap; - tile_x_off = drawable->x; - tile_y_off = drawable->y; + fill = pWin->border; + solid = pWin->borderIsPixel; /* servers without pixmaps draw their own borders */ if (!pScreen->GetWindowPixmap) return; pixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) drawable); drawable = &pixmap->drawable; + + while (pWin->backgroundState == ParentRelative) + pWin = pWin->parent; + + tile_x_off = pWin->drawable.x; + tile_y_off = pWin->drawable.y; + #ifdef COMPOSITE draw_x_off = pixmap->screen_x; draw_y_off = pixmap->screen_y; @@ -471,8 +478,6 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) draw_x_off = 0; draw_y_off = 0; #endif - fill = pWin->border; - solid = pWin->borderIsPixel; } gcval[0].val = GXcopy; diff --git a/mi/miwideline.c b/mi/miwideline.c index 452d74fc1..6f0b9bcbd 100644 --- a/mi/miwideline.c +++ b/mi/miwideline.c @@ -1458,7 +1458,7 @@ miLineArc(DrawablePtr pDraw, int xorgi = 0, yorgi = 0; Spans spanRec; int n; - PolyEdgeRec edge1, edge2; + PolyEdgeRec edge1 = { 0 }, edge2 = { 0 }; int edgey1, edgey2; Bool edgeleft1, edgeleft2; diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h index dadeab3cb..e147f5ce2 100644 --- a/miext/rootless/rootlessCommon.h +++ b/miext/rootless/rootlessCommon.h @@ -70,8 +70,8 @@ extern DevPrivateKeyRec rootlessWindowOldPixmapPrivateKeyRec; // RootlessGCRec: private per-gc data typedef struct { - GCFuncs *originalFuncs; - GCOps *originalOps; + const GCFuncs *originalFuncs; + const GCOps *originalOps; } RootlessGCRec; // RootlessScreenRec: per-screen private data @@ -195,19 +195,19 @@ extern RegionRec rootlessHugeRoot; #define HUGE_ROOT(pWin) \ do { \ - WindowPtr w = pWin; \ - while (w->parent) \ - w = w->parent; \ - saveRoot = w->winSize; \ - w->winSize = rootlessHugeRoot; \ + WindowPtr _w = pWin; \ + while (_w->parent) \ + _w = _w->parent; \ + saveRoot = _w->winSize; \ + _w->winSize = rootlessHugeRoot; \ } while (0) #define NORMAL_ROOT(pWin) \ do { \ - WindowPtr w = pWin; \ - while (w->parent) \ - w = w->parent; \ - w->winSize = saveRoot; \ + WindowPtr _w = pWin; \ + while (_w->parent) \ + _w = _w->parent; \ + _w->winSize = saveRoot; \ } while (0) // Returns TRUE if this window is a top-level window (i.e. child of the root) diff --git a/miext/rootless/rootlessGC.c b/miext/rootless/rootlessGC.c index 4fba26c8d..235b3ab7c 100644 --- a/miext/rootless/rootlessGC.c +++ b/miext/rootless/rootlessGC.c @@ -403,7 +403,7 @@ RootlessCopyClip(GCPtr pgcDst, GCPtr pgcSrc) #define GCOP_UNWRAP(pGC) \ RootlessGCRec *gcrec = (RootlessGCRec *) \ dixLookupPrivate(&(pGC)->devPrivates, rootlessGCPrivateKey); \ - GCFuncs *saveFuncs = pGC->funcs; \ + const GCFuncs *saveFuncs = pGC->funcs; \ (pGC)->funcs = gcrec->originalFuncs; \ (pGC)->ops = gcrec->originalOps; diff --git a/miext/rootless/rootlessValTree.c b/miext/rootless/rootlessValTree.c index 0f7b76cb6..409e6a092 100644 --- a/miext/rootless/rootlessValTree.c +++ b/miext/rootless/rootlessValTree.c @@ -487,7 +487,7 @@ RootlessMiValidateTree(WindowPtr pRoot, /* Parent to validate */ if (RegionBroken(&pRoot->clipList) && !RegionBroken(&pRoot->borderClip)) { // fixme this might not work, but hopefully doesn't happen anyway. kind = VTBroken; - RegionEmpty(&pRoot->clipList); + RegionNull(&pRoot->clipList); ErrorF("ValidateTree: BUSTED!\n"); } diff --git a/os/connection.c b/os/connection.c index 6b0aa6d20..973ed212b 100644 --- a/os/connection.c +++ b/os/connection.c @@ -113,17 +113,11 @@ SOFTWARE. #ifdef HAVE_GETPEERUCRED #include <ucred.h> #include <zone.h> -#endif - -#ifdef XSERVER_DTRACE -#include <sys/types.h> -typedef const char *string; - -#ifndef HAVE_GETPEERUCRED +#else #define zoneid_t int #endif -#include "../dix/Xserver-dtrace.h" -#endif + +#include "probes.h" static int lastfdesc; /* maximum file descriptor */ diff --git a/os/utils.c b/os/utils.c index 9bb39eb11..6ed927b16 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1216,26 +1216,57 @@ SmartScheduleTimer(int sig) SmartScheduleTime += SmartScheduleInterval; } -void -SmartScheduleInit(void) +static int +SmartScheduleEnable(void) { + int ret = 0; #ifdef SMART_SCHEDULE_POSSIBLE struct sigaction act; if (SmartScheduleDisable) - return; + return 0; memset((char *) &act, 0, sizeof(struct sigaction)); /* Set up the timer signal function */ + act.sa_flags = SA_RESTART; act.sa_handler = SmartScheduleTimer; sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGALRM); - if (sigaction(SIGALRM, &act, 0) < 0) { + ret = sigaction(SIGALRM, &act, 0); +#endif + return ret; +} + +static int +SmartSchedulePause(void) +{ + int ret = 0; +#ifdef SMART_SCHEDULE_POSSIBLE + struct sigaction act; + + if (SmartScheduleDisable) + return 0; + + memset((char *) &act, 0, sizeof(struct sigaction)); + + act.sa_handler = SIG_IGN; + sigemptyset(&act.sa_mask); + ret = sigaction(SIGALRM, &act, 0); +#endif + return ret; +} + +void +SmartScheduleInit(void) +{ + if (SmartScheduleDisable) + return; + + if (SmartScheduleEnable() < 0) { perror("sigaction for smart scheduler"); SmartScheduleDisable = TRUE; } -#endif } #ifdef SIG_BLOCK @@ -1431,8 +1462,6 @@ static struct pid { int pid; } *pidlist; -OsSigHandlerPtr old_alarm = NULL; /* XXX horrible awful hack */ - void * Popen(const char *command, const char *type) { @@ -1455,8 +1484,7 @@ Popen(const char *command, const char *type) } /* Ignore the smart scheduler while this is going on */ - old_alarm = OsSignal(SIGALRM, SIG_IGN); - if (old_alarm == SIG_ERR) { + if (SmartSchedulePause() < 0) { close(pdes[0]); close(pdes[1]); free(cur); @@ -1469,7 +1497,7 @@ Popen(const char *command, const char *type) close(pdes[0]); close(pdes[1]); free(cur); - if (OsSignal(SIGALRM, old_alarm) == SIG_ERR) + if (SmartScheduleEnable() < 0) perror("signal"); return NULL; case 0: /* child */ @@ -1644,7 +1672,7 @@ Pclose(void *iop) /* allow EINTR again */ OsReleaseSignals(); - if (old_alarm && OsSignal(SIGALRM, old_alarm) == SIG_ERR) { + if (SmartScheduleEnable() < 0) { perror("signal"); return -1; } diff --git a/os/xdmauth.c b/os/xdmauth.c index f11cbb997..482bc67db 100644 --- a/os/xdmauth.c +++ b/os/xdmauth.c @@ -227,7 +227,7 @@ XdmClientAuthTimeout(long now) prev = 0; for (client = xdmClients; client; client = next) { next = client->next; - if (abs(now - client->time) > TwentyFiveMinutes) { + if (labs(now - client->time) > TwentyFiveMinutes) { if (prev) prev->next = next; else @@ -299,7 +299,7 @@ XdmAuthorizationValidate(unsigned char *plain, int length, } now += clockOffset; XdmClientAuthTimeout(now); - if (abs(client->time - now) > TwentyMinutes) { + if (labs(client->time - now) > TwentyMinutes) { free(client); if (reason) *reason = "Excessive XDM-AUTHORIZATION-1 time offset"; diff --git a/os/xdmcp.c b/os/xdmcp.c index b265db338..5bdcbe9c9 100644 --- a/os/xdmcp.c +++ b/os/xdmcp.c @@ -84,8 +84,6 @@ static int req_socklen; static CARD32 SessionID; static CARD32 timeOutTime; static int timeOutRtx; -static CARD32 defaultKeepaliveDormancy = XDM_DEF_DORMANCY; -static CARD32 keepaliveDormancy = XDM_DEF_DORMANCY; static CARD16 DisplayNumber; static xdmcp_states XDM_INIT_STATE = XDM_OFF; @@ -199,8 +197,6 @@ static void send_packet(void); static void timeout(void); -static void restart(void); - static void XdmcpBlockHandler(void *data , struct timeval **wt, void *LastSelectMask); @@ -634,6 +630,7 @@ XdmcpOpenDisplay(int sock) if (state != XDM_AWAIT_MANAGE_RESPONSE) return; state = XDM_RUN_SESSION; + timeOutTime = GetTimeInMillis() + XDM_DEF_DORMANCY * 1000; sessionSocket = sock; } @@ -691,7 +688,6 @@ XdmcpWakeupHandler(void *data, /* unused */ int i, void *pReadmask) { fd_set *last_select_mask = (fd_set *) pReadmask; - fd_set devicesReadable; if (state == XDM_OFF) return; @@ -706,15 +702,6 @@ XdmcpWakeupHandler(void *data, /* unused */ FD_CLR(xdmcpSocket6, last_select_mask); } #endif - XFD_ANDSET(&devicesReadable, last_select_mask, &EnabledDevices); - if (XFD_ANYSET(&devicesReadable)) { - if (state == XDM_AWAIT_USER_INPUT) - restart(); - else if (state == XDM_RUN_SESSION) - keepaliveDormancy = defaultKeepaliveDormancy; - } - if (XFD_ANYSET(&AllClients) && state == XDM_RUN_SESSION) - timeOutTime = GetTimeInMillis() + keepaliveDormancy * 1000; } else if (timeOutTime && (int) (GetTimeInMillis() - timeOutTime) >= 0) { if (state == XDM_RUN_SESSION) { @@ -936,14 +923,6 @@ timeout(void) send_packet(); } -static void -restart(void) -{ - state = XDM_INIT_STATE; - timeOutRtx = 0; - send_packet(); -} - static int XdmcpCheckAuthentication(ARRAY8Ptr Name, ARRAY8Ptr Data, int packet_type) { @@ -1411,15 +1390,8 @@ recv_alive_msg(unsigned length) if (XdmcpReadCARD8(&buffer, &SessionRunning) && XdmcpReadCARD32(&buffer, &AliveSessionID)) { if (SessionRunning && AliveSessionID == SessionID) { - /* backoff dormancy period */ state = XDM_RUN_SESSION; - if ((GetTimeInMillis() - LastEventTime(XIAllDevices).milliseconds) > - keepaliveDormancy * 1000) { - keepaliveDormancy <<= 1; - if (keepaliveDormancy > XDM_MAX_DORMANCY) - keepaliveDormancy = XDM_MAX_DORMANCY; - } - timeOutTime = GetTimeInMillis() + keepaliveDormancy * 1000; + timeOutTime = GetTimeInMillis() + XDM_DEF_DORMANCY * 1000; } else { XdmcpDeadSession("Alive response indicates session dead"); @@ -1427,6 +1399,7 @@ recv_alive_msg(unsigned length) } } +_X_NORETURN static void XdmcpFatal(const char *type, ARRAY8Ptr status) { diff --git a/present/present.c b/present/present.c index a6346015e..beb4ff03a 100644 --- a/present/present.c +++ b/present/present.c @@ -710,9 +710,9 @@ present_pixmap(WindowPtr window, present_notify_ptr notifies, int num_notifies) { - uint64_t ust; + uint64_t ust = 0; uint64_t target_msc; - uint64_t crtc_msc; + uint64_t crtc_msc = 0; int ret; present_vblank_ptr vblank, tmp; ScreenPtr screen = window->drawable.pScreen; @@ -734,13 +734,15 @@ present_pixmap(WindowPtr window, target_crtc = present_get_crtc(window); } - present_get_ust_msc(screen, target_crtc, &ust, &crtc_msc); + ret = present_get_ust_msc(screen, target_crtc, &ust, &crtc_msc); target_msc = present_window_to_crtc_msc(window, target_crtc, window_msc, crtc_msc); - /* Stash the current MSC away in case we need it later - */ - window_priv->msc = crtc_msc; + if (ret == Success) { + /* Stash the current MSC away in case we need it later + */ + window_priv->msc = crtc_msc; + } /* Adjust target_msc to match modulus */ @@ -931,7 +933,7 @@ present_notify_msc(WindowPtr window, 0, 0, NULL, NULL, NULL, - PresentOptionAsync, + divisor == 0 ? PresentOptionAsync : 0, target_msc, divisor, remainder, NULL, 0); } diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index dca0691ac..349874514 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -1663,23 +1663,30 @@ Bool RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable) { rrScrPriv(pDrawable->pScreen); - int i; - Bool size_fits = FALSE; - Bool changed = FALSE; Bool ret = TRUE; + PixmapPtr *saved_scanout_pixmap; + int i; + + saved_scanout_pixmap = malloc(sizeof(PixmapPtr)*pScrPriv->numCrtcs); + if (saved_scanout_pixmap == NULL) + return FALSE; for (i = 0; i < pScrPriv->numCrtcs; i++) { RRCrtcPtr crtc = pScrPriv->crtcs[i]; + Bool size_fits; + + saved_scanout_pixmap[i] = crtc->scanout_pixmap; if (!crtc->mode && enable) continue; + if (!crtc->scanout_pixmap && !enable) + continue; - changed = FALSE; - if (crtc->mode && crtc->x == pDrawable->x && - crtc->y == pDrawable->y && - crtc->mode->mode.width == pDrawable->width && - crtc->mode->mode.height == pDrawable->height) - size_fits = TRUE; + size_fits = (crtc->mode && + crtc->x == pDrawable->x && + crtc->y == pDrawable->y && + crtc->mode->mode.width == pDrawable->width && + crtc->mode->mode.height == pDrawable->height); /* is the pixmap already set? */ if (crtc->scanout_pixmap == pPixmap) { @@ -1687,32 +1694,48 @@ RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable) if (enable == FALSE) { /* set scanout to NULL */ crtc->scanout_pixmap = NULL; - changed = TRUE; - } else { - /* if the size fits then we are already setup */ - if (size_fits) - return TRUE; + } + else if (!size_fits) { /* if the size no longer fits then drop off */ crtc->scanout_pixmap = NULL; - changed = TRUE; + pScrPriv->rrCrtcSetScanoutPixmap(crtc, crtc->scanout_pixmap); + + (*pScrPriv->rrCrtcSet) (pDrawable->pScreen, crtc, crtc->mode, crtc->x, crtc->y, + crtc->rotation, crtc->numOutputs, crtc->outputs); + saved_scanout_pixmap[i] = crtc->scanout_pixmap; ret = FALSE; } - } else { + else { + /* if the size fits then we are already setup */ + } + } + else { if (!size_fits) - return FALSE; - if (enable) { + ret = FALSE; + else if (enable) crtc->scanout_pixmap = pPixmap; - pScrPriv->rrCrtcSetScanoutPixmap(crtc, pPixmap); - changed = TRUE; - } + else + /* reject an attempt to disable someone else's scanout_pixmap */ + ret = FALSE; } + } + + for (i = 0; i < pScrPriv->numCrtcs; i++) { + RRCrtcPtr crtc = pScrPriv->crtcs[i]; + + if (crtc->scanout_pixmap == saved_scanout_pixmap[i]) + continue; - if (changed && pScrPriv->rrCrtcSet) { + if (ret) { pScrPriv->rrCrtcSetScanoutPixmap(crtc, crtc->scanout_pixmap); (*pScrPriv->rrCrtcSet) (pDrawable->pScreen, crtc, crtc->mode, crtc->x, crtc->y, crtc->rotation, crtc->numOutputs, crtc->outputs); } + else + crtc->scanout_pixmap = saved_scanout_pixmap[i]; } + free(saved_scanout_pixmap); + return ret; } diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c index b9346d3f9..7fee2bf9c 100644 --- a/randr/rrdispatch.c +++ b/randr/rrdispatch.c @@ -92,7 +92,9 @@ ProcRRSelectInput(ClientPtr client) RRCrtcChangeNotifyMask | RROutputChangeNotifyMask | RROutputPropertyNotifyMask | - RRProviderPropertyNotifyMask)) { + RRProviderChangeNotifyMask | + RRProviderPropertyNotifyMask | + RRResourceChangeNotifyMask)) { ScreenPtr pScreen = pWin->drawable.pScreen; rrScrPriv(pScreen); diff --git a/randr/rrtransform.c b/randr/rrtransform.c index c8a27498f..f3f1b1e65 100644 --- a/randr/rrtransform.c +++ b/randr/rrtransform.c @@ -121,7 +121,7 @@ RRTransformRescale(struct pixman_f_transform *f_transform, double limit) for (j = 0; j < 3; j++) for (i = 0; i < 3; i++) - if ((v = abs(f_transform->m[j][i])) > max) + if ((v = fabs(f_transform->m[j][i])) > max) max = v; scale = limit / max; for (j = 0; j < 3; j++) diff --git a/render/picture.c b/render/picture.c index 6ff31ba02..6e23e2bbf 100644 --- a/render/picture.c +++ b/render/picture.c @@ -856,7 +856,11 @@ createSourcePicture(void) { PicturePtr pPicture; - pPicture = dixAllocateScreenObjectWithPrivates(NULL, PictureRec, PRIVATE_PICTURE); + pPicture = dixAllocateScreenObjectWithPrivates(NULL, PictureRec, + PRIVATE_PICTURE); + if (!pPicture) + return 0; + pPicture->pDrawable = 0; pPicture->pFormat = 0; pPicture->pNext = 0; @@ -896,7 +900,7 @@ CreateLinearGradientPicture(Picture pid, xPointFixed * p1, xPointFixed * p2, { PicturePtr pPicture; - if (nStops < 2) { + if (nStops < 1) { *error = BadValue; return 0; } @@ -936,7 +940,7 @@ CreateRadialGradientPicture(Picture pid, xPointFixed * inner, PicturePtr pPicture; PictRadialGradient *radial; - if (nStops < 2) { + if (nStops < 1) { *error = BadValue; return 0; } @@ -979,7 +983,7 @@ CreateConicalGradientPicture(Picture pid, xPointFixed * center, xFixed angle, { PicturePtr pPicture; - if (nStops < 2) { + if (nStops < 1) { *error = BadValue; return 0; } @@ -1392,6 +1396,7 @@ FreePicture(void *value, XID pid) if (--pPicture->refcnt == 0) { free(pPicture->transform); + free(pPicture->filter_params); if (pPicture->pSourcePict) { if (pPicture->pSourcePict->type != SourcePictTypeSolidFill) diff --git a/render/render.c b/render/render.c index 723f380c2..93e43e7a3 100644 --- a/render/render.c +++ b/render/render.c @@ -2099,20 +2099,7 @@ SProcRenderComposite(ClientPtr client) static int SProcRenderScale(ClientPtr client) { - REQUEST(xRenderScaleReq); - REQUEST_SIZE_MATCH(xRenderScaleReq); - swaps(&stuff->length); - swapl(&stuff->src); - swapl(&stuff->dst); - swapl(&stuff->colorScale); - swapl(&stuff->alphaScale); - swaps(&stuff->xSrc); - swaps(&stuff->ySrc); - swaps(&stuff->xDst); - swaps(&stuff->yDst); - swaps(&stuff->width); - swaps(&stuff->height); - return (*ProcRenderVector[stuff->renderReqType]) (client); + return BadImplementation; } static int |