Re: [PATCH 3/3 all repositories] autogen: Set a default subject prefix for patches

2017-01-23 Thread Peter Hutterer
On Tue, Jan 24, 2017 at 02:35:34AM +, Emil Velikov wrote:
> On 24 January 2017 at 00:40, Peter Hutterer  wrote:
> > From: Adam Jackson 
> >
> > Per discussion at XDC2015, we want this so we can easily distinguish
> > which module a patch is for. There's no way to set this in the
> > server-side config, so setting a default at autogen time is about the
> > best we can do.
> >
> > Reviewed-by: Eric Anholt 
> > Signed-off-by: Adam Jackson 
> > Signed-off-by: Peter Hutterer 
> > ---
> >  autogen.sh | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/autogen.sh b/autogen.sh
> > index 0006de8..cda30cc 100755
> > --- a/autogen.sh
> > +++ b/autogen.sh
> > @@ -9,6 +9,9 @@ cd "$srcdir"
> >  autoreconf -v --install || exit 1
> >  cd "$ORIGDIR" || exit $?
> >
> > +git config --local --get format.subjectPrefix ||
> > +git config --local format.subjectPrefix "PATCH bigreqsproto"
> Seems off, plus a simple basename `pwd` might not always work.

that's an artefact of the script I used here on the first repository, i.e.
it shows that it's working (I took this patchset from the bigreqsproto
repo). the prefix is hardcoded per repository. 

> Mihail Konev has a patch (message id
> <20161014000652.GA12465@localhost>) which includes a tarball with all
> the patches.
> From a quick skim things seem ok - don't see anything wrong and/or
> missing. Fwiw I'd go with that one.

ok, I'll have a look at that one too then, thanks.

Cheers,
   Peter



> 
> The rest of the series is (fwiw)
> Reviewed-by: Emil Velikov 
> 
> Thanks !
> Emil
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH util-modular 4/4] release.sh: implement around git worktree

2017-01-23 Thread Emil Velikov
On 24 January 2017 at 01:14, Peter Hutterer  wrote:
> On Mon, Jan 23, 2017 at 12:51:31PM +, Emil Velikov wrote:
>> On 23 January 2017 at 04:03, Peter Hutterer  wrote:
>> > On Fri, Jan 20, 2017 at 02:19:06PM +, Emil Velikov wrote:
>> >> On 20 January 2017 at 02:49, Peter Hutterer  
>> >> wrote:
>> >> > On Thu, Jan 19, 2017 at 07:30:10PM +, Emil Velikov wrote:
>> >> >> From: Emil Velikov 
>> >> >>
>> >> >> Months ago, before my work in here there the script had a number of
>> >> >> assumptions:
>> >> >>  - autoreconf or alike is ran by the user - slight nuisance esp. when
>> >> >> releasing multiple packages.
>> >> >>  - the generated files were compatible with the ones on the server -
>> >> >> rarely and issue, but still
>> >> >>  - config.status means 'all the autotools bits were generated 
>> >> >> correctly'
>> >> >>  - failed to consider if user has multiple config.status - using
>> >> >> ./build-64bit/ and ./build-32bit/ anyone ?
>> >> >>  - ...
>> >> >>
>> >> >> With 663364cda5e316a0509ff5869293e3a815b9945f we mitigated a lot of 
>> >> >> that
>> >> >> but did not consider
>> >> >>  - forcing people to `git clean' is annoying and if not careful one can
>> >> >> purge local files that they want to keep
>> >> >>  - the files generated by autotools were left behind
>> >> >>
>> >> >> In order to mitigate those use git worktree. This is more efficient
>> >> >> [both bandwidth and storage wise] than pulling/generating git tarballs,
>> >> >> git clone and friends.
>> >> >>
>> >> >> Cc: Peter Hutterer 
>> >> >> Signed-off-by: Emil Velikov 
>> >> >> ---
>> >> >> There's a git of noise produced by git worktree and autoreconf. I'm 
>> >> >> fine
>> >> >> with 2>/dev/null but I'd leave that to others to decide
>> >> >> ---
>> >> >>  release.sh | 34 +++---
>> >> >>  1 file changed, 19 insertions(+), 15 deletions(-)
>> >> >>
>> >> >> diff --git a/release.sh b/release.sh
>> >> >> index 8ed179d..0b3fcbf 100755
>> >> >> --- a/release.sh
>> >> >> +++ b/release.sh
>> >> >> @@ -357,25 +357,24 @@ process_module() {
>> >> >>   return 1
>> >> >>  fi
>> >> >>
>> >> >> -if [ -e configure ]; then
>> >> >> -echo "Error: the git repository contains configure"
>> >> >> -echo "Did you forget to run git clean -fXd (and git clean 
>> >> >> -fxd) ?"
>> >> >> -return 1
>> >> >> -fi
>> >> >> -
>> >> >> -# Create tmpdir for the build
>> >> >> +# Create tmpdir for the release
>> >> >>  build_dir=`mktemp -d -p . build.XX`
>> >> >>  if [ $? -ne 0 ]; then
>> >> >> -echo "Error: could not create a temporary directory for the 
>> >> >> build."
>> >> >> +echo "Error: could not create a temporary directory for the 
>> >> >> release"
>> >> >>  echo "Do you have coreutils' mktemp ?"
>> >> >>  return 1
>> >> >>  fi
>> >> >>
>> >> >> -echo "Info: generating configure."
>> >> >> -autoreconf --force --install >/dev/null
>> >> >> +# Worktree removal is intentionally left to the user, due to:
>> >> >> +#  - currently we cannot select only one worktree to prune
>> >> >> +#  - requires to removal of $build_dir which might contradict 
>> >> >> with the
>> >> >> +# user decision to keep some artefacts like tarballs or other
>> >> >> +echo "Info: creating new git worktree."
>> >> >> +git worktree add $build_dir
>> >> >>  if [ $? -ne 0 ]; then
>> >> >> -echo "Error: failed to generate configure."
>> >> >> -return 1
>> >> >> + echo "Error: failed to create a git worktree."
>> >> >> + cd $top_src
>> >> >> + return 1
>> >> >
>> >> > there's an indentation error,
>> >> Funky indentation was there (it was a code movement) - we still have a
>> >> handful of tabs that are meant to be 8 spaces.
>> >>
>> >> > but otherwise the series looks good and is
>> >> > Reviewed-by: Peter Hutterer 
>> >> >
>> >> Note: after another thought I've went with v2 for 3/4 (having a
>> >> version check and building from there).
>> >>
>> >> > I guess I'll test this on the next release ;)
>> >> >
>> >> Thank you very much. Please let me know if you spot anything odd.
>> >
>> > Ok, tested it on the libXi release and something is off, but haven't found
>> > out what it is yet. You can reproduce it by running a --dry-run on the 
>> > libXi
>> > repo, for some reason make distcleancheck fails with
>> >
>> > ERROR: files left in build directory after distclean:
>> > ./config.sub
>> > ./ltmain.sh
>> > ./config.guess
>> > ./install-sh
>> > ./missing
>> > ./depcomp
>> > ./compile
>> > make[1]: *** [distcleancheck] Error 1
>> >
>> > since these are standard files, it's not a libXi issue, must be something 
>> > to
>> > do with the worktrees or how we invoke configure. Reverting this patch
>> > makes it work 

Re: [PATCH v2 xserver 3/4] dri2: refine dri2_probe_driver_name (v2)

2017-01-23 Thread Emil Velikov
On 23 January 2017 at 06:30, Yu, Qiang  wrote:
>
> Hi,
>
> If no further comments, can this patch be merged?
>
It's up-to our maintainers to pull the series. They might be a bit
busy with other atm.

-Emil
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH 3/3 all repositories] autogen: Set a default subject prefix for patches

2017-01-23 Thread Emil Velikov
On 24 January 2017 at 00:40, Peter Hutterer  wrote:
> From: Adam Jackson 
>
> Per discussion at XDC2015, we want this so we can easily distinguish
> which module a patch is for. There's no way to set this in the
> server-side config, so setting a default at autogen time is about the
> best we can do.
>
> Reviewed-by: Eric Anholt 
> Signed-off-by: Adam Jackson 
> Signed-off-by: Peter Hutterer 
> ---
>  autogen.sh | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/autogen.sh b/autogen.sh
> index 0006de8..cda30cc 100755
> --- a/autogen.sh
> +++ b/autogen.sh
> @@ -9,6 +9,9 @@ cd "$srcdir"
>  autoreconf -v --install || exit 1
>  cd "$ORIGDIR" || exit $?
>
> +git config --local --get format.subjectPrefix ||
> +git config --local format.subjectPrefix "PATCH bigreqsproto"
Seems off, plus a simple basename `pwd` might not always work.

Mihail Konev has a patch (message id
<20161014000652.GA12465@localhost>) which includes a tarball with all
the patches.
From a quick skim things seem ok - don't see anything wrong and/or
missing. Fwiw I'd go with that one.

The rest of the series is (fwiw)
Reviewed-by: Emil Velikov 

Thanks !
Emil
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH util-modular v3] release.sh: remove $MESA_VERSION from the destination location

2017-01-23 Thread Emil Velikov
From: Emil Velikov 

Requested by a number of distribution maintainers. Used starting with
the 17.0 series.

v2: Keep things conditional based on the version.
v3: Also update srv_path, to create the correct path

Signed-off-by: Emil Velikov 
---
 release.sh | 20 
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/release.sh b/release.sh
index f5ea397..3eca537 100755
--- a/release.sh
+++ b/release.sh
@@ -574,18 +574,22 @@ process_module() {
 elif [ x"$section" = xmesa ]; then
 host_current=$host_mesa
 mesa_version=`echo $pkg_version | sed 's:-rc.*::'`
-section_path=archive/$mesa_version
+section_path=archive
 srv_path="/srv/$host_current/www/$section_path"
 list_to=$list_mesa_announce
 list_cc=$list_mesa_devel
 
-# Mesa uses separate folder for each release
-echo "Info: creating mesa directory on web server:"
-ssh $USER_NAME$hostname mkdir -p $srv_path  &>/dev/null
-if [ $? -ne 0 ]; then
-echo "Error: cannot create the path \"$srv_path\" on the web 
server."
-cd $top_src
-return 1
+# Prior to 17.0.x Mesa uses separate folder for each release
+if test `echo $mesa_version | cut -d'.' -f1` -lt 17; then
+section_path=$section_path/$mesa_version
+srv_path="/srv/$host_current/www/$section_path"
+echo "Info: creating mesa directory on web server:"
+ssh $USER_NAME$hostname mkdir -p $srv_path  &>/dev/null
+if [ $? -ne 0 ]; then
+echo "Error: cannot create the path \"$srv_path\" on the web 
server."
+cd $top_src
+return 1
+fi
 fi
 fi
 
-- 
2.11.0

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH util-modular 4/4] release.sh: implement around git worktree

2017-01-23 Thread Peter Hutterer
On Mon, Jan 23, 2017 at 12:51:31PM +, Emil Velikov wrote:
> On 23 January 2017 at 04:03, Peter Hutterer  wrote:
> > On Fri, Jan 20, 2017 at 02:19:06PM +, Emil Velikov wrote:
> >> On 20 January 2017 at 02:49, Peter Hutterer  
> >> wrote:
> >> > On Thu, Jan 19, 2017 at 07:30:10PM +, Emil Velikov wrote:
> >> >> From: Emil Velikov 
> >> >>
> >> >> Months ago, before my work in here there the script had a number of
> >> >> assumptions:
> >> >>  - autoreconf or alike is ran by the user - slight nuisance esp. when
> >> >> releasing multiple packages.
> >> >>  - the generated files were compatible with the ones on the server -
> >> >> rarely and issue, but still
> >> >>  - config.status means 'all the autotools bits were generated correctly'
> >> >>  - failed to consider if user has multiple config.status - using
> >> >> ./build-64bit/ and ./build-32bit/ anyone ?
> >> >>  - ...
> >> >>
> >> >> With 663364cda5e316a0509ff5869293e3a815b9945f we mitigated a lot of that
> >> >> but did not consider
> >> >>  - forcing people to `git clean' is annoying and if not careful one can
> >> >> purge local files that they want to keep
> >> >>  - the files generated by autotools were left behind
> >> >>
> >> >> In order to mitigate those use git worktree. This is more efficient
> >> >> [both bandwidth and storage wise] than pulling/generating git tarballs,
> >> >> git clone and friends.
> >> >>
> >> >> Cc: Peter Hutterer 
> >> >> Signed-off-by: Emil Velikov 
> >> >> ---
> >> >> There's a git of noise produced by git worktree and autoreconf. I'm fine
> >> >> with 2>/dev/null but I'd leave that to others to decide
> >> >> ---
> >> >>  release.sh | 34 +++---
> >> >>  1 file changed, 19 insertions(+), 15 deletions(-)
> >> >>
> >> >> diff --git a/release.sh b/release.sh
> >> >> index 8ed179d..0b3fcbf 100755
> >> >> --- a/release.sh
> >> >> +++ b/release.sh
> >> >> @@ -357,25 +357,24 @@ process_module() {
> >> >>   return 1
> >> >>  fi
> >> >>
> >> >> -if [ -e configure ]; then
> >> >> -echo "Error: the git repository contains configure"
> >> >> -echo "Did you forget to run git clean -fXd (and git clean 
> >> >> -fxd) ?"
> >> >> -return 1
> >> >> -fi
> >> >> -
> >> >> -# Create tmpdir for the build
> >> >> +# Create tmpdir for the release
> >> >>  build_dir=`mktemp -d -p . build.XX`
> >> >>  if [ $? -ne 0 ]; then
> >> >> -echo "Error: could not create a temporary directory for the 
> >> >> build."
> >> >> +echo "Error: could not create a temporary directory for the 
> >> >> release"
> >> >>  echo "Do you have coreutils' mktemp ?"
> >> >>  return 1
> >> >>  fi
> >> >>
> >> >> -echo "Info: generating configure."
> >> >> -autoreconf --force --install >/dev/null
> >> >> +# Worktree removal is intentionally left to the user, due to:
> >> >> +#  - currently we cannot select only one worktree to prune
> >> >> +#  - requires to removal of $build_dir which might contradict with 
> >> >> the
> >> >> +# user decision to keep some artefacts like tarballs or other
> >> >> +echo "Info: creating new git worktree."
> >> >> +git worktree add $build_dir
> >> >>  if [ $? -ne 0 ]; then
> >> >> -echo "Error: failed to generate configure."
> >> >> -return 1
> >> >> + echo "Error: failed to create a git worktree."
> >> >> + cd $top_src
> >> >> + return 1
> >> >
> >> > there's an indentation error,
> >> Funky indentation was there (it was a code movement) - we still have a
> >> handful of tabs that are meant to be 8 spaces.
> >>
> >> > but otherwise the series looks good and is
> >> > Reviewed-by: Peter Hutterer 
> >> >
> >> Note: after another thought I've went with v2 for 3/4 (having a
> >> version check and building from there).
> >>
> >> > I guess I'll test this on the next release ;)
> >> >
> >> Thank you very much. Please let me know if you spot anything odd.
> >
> > Ok, tested it on the libXi release and something is off, but haven't found
> > out what it is yet. You can reproduce it by running a --dry-run on the libXi
> > repo, for some reason make distcleancheck fails with
> >
> > ERROR: files left in build directory after distclean:
> > ./config.sub
> > ./ltmain.sh
> > ./config.guess
> > ./install-sh
> > ./missing
> > ./depcomp
> > ./compile
> > make[1]: *** [distcleancheck] Error 1
> >
> > since these are standard files, it's not a libXi issue, must be something to
> > do with the worktrees or how we invoke configure. Reverting this patch
> > makes it work again.
> >
> That's strange I haven't seen issues like the ones you mentioned.
> Fetching a clean copy of libXi and doing "../path/to/release.sh .
> --dry-run" brings up other issues :-]

ok, verified, sorry. clean clone of the repo seems 

libx11: Issues with Data32/_XData32

2017-01-23 Thread James Clarke
Hi,
I've been debugging an issue in gtk2-perl causing it to SIGBUS on
sparc64, and traced it back to what seems to be dodgy code inside
libx11. One of the tests calls gdk_window_set_opacity, which calls
XChangeProperty with a pointer to a guint32, cast to char*, with the
length set to 32 bits as expected. However, this data pointer then gets
cast to a (long *) on line 83 of ChProp.c when calling Data32. Indeed,
the definition of Data32 specifies that data is a (long *) on sparc64,
since LONG64 is defined. This feels very wrong, but in and of itself is
not too bad (I believe it violates strict aliasing).

The problem really comes inside the implementation of _XData32. The
destination buffer, buf, is an (int *), but data is still a (long *).
These are not the same size. The issues with this are as follows:

 1. Incrementing data increases the pointer by 8, so it skips over every
other 4-byte int, and reads twice as many bytes as it should.

 2. On big-endian systems, (int)*(long *)an_int_pointer will end up
getting the 4 bytes *after* an_int_pointer, which means it gets
completely the wrong data even in the case of len being 4 (bytes).

 3. On sparc64, pointers have strict alignment requirements - they must
be size aligned (ie (int *) must be 4-byte aligned, (long *) must be
8-byte aligned). In this case, the data pointer (which came all the
way from gdk_window_set_opacity) is only 4-byte aligned (which is
fine, since it's a pointer to a guint32), but it has been cast to a
(long *) and dereferenced, so it is required to be 8-byte aligned.
This is the cause of the observed crash.

However, I wonder how 1. is not seen currently given the wide use
of X11 on amd64. I can only assume 2. not being seen is because the only
64-bit big-endian architectures are generally used for servers, and
there aren't many of them.

I don't know what the solution to the problem is. There are various
places in the call stack where this could be fixed up. The "correct" fix
seems to be to change Data32 to take an (int *) (or some other data type
of your choosing if you're worried about int's size not being portable)
and fix up the casts at all the call sites, but this is an intrusive
change to a public header, and I worry that there are things out there
relying on the current behaviour.

Alternatively, Data32 could be altered to still take a (long *), but
cast it back to an (int *). This has the advantage of not touching
public headers, but the prototype is then lying about what it's actually
doing, and this still has the problem of breaking behaviour.

The final, ugly alternative, is to alter XChangeProperty so it makes a
copy of data as an array of long, padding or sign-extending each
element, before passing it to Data32.

I can't claim to have spent much time looking through the code, so it's
highly likely I've missed something. Could those with more knowledge
please comment on the above?

Thanks,
James
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] libXinerama: Set number to 0 on error.

2017-01-23 Thread Tobias Stoeckmann
On Mon, Jan 23, 2017 at 11:52:13AM -0500, Adam Jackson wrote:
> Not that any caller has likely made this mistake, but you want an if
> (number) before this, otherwise you turn a protocol error into a
> segfault.

If a caller supplies NULL, a segfault would always occur because the
pointer is never checked for NULL.


Tobias
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [Mesa-dev] Time to update GSoC/EVoC ideas page

2017-01-23 Thread Daniel Vetter
On Fri, Jan 20, 2017 at 08:44:19AM -0800, Jason Ekstrand wrote:
> On Fri, Jan 20, 2017 at 2:15 AM, Nicolai Hähnle  wrote:
> 
> > Hi Rob,
> >
> > On 19.01.2017 23:32, Rob Clark wrote:
> >
> >> Just a friendly reminder that now would be a good time to update the
> >> wiki page for GSoC/EVoC ideas:
> >>
> >>   https://www.x.org/wiki/SummerOfCodeIdeas/
> >>
> >> There are currently still some stale ideas there (and probably plenty
> >> of missing good ideas).
> >>
> >> Also, I've added a "Potential Mentors" section.  Please add yourself
> >> if you are willing to be a mentor (and what sorts of projects you
> >> would be willing to mentor)
> >>
> >
> > I'd be happy to be listed as a possible mentor on the DriConf replacement
> > project (nha on IRC/freenode), but I either don't have a Wiki account or
> > forgot it a long time ago. Could you put my name down on the page?
> >
> 
> Pro tip: You can just git clone the wiki, change a markdown file, and git
> push it back up.  That's the way I always make edits.  Way nicer than a web
> GUI. :-)

And if you have a shell account, it's easy to resurrect your web wiki
account:

https://wiki.freedesktop.org/sitewranglers/wiki/401/

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH 2/3 all repositories] autogen.sh: use quoted string variables

2017-01-23 Thread Peter Hutterer
From: Emil Velikov 

Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
fall-outs, when they contain space.

Signed-off-by: Emil Velikov 
Reviewed-by: Peter Hutterer 
Signed-off-by: Peter Hutterer 
---
 autogen.sh | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index fd9c59a..0006de8 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,14 +1,14 @@
 #! /bin/sh
 
-srcdir=`dirname $0`
+srcdir=`dirname "$0"`
 test -z "$srcdir" && srcdir=.
 
 ORIGDIR=`pwd`
-cd $srcdir
+cd "$srcdir"
 
 autoreconf -v --install || exit 1
-cd $ORIGDIR || exit $?
+cd "$ORIGDIR" || exit $?
 
 if test -z "$NOCONFIGURE"; then
-exec $srcdir/configure "$@"
+exec "$srcdir"/configure "$@"
 fi
-- 
2.9.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH 3/3 all repositories] autogen: Set a default subject prefix for patches

2017-01-23 Thread Peter Hutterer
From: Adam Jackson 

Per discussion at XDC2015, we want this so we can easily distinguish
which module a patch is for. There's no way to set this in the
server-side config, so setting a default at autogen time is about the
best we can do.

Reviewed-by: Eric Anholt 
Signed-off-by: Adam Jackson 
Signed-off-by: Peter Hutterer 
---
 autogen.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/autogen.sh b/autogen.sh
index 0006de8..cda30cc 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -9,6 +9,9 @@ cd "$srcdir"
 autoreconf -v --install || exit 1
 cd "$ORIGDIR" || exit $?
 
+git config --local --get format.subjectPrefix ||
+git config --local format.subjectPrefix "PATCH bigreqsproto"
+
 if test -z "$NOCONFIGURE"; then
 exec "$srcdir"/configure "$@"
 fi
-- 
2.9.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH 0/3 all repositories] autogen.sh: sync with server

2017-01-23 Thread Peter Hutterer

Heads up: I'll be pushing the following three patches into all xorg
repositories that need it in the next few days. Speak up now or be forever
silent, etc. etc.

Cheers,
  Peter
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH 1/3 all repositories] autogen.sh: use exec instead of waiting for configure to finish

2017-01-23 Thread Peter Hutterer
Syncs the invocation of configure with the one from the server.

Signed-off-by: Peter Hutterer 
---
 autogen.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/autogen.sh b/autogen.sh
index fc34bd5..fd9c59a 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -10,5 +10,5 @@ autoreconf -v --install || exit 1
 cd $ORIGDIR || exit $?
 
 if test -z "$NOCONFIGURE"; then
-$srcdir/configure "$@"
+exec $srcdir/configure "$@"
 fi
-- 
2.9.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 00/19] Module loader cleanup

2017-01-23 Thread Julien Cristau
On Mon, Jan 23, 2017 at 14:32:14 -0500, Adam Jackson wrote:

> I'd like to move the module loader up to dix. In preparation for that, here's
> a bunch of cleanup patches. The first three aren't mine, I just think they're
> neat.
> 
A few nits in separate mails, but for the series:
Reviewed-by: Julien Cristau 

Cheers,
Julien
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 19/19] loader: Fix an obviously backwards comparison

2017-01-23 Thread Julien Cristau
On Mon, Jan 23, 2017 at 14:32:33 -0500, Adam Jackson wrote:

> Hmm, this code looks wrong to me. I know! Instead of fix it, I'll put a
> comment here that nobody will look at for decades on end.
> 
> Yaaay xfree86.
> 
> Signed-off-by: Adam Jackson 
> ---
>  hw/xfree86/loader/loadmod.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
> index ca77c7a..55bec14 100644
> --- a/hw/xfree86/loader/loadmod.c
> +++ b/hw/xfree86/loader/loadmod.c
> @@ -545,8 +545,7 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * 
> data,
> "(%d)\n", module, maj, reqmaj);
>  return FALSE;
>  }
> -/* XXX Maybe this should be the other way around? */
> -if (min > reqmin) {
> +if (min < reqmin) {
>  LogMessageVerb(X_WARNING, 2, "%s: module ABI minor version "
> "(%d) is newer than that available (%d)\n",
> module, min, reqmin);

I guess the message should be fixed too?

Cheers,
Julien
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 06/19] loader: Remove *GetOS

2017-01-23 Thread Julien Cristau
On Mon, Jan 23, 2017 at 14:32:20 -0500, Adam Jackson wrote:

> This API is dumb.  uname(3) exists, feel free to use it, but ideally
> write to the interface not to the OS.  There are a couple of drivers
> using this API, they could all reasonably just not.
> 
It's uname(2) AFAICT :)

Cheers,
Julien
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 02/19] xfree86: remove unused path from the LoadModule API

2017-01-23 Thread Aaron Plattner
On 01/23/2017 01:27 PM, Eric Anholt wrote:
> Adam Jackson  writes:
> 
>> From: Emil Velikov 
>>
>> Similar to its little brothre - LoadSubModule. Currently all call sites
>> provide NULL anyway ;-)
> 
> "brother".  Other than that,
> 
> Reviewed-by: Eric Anholt 

Reviewed-by: Aaron Plattner 

We don't use LoadModule in our driver, and if we do start loading extra
stuff, it'll probably be with LoadSubModule anyway.

-- Aaron
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 04/19] xfree86: flatten pathlist management in the loader

2017-01-23 Thread Julien Cristau
On Mon, Jan 23, 2017 at 14:32:18 -0500, Adam Jackson wrote:

> From: Emil Velikov 
> 
> Now that used can set the path only via LoaderSetPath(), we can simplify
> things.
> 
used -> users, maybe?

Cheers,
Julien
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 04/19] xfree86: flatten pathlist management in the loader

2017-01-23 Thread Eric Anholt
Adam Jackson  writes:

> From: Emil Velikov 
>
> Now that used can set the path only via LoaderSetPath(), we can simplify

"users"?

Other than that, 4-14 are:

Reviewed-by: Eric Anholt 

There is so much "wow, remember when that was a thing?" in this series.
Time to go get some lunch before I see if I can get through the
remaining few patches.


signature.asc
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 01/19] xfree86: remove references from LoadSubModule's path from the doc

2017-01-23 Thread Julien Cristau
On Mon, Jan 23, 2017 at 14:32:15 -0500, Adam Jackson wrote:

> From: Emil Velikov 
> 
> Afaics the argument hasn't been part of the API since the documentation
> has been converted to xml with commit fc6ebe1e1d3 "Convert LinuxDoc
> documents to DocBook/XML"
> 
The commit message seems confused.  AFAICT the text says "LoadSubModule
is like LoadModule except it doesn't take a 'path' parameter", which
until patch 2 seems to be correct?

Cheers,
Julien

> Signed-off-by: Emil Velikov 
> ---
>  hw/xfree86/doc/ddxDesign.xml | 6 +-
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml
> index f7d6628..b62272d 100644
> --- a/hw/xfree86/doc/ddxDesign.xml
> +++ b/hw/xfree86/doc/ddxDesign.xml
> @@ -5695,11 +5695,7 @@ the server, and may also be used from within modules.
>  described above, except that the module loaded is registered as a
>  child of the calling module.  The parent parameter
>  is the calling module's handle.  Modules loaded with this function
> -are automatically unloaded when the parent module is unloaded.  The
> -other difference is that the path parameter may not be specified.
> -The module search path used for modules loaded with this function
> -is the default search path as initialised with
> -LoaderSetPath().
> +are automatically unloaded when the parent module is unloaded.
>   
>  
> 
> -- 
> 2.9.3
> 
> ___
> xorg-devel@lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH:xdm] Install xdm man pages under admin section (8), not user programs (1)

2017-01-23 Thread Julien Cristau
On Mon, Jan 16, 2017 at 16:26:08 -0800, Alan Coopersmith wrote:

> As best I can tell, it was historically under section 1 mainly because
> the old X Consortium Imake configs only supporting installing program
> man pages there, and didn't have an option for using other sections.
> 
> Signed-off-by: Alan Coopersmith 
> ---
> 
> I'm sending this out not just for review that I made the right changes,
> but to see if there's general agreement this change is right.  It was
> pointed out by one of our users who thought it odd that gdm's man page
> is in section 8, but xdm's is in section 1.
> 
That seems right to me.

Cheers,
Julien
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 02/19] xfree86: remove unused path from the LoadModule API

2017-01-23 Thread Eric Anholt
Adam Jackson  writes:

> From: Emil Velikov 
>
> Similar to its little brothre - LoadSubModule. Currently all call sites
> provide NULL anyway ;-)

"brother".  Other than that,

Reviewed-by: Eric Anholt 


signature.asc
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 01/19] xfree86: remove references from LoadSubModule's path from the doc

2017-01-23 Thread Eric Anholt
Adam Jackson  writes:

> From: Emil Velikov 
>
> Afaics the argument hasn't been part of the API since the documentation
> has been converted to xml with commit fc6ebe1e1d3 "Convert LinuxDoc
> documents to DocBook/XML"

In the subject, "remove references *to* LoadSubModule's path"?

Potential followup: ddxDesign.xml's LoaderSetPath() docs refer to these
functions taking a path, when they don't any more.

Reviewed-by: Eric Anholt 


signature.asc
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 00/19] Module loader cleanup

2017-01-23 Thread Adam Jackson
I'd like to move the module loader up to dix. In preparation for that, here's
a bunch of cleanup patches. The first three aren't mine, I just think they're
neat.

 b/hw/xfree86/common/xf86.h  |2 
 b/hw/xfree86/common/xf86Config.c|   78 -
 b/hw/xfree86/common/xf86Config.h|1 
 b/hw/xfree86/common/xf86Configure.c |  103 +--
 b/hw/xfree86/common/xf86Helper.c|   19 -
 b/hw/xfree86/common/xf86Init.c  |6 
 b/hw/xfree86/common/xf86Module.h|   31 --
 b/hw/xfree86/common/xf86str.h   |   10 
 b/hw/xfree86/doc/ddxDesign.xml  |   81 -
 b/hw/xfree86/loader/Makefile.am |3 
 b/hw/xfree86/loader/loader.c|   47 +--
 b/hw/xfree86/loader/loader.h|2 
 b/hw/xfree86/loader/loaderProcs.h   |   10 
 b/hw/xfree86/loader/loadmod.c   |  495 +---
 hw/xfree86/loader/os.c  |   72 -
 15 files changed, 262 insertions(+), 698 deletions(-)

- ajax

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 02/19] xfree86: remove unused path from the LoadModule API

2017-01-23 Thread Adam Jackson
From: Emil Velikov 

Similar to its little brothre - LoadSubModule. Currently all call sites
provide NULL anyway ;-)

Cc: Aaron Plattner 
Signed-off-by: Emil Velikov 
---
 hw/xfree86/common/xf86Helper.c  | 2 +-
 hw/xfree86/common/xf86Init.c| 2 +-
 hw/xfree86/doc/ddxDesign.xml| 8 +---
 hw/xfree86/loader/loaderProcs.h | 2 +-
 hw/xfree86/loader/loadmod.c | 7 +++
 5 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 6f3a608..9388436 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1615,7 +1615,7 @@ xf86LoadOneModule(const char *name, void *opt)
 return NULL;
 }
 
-mod = LoadModule(Name, NULL, NULL, NULL, opt, NULL, , );
+mod = LoadModule(Name, NULL, NULL, opt, NULL, , );
 if (!mod)
 LoaderErrorMsg(NULL, Name, errmaj, errmin);
 free(Name);
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index a544b65..f6f77c0 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1503,7 +1503,7 @@ xf86LoadModules(const char **list, void **optlist)
 else
 opt = NULL;
 
-if (!LoadModule(name, NULL, NULL, NULL, opt, NULL, , )) {
+if (!LoadModule(name, NULL, NULL, opt, NULL, , )) {
 LoaderErrorMsg(NULL, name, errmaj, errmin);
 failed = TRUE;
 }
diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml
index b62272d..2ff2894 100644
--- a/hw/xfree86/doc/ddxDesign.xml
+++ b/hw/xfree86/doc/ddxDesign.xml
@@ -5210,7 +5210,7 @@ XFree86 common layer.
 
   
  
-pointer LoadModule(const char *module, const char *path,
+pointer LoadModule(const char *module,
const char **subdirlist, const char **patternlist,
pointer options, const XF86ModReqInfo * modreq,
int *errmaj, int *errmin);
@@ -5226,12 +5226,6 @@ XFree86 common layer.
 This might change.  The other parameters are:
 
  
-   
- path
- 
- An optional comma-separated list of module search paths.
- When NULL, the default search path is 
used.
-   
 
 

diff --git a/hw/xfree86/loader/loaderProcs.h b/hw/xfree86/loader/loaderProcs.h
index cfc4d80..8d7872f 100644
--- a/hw/xfree86/loader/loaderProcs.h
+++ b/hw/xfree86/loader/loaderProcs.h
@@ -74,7 +74,7 @@ void LoaderInit(void);
 
 ModuleDescPtr LoadDriver(const char *, const char *, int, void *, int *,
  int *);
-ModuleDescPtr LoadModule(const char *, const char *, const char **,
+ModuleDescPtr LoadModule(const char *, const char **,
  const char **, void *, const XF86ModReqInfo *,
  int *, int *);
 ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent);
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 940f5fc..5e4d7da 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -751,7 +751,7 @@ LoadSubModule(void *_parent, const char *module,
 return NULL;
 }
 
-submod = LoadModule(module, NULL, subdirlist, patternlist, options,
+submod = LoadModule(module, subdirlist, patternlist, options,
 modreq, errmaj, errmin);
 if (submod && submod != (ModuleDescPtr) 1) {
 parent->child = AddSibling(parent->child, submod);
@@ -821,7 +821,6 @@ static const char *compiled_in_modules[] = {
  * module   The module name.  Normally this is not a filename but the
  *  module's "canonical name.  A full pathname is, however,
  *  also accepted.
- * path A comma separated list of module directories.
  * subdirlist   A NULL terminated list of subdirectories to search.  When
  *  NULL, the default "stdSubdirs" list is used.  The default
  *  list is also substituted for entries with value DEFAULT_LIST.
@@ -853,7 +852,7 @@ static const char *compiled_in_modules[] = {
  *
  */
 ModuleDescPtr
-LoadModule(const char *module, const char *path, const char **subdirlist,
+LoadModule(const char *module, const char **subdirlist,
const char **patternlist, void *options,
const XF86ModReqInfo * modreq, int *errmaj, int *errmin)
 {
@@ -909,7 +908,7 @@ LoadModule(const char *module, const char *path, const char 
**subdirlist,
 goto LoadModule_fail;
 }
 
-pathlist = InitPathList(path);
+pathlist = InitPathList(NULL);
 if (!pathlist) {
 /* This could be a malloc failure too */
 if (errmaj)
-- 
2.9.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: 

[PATCH xserver 18/19] loader: Learn about the joy of snprintf

2017-01-23 Thread Adam Jackson
Signed-off-by: Adam Jackson 
---
 hw/xfree86/loader/loadmod.c | 11 ++-
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index cb86925..ca77c7a 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -335,10 +335,7 @@ FindModule(const char *module, const char *dirname, 
PatternPtr patterns)
 return NULL;
 
 for (s = stdSubdirs; *s; s++) {
-if ((strlen(dirname) + strlen(*s)) > PATH_MAX)
-continue;
-strcpy(buf, dirname);
-strcat(buf, *s);
+snprintf(buf, PATH_MAX, "%s%s", dirname, *s);
 if ((name = FindModuleInSubdir(buf, module)))
 break;
 }
@@ -371,11 +368,7 @@ LoaderListDir(const char *subdir, const char **patternlist)
 goto bail;
 
 for (elem = pathlist; *elem; elem++) {
-if ((dirlen = strlen(*elem) + strlen(subdir) + 1) > PATH_MAX)
-continue;
-strcpy(buf, *elem);
-strcat(buf, "/");
-strcat(buf, subdir);
+dirlen = snprintf(buf, PATH_MAX, "%s/%s", *elem, subdir);
 fp = buf + dirlen;
 if (stat(buf, _buf) == 0 && S_ISDIR(stat_buf.st_mode) &&
 (d = opendir(buf))) {
-- 
2.9.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 17/19] loader: Remove unused path and name from ModuleDescPtr

2017-01-23 Thread Adam Jackson
Just a waste of memory. Path was never referenced at all, and name was
only used when unloading the module; we can just as well get the
module's internal idea of its name from VersionInfo.

Signed-off-by: Adam Jackson 
---
 hw/xfree86/loader/loaderProcs.h |  2 --
 hw/xfree86/loader/loadmod.c | 31 +--
 2 files changed, 9 insertions(+), 24 deletions(-)

diff --git a/hw/xfree86/loader/loaderProcs.h b/hw/xfree86/loader/loaderProcs.h
index 84ed103..8b16cb7 100644
--- a/hw/xfree86/loader/loaderProcs.h
+++ b/hw/xfree86/loader/loaderProcs.h
@@ -59,8 +59,6 @@ typedef struct module_desc {
 struct module_desc *child;
 struct module_desc *sib;
 struct module_desc *parent;
-char *name;
-char *path;
 void *handle;
 ModuleSetupProc SetupProc;
 ModuleTearDownProc TearDownProc;
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index fc982c7..cb86925 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -600,17 +600,6 @@ LoadSubModule(void *_parent, const char *module,
 return submod;
 }
 
-static ModuleDescPtr
-NewModuleDesc(const char *name)
-{
-ModuleDescPtr mdp = calloc(1, sizeof(ModuleDesc));
-
-if (mdp)
-mdp->name = xstrdup(name);
-
-return mdp;
-}
-
 ModuleDescPtr
 DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
 {
@@ -619,7 +608,7 @@ DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
 if (!mod)
 return NULL;
 
-ret = NewModuleDesc(mod->name);
+ret = calloc(1, sizeof(ModuleDesc));
 if (ret == NULL)
 return NULL;
 
@@ -632,7 +621,6 @@ DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
 ret->sib = DuplicateModule(mod->sib, parent);
 ret->parent = parent;
 ret->VersionInfo = mod->VersionInfo;
-ret->path = strdup(mod->path);
 
 return ret;
 }
@@ -726,7 +714,7 @@ LoadModule(const char *module, void *options, const 
XF86ModReqInfo *modreq,
 *errmaj = LDR_BADUSAGE;
 goto LoadModule_fail;
 }
-ret = NewModuleDesc(name);
+ret = calloc(1, sizeof(ModuleDesc));
 if (!ret) {
 if (errmaj)
 *errmaj = LDR_NOMEM;
@@ -773,7 +761,6 @@ LoadModule(const char *module, void *options, const 
XF86ModReqInfo *modreq,
 ret->handle = LoaderOpen(found, errmaj);
 if (ret->handle == NULL)
 goto LoadModule_fail;
-ret->path = strdup(found);
 
 /* drop any explicit suffix from the module name */
 p = strchr(name, '.');
@@ -857,31 +844,31 @@ void
 UnloadModule(void *_mod)
 {
 ModuleDescPtr mod = _mod;
+const char *name;
 
 if (mod == (ModuleDescPtr) 1)
 return;
 
-if (mod == NULL || mod->name == NULL)
+if (mod == NULL)
 return;
 
+name = mod->VersionInfo->modname;
+
 if (mod->parent)
-LogMessageVerbSigSafe(X_INFO, 3, "UnloadSubModule: \"%s\"\n",
-  mod->name);
+LogMessageVerbSigSafe(X_INFO, 3, "UnloadSubModule: \"%s\"\n", name);
 else
-LogMessageVerbSigSafe(X_INFO, 3, "UnloadModule: \"%s\"\n", mod->name);
+LogMessageVerbSigSafe(X_INFO, 3, "UnloadModule: \"%s\"\n", name);
 
 if (mod->TearDownData != ModuleDuplicated) {
 if ((mod->TearDownProc) && (mod->TearDownData))
 mod->TearDownProc(mod->TearDownData);
-LoaderUnload(mod->name, mod->handle);
+LoaderUnload(name, mod->handle);
 }
 
 if (mod->child)
 UnloadModule(mod->child);
 if (mod->sib)
 UnloadModule(mod->sib);
-free(mod->path);
-free(mod->name);
 free(mod);
 }
 
-- 
2.9.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 13/19] xfree86: Remove a stray reference to font modules

2017-01-23 Thread Adam Jackson
Signed-off-by: Adam Jackson 
---
 hw/xfree86/common/xf86Configure.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/xfree86/common/xf86Configure.c 
b/hw/xfree86/common/xf86Configure.c
index 8c8e49e..0d7a127 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -399,10 +399,9 @@ configureModuleSection(void)
 {
 const char **elist, **el;
 
-/* Find the list of extension & font modules. */
+/* Find the list of extension modules. */
 const char *esubdirs[] = {
 "extensions",
-"fonts",
 NULL
 };
 parsePrologue(XF86ConfModulePtr, XF86ConfModuleRec);
-- 
2.9.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 19/19] loader: Fix an obviously backwards comparison

2017-01-23 Thread Adam Jackson
Hmm, this code looks wrong to me. I know! Instead of fix it, I'll put a
comment here that nobody will look at for decades on end.

Yaaay xfree86.

Signed-off-by: Adam Jackson 
---
 hw/xfree86/loader/loadmod.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index ca77c7a..55bec14 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -545,8 +545,7 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * 
data,
"(%d)\n", module, maj, reqmaj);
 return FALSE;
 }
-/* XXX Maybe this should be the other way around? */
-if (min > reqmin) {
+if (min < reqmin) {
 LogMessageVerb(X_WARNING, 2, "%s: module ABI minor version "
"(%d) is newer than that available (%d)\n",
module, min, reqmin);
-- 
2.9.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 15/19] loader: Turn LoaderListDirs into LoaderListDir

2017-01-23 Thread Adam Jackson
Callers only ever use this for a single directory anyway.

While we're at it, also move xf86DriverListFromCompile near its only
user in the X -configure code (and inline it out of existence), and
remove LoaderFreeDirList as it's unused (since X -configure is just
going to exit anyway, none of that code cares about cleanup).

Signed-off-by: Adam Jackson 
---
 hw/xfree86/common/xf86Config.c| 76 --
 hw/xfree86/common/xf86Config.h|  1 -
 hw/xfree86/common/xf86Configure.c | 75 +
 hw/xfree86/loader/loaderProcs.h   |  3 +-
 hw/xfree86/loader/loadmod.c   | 99 +--
 5 files changed, 110 insertions(+), 144 deletions(-)

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 3a8f0e1..f03acf3 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -518,82 +518,6 @@ xf86InputDriverlistFromConfig(void)
 return modulearray;
 }
 
-static int
-is_fallback(const char *s)
-{
-/* later entries are less preferred */
-const char *fallback[5] = { "modesetting", "fbdev", "vesa",  "wsfb", NULL 
};
-int i;
-
-for (i = 0; fallback[i]; i++)
-   if (strstr(s, fallback[i]))
-   return i;
-
-return -1;
-}
-
-static int
-driver_sort(const void *_l, const void *_r)
-{
-const char *l = *(const char **)_l;
-const char *r = *(const char **)_r;
-int left = is_fallback(l);
-int right = is_fallback(r);
-
-/* neither is a fallback, asciibetize */
-if (left == -1 && right == -1)
-   return strcmp(l, r);
-
-/* left is a fallback */
-if (left >= 0)
-   return 1;
-
-/* right is a fallback */
-if (right >= 0)
-   return -1;
-
-/* both are fallbacks, which is worse */
-return left - right;
-}
-
-static void
-fixup_video_driver_list(const char **drivers)
-{
-const char **end;
-
-/* walk to the end of the list */
-for (end = drivers; *end && **end; end++);
-end--;
-
-qsort(drivers, end - drivers, sizeof(const char *), driver_sort);
-}
-
-static const char **
-GenerateDriverlist(const char *dirname)
-{
-const char **ret;
-const char *subdirs[] = { dirname, NULL };
-static const char *patlist[] = { "(.*)_drv\\.so", NULL };
-ret = LoaderListDirs(subdirs, patlist);
-
-/* fix up the probe order for video drivers */
-if (strstr(dirname, "drivers") && ret != NULL)
-fixup_video_driver_list(ret);
-
-return ret;
-}
-
-const char **
-xf86DriverlistFromCompile(void)
-{
-static const char **driverlist = NULL;
-
-if (!driverlist)
-driverlist = GenerateDriverlist("drivers");
-
-return driverlist;
-}
-
 static void
 configFiles(XF86ConfFilesPtr fileconf)
 {
diff --git a/hw/xfree86/common/xf86Config.h b/hw/xfree86/common/xf86Config.h
index 23fb383..bbcb252 100644
--- a/hw/xfree86/common/xf86Config.h
+++ b/hw/xfree86/common/xf86Config.h
@@ -61,7 +61,6 @@ typedef struct _ModuleDefault {
  */
 const char **xf86ModulelistFromConfig(void ***);
 const char **xf86DriverlistFromConfig(void);
-const char **xf86DriverlistFromCompile(void);
 const char **xf86InputDriverlistFromConfig(void);
 Bool xf86BuiltinInputDriver(const char *);
 ConfigStatus xf86HandleConfigFile(Bool);
diff --git a/hw/xfree86/common/xf86Configure.c 
b/hw/xfree86/common/xf86Configure.c
index e5889b4..f975b98 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -400,14 +400,9 @@ configureModuleSection(void)
 {
 const char **elist, **el;
 
-/* Find the list of extension modules. */
-const char *esubdirs[] = {
-"extensions",
-NULL
-};
 parsePrologue(XF86ConfModulePtr, XF86ConfModuleRec);
 
-elist = LoaderListDirs(esubdirs, NULL);
+elist = LoaderListDir("extensions", NULL);
 if (elist) {
 for (el = elist; *el; el++) {
 XF86LoadPtr module;
@@ -534,6 +529,70 @@ configureDDCMonitorSection(int screennum)
 return ptr;
 }
 
+static int
+is_fallback(const char *s)
+{
+/* later entries are less preferred */
+const char *fallback[5] = { "modesetting", "fbdev", "vesa",  "wsfb", NULL 
};
+int i;
+
+for (i = 0; fallback[i]; i++)
+   if (strstr(s, fallback[i]))
+   return i;
+
+return -1;
+}
+
+static int
+driver_sort(const void *_l, const void *_r)
+{
+const char *l = *(const char **)_l;
+const char *r = *(const char **)_r;
+int left = is_fallback(l);
+int right = is_fallback(r);
+
+/* neither is a fallback, asciibetize */
+if (left == -1 && right == -1)
+   return strcmp(l, r);
+
+/* left is a fallback */
+if (left >= 0)
+   return 1;
+
+/* right is a fallback */
+if (right >= 0)
+   return -1;
+
+/* both are fallbacks, which is worse */
+return left - right;
+}
+
+static void
+fixup_video_driver_list(const char **drivers)
+{
+const char **end;
+
+/* walk to the end of the 

[PATCH xserver 11/19] xfree86: Remove DriverRec1 compat struct

2017-01-23 Thread Adam Jackson
The idea here is that the driver might have once been old enough to not
have the driverFunc slot in DriverRec, with the module ABI not having
changed when it was added. That was ages ago, and drivers always declare
themselves with DriverRec not DriverRec1, so uninitialized slots will
simply be zero.

Signed-off-by: Adam Jackson 
---
 hw/xfree86/common/xf86Helper.c |  9 +
 hw/xfree86/common/xf86str.h| 10 --
 2 files changed, 1 insertion(+), 18 deletions(-)

diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index f48af75..b464864 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -79,14 +79,7 @@ xf86AddDriver(DriverPtr driver, void *module, int flags)
 xf86DriverList = xnfreallocarray(xf86DriverList,
  xf86NumDrivers, sizeof(DriverPtr));
 xf86DriverList[xf86NumDrivers - 1] = xnfalloc(sizeof(DriverRec));
-if (flags & HaveDriverFuncs)
-*xf86DriverList[xf86NumDrivers - 1] = *driver;
-else {
-(void) memset(xf86DriverList[xf86NumDrivers - 1], 0, 
sizeof(DriverRec));
-(void) memcpy(xf86DriverList[xf86NumDrivers - 1], driver,
-  sizeof(DriverRec1));
-
-}
+*xf86DriverList[xf86NumDrivers - 1] = *driver;
 xf86DriverList[xf86NumDrivers - 1]->module = module;
 xf86DriverList[xf86NumDrivers - 1]->refCount = 0;
 }
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index bfcb75e..74c65ba 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -209,16 +209,6 @@ typedef CARD32 xorgHWFlags;
  */
 struct _DriverRec;
 
-typedef struct {
-int driverVersion;
-const char *driverName;
-void (*Identify) (int flags);
-Bool (*Probe) (struct _DriverRec * drv, int flags);
-const OptionInfoRec *(*AvailableOptions) (int chipid, int bustype);
-void *module;
-int refCount;
-} DriverRec1;
-
 struct _SymTabRec;
 struct _PciChipsets;
 
-- 
2.9.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 12/19] xfree86: Fix up some bad indentation

2017-01-23 Thread Adam Jackson
indent(1) gets confused by function-like macros with no trailing
semicolon, which is fair enough really.

Signed-off-by: Adam Jackson 
---
 hw/xfree86/common/xf86Configure.c | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/hw/xfree86/common/xf86Configure.c 
b/hw/xfree86/common/xf86Configure.c
index 59d275e..8c8e49e 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -157,7 +157,7 @@ configureInputSection(void)
 {
 XF86ConfInputPtr mouse = NULL;
 
-parsePrologue(XF86ConfInputPtr, XF86ConfInputRec)
+parsePrologue(XF86ConfInputPtr, XF86ConfInputRec);
 
 ptr->inp_identifier = xnfstrdup("Keyboard0");
 ptr->inp_driver = xnfstrdup("kbd");
@@ -196,7 +196,7 @@ configureScreenSection(int screennum)
 int i;
 int depths[] = { 1, 4, 8, 15, 16, 24 /*, 32 */  };
 char *tmp;
-parsePrologue(XF86ConfScreenPtr, XF86ConfScreenRec)
+parsePrologue(XF86ConfScreenPtr, XF86ConfScreenRec);
 
 XNFasprintf(, "Screen%d", screennum);
 ptr->scrn_identifier = tmp;
@@ -254,9 +254,9 @@ configureDeviceSection(int screennum)
 int i = 0;
 char *identifier;
 
-parsePrologue(XF86ConfDevicePtr, XF86ConfDeviceRec)
+parsePrologue(XF86ConfDevicePtr, XF86ConfDeviceRec);
 
-/* Move device info to parser structure */
+/* Move device info to parser structure */
if (asprintf(, "Card%d", screennum) == -1)
 identifier = NULL;
 ptr->dev_identifier = identifier;
@@ -326,9 +326,9 @@ configureLayoutSection(void)
 {
 int scrnum = 0;
 
-parsePrologue(XF86ConfLayoutPtr, XF86ConfLayoutRec)
+parsePrologue(XF86ConfLayoutPtr, XF86ConfLayoutRec);
 
-ptr->lay_identifier = "X.org Configured";
+ptr->lay_identifier = "X.org Configured";
 
 {
 XF86ConfInputrefPtr iptr;
@@ -389,9 +389,9 @@ configureLayoutSection(void)
 static XF86ConfFlagsPtr
 configureFlagsSection(void)
 {
-parsePrologue(XF86ConfFlagsPtr, XF86ConfFlagsRec)
+parsePrologue(XF86ConfFlagsPtr, XF86ConfFlagsRec);
 
-return ptr;
+return ptr;
 }
 
 static XF86ConfModulePtr
@@ -405,9 +405,9 @@ configureModuleSection(void)
 "fonts",
 NULL
 };
-parsePrologue(XF86ConfModulePtr, XF86ConfModuleRec)
+parsePrologue(XF86ConfModulePtr, XF86ConfModuleRec);
 
-elist = LoaderListDirs(esubdirs, NULL);
+elist = LoaderListDirs(esubdirs, NULL);
 if (elist) {
 for (el = elist; *el; el++) {
 XF86LoadPtr module;
@@ -427,9 +427,9 @@ configureModuleSection(void)
 static XF86ConfFilesPtr
 configureFilesSection(void)
 {
-parsePrologue(XF86ConfFilesPtr, XF86ConfFilesRec)
+parsePrologue(XF86ConfFilesPtr, XF86ConfFilesRec);
 
-if (xf86ModulePath)
+if (xf86ModulePath)
 ptr->file_modulepath = xnfstrdup(xf86ModulePath);
 if (defaultFontPath)
 ptr->file_fontpath = xnfstrdup(defaultFontPath);
@@ -441,7 +441,7 @@ static XF86ConfMonitorPtr
 configureMonitorSection(int screennum)
 {
 char *tmp;
-parsePrologue(XF86ConfMonitorPtr, XF86ConfMonitorRec)
+parsePrologue(XF86ConfMonitorPtr, XF86ConfMonitorRec);
 
 XNFasprintf(, "Monitor%d", screennum);
 ptr->mon_identifier = tmp;
@@ -486,7 +486,7 @@ configureDDCMonitorSection(int screennum)
 int displaySizeLen;
 char *tmp;
 
-parsePrologue(XF86ConfMonitorPtr, XF86ConfMonitorRec)
+parsePrologue(XF86ConfMonitorPtr, XF86ConfMonitorRec);
 
 XNFasprintf(, "Monitor%d", screennum);
 ptr->mon_identifier = tmp;
-- 
2.9.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 05/19] loader: Port from xfree86 to dix API

2017-01-23 Thread Adam Jackson
Signed-off-by: Adam Jackson 
---
 hw/xfree86/loader/loader.c  |  43 +-
 hw/xfree86/loader/loadmod.c | 141 
 2 files changed, 81 insertions(+), 103 deletions(-)

diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index c8d7540..fded87b 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -50,21 +50,10 @@
 #include 
 #endif
 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
-#include 
-
 #include "os.h"
 #include "loader.h"
 #include "loaderProcs.h"
-#include "xf86.h"
-#include "xf86Priv.h"
 
 #ifdef HAVE_DLFCN_H
 
@@ -80,20 +69,20 @@ extern void *xorg_symbols[];
 void
 LoaderInit(void)
 {
-xf86MsgVerb(X_INFO, 2, "Loader magic: %p\n", (void *) xorg_symbols);
-xf86MsgVerb(X_INFO, 2, "Module ABI versions:\n");
-xf86ErrorFVerb(2, "\t%s: %d.%d\n", ABI_CLASS_ANSIC,
-   GET_ABI_MAJOR(LoaderVersionInfo.ansicVersion),
-   GET_ABI_MINOR(LoaderVersionInfo.ansicVersion));
-xf86ErrorFVerb(2, "\t%s: %d.%d\n", ABI_CLASS_VIDEODRV,
-   GET_ABI_MAJOR(LoaderVersionInfo.videodrvVersion),
-   GET_ABI_MINOR(LoaderVersionInfo.videodrvVersion));
-xf86ErrorFVerb(2, "\t%s : %d.%d\n", ABI_CLASS_XINPUT,
-   GET_ABI_MAJOR(LoaderVersionInfo.xinputVersion),
-   GET_ABI_MINOR(LoaderVersionInfo.xinputVersion));
-xf86ErrorFVerb(2, "\t%s : %d.%d\n", ABI_CLASS_EXTENSION,
-   GET_ABI_MAJOR(LoaderVersionInfo.extensionVersion),
-   GET_ABI_MINOR(LoaderVersionInfo.extensionVersion));
+LogMessageVerb(X_INFO, 2, "Loader magic: %p\n", (void *) xorg_symbols);
+LogMessageVerb(X_INFO, 2, "Module ABI versions:\n");
+LogWrite(2, "\t%s: %d.%d\n", ABI_CLASS_ANSIC,
+ GET_ABI_MAJOR(LoaderVersionInfo.ansicVersion),
+ GET_ABI_MINOR(LoaderVersionInfo.ansicVersion));
+LogWrite(2, "\t%s: %d.%d\n", ABI_CLASS_VIDEODRV,
+ GET_ABI_MAJOR(LoaderVersionInfo.videodrvVersion),
+ GET_ABI_MINOR(LoaderVersionInfo.videodrvVersion));
+LogWrite(2, "\t%s : %d.%d\n", ABI_CLASS_XINPUT,
+ GET_ABI_MAJOR(LoaderVersionInfo.xinputVersion),
+ GET_ABI_MINOR(LoaderVersionInfo.xinputVersion));
+LogWrite(2, "\t%s : %d.%d\n", ABI_CLASS_EXTENSION,
+ GET_ABI_MAJOR(LoaderVersionInfo.extensionVersion),
+ GET_ABI_MINOR(LoaderVersionInfo.extensionVersion));
 
 }
 
@@ -108,10 +97,10 @@ LoaderOpen(const char *module, int *errmaj, int *errmin)
 ErrorF("LoaderOpen(%s)\n", module);
 #endif
 
-xf86Msg(X_INFO, "Loading %s\n", module);
+LogMessage(X_INFO, "Loading %s\n", module);
 
 if (!(ret = dlopen(module, RTLD_LAZY | RTLD_GLOBAL))) {
-xf86Msg(X_ERROR, "Failed to load %s: %s\n", module, dlerror());
+LogMessage(X_ERROR, "Failed to load %s: %s\n", module, dlerror());
 if (errmaj)
 *errmaj = LDR_NOLOAD;
 if (errmin)
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index fd61a82..03c9966 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -51,18 +51,11 @@
 #endif
 
 #include "os.h"
-/* For stat() and related stuff */
-#define NO_OSLIB_PROTOTYPES
-#include "xf86_OSlib.h"
-#define LOADERDECLARATIONS
 #include "loaderProcs.h"
-#include "misc.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86Xinput.h"
+#include "xf86Module.h"
 #include "loader.h"
-#include "xf86Optrec.h"
 
+#include 
 #include 
 #include 
 #include 
@@ -307,7 +300,7 @@ InitSubdirs(const char **subdirlist)
  */
 if (**s == '/' || **s == '\\' || strchr(*s, ':') ||
 strstr(*s, "..")) {
-xf86Msg(X_ERROR, "InitSubdirs: Bad subdir: \"%s\"\n", *s);
+LogMessage(X_ERROR, "InitSubdirs: Bad subdir \"%s\"\n", 
*s);
 free(tmp_subdirlist);
 return NULL;
 }
@@ -572,22 +565,22 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * 
data,
 long ver = data->xf86version;
 MessageType errtype;
 
-xf86Msg(X_INFO, "Module %s: vendor=\"%s\"\n",
-data->modname ? data->modname : "UNKNOWN!",
-data->vendor ? data->vendor : "UNKNOWN!");
+LogMessage(X_INFO, "Module %s: vendor=\"%s\"\n",
+   data->modname ? data->modname : "UNKNOWN!",
+   data->vendor ? data->vendor : "UNKNOWN!");
 
 vercode[0] = ver / 1000;
 vercode[1] = (ver / 10) % 100;
 vercode[2] = (ver / 1000) % 100;
 vercode[3] = ver % 1000;
-xf86ErrorF("\tcompiled for %d.%d.%d", vercode[0], vercode[1], vercode[2]);
+LogWrite(1, "\tcompiled for %d.%d.%d", vercode[0], vercode[1], vercode[2]);
 if (vercode[3] != 0)
-xf86ErrorF(".%d", vercode[3]);
-xf86ErrorF(", module version = %d.%d.%d\n", data->majorversion,
-  

[PATCH xserver 09/19] loader: Remove unused loader error codes and dead enum

2017-01-23 Thread Adam Jackson
The enum has been unused since at least the removal of elfloader.

Signed-off-by: Adam Jackson 
---
 hw/xfree86/common/xf86Module.h | 15 +--
 hw/xfree86/loader/loadmod.c| 18 --
 2 files changed, 1 insertion(+), 32 deletions(-)

diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index 7d09a1b..ff0e23e 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -49,13 +49,6 @@
 #define NULL ((void *)0)
 #endif
 
-typedef enum {
-LD_RESOLV_IFDONE = 0,   /* only check if no more
-   delays pending */
-LD_RESOLV_NOW = 1,  /* finish one delay step */
-LD_RESOLV_FORCE = 2 /* force checking... */
-} LoaderResolveOptions;
-
 #define DEFAULT_LIST ((char *)-1)
 
 /* Built-in ABI classes.  These definitions must not be changed. */
@@ -92,19 +85,13 @@ typedef enum {
 #define MODULEVENDORSTRING "X.Org Foundation"
 #endif
 
-/* Error return codes for errmaj.  New codes must only be added at the end. */
+/* Error return codes for errmaj */
 typedef enum {
 LDR_NOERROR = 0,
 LDR_NOMEM,  /* memory allocation failed */
 LDR_NOENT,  /* Module file does not exist */
-LDR_NOSUBENT,   /* pre-requsite file to be sub-loaded does not 
exist */
-LDR_NOSPACE,/* internal module array full */
-LDR_NOMODOPEN,  /* module file could not be opened (check 
errmin) */
-LDR_UNKTYPE,/* file is not a recognized module type */
 LDR_NOLOAD, /* type specific loader failed */
 LDR_ONCEONLY,   /* Module should only be loaded once (not an 
error) */
-LDR_NOPORTOPEN, /* could not open port (check errmin) */
-LDR_NOHARDWARE, /* could not query/initialize the hardware 
device */
 LDR_MISMATCH,   /* the module didn't match the spec'd 
requirments */
 LDR_BADUSAGE,   /* LoadModule is called with bad arguments */
 LDR_INVALID,/* The module doesn't have a valid ModuleData 
object */
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index d326d9d..85689be 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -1094,18 +1094,6 @@ LoaderErrorMsg(const char *name, const char *modname, 
int errmaj, int errmin)
 case LDR_NOENT:
 msg = "module does not exist";
 break;
-case LDR_NOSUBENT:
-msg = "a required submodule could not be loaded";
-break;
-case LDR_NOSPACE:
-msg = "too many modules";
-break;
-case LDR_NOMODOPEN:
-msg = "open failed";
-break;
-case LDR_UNKTYPE:
-msg = "unknown module type";
-break;
 case LDR_NOLOAD:
 msg = "loader failed";
 break;
@@ -1113,12 +1101,6 @@ LoaderErrorMsg(const char *name, const char *modname, 
int errmaj, int errmin)
 msg = "already loaded";
 type = X_INFO;
 break;
-case LDR_NOPORTOPEN:
-msg = "port open failed";
-break;
-case LDR_NOHARDWARE:
-msg = "no hardware found";
-break;
 case LDR_MISMATCH:
 msg = "module requirement mismatch";
 break;
-- 
2.9.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 06/19] loader: Remove *GetOS

2017-01-23 Thread Adam Jackson
This API is dumb.  uname(3) exists, feel free to use it, but ideally
write to the interface not to the OS.  There are a couple of drivers
using this API, they could all reasonably just not.

This also removes the OS name from the loader subdirectory path search.
Having /usr/lib/xorg shared across OSes is a non-goal here.

Signed-off-by: Adam Jackson 
---
 hw/xfree86/common/xf86.h   |  2 --
 hw/xfree86/common/xf86Helper.c |  4 ---
 hw/xfree86/common/xf86Module.h |  2 --
 hw/xfree86/loader/Makefile.am  |  3 +-
 hw/xfree86/loader/loadmod.c| 14 +---
 hw/xfree86/loader/os.c | 72 --
 6 files changed, 2 insertions(+), 95 deletions(-)
 delete mode 100644 hw/xfree86/loader/os.c

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index f724688..828bff1 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -343,8 +343,6 @@ xf86SetSilkenMouse(ScreenPtr pScreen);
 extern _X_EXPORT void *
 xf86FindXvOptions(ScrnInfoPtr pScrn, int adapt_index, const char *port_name,
   const char **adaptor_name, void **adaptor_options);
-extern _X_EXPORT void
-xf86GetOS(const char **name, int *major, int *minor, int *teeny);
 extern _X_EXPORT ScrnInfoPtr
 xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag,
int entityIndex, EntityProc init,
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 9388436..f48af75 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1752,10 +1752,6 @@ xf86FindXvOptions(ScrnInfoPtr pScrn, int adaptor_index, 
const char *port_name,
 return NULL;
 }
 
-/* Rather than duplicate loader's get OS function, just include it directly */
-#define LoaderGetOS xf86GetOS
-#include "loader/os.c"
-
 static void
 xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init,
EntityProc enter, EntityProc leave, void *private)
diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index e0212cf..cd4227a 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -176,8 +176,6 @@ extern _X_EXPORT void *LoaderSymbol(const char *);
 extern _X_EXPORT const char **LoaderListDirs(const char **, const char **);
 extern _X_EXPORT void LoaderFreeDirList(char **);
 extern _X_EXPORT void LoaderErrorMsg(const char *, const char *, int, int);
-extern _X_EXPORT void LoaderGetOS(const char **name, int *major, int *minor,
-  int *teeny);
 extern _X_EXPORT Bool LoaderShouldIgnoreABI(void);
 extern _X_EXPORT int LoaderGetABIVersion(const char *abiclass);
 
diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am
index 9218cab..3529a7a 100644
--- a/hw/xfree86/loader/Makefile.am
+++ b/hw/xfree86/loader/Makefile.am
@@ -14,7 +14,6 @@ EXTRA_DIST = \
 libloader_la_SOURCES = \
loader.c \
loaderProcs.h \
-loadmod.c \
-   os.c
+loadmod.c
 
 libloader_la_LIBADD = $(DLOPEN_LIBS)
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 03c9966..95a37fc 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -269,9 +269,7 @@ InitSubdirs(const char **subdirlist)
 const char **tmp_subdirlist = NULL;
 char **subdirs = NULL;
 const char **s, **stmp = NULL;
-const char *osname;
-const char *slash;
-int oslen = 0, len;
+int len;
 Bool indefault;
 
 if (subdirlist == NULL) {
@@ -282,9 +280,6 @@ InitSubdirs(const char **subdirlist)
 subdirlist[1] = NULL;
 }
 
-LoaderGetOS(, NULL, NULL, NULL);
-oslen = strlen(osname);
-
 {
 /* Count number of entries and check for invalid paths */
 for (i = 0, s = subdirlist; *s; i++, s++) {
@@ -323,12 +318,8 @@ InitSubdirs(const char **subdirlist)
 }
 len = strlen(*s);
 if (**s && (*s)[len - 1] != '/') {
-slash = "/";
 len++;
 }
-else
-slash = "";
-len += oslen + 2;
 if (!(subdirs[i] = malloc(len))) {
 while (--i >= 0)
 free(subdirs[i]);
@@ -336,9 +327,6 @@ InitSubdirs(const char **subdirlist)
 free(tmp_subdirlist);
 return NULL;
 }
-/* tack on the OS name */
-sprintf(subdirs[i], "%s%s%s/", *s, slash, osname);
-i++;
 /* path as given */
 subdirs[i] = strdup(*s);
 i++;
diff --git a/hw/xfree86/loader/os.c b/hw/xfree86/loader/os.c
deleted file mode 100644
index 8d03721..000
--- a/hw/xfree86/loader/os.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 1999-2002 by The XFree86 Project, Inc.
- *
- * 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 

[PATCH xserver 10/19] loader: Remove silly "unspecified" version handling

2017-01-23 Thread Adam Jackson
Nobody who is using this functionality is ever not specifying a major
version, which makes sense. If you don't care about a minor version,
that's equivalent to saying you require minor >= 0, so just say so;
likewise patch level.

Likewise nobody using this functionality is ever not specifying an ABI
class.

Signed-off-by: Adam Jackson 
---
 hw/xfree86/common/xf86Module.h |  6 --
 hw/xfree86/doc/ddxDesign.xml   | 20 +-
 hw/xfree86/loader/loadmod.c| 47 +-
 3 files changed, 29 insertions(+), 44 deletions(-)

diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index ff0e23e..faea07f 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -141,12 +141,6 @@ typedef struct {
 const char *moduleclass;/* module class */
 } XF86ModReqInfo;
 
-/* values to indicate unspecified fields in XF86ModReqInfo. */
-#define MAJOR_UNSPEC   0xFF
-#define MINOR_UNSPEC   0xFF
-#define PATCH_UNSPEC   0x
-#define ABI_VERS_UNSPEC0x
-
 #define MODULE_VERSION_NUMERIC(maj, min, patch) \
maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | (patch & 0x))
 #define GET_MODULE_MAJOR_VERSION(vers) (((vers) >> 24) & 0xFF)
diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml
index 2ff2894..05ee042 100644
--- a/hw/xfree86/doc/ddxDesign.xml
+++ b/hw/xfree86/doc/ddxDesign.xml
@@ -5293,12 +5293,12 @@ XFree86 common layer.
  as follows:
  
 typedef struct {
-   CARD8majorversion;  /* MAJOR_UNSPEC */
-   CARD8minorversion;  /* MINOR_UNSPEC */
-   CARD16   patchlevel;/* PATCH_UNSPEC */
-   const char * abiclass;  /* ABI_CLASS_NONE */
-   CARD32   abiversion;/* ABI_VERS_UNSPEC */
-   const char * moduleclass;   /* MOD_CLASS_NONE */
+   CARD8majorversion;
+   CARD8minorversion;
+   CARD16   patchlevel;
+   const char * abiclass;
+   CARD32   abiversion;
+   const char * moduleclass;
 } XF86ModReqInfo;

 
@@ -5323,8 +5323,8 @@ typedef struct {
   The module's minor version must be
   no less than this value.  This
   comparison is only made if
-  majorversion is
-  specified and matches.
+  majorversion
+   matches.

 

@@ -5333,8 +5333,8 @@ typedef struct {
   The module's patchlevel must be no
   less than this value.  This comparison
   is only made if
-  minorversion is
-  specified and matches.
+  minorversion
+  matches.

 

diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 85689be..528cc88 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -617,32 +617,24 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * 
data,
 
 /* Check against requirements that the caller has specified */
 if (req) {
-if (req->majorversion != MAJOR_UNSPEC) {
-if (data->majorversion != req->majorversion) {
-LogMessageVerb(X_WARNING, 2, "%s: module major version (%d) "
-   "doesn't match required major version (%d)\n",
-   module, data->majorversion, req->majorversion);
-return FALSE;
-}
-else if (req->minorversion != MINOR_UNSPEC) {
-if (data->minorversion < req->minorversion) {
-LogMessageVerb(X_WARNING, 2, "%s: module minor version "
-   "(%d) is less than the required minor "
-   "version (%d)\n", module,
-  data->minorversion, req->minorversion);
-return FALSE;
-}
-else if (data->minorversion == req->minorversion &&
- req->patchlevel != PATCH_UNSPEC) {
-if (data->patchlevel < req->patchlevel) {
-LogMessageVerb(X_WARNING, 2, "%sL module patch level "
-   "(%d) is less than the required patch "
-   "level (%d)\n", module, 
data->patchlevel,
-   req->patchlevel);
-return FALSE;
-}
-}
-}
+if (data->majorversion != 

[PATCH xserver 07/19] loader: Don't add internal/ to the search path

2017-01-23 Thread Adam Jackson
Signed-off-by: Adam Jackson 
---
 hw/xfree86/loader/loadmod.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 95a37fc..d326d9d 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -177,7 +177,6 @@ static const char *stdSubdirs[] = {
 "input/",
 "drivers/",
 "extensions/",
-"internal/",
 NULL
 };
 
-- 
2.9.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 08/19] loader: Include fewer headers from xf86Module.h

2017-01-23 Thread Adam Jackson
This looks like more, but only if you don't compare it to the number
pulled in by misc.h.

Signed-off-by: Adam Jackson 
---
 hw/xfree86/common/xf86Module.h | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index cd4227a..7d09a1b 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -41,8 +41,10 @@
 #ifndef _XF86MODULE_H
 #define _XF86MODULE_H
 
-#include "misc.h"
-#include "extension.h"
+#include 
+#include 
+#include 
+
 #ifndef NULL
 #define NULL ((void *)0)
 #endif
-- 
2.9.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 01/19] xfree86: remove references from LoadSubModule's path from the doc

2017-01-23 Thread Adam Jackson
From: Emil Velikov 

Afaics the argument hasn't been part of the API since the documentation
has been converted to xml with commit fc6ebe1e1d3 "Convert LinuxDoc
documents to DocBook/XML"

Signed-off-by: Emil Velikov 
---
 hw/xfree86/doc/ddxDesign.xml | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml
index f7d6628..b62272d 100644
--- a/hw/xfree86/doc/ddxDesign.xml
+++ b/hw/xfree86/doc/ddxDesign.xml
@@ -5695,11 +5695,7 @@ the server, and may also be used from within modules.
 described above, except that the module loaded is registered as a
 child of the calling module.  The parent parameter
 is the calling module's handle.  Modules loaded with this function
-are automatically unloaded when the parent module is unloaded.  The
-other difference is that the path parameter may not be specified.
-The module search path used for modules loaded with this function
-is the default search path as initialised with
-LoaderSetPath().
+are automatically unloaded when the parent module is unloaded.

 
  
-- 
2.9.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 03/19] xfree86: remove dummy/dead function prototype for LoadDriver

2017-01-23 Thread Adam Jackson
From: Emil Velikov 

Signed-off-by: Emil Velikov 
---
 hw/xfree86/loader/loaderProcs.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/hw/xfree86/loader/loaderProcs.h b/hw/xfree86/loader/loaderProcs.h
index 8d7872f..ee8a557 100644
--- a/hw/xfree86/loader/loaderProcs.h
+++ b/hw/xfree86/loader/loaderProcs.h
@@ -72,8 +72,6 @@ typedef struct module_desc {
 
 void LoaderInit(void);
 
-ModuleDescPtr LoadDriver(const char *, const char *, int, void *, int *,
- int *);
 ModuleDescPtr LoadModule(const char *, const char **,
  const char **, void *, const XF86ModReqInfo *,
  int *, int *);
-- 
2.9.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver] tests: shuffle around the linking order to please GNU ld

2017-01-23 Thread Martin Peres
Classic GNU ld resolves symbol dependencies only forward, while GOLD
seems to work regardless of the specified library order.

I assume that the original author of the changes (just like me), has
been using GNU ld with GOLD enabled (default on ArchLinux), and did
not check on older distros like Ubuntu 16.04 which shows the issue.

Suggested-by: Eero Tamminen 
Signed-off-by: Martin Peres 
---
 test/Makefile.am | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/test/Makefile.am b/test/Makefile.am
index 111b60788b..e7fe587bb8 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -64,7 +64,7 @@ tests_LDFLAGS = \
-Wl,-wrap,GrabButton \
$()
 
-tests_LDADD = $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS)
+tests_LDADD =
 
 tests_SOURCES = \
 tests-common.c \
@@ -225,6 +225,10 @@ endif
 
 endif !XORG
 
+# GNU LD scans only in one direction, add the following dependencies at the end
+# so as they get picked up by the previously-linked libraries
+tests_LDADD += $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS)
+
 endif ENABLE_UNIT_TESTS
 
 EXTRA_DIST = \
-- 
2.11.0

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] libXinerama: Set number to 0 on error.

2017-01-23 Thread Adam Jackson
On Sun, 2017-01-22 at 15:18 +0100, Tobias Stoeckmann wrote:

> @@ -286,6 +286,7 @@ XineramaQueryScreens(
>  if (!_XReply (dpy, (xReply *) , 0, xFalse)) {
>   UnlockDisplay (dpy);
>   SyncHandle ();
> + *number = 0;

Not that any caller has likely made this mistake, but you want an if
(number) before this, otherwise you turn a protocol error into a
segfault.

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver] parser: Fix crash when xf86nameCompare(s1 = x, s2 = NULL)

2017-01-23 Thread Adam Jackson
Signed-off-by: Adam Jackson 
---
 hw/xfree86/parser/scan.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index 81a454b..3356224 100644
--- a/hw/xfree86/parser/scan.c
+++ b/hw/xfree86/parser/scan.c
@@ -1046,6 +1046,8 @@ xf86nameCompare(const char *s1, const char *s2)
 return 0;
 else
 return 1;
+} else if (!s2 || *s2 == 0) {
+return -1;
 }
 
 while (*s1 == '_' || *s1 == ' ' || *s1 == '\t')
-- 
2.9.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver] glamor: keep gl_fbo and fbo consistent

2017-01-23 Thread Olivier Fourdan
If the pixmap type is neither GLAMOR_TEXTURE_ONLY nor GLAMOR_TEXTURE_DRM
we might have the fbo field set but the gl_fbo still set to the default
GLAMOR_FBO_UNATTACHED, which later may fail an assert in
glamor_upload_picture_to_texture().

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99346
Signed-off-by: Olivier Fourdan 
---
 glamor/glamor_render.c | 8 
 glamor/glamor_utils.h  | 4 
 2 files changed, 12 insertions(+)

diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index e04dd21..a9ab971 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -916,6 +916,10 @@ glamor_composite_choose_shader(CARD8 op,
 }
 if (source_pixmap_priv->gl_fbo == GLAMOR_FBO_UNATTACHED) {
 #ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD
+if (!GLAMOR_PIXMAP_PRIV_HAS_TEXTURE(source_pixmap_priv)) {
+glamor_fallback("no texture in source\n");
+goto fail;
+}
 source_needs_upload = TRUE;
 #else
 glamor_fallback("no texture in source\n");
@@ -932,6 +936,10 @@ glamor_composite_choose_shader(CARD8 op,
 }
 if (mask_pixmap_priv->gl_fbo == GLAMOR_FBO_UNATTACHED) {
 #ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD
+if (!GLAMOR_PIXMAP_PRIV_HAS_TEXTURE(mask_pixmap_priv)) {
+glamor_fallback("no texture in mask\n");
+goto fail;
+}
 mask_needs_upload = TRUE;
 #else
 glamor_fallback("no texture in mask\n");
diff --git a/glamor/glamor_utils.h b/glamor/glamor_utils.h
index 6b88527..636c095 100644
--- a/glamor/glamor_utils.h
+++ b/glamor/glamor_utils.h
@@ -585,6 +585,10 @@
 
 #define GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)(pixmap_priv->gl_fbo == 
GLAMOR_FBO_NORMAL)
 
+#define GLAMOR_PIXMAP_PRIV_HAS_TEXTURE(pixmap_priv) (  \
+   pixmap_priv->type == GLAMOR_TEXTURE_DRM \
+   || pixmap_priv->type == GLAMOR_TEXTURE_ONLY)
+
 /**
  * Borrow from uxa.
  */
-- 
2.9.3

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH util-modular] WIP: HACK: invoke configure from a subdir

2017-01-23 Thread Emil Velikov
---
Educated guess since I cannot reproduce it. If you're seing any of the 
install/changelog issues mentioned in my email, just drop the relevant 
lines from Makefile.am

 release.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/release.sh b/release.sh
index e0209bc..74b9bae 100755
--- a/release.sh
+++ b/release.sh
@@ -391,7 +391,9 @@ process_module() {
 return 1
 fi
 
-./configure >/dev/null
+mkdir -p foo
+cd foo
+../configure >/dev/null
 if [ $? -ne 0 ]; then
 echo "Error: failed to configure module."
 cd $top_src
-- 
2.11.0

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH util-modular 4/4] release.sh: implement around git worktree

2017-01-23 Thread Emil Velikov
On 23 January 2017 at 04:03, Peter Hutterer  wrote:
> On Fri, Jan 20, 2017 at 02:19:06PM +, Emil Velikov wrote:
>> On 20 January 2017 at 02:49, Peter Hutterer  wrote:
>> > On Thu, Jan 19, 2017 at 07:30:10PM +, Emil Velikov wrote:
>> >> From: Emil Velikov 
>> >>
>> >> Months ago, before my work in here there the script had a number of
>> >> assumptions:
>> >>  - autoreconf or alike is ran by the user - slight nuisance esp. when
>> >> releasing multiple packages.
>> >>  - the generated files were compatible with the ones on the server -
>> >> rarely and issue, but still
>> >>  - config.status means 'all the autotools bits were generated correctly'
>> >>  - failed to consider if user has multiple config.status - using
>> >> ./build-64bit/ and ./build-32bit/ anyone ?
>> >>  - ...
>> >>
>> >> With 663364cda5e316a0509ff5869293e3a815b9945f we mitigated a lot of that
>> >> but did not consider
>> >>  - forcing people to `git clean' is annoying and if not careful one can
>> >> purge local files that they want to keep
>> >>  - the files generated by autotools were left behind
>> >>
>> >> In order to mitigate those use git worktree. This is more efficient
>> >> [both bandwidth and storage wise] than pulling/generating git tarballs,
>> >> git clone and friends.
>> >>
>> >> Cc: Peter Hutterer 
>> >> Signed-off-by: Emil Velikov 
>> >> ---
>> >> There's a git of noise produced by git worktree and autoreconf. I'm fine
>> >> with 2>/dev/null but I'd leave that to others to decide
>> >> ---
>> >>  release.sh | 34 +++---
>> >>  1 file changed, 19 insertions(+), 15 deletions(-)
>> >>
>> >> diff --git a/release.sh b/release.sh
>> >> index 8ed179d..0b3fcbf 100755
>> >> --- a/release.sh
>> >> +++ b/release.sh
>> >> @@ -357,25 +357,24 @@ process_module() {
>> >>   return 1
>> >>  fi
>> >>
>> >> -if [ -e configure ]; then
>> >> -echo "Error: the git repository contains configure"
>> >> -echo "Did you forget to run git clean -fXd (and git clean -fxd) 
>> >> ?"
>> >> -return 1
>> >> -fi
>> >> -
>> >> -# Create tmpdir for the build
>> >> +# Create tmpdir for the release
>> >>  build_dir=`mktemp -d -p . build.XX`
>> >>  if [ $? -ne 0 ]; then
>> >> -echo "Error: could not create a temporary directory for the 
>> >> build."
>> >> +echo "Error: could not create a temporary directory for the 
>> >> release"
>> >>  echo "Do you have coreutils' mktemp ?"
>> >>  return 1
>> >>  fi
>> >>
>> >> -echo "Info: generating configure."
>> >> -autoreconf --force --install >/dev/null
>> >> +# Worktree removal is intentionally left to the user, due to:
>> >> +#  - currently we cannot select only one worktree to prune
>> >> +#  - requires to removal of $build_dir which might contradict with 
>> >> the
>> >> +# user decision to keep some artefacts like tarballs or other
>> >> +echo "Info: creating new git worktree."
>> >> +git worktree add $build_dir
>> >>  if [ $? -ne 0 ]; then
>> >> -echo "Error: failed to generate configure."
>> >> -return 1
>> >> + echo "Error: failed to create a git worktree."
>> >> + cd $top_src
>> >> + return 1
>> >
>> > there's an indentation error,
>> Funky indentation was there (it was a code movement) - we still have a
>> handful of tabs that are meant to be 8 spaces.
>>
>> > but otherwise the series looks good and is
>> > Reviewed-by: Peter Hutterer 
>> >
>> Note: after another thought I've went with v2 for 3/4 (having a
>> version check and building from there).
>>
>> > I guess I'll test this on the next release ;)
>> >
>> Thank you very much. Please let me know if you spot anything odd.
>
> Ok, tested it on the libXi release and something is off, but haven't found
> out what it is yet. You can reproduce it by running a --dry-run on the libXi
> repo, for some reason make distcleancheck fails with
>
> ERROR: files left in build directory after distclean:
> ./config.sub
> ./ltmain.sh
> ./config.guess
> ./install-sh
> ./missing
> ./depcomp
> ./compile
> make[1]: *** [distcleancheck] Error 1
>
> since these are standard files, it's not a libXi issue, must be something to
> do with the worktrees or how we invoke configure. Reverting this patch
> makes it work again.
>
That's strange I haven't seen issues like the ones you mentioned.
Fetching a clean copy of libXi and doing "../path/to/release.sh .
--dry-run" brings up other issues :-]
Which version of autotools are you using ? See libtool --help

Using Arch here, packages patched as mentioned:
   version:libtool (GNU libtool) 2.4.6
   automake:   automake (GNU automake) 1.15
   autoconf:   autoconf (GNU Autoconf) 2.69