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

Conversation

uli42
Copy link
Member

@uli42 uli42 commented May 13, 2019

I want to know if this has chances to get merged, from a license point of view. It it okay to handle derived code like I do here?

@uli42 uli42 requested review from sunweaver and Ionic May 13, 2019 20:05
Copy link
Member

@sunweaver sunweaver left a comment

Choose a reason for hiding this comment

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

@uli42: Thanks for working on this massive clean-up branch. You mainly have two strategies:

  • renaming the Xserver's original function to xorg_<bla> and calling the original code from within the DDX's code (plus run some extra code before or after calling the Xserver original code): This is ok license wise.

  • Secondly, you move snippets from hw/nxagent/NX*.c to dix/*.c: This is not ok, as you mix GPL-2 code and Xserver code (licensed under MIT/X11 or some such). What is possible: put the code fragment from hw/nxagent/NX*.c into some helper function and call that helper function from within the DIX code base. This is a formalistic trick for calling nxagent code paths from within the DIX code base. (The function call comes from you, so you can license it under the Xserver's license).

nx-X11/programs/Xserver/Xext/xvdisp.c Show resolved Hide resolved
nx-X11/programs/Xserver/Xext/xvdisp.c Show resolved Hide resolved
nx-X11/programs/Xserver/Xext/shm.c Show resolved Hide resolved
nx-X11/programs/Xserver/Xext/shm.c Show resolved Hide resolved
nx-X11/programs/Xserver/dix/window.c Outdated Show resolved Hide resolved
free(CurrentSelections);
CurrentSelections = (Selection *)NULL;
NumCurrentSelections = 0;
xorg_InitSelections();
Copy link
Member

Choose a reason for hiding this comment

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

Ahhhh... now I get what you are doing.

Ok. These xorg_* namespacing commits, they will work copyright wise...

*/

|| (nxagentRenderTrap && strcmp(extensions[i]->name, "RENDER") == 0)
#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.

*/

if (nxagentRenderTrap && strcmp(extensions[i]->name, "RENDER") == 0)
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.

@@ -248,7 +248,7 @@ NXAGENTOBJS = hw/nxagent/miinitext.o \
hw/nxagent/NXglxext.o \
hw/nxagent/NXmiexpose.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.

if (imageblt)
(*pGC->ops->ImageGlyphBlt)(pDrawable, pGC, x, y, n, charinfo,
FONTGLYPHS(pGC->font));
else
(*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, n, charinfo,
FONTGLYPHS(pGC->font));
#endif
Copy link
Member

Choose a reason for hiding this comment

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

strictly thinking, this is also GPL-2 license stuff. Even if it is just an ifdef block that gets added.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have taken another look into this and found I have made a mistake. This must be an #ifndef instead of #ifdef. I guess disabling code is ok, license wise. Right?

@sunweaver
Copy link
Member

sunweaver commented May 21, 2019 via email

@sunweaver
Copy link
Member

sunweaver commented May 22, 2019 via email

@uli42
Copy link
Member Author

uli42 commented May 22, 2019

Ok, and what about simply calling an existing function? Is that ok or do we need a wrapper, too? I am thinking about this:

#ifdef NXAGENT_SERVER
    nxagentFlushConfigureWindow();
#endif

@sunweaver
Copy link
Member

sunweaver commented May 22, 2019 via email

@uli42
Copy link
Member Author

uli42 commented May 22, 2019

That's the problem with most of NX's changes: It's no easy to judge... Generally one could add hooks here and there. But you cannot have them everywhere without cluttering the whole upstream code.

I am tempted to drop changes that are enclosed in ifdef TEST or DEBUG. And changes that simply print something. But there are also changes the really look important...

@sunweaver
Copy link
Member

sunweaver commented May 22, 2019 via email

@uli42 uli42 force-pushed the pr/simplify_derivations branch 3 times, most recently from dbbe658 to 92eb55c Compare May 31, 2019 23:25
@sunweaver
Copy link
Member

@uli42: is PR #805 ready for a second review iteration? Please rebase beforehand. Thanks.

@uli42
Copy link
Member Author

uli42 commented Jun 11, 2019

no, currently this is not uptodate. I will alert when it's time for another review. Currently I try to pull out commits from here into separate branches to get stuff included that can clearly be merged.

@sunweaver
Copy link
Member

sunweaver commented Jun 11, 2019 via email

@uli42 uli42 force-pushed the pr/simplify_derivations branch from 92eb55c to 627641e Compare June 21, 2019 14:00
@uli42 uli42 force-pushed the pr/simplify_derivations branch from 627641e to 58cb1cc Compare August 6, 2019 20:03
@sunweaver
Copy link
Member

@uli42: What's the status of the PR (#805)? Is it ready for review again? I left some requests / comments. Please get in touch.

@uli42
Copy link
Member Author

uli42 commented Aug 10, 2019 via email

uli42 added 11 commits September 1, 2019 13:40
"clipboard=something" does not need to be passed on, so return after
setting nxagentOptions accordingly. This fixes

[nx-X11/programs/Xserver/hw/nxagent/Args.c:1584]: (error) Uninitialized variable: argc
Right at the beginnigng of nxagentParseSingleOption we check for
"clipboard" and prepare argv and argc accordingly for
ddxProcessArgument. The removed code thus could never be reached.
This should disable clipboard but effictively did activate clipboard=both.
NXxvdisp.c only exists to set/unset nxagentXvTrap before/after
dispatch. There's no need to duplicate the original code. We now
rename the original dispatch functions and call them in our dispatch
code.

Also drop check for sun and cygwin, as they never appeared in xorg
upstream code.
instead of having an own (identical) copy
The only difference was one short code block. There's no need to clone
~100 lines just for that...
@uli42 uli42 force-pushed the pr/simplify_derivations branch from 58cb1cc to 047ab33 Compare September 1, 2019 13:22
@uli42 uli42 force-pushed the pr/simplify_derivations branch from 9ee3a20 to 6e5100a Compare September 5, 2019 18:53
@sunweaver
Copy link
Member

Ok, I guess it is time for this one, I guess?

@uli42
Copy link
Member Author

uli42 commented Oct 29, 2019

I have now split this up, see #858 to #869. Some NXwindow commits are left, I need to rework them because of "incompatible license" issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants