Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr/simplify derivations #805

Open
wants to merge 54 commits into
base: 3.6.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
5b5ea5e
Args.c: fix unitialized variable
uli42 Jun 22, 2019
31fdc04
Args.c: remove unreachable code
uli42 Jun 22, 2019
3cc7209
Args.c: fix clipboard=0 or -clipboard 0
uli42 Jun 22, 2019
dcee638
Args.c: simplify options string allocation
uli42 Jun 22, 2019
9ce59a6
NXrender.c, render.c: fix memory leaks
uli42 May 30, 2019
f4ea243
NXrender.c: fix possible memory leak
uli42 Jun 21, 2019
1384e74
NXshm.c: rework code to be identical for ProcShmDispatch and SProcShm…
uli42 May 1, 2019
8067b1d
Simplify (NX)xvdisp.c
uli42 May 1, 2019
1b7d18c
NXshm.c: use upstream versions of Dispatch functions
uli42 May 1, 2019
36f11b3
NXwindow.c: call upstream version UnmapWindow()
uli42 May 1, 2019
3803fad
NXwindow.c: use upstream function ReparentWindow()
uli42 May 1, 2019
8ca5b50
NXwindow.c: use upstream function DeleteWindow()
uli42 May 1, 2019
b85d5b4
NXwindow.c: use upstream function ResizeChildrenWinSize()
uli42 May 1, 2019
31139f3
NXwindow.c: use upstream function ConfigureWindow()
uli42 May 1, 2019
28760ea
NXwindow.c: use upstream version of MapWindow()
uli42 May 21, 2019
ba197b2
NXwindow.c: call upstream function for SaveScreens()
uli42 May 1, 2019
45a9972
NXdamage.c: drop file and replace it by a link
uli42 May 5, 2019
df73aa7
NXglxext.c: use upstream versions of Dispatch functions
uli42 May 1, 2019
18239e0
NXdispatch.c: Simplify InitSelections()
uli42 May 3, 2019
265d974
NXdispatch.c: call upstream CloseDownClient()
uli42 May 3, 2019
aa8bb89
NXdispatch.c: simplify InitClientPrivates()
uli42 May 3, 2019
c541d8f
NXextension.c: use upstream ProcQueryExtension()
uli42 May 5, 2019
ed99411
NXextension.c: use upstream ProcListExtensions()
uli42 May 5, 2019
40259b4
NXextension.c: remove Open Group copyright notice
uli42 May 5, 2019
2134c50
NXevents.c: call upstream versions of (De)ActivatePointerGrab()
uli42 May 5, 2019
f4c2074
(Mis)use MapWindow()'s returncode to signal NX code
uli42 May 21, 2019
071d869
Introduce NXhooks.c
uli42 May 21, 2019
6ace1df
NXevents.c: call upstream version of ProcSendEvent()
uli42 May 22, 2019
2668d2c
NXevents.c: call upstream DefineInitialRootWindow()
uli42 May 22, 2019
81970d4
NXEvents.c: mark NX specific code
uli42 May 22, 2019
baf2272
NXevents.c: call upstream ProcAllocEvents()
uli42 May 22, 2019
72c7b41
NXglyphcurs.c: use dixChangeCG()
uli42 May 22, 2019
09fc26f
NXglyph.c: adapt FindGlyph() to better match render/glyph.c
uli42 May 22, 2019
6ac13c4
NX{dispatch,mitrap,picture,render}.c: mark NX changes
uli42 May 25, 2019
a60f654
NXrender.c: modify code to match upstream as close as possible
uli42 May 25, 2019
007502a
miwindow.c: mark NX changes
uli42 May 26, 2019
1c55def
NXshm.c: call upstream ShmExtensionInit
uli42 May 30, 2019
631f6b4
NXshm.c: call upstream miShmPutImage
uli42 May 30, 2019
b4b6511
NXrender.c: call upstream versions of (S)ProcRenderDispatch
uli42 May 30, 2019
6801d6a
Pixmap.c: call miModifyPixmapHeader twice instead of duplicating code
uli42 Jun 11, 2019
b17088d
NXglyph.c: mark NX changes
uli42 Jun 11, 2019
c205f2b
NXwindow.c: drop own UnmapWindow()
uli42 Sep 1, 2019
1162081
NXwindow.c: call InitRootWindow from dix
uli42 Sep 1, 2019
bc00ae9
nxagent: move atom initiatialization to Init.c
uli42 Sep 1, 2019
250eb10
nxagent: drop unused return code of nxagentRenderRealizeCursor
uli42 Sep 1, 2019
c175824
Render.c: simplify nxagentRenderRealizeCursor
uli42 Sep 1, 2019
3541c5f
Render.c: drop unused nxagentValidatePicture
uli42 Sep 1, 2019
8207057
Render.c. simplify nxagentMatchingFormats
uli42 Sep 1, 2019
8a8c12d
Render.c: fix broken comment
uli42 Sep 1, 2019
b2a23d5
Render.c: drop unused nxagentRasterizeTrapezoid
uli42 Sep 1, 2019
3437b25
NXpicture.c: call xorg upstream versions of Create*Picture
uli42 Sep 1, 2019
0e9bca5
NXrender.c: Code simplifications
uli42 Sep 1, 2019
52aca52
fixup! NX{dispatch,mitrap,picture,render}.c: mark NX changes
uli42 Sep 1, 2019
6e5100a
fixup! NX{dispatch,mitrap,picture,render}.c: mark NX changes
uli42 Sep 2, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions nx-X11/programs/Xserver/GL/glx/glxext.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,15 @@ __GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag,

/************************************************************************/

#ifndef NXAGENT_SERVER

/*
** Top level dispatcher; all commands are executed from here down.
*/
#ifdef NXAGENT_SERVER
static int xorg__glXDispatch(ClientPtr client)
#else
static int __glXDispatch(ClientPtr client)
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the xorg_* namespace here?

{
REQUEST(xGLXSingleReq);
CARD8 opcode;
Expand Down Expand Up @@ -449,8 +452,6 @@ static int __glXDispatch(ClientPtr client)
return (*proc)(cl, (GLbyte *) stuff);
}

#endif /* NXAGENT_SERVER */


int __glXNoSuchSingleOpcode(__GLXclientState *cl, GLbyte *pc)
{
Expand Down
6 changes: 3 additions & 3 deletions nx-X11/programs/Xserver/Imakefile
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ NXAGENTOBJS = hw/nxagent/miinitext.o \
hw/nxagent/NXextension.o \
hw/nxagent/NXglxext.o \
hw/nxagent/NXresource.o \
hw/nxagent/NXdamage.o \
hw/nxagent/damage.o \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels wrong (symlinks damage.[c|o] from DIX to DDX). Why not build damage.c at its original location?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the same as with some other linked files: NXdamage.c did not have any code left after cleanup, but in dix/damage.c there are NXAGENT_SERVER ifdefs. That define is only set during nxagent compilation, but not during dix compilation.

$(NULL)
#elif !defined(Win32Architecture)
NXAGENTOBJS = hw/nxagent/miinitext.o \
Expand All @@ -264,7 +264,7 @@ NXAGENTOBJS = hw/nxagent/miinitext.o \
hw/nxagent/NXglxext.o \
hw/nxagent/NXxvdisp.o \
hw/nxagent/NXresource.o \
hw/nxagent/NXdamage.o \
hw/nxagent/damage.o \
$(NULL)
#else
NXAGENTOBJS = hw/nxagent/miinitext.o \
Expand All @@ -281,7 +281,7 @@ NXAGENTOBJS = hw/nxagent/miinitext.o \
hw/nxagent/NXglxext.o \
hw/nxagent/NXxvdisp.o \
hw/nxagent/NXresource.o \
hw/nxagent/NXdamage.o \
hw/nxagent/damage.o \
dix/main.o \
$(NULL)
#endif
Expand Down
5 changes: 1 addition & 4 deletions nx-X11/programs/Xserver/Xext/Imakefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ XF86BIGFOBJS = xf86bigfont.o
#endif
#endif

#if BuildXvExt && ( (defined(NXAgentServer) && NXAgentServer) && !defined(SunArchitecture) && !defined(cygwinArchitecture) )
XVSRCS = xvmain.c xvmc.c
XVOBJS = xvmain.o xvmc.o
#elif BuildXvExt
#if BuildXvExt
XVSRCS = xvmain.c xvdisp.c xvmc.c
XVOBJS = xvmain.o xvdisp.o xvmc.o
#endif
Expand Down
24 changes: 17 additions & 7 deletions nx-X11/programs/Xserver/Xext/shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,12 @@ static Bool CheckForShmSyscall()

#endif

#ifndef NXAGENT_SERVER
void
#ifdef NXAGENT_SERVER
xorg_ShmExtensionInit(void)
#else
ShmExtensionInit(void)
#endif
{
ExtensionEntry *extEntry;
int i;
Expand Down Expand Up @@ -253,7 +256,6 @@ ShmExtensionInit(void)
EventSwapVector[ShmCompletionCode] = (EventSwapPtr) SShmCompletionEvent;
}
}
#endif /* NXAGENT_SERVER */

/*ARGSUSED*/
static void
Expand Down Expand Up @@ -490,9 +492,12 @@ ProcShmDetach(client)
return(client->noClientException);
}

#ifndef NXAGENT_SERVER
static void
#ifdef NXAGENT_SERVER
xorg_miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
#else
miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
#endif
DrawablePtr dst;
GCPtr pGC;
int depth, w, h, sx, sy, sw, sh, dx, dy;
Expand Down Expand Up @@ -525,6 +530,7 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
(*pmap->drawable.pScreen->DestroyPixmap)(pmap);
}

#ifndef NXAGENT_SERVER
static void
fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
DrawablePtr dst;
Expand Down Expand Up @@ -1138,9 +1144,12 @@ ProcShmCreatePixmap(client)
return (BadAlloc);
}

#ifndef NXAGENT_SERVER
static int
#ifdef NXAGENT_SERVER
xorg_ProcShmDispatch (client)
#else
ProcShmDispatch (client)
#endif
uli42 marked this conversation as resolved.
Show resolved Hide resolved
register ClientPtr client;
{
REQUEST(xReq);
Expand Down Expand Up @@ -1174,7 +1183,6 @@ ProcShmDispatch (client)
return BadRequest;
}
}
#endif /* NXAGENT_SERVER */

static void
SShmCompletionEvent(from, to)
Expand Down Expand Up @@ -1278,9 +1286,12 @@ SProcShmCreatePixmap(client)
return ProcShmCreatePixmap(client);
}

#ifndef NXAGENT_SERVER
static int
#ifdef NXAGENT_SERVER
xorg_SProcShmDispatch (client)
#else
SProcShmDispatch (client)
#endif
uli42 marked this conversation as resolved.
Show resolved Hide resolved
register ClientPtr client;
{
REQUEST(xReq);
Expand All @@ -1302,4 +1313,3 @@ SProcShmDispatch (client)
return BadRequest;
}
}
#endif /* NXAGENT_SERVER */
11 changes: 8 additions & 3 deletions nx-X11/programs/Xserver/Xext/xvdisp.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,12 @@ static int SWriteImageFormatInfo(ClientPtr, xvImageFormatInfo*);
**
*/

#if !defined(NXAGENT_SERVER) || defined(__sun) || defined(__CYGWIN__)

int
#ifdef NXAGENT_SERVER
xorg_ProcXvDispatch(ClientPtr client)
#else
ProcXvDispatch(ClientPtr client)
#endif
uli42 marked this conversation as resolved.
Show resolved Hide resolved
{
REQUEST(xReq);

Expand Down Expand Up @@ -309,7 +311,11 @@ ProcXvDispatch(ClientPtr client)
}

int
#ifdef NXAGENT_SERVER
xorg_SProcXvDispatch(ClientPtr client)
#else
SProcXvDispatch(ClientPtr client)
#endif
uli42 marked this conversation as resolved.
Show resolved Hide resolved
{
REQUEST(xReq);

Expand Down Expand Up @@ -353,7 +359,6 @@ SProcXvDispatch(ClientPtr client)
}
}
}
#endif /* !defined(NXAGENT_SERVER) || defined(__sun) || defined(__CYGWIN__) */


static int
Expand Down
22 changes: 14 additions & 8 deletions nx-X11/programs/Xserver/dix/dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,18 @@ UpdateCurrentTimeIf()
currentTime = systime;
}

#ifndef NXAGENT_SERVER
void
InitSelections()
#ifdef NXAGENT_SERVER
xorg_InitSelections(void)
#else
InitSelections(void)
#endif
{
if (CurrentSelections)
free(CurrentSelections);
CurrentSelections = (Selection *)NULL;
NumCurrentSelections = 0;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why xorg_* namespace?

#endif /* NXAGENT_SERVER */

#undef SMART_DEBUG

Expand Down Expand Up @@ -3475,11 +3477,14 @@ InitProcVectors(void)
* then killed again, the client is really destroyed.
*********************/

#ifndef NXAGENT_SERVER
char dispatchExceptionAtReset = DE_RESET;

void
CloseDownClient(register ClientPtr client)
#ifdef NXAGENT_SERVER
xorg_CloseDownClient(ClientPtr client)
#else
CloseDownClient(ClientPtr client)
#endif
{
Bool really_close_down = client->clientGone ||
client->closeDownMode == DestroyAll;
Expand Down Expand Up @@ -3564,7 +3569,6 @@ CloseDownClient(register ClientPtr client)
currentMaxClients--;
}
}
#endif /* NXAGENT_SERVER */

static void
KillAllClients()
Expand Down Expand Up @@ -3641,9 +3645,12 @@ void InitClient(ClientPtr client, int i, void * ospriv)
client->clientIds = NULL;
}

#ifndef NXAGENT_SERVER
int
#ifdef NXAGENT_SERVER
xorg_InitClientPrivates(ClientPtr client)
#else
InitClientPrivates(ClientPtr client)
#endif
{
register char *ptr;
DevUnion *ppriv;
Expand Down Expand Up @@ -3687,7 +3694,6 @@ InitClientPrivates(ClientPtr client)
}
return 1;
}
#endif /* NXAGENT_SERVER */

/************************
* int NextAvailableClient(ospriv)
Expand Down
29 changes: 22 additions & 7 deletions nx-X11/programs/Xserver/dix/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -1216,10 +1216,14 @@ CheckGrabForSyncs(register DeviceIntPtr thisDev, Bool thisMode, Bool otherMode)
ComputeFreezes();
}

#ifndef NXAGENT_SERVER
void
ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab,
#ifdef NXAGENT_SERVER
xorg_ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab,
TimeStamp time, Bool autoGrab)
#else
ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab,
TimeStamp time, Bool autoGrab)
#endif
{
WindowPtr oldWin = (mouse->grab) ? mouse->grab->window
: sprite.win;
Expand All @@ -1246,7 +1250,11 @@ ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab,
}

void
#ifdef NXAGENT_SERVER
xorg_DeactivatePointerGrab(register DeviceIntPtr mouse)
#else
DeactivatePointerGrab(register DeviceIntPtr mouse)
#endif
{
register GrabPtr grab = mouse->grab;
register DeviceIntPtr dev;
Expand All @@ -1268,7 +1276,6 @@ DeactivatePointerGrab(register DeviceIntPtr mouse)
FreeCursor(grab->cursor, (Cursor)0);
ComputeFreezes();
}
#endif /* NXAGENT_SERVER */

void
ActivateKeyboardGrab(register DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, Bool passive)
Expand Down Expand Up @@ -1429,7 +1436,11 @@ AllowSome(ClientPtr client, TimeStamp time, DeviceIntPtr thisDev, int newState)
}

int
#ifdef NXAGENT_SERVER
xorg_ProcAllowEvents(register ClientPtr client)
#else
ProcAllowEvents(register ClientPtr client)
#endif
{
TimeStamp time;
DeviceIntPtr mouse = inputInfo.pointer;
Expand Down Expand Up @@ -2063,9 +2074,12 @@ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff)
}
#endif

#ifndef NXAGENT_SERVER
void
#ifdef NXAGENT_SERVER
xorg_DefineInitialRootWindow(register WindowPtr win)
#else
DefineInitialRootWindow(register WindowPtr win)
#endif
{
register ScreenPtr pScreen = win->drawable.pScreen;

Expand Down Expand Up @@ -2105,7 +2119,6 @@ DefineInitialRootWindow(register WindowPtr win)
}
#endif
}
#endif /* NXAGENT_SERVER */

/*
* This does not take any shortcuts, and even ignores its argument, since
Expand Down Expand Up @@ -3940,9 +3953,12 @@ CloseDownEvents(void)
spriteTraceSize = 0;
}

#ifndef NXAGENT_SERVER
int
#ifdef NXAGENT_SERVER
xorg_ProcSendEvent(ClientPtr client)
#else
ProcSendEvent(ClientPtr client)
#endif
{
WindowPtr pWin;
WindowPtr effectiveFocus = NullWindow; /* only set if dest==InputFocus */
Expand Down Expand Up @@ -4027,7 +4043,6 @@ ProcSendEvent(ClientPtr client)
NullGrab, 0);
return Success;
}
#endif /* NXAGENT_SERVER */

int
ProcUngrabKey(ClientPtr client)
Expand Down
13 changes: 11 additions & 2 deletions nx-X11/programs/Xserver/dix/extension.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ extern int extensionPrivateLen;
extern unsigned *extensionPrivateSizes;
extern unsigned totalExtensionSize;

#ifdef NXAGENT_SERVER
#include "NXhooks.h"
#endif

static void
InitExtensionPrivates(ExtensionEntry *ext)
{
Expand Down Expand Up @@ -332,7 +336,6 @@ CloseDownExtensions()
}
}

#ifndef NXAGENT_SERVER
int
ProcQueryExtension(ClientPtr client)
{
Expand All @@ -354,6 +357,9 @@ ProcQueryExtension(ClientPtr client)
{
i = FindExtension((char *)&stuff[1], stuff->nbytes);
if (i < 0
#ifdef NXAGENT_SERVER
|| nxagentHook_IsFaultyRenderExtension(extensions[i]->name)
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this bit into nxagent DDX code, then it is ok.

#ifdef XCSECURITY
/* don't show insecure extensions to untrusted clients */
|| (client->trustLevel == XSecurityClientUntrusted &&
Expand Down Expand Up @@ -400,6 +406,10 @@ ProcListExtensions(ClientPtr client)
if (client->trustLevel == XSecurityClientUntrusted &&
!extensions[i]->secure)
continue;
#endif
#ifdef NXAGENT_SERVER
if (nxagentHook_IsFaultyRenderExtension(extensions[i]->name))
continue;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to DDX code base.

#endif
total_length += strlen(extensions[i]->name) + 1;
reply.nExtensions += 1 + extensions[i]->num_aliases;
Expand Down Expand Up @@ -437,7 +447,6 @@ ProcListExtensions(ClientPtr client)
}
return(client->noClientException);
}
#endif

ExtensionLookupProc
LookupProc(char *name, GCPtr pGC)
Expand Down
Loading