Re: [RFC] Allow fd.o to join forces with X.Org

2018-10-15 Thread Eric Engestrom
On October 15, 2018 2:50:13 PM UTC, Harry Wentland  
wrote:
> The leadership of freedesktop.org (fd.o) has recently expressed
> interest
> in having an elected governing body. Given the tight connection
> between
> fd.o and X.Org and the fact that X.Org has such a governing body it
> seemed obvious to consider extending X.Org's mandate to fd.o.
> 
> Quite a bit of background on fd.o leading up to this has been covered
> by
> Daniel Stone at XDC 2018 and was covered really well by Jake Edge of
> LWN [1].

If you'd like to watch Daniel's presentation, the recording is available on 
YouTube:
https://youtu.be/s22B3E7rUTs

The slides are linked in the description.

> 
> One question that is briefly addressed in the LWN article and was
> thoroughly discussed by members of the X.Org boards, Daniel Stone, and
> others in hallway discussions is the question of whether to extend the
> X.Org membership to projects hosted on fd.o but outside the purpose of
> the X.Org foundation as enacted in its bylaws.
> 
> Most people I talked to would prefer not to dilute X.Org's mission and
> extend membership only to contributors of projects that follow X.Org's
> purpose as enacted in its bylaws. Other projects can continue to be
> hosted on fd.o but won't receive X.Org membership for the mere reason
> of
> being hosted on fd.o.

With my member hat on, I think this is the best choice.
Acked-by: Eric Engestrom 

> 
> [1] https://lwn.net/Articles/767258/
> 
> v2:
>  - Subject line that better describes the intention
>  - Briefly describe reasons behind this change
>  - Drop expanding membership eligibility
> ---
> 
> We're looking for feedback and comments on this patch. If it's not
> widely controversial the final version of the patch will be put to a
> vote at the 2019 X.Org elections.
> 
> The patch applies to the X.Org bylaws git repo, which can be found at
> https://gitlab.freedesktop.org/xorgfoundation/bylaws
> 
> Happy commenting.
> 
> Harry
> 
> bylaws.tex | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/bylaws.tex b/bylaws.tex
> index 4ab35a4f7745..44ff4745963b 100644
> --- a/bylaws.tex
> +++ b/bylaws.tex
> @@ -14,7 +14,7 @@ BE IT ENACTED AND IT IS HEREBY ENACTED as a By-law
> of the X.Org Foundation
>  
>  The purpose of the X.Org Foundation shall be to:
>  \begin{enumerate}[(i)\hspace{.2cm}]
> - \item Research, develop, support, organize, administrate,
> standardize,
> + \item \label{1} Research, develop, support, organize, administrate,
> standardize,
>   promote, and defend a free and open accelerated graphics stack. This
>   includes, but is not limited to, the following projects: DRM, Mesa,
>   Wayland and the X Window System,
> @@ -24,6 +24,11 @@ The purpose of the X.Org Foundation shall be to:
>  
>   \item Support and educate the general community of users of this
>   graphics stack.
> +
> + \item Support free and open source projects through the
> freedesktop.org
> + infrastructure. For projects outside the scope of item (\ref{1})
> support
> + extends to project hosting only.
> +
>  \end{enumerate}
>  
>  \article{INTERPRETATION}
> -- 
> 2.19.1
> 
> ___
> memb...@foundation.x.org: X.Org Foundation Members
> Archives: https://foundation.x.org/cgi-bin/mailman/private/members
> Info: https://foundation.x.org/cgi-bin/mailman/listinfo/members
___
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] exa: promise not to touch the data when swapping pointers

2018-03-21 Thread Eric Engestrom
On Wednesday, 2018-03-21 11:24:50 -0400, Adam Jackson wrote:
> On Wed, 2018-03-14 at 15:37 +, Emil Velikov wrote:
> > On 13 March 2018 at 10:55, Eric Engestrom <eric.engest...@imgtec.com> wrote:
> > > exa/exa.c:525:10: warning: initialization discards ‘const’ qualifier from 
> > > pointer target type [-Wdiscarded-qualifiers]
> > >  swap(pExaGC, pGC, funcs);
> > >   ^
> > > 
> > > Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
> > > ---
> > >  exa/exa_priv.h | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/exa/exa_priv.h b/exa/exa_priv.h
> > > index ca4db720fbe871b50b7e..912e214789adba95c7fa 100644
> > > --- a/exa/exa_priv.h
> > > +++ b/exa/exa_priv.h
> > > @@ -244,7 +244,7 @@ extern DevPrivateKeyRec exaScreenPrivateKeyRec;
> > >  }
> > >  #else
> > >  #define swap(priv, real, mem) {\
> > > -void *tmp = priv->Saved##mem; \
> > > +const void *tmp = priv->Saved##mem; \
> > 
> > Hmm what compiler are you using - any clang/gcc should hit the HAVE_TYPEOF 
> > case.

Hmm, forgot to reply, sorry about that:
I've had the patch locally for just about forever, so I don't remember
exactly, but I think I hit some issue with one of the callers and when
I looked at the implementations I noticed this.

The warning I put in the commit message was obtained by manually forcing
the HAVE_TYPEOF case off.

> > Regardless, the patch is spot on:
> > 
> > Reviewed-by: Emil Velikov <emil.veli...@collabora.com>
> 
> Merged,thanks:

Cheers :)

> 
> remote: Updating patchwork state for 
> https://patchwork.freedesktop.org/project/Xorg/list/
> remote: I: patch #210087 updated using rev 
> 610055809f4030bd0e7312c6b0c561fdfe6e0183.
> remote: I: 1 patch(es) updated to state Accepted.
> To ssh://git.freedesktop.org/git/xorg/xserver
>d36128a72a..610055809f  master -> master
> 
> - 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

Re: [PATCH xserver] dix: don't free() stack memory

2018-03-13 Thread Eric Engestrom
On Tuesday, 2018-03-13 12:09:40 +0100, Michel Dänzer wrote:
> On 2018-03-13 11:56 AM, Eric Engestrom wrote:
> > In function ‘doImageText’,
> > inlined from ‘ImageText’ at dix/dixfonts.c:1513:5:
> > dix/dixfonts.c:1492:9: warning: attempt to free a non-heap object 
> > ‘local_closure’ [-Wfree-nonheap-object]
> >  free(c);
> >  ^
> > 
> > Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
> > ---
> >  dix/dixfonts.c | 23 ---
> >  1 file changed, 12 insertions(+), 11 deletions(-)
> > 
> > diff --git a/dix/dixfonts.c b/dix/dixfonts.c
> > index cca92ed2791ccf262017..c48034dd41426b47915d 100644
> > --- a/dix/dixfonts.c
> > +++ b/dix/dixfonts.c
> > @@ -1498,19 +1498,20 @@ int
> >  ImageText(ClientPtr client, DrawablePtr pDraw, GC * pGC, int nChars,
> >unsigned char *data, int xorg, int yorg, int reqType, XID did)
> >  {
> > -ITclosureRec local_closure;
> > +ITclosureRec *local_closure = malloc(sizeof(*local_closure));
> >  
> > -local_closure.client = client;
> > -local_closure.pDraw = pDraw;
> > -local_closure.pGC = pGC;
> > -local_closure.nChars = nChars;
> > -local_closure.data = data;
> > -local_closure.xorg = xorg;
> > -local_closure.yorg = yorg;
> > -local_closure.reqType = reqType;
> > -local_closure.did = did;
> > +local_closure->client = client;
> > +local_closure->pDraw = pDraw;
> > +local_closure->pGC = pGC;
> > +local_closure->nChars = nChars;
> > +local_closure->data = data;
> > +local_closure->xorg = xorg;
> > +local_closure->yorg = yorg;
> > +local_closure->reqType = reqType;
> > +local_closure->did = did;
> >  
> > -(void) doImageText(client, _closure);
> > +(void) doImageText(client, local_closure);
> > +free(local_closure);
> 
> If the free(c) in the compiler warning above is hit, this is a
> double-free, isn't it?

Yes, yes it is...  :facepalm:

I'll look at the code more closely to figure out when the free is
needed, but I just saw this warning and had a look, this isn't code I'm
familiar with *at all*, so I might just end up giving up if I can't
figure it out easily enough :/

> 
> 
> -- 
> Earthling Michel Dänzer   |   http://www.amd.com
> Libre software enthusiast | Mesa and X developer
___
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] dix: don't free() stack memory

2018-03-13 Thread Eric Engestrom
In function ‘doImageText’,
inlined from ‘ImageText’ at dix/dixfonts.c:1513:5:
dix/dixfonts.c:1492:9: warning: attempt to free a non-heap object 
‘local_closure’ [-Wfree-nonheap-object]
 free(c);
 ^

Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 dix/dixfonts.c | 23 ---
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index cca92ed2791ccf262017..c48034dd41426b47915d 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1498,19 +1498,20 @@ int
 ImageText(ClientPtr client, DrawablePtr pDraw, GC * pGC, int nChars,
   unsigned char *data, int xorg, int yorg, int reqType, XID did)
 {
-ITclosureRec local_closure;
+ITclosureRec *local_closure = malloc(sizeof(*local_closure));
 
-local_closure.client = client;
-local_closure.pDraw = pDraw;
-local_closure.pGC = pGC;
-local_closure.nChars = nChars;
-local_closure.data = data;
-local_closure.xorg = xorg;
-local_closure.yorg = yorg;
-local_closure.reqType = reqType;
-local_closure.did = did;
+local_closure->client = client;
+local_closure->pDraw = pDraw;
+local_closure->pGC = pGC;
+local_closure->nChars = nChars;
+local_closure->data = data;
+local_closure->xorg = xorg;
+local_closure->yorg = yorg;
+local_closure->reqType = reqType;
+local_closure->did = did;
 
-(void) doImageText(client, _closure);
+(void) doImageText(client, local_closure);
+free(local_closure);
 return Success;
 }
 
-- 
Cheers,
  Eric

___
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] exa: promise not to touch the data when swapping pointers

2018-03-13 Thread Eric Engestrom
exa/exa.c:525:10: warning: initialization discards ‘const’ qualifier from 
pointer target type [-Wdiscarded-qualifiers]
 swap(pExaGC, pGC, funcs);
  ^

Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 exa/exa_priv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index ca4db720fbe871b50b7e..912e214789adba95c7fa 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -244,7 +244,7 @@ extern DevPrivateKeyRec exaScreenPrivateKeyRec;
 }
 #else
 #define swap(priv, real, mem) {\
-void *tmp = priv->Saved##mem; \
+const void *tmp = priv->Saved##mem; \
 priv->Saved##mem = real->mem; \
 real->mem = tmp; \
 }
-- 
Cheers,
  Eric

___
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] xkb: small clarification

2017-11-08 Thread Eric Engestrom
On Tuesday, 2017-11-07 18:37:11 +0100, Giuseppe Bilotta wrote:
> ---
>  xkb/xkbUtils.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> On Tue, Nov 7, 2017 at 10:55 AM, Eric Engestrom <e...@engestrom.ch> wrote:
> 
> > I think this patch is good, because it explicitly shows the NoSymbol
> > value that is tested later on. The implicit 0s are fine, but I think adding
> > a one-sentence explanation to the commit message would be good.
> 
> Oops, looks like it was pushed already.
> 
> Not sure if it's worth it anymore, but here's a one-line clarification comment
> in-code, just in case.

Meh, I wouldn't bother. Thanks though :)

> 
> -- 
> Giuseppe "Oblomov" Bilotta
> 
> diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
> index 8975ade8d..023902be5 100644
> --- a/xkb/xkbUtils.c
> +++ b/xkb/xkbUtils.c
> @@ -222,7 +222,9 @@ XkbUpdateKeyTypesFromCore(DeviceIntPtr pXDev,
>  XkbDescPtr xkb;
>  unsigned key, nG, explicit;
>  int types[XkbNumKbdGroups];
> -KeySym tsyms[XkbMaxSymsPerKey] = {NoSymbol}, *syms;
> +/* Initialize tsym with NoSymbol, which conveniently has value 0 */
> +KeySym tsyms[XkbMaxSymsPerKey] = { NoSymbol };
> +KeySym *syms;
>  XkbMapChangesPtr mc;
>  
>  xkb = pXDev->key->xkbInfo->desc;
> -- 
> 2.14.1.439.g647b9b4702
> 
___
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] xkb: initialize tsyms

2017-11-07 Thread Eric Engestrom


On 7 November 2017 09:43:06 GMT, Giuseppe Bilotta <giuseppe.bilo...@gmail.com> 
wrote:
> On Mon, Nov 6, 2017 at 4:41 PM, Eric Engestrom
> <eric.engest...@imgtec.com> wrote:
> > On Friday, 2017-11-03 21:38:51 +0100, Giuseppe Bilotta wrote:
> >> This fixes some “Conditional jump depends on uninitialized
> value(s)”
> >> errors spotted by valgrind.
> >>
> >> Signed-off-by: Giuseppe Bilotta <giuseppe.bilo...@gmail.com>
> >
> > Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>
> >
> > Although the rest of the array is 0-initialised, so this only works
> > because NoSymbol is also 0.
> 
> Indeed. I considered clarifying this in a comment, and even just
> making it all 0-initialized with {}. Would that be better?

I think this patch is good, because it explicitly shows the NoSymbol
value that is tested later on. The implicit 0s are fine, but I think adding
a one-sentence explanation to the commit message would be good.

> 
> -- 
> Giuseppe "Oblomov" Bilotta
___
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 3/5] randr: ProcRRGetOutputInfo: initialize memory

2017-11-06 Thread Eric Engestrom
On Saturday, 2017-11-04 23:06:29 +0100, Giuseppe Bilotta wrote:
> Running Xephyr under valgrind reveals that we're sending some
> uninitialized memory over the wire (particularly, the leftover padding
> that comes from rounding extraLen to the next 32-bit multiple).
> 
> Solve by calloc()ing the memory instead of malloc()ing (the alternative
> would be to memset just the padding, but I'm not sure it's more
> convenient.)

This sounds like the right fix, but I don't know enough to be sure.

The rest of the series is
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> 
> Signed-off-by: Giuseppe Bilotta <giuseppe.bilo...@gmail.com>
> ---
>  randr/rroutput.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/randr/rroutput.c b/randr/rroutput.c
> index a8efec409..647f19a52 100644
> --- a/randr/rroutput.c
> +++ b/randr/rroutput.c
> @@ -459,7 +459,7 @@ ProcRRGetOutputInfo(ClientPtr client)
>  
>  if (extraLen) {
>  rep.length += bytes_to_int32(extraLen);
> -extra = malloc(extraLen);
> +extra = calloc(1, extraLen);
>  if (!extra)
>  return BadAlloc;
>  }
> -- 
> 2.14.1.439.g647b9b4702
> 
___
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] xkb: initialize tsyms

2017-11-06 Thread Eric Engestrom
On Friday, 2017-11-03 21:38:51 +0100, Giuseppe Bilotta wrote:
> This fixes some “Conditional jump depends on uninitialized value(s)”
> errors spotted by valgrind.
> 
> Signed-off-by: Giuseppe Bilotta <giuseppe.bilo...@gmail.com>

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

Although the rest of the array is 0-initialised, so this only works
because NoSymbol is also 0.

> ---
>  xkb/xkbUtils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
> index 25b5a364e..8975ade8d 100644
> --- a/xkb/xkbUtils.c
> +++ b/xkb/xkbUtils.c
> @@ -222,7 +222,7 @@ XkbUpdateKeyTypesFromCore(DeviceIntPtr pXDev,
>  XkbDescPtr xkb;
>  unsigned key, nG, explicit;
>  int types[XkbNumKbdGroups];
> -KeySym tsyms[XkbMaxSymsPerKey], *syms;
> +KeySym tsyms[XkbMaxSymsPerKey] = {NoSymbol}, *syms;
>  XkbMapChangesPtr mc;
>  
>  xkb = pXDev->key->xkbInfo->desc;
> -- 
> 2.14.1.439.g647b9b4702
> 
___
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 1/4] modesetting: Fix potential buffer overflow

2017-10-30 Thread Eric Engestrom
On Friday, 2017-10-27 16:11:53 +0200, Daniel Martin wrote:
> If one misconfigures a ZaphodHeads value (more than 20 characters
> without a delimiter), we get an overflow of our buffer.
> Use xstrtokenize() instead of writing/fixing our own tokenizer.
> 
> Signed-off-by: Daniel Martin <consume.no...@gmail.com>

Patches 1-3 are
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

Patch 4 is
Acked-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  hw/xfree86/drivers/modesetting/drmmode_display.c | 38 
> 
>  1 file changed, 13 insertions(+), 25 deletions(-)
> 
> diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c 
> b/hw/xfree86/drivers/modesetting/drmmode_display.c
> index 5bfae0b03..e14833dee 100644
> --- a/hw/xfree86/drivers/modesetting/drmmode_display.c
> +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
> @@ -57,34 +57,22 @@ static PixmapPtr drmmode_create_pixmap_header(ScreenPtr 
> pScreen, int width, int
>  static Bool
>  drmmode_zaphod_string_matches(ScrnInfoPtr scrn, const char *s, char 
> *output_name)
>  {
> -int i = 0;
> -char s1[20];
> +char **token = xstrtokenize(s, ", \t\n\r");
> +Bool ret = FALSE;
>  
> -do {
> -switch(*s) {
> -case ',':
> -s1[i] = '\0';
> -i = 0;
> -if (strcmp(s1, output_name) == 0)
> -return TRUE;
> -break;
> -case ' ':
> -case '\t':
> -case '\n':
> -case '\r':
> -break;
> -default:
> -s1[i] = *s;
> -i++;
> -break;
> -}
> -} while(*s++);
> +if (!token)
> +return FALSE;
>  
> -s1[i] = '\0';
> -if (strcmp(s1, output_name) == 0)
> -return TRUE;
> +for (int i = 0; token[i]; i++) {
> +if (strcmp(token[i], output_name) == 0)
> +ret = TRUE;
>  
> -return FALSE;
> +free(token[i]);
> +}
> +
> +free(token);
> +
> +return ret;
>  }
>  
>  int
> -- 
> 2.13.6
> 
___
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 libICE 2/2] make IceProtocolShutdown() more readable

2017-09-12 Thread Eric Engestrom
On Friday, 2017-09-08 20:03:03 +0200, walter harms wrote:
> I found IceProtocolShutdown() hard to read only to find that was
> it does it aktually very simple. So i rearranged the code to make
> it more readable.
> 
> Signed-off-by: Walter Harms <wha...@bfs.de>
> ---
>  src/shutdown.c | 47 ---
>  1 file changed, 20 insertions(+), 27 deletions(-)
> 
> diff --git a/src/shutdown.c b/src/shutdown.c
> index 90e9ded..98376a7 100644
> --- a/src/shutdown.c
> +++ b/src/shutdown.c
> @@ -40,45 +40,38 @@ IceProtocolShutdown (
>   int majorOpcode
>  )
>  {
> +int i;
> +
>  if (iceConn->proto_ref_count == 0 || iceConn->process_msg_info == NULL ||
>  majorOpcode < 1 || majorOpcode > _IceLastMajorOpcode)
>  {
>   return (0);
>  }
> -else
> -{
> - /*
> -  * Make sure this majorOpcode is really being used.
> -  */
> -
> - int i;
> +
> +
> +/*
> + * Make sure this majorOpcode is really being used.
> + */
> 
> - for (i = iceConn->his_min_opcode; i <= iceConn->his_max_opcode; i++)
> - {
> - if (iceConn->process_msg_info[
> - i - iceConn->his_min_opcode].in_use &&
> -iceConn->process_msg_info[
> - i - iceConn->his_min_opcode].my_opcode == majorOpcode)
> - break;
> - }
> +for (i = iceConn->his_min_opcode; i <= iceConn->his_max_opcode; i++)
> +  {
> + int n=i - iceConn->his_min_opcode;

spaces around `=`, and can you be more consistent with the indentation?
(mostly avoid mixing tabs and spaces).

With that fixed:
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> + if (iceConn->process_msg_info[n].in_use &&
> + iceConn->process_msg_info[n].my_opcode == majorOpcode)
> +   {
> 
> - if (i > iceConn->his_max_opcode)
> - {
> - return (0);
> - }
> - else
> - {
>   /*
>* OK, we can shut down the protocol.
>*/
> 
> - iceConn->process_msg_info[
> - i - iceConn->his_min_opcode].in_use = False;
> - iceConn->proto_ref_count--;
> +   iceConn->process_msg_info[n].in_use = False;
> +   iceConn->proto_ref_count--;
> +   return (1);
> +   }
> + 
> +  }
> 
> - return (1);
> - }
> -}
> +return (0);
>  }
> 
> 
> -- 
> 2.1.4
> 
___
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 libICE 1/2] free() can handle NULL so remove the check

2017-09-12 Thread Eric Engestrom
On Friday, 2017-09-08 19:59:17 +0200, walter harms wrote:
> free() can handle NULL so remove the check

Did you use a cocci script [1] to generate this?
If so, can you add it to the commit message?

Regardless, I double-checked it and it looks good to me:
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

[1] perhaps something like this?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/coccinelle/free/ifnullfree.cocci

> 
> Signed-off-by: Walter Harms <wha...@bfs.de>
> ---
>  src/authutil.c | 24 
>  src/misc.c |  3 +--
>  src/process.c  | 41 +++--
>  src/shutdown.c | 44 +++-
>  4 files changed, 39 insertions(+), 73 deletions(-)
> 
> diff --git a/src/authutil.c b/src/authutil.c
> index ca0504a..d7bcef9 100644
> --- a/src/authutil.c
> +++ b/src/authutil.c
> @@ -111,8 +111,8 @@ IceAuthFileName (void)
> 
>  if (size > bsize)
>  {
> - if (buf)
> - free (buf);
> +
> + free (buf);
>   buf = malloc (size);
>   if (!buf) {
>   bsize = 0;
> @@ -266,11 +266,11 @@ IceReadAuthFileEntry (
> 
>   bad:
> 
> -if (local.protocol_name) free (local.protocol_name);
> -if (local.protocol_data) free (local.protocol_data);
> -if (local.network_id) free (local.network_id);
> -if (local.auth_name) free (local.auth_name);
> -if (local.auth_data) free (local.auth_data);
> +free (local.protocol_name);
> +free (local.protocol_data);
> +free (local.network_id);
> +free (local.auth_name);
> +free (local.auth_data);
> 
>  return (NULL);
>  }
> @@ -284,11 +284,11 @@ IceFreeAuthFileEntry (
>  {
>  if (auth)
>  {
> - if (auth->protocol_name) free (auth->protocol_name);
> - if (auth->protocol_data) free (auth->protocol_data);
> - if (auth->network_id) free (auth->network_id);
> - if (auth->auth_name) free (auth->auth_name);
> - if (auth->auth_data) free (auth->auth_data);
> + free (auth->protocol_name);
> + free (auth->protocol_data);
> + free (auth->network_id);
> + free (auth->auth_name);
> + free (auth->auth_data);
>   free (auth);
>  }
>  }
> diff --git a/src/misc.c b/src/misc.c
> index d2e9150..87d6335 100644
> --- a/src/misc.c
> +++ b/src/misc.c
> @@ -54,8 +54,7 @@ IceAllocScratch (
>  {
>  if (!iceConn->scratch || size > iceConn->scratch_size)
>  {
> - if (iceConn->scratch)
> - free (iceConn->scratch);
> + free (iceConn->scratch);
> 
>   iceConn->scratch = malloc (size);
>   iceConn->scratch_size = size;
> diff --git a/src/process.c b/src/process.c
> index 4100a83..a9a8d08 100644
> --- a/src/process.c
> +++ b/src/process.c
> @@ -1026,8 +1026,7 @@ ProcessConnectionSetup (
>   iceConn->connection_status = IceConnectRejected;
>   }
> 
> - if (hostname)
> - free (hostname);
> + free (hostname);
>   }
> 
>   if (iceConn->connection_status == IceConnectRejected)
> @@ -1080,8 +1079,7 @@ ProcessConnectionSetup (
>   if (authData && authDataLen > 0)
>   free (authData);
> 
> - if (errorString)
> - free (errorString);
> + free (errorString);
>  }
> 
>  if (accept_setup_now)
> @@ -1369,8 +1367,7 @@ ProcessAuthReply (
>   status = IcePaAuthAccepted;
>   }
> 
> - if (hostname)
> - free (hostname);
> + free (hostname);
>   }
> 
>   if (status != IcePaAuthAccepted)
> @@ -1444,8 +1441,7 @@ ProcessAuthReply (
>   status = IcePaAuthAccepted;
>   }
> 
> - if (hostname)
> - free (hostname);
> + free (hostname);
>   }
> 
>   if (status == IcePaAuthRejected)
> @@ -1559,18 +1555,15 @@ ProcessAuthReply (
>   _IceErrorSetupFailed (iceConn, ICE_ProtocolSetup,
>   failureReason);
> 
> - if (failureReason)
> - free (failureReason);
> + free (failureReason);
>   }
>   }
> 
> 
>   if (free_setup_info)
>   {
> - if (iceConn->protosetup_to_me->his_vendor)
> - free (iceConn->protosetup_to_me->his_vendor);
> - if (iceConn->protosetup_to_me->his_release)
> - free (iceConn->protosetup_to_me->his_release);
> + free (iceConn->protosetup_to_me->

Re: [PATCH libICE 3/3] Make sure string is never NULL

2017-09-04 Thread Eric Engestrom
On Monday, 2017-09-04 12:00:58 +0100, Emil Velikov wrote:
> On 7 July 2017 at 11:23, Eric Engestrom <eric.engest...@imgtec.com> wrote:
> > `error_message` is passed in to strncpy() without any check, which
> > doesn't handle NULL itself, so let's make it a valid empty string in
> > cases where it was NULL.
> >
> Strictly speaking strdup() can fail, thus we could still end with a NULL.
> In all fairness I'm not sure how much one should bother though.

strdup() failing is further down the list of priorities than explicitly
passing NULL to a function that can't handle NULL ;)

Also note that I didn't experience this crash, I was just bothered by
the compiler warnings whenever I compiled this project :P

> > Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
> > ---
> >  src/process.c | 14 --
> >  1 file changed, 12 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/process.c b/src/process.c
> > index 1ee1ceb..30d073f 100644
> > --- a/src/process.c
> > +++ b/src/process.c
> > @@ -704,6 +704,11 @@ ProcessError (
> > invokeHandler = 1;
> > }
> >
> > +   if (!errorStr)
> > +   {
> > +   errorStr = strdup("");
> > +   }
> > +
> > errorReply->type = ICE_CONNECTION_ERROR;
> > errorReply->error_message = errorStr;
> > }
> > @@ -794,6 +799,11 @@ ProcessError (
> > invokeHandler = 1;
> > }
> >
> > +   if (!errorStr)
> > +   {
> > +   errorStr = strdup("");
> > +   }
> > +
> Skimming through the file, one could drop the curly brackets.

I'm used to our internal style, which is to always have the brackets,
and this file has a mix of both styles, so I chose to have the explicit
brackets, but I could indeed drop them.
I won't send a v2 just for this though, unless you feel strongly about it?

> Indentation also seems off, although it could be my MUA.

Indentation is all over the place in this file, with random mixes of
tabs and spaces on the surrounding lines, but I used a simple
tab-per-indentation-level on the lines I added.

> 
> With the above nitpicks, the series is
> Reviewed-by: Emil Velikov <emil.veli...@collabora.com>
> 
> -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 libICE 0/3] Fix memory access

2017-09-04 Thread Eric Engestrom
Ping :)

On Friday, 2017-07-07 11:23:45 +0100, Eric Engestrom wrote:
> Fix a few free() of static strings and strncpy() of NULL.
> 
> BTW, there hasn't been a release in quite a few years, but some of the
> fixes might be interesting, especially ff5e59f322 "Use getentropy() if
> arc4random_buf() is not available".
> 
> Could it be time to release 1.0.10/1.1.0?
> 
> Cc: Alan Coopersmith <alan.coopersm...@oracle.com>
> 
> Eric Engestrom (3):
>   Make sure errorStr is a free-able string
>   Make sure error_message is a free-able string
>   Make sure string is never NULL
> 
>  src/process.c | 20 +++-
>  1 file changed, 15 insertions(+), 5 deletions(-)
> 
> -- 
> Cheers,
>   Eric
___
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 libICE 3/3] Make sure string is never NULL

2017-07-07 Thread Eric Engestrom
`error_message` is passed in to strncpy() without any check, which
doesn't handle NULL itself, so let's make it a valid empty string in
cases where it was NULL.

Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 src/process.c | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/process.c b/src/process.c
index 1ee1ceb..30d073f 100644
--- a/src/process.c
+++ b/src/process.c
@@ -704,6 +704,11 @@ ProcessError (
invokeHandler = 1;
}
 
+   if (!errorStr)
+   {
+   errorStr = strdup("");
+   }
+
errorReply->type = ICE_CONNECTION_ERROR;
errorReply->error_message = errorStr;
}
@@ -794,6 +799,11 @@ ProcessError (
invokeHandler = 1;
}
 
+   if (!errorStr)
+   {
+   errorStr = strdup("");
+   }
+
errorReply->type = ICE_PROTOCOL_ERROR;
errorReply->error_message = errorStr;
}
@@ -1270,7 +1280,7 @@ ProcessAuthRequired (
}
 
if (asprintf (, "%s%s", prefix, errorString) == -1)
-   returnErrorString = NULL;
+   returnErrorString = strdup("");
free (errorString);
 
if (iceConn->connect_to_you)
@@ -1697,7 +1707,7 @@ ProcessAuthNextPhase (
}
 
if (asprintf (, "%s%s", prefix, errorString) == -1)
-   returnErrorString = NULL;
+   returnErrorString = strdup("");
free (errorString);
 
if (iceConn->connect_to_you)
-- 
Cheers,
  Eric

___
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 libICE 2/3] Make sure error_message is a free-able string

2017-07-07 Thread Eric Engestrom
Similar to the previous commit, assigning a static string would crash
upon freeing.

Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 src/process.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/process.c b/src/process.c
index 1d7c07a..1ee1ceb 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1797,7 +1797,7 @@ ProcessConnectionReply (
 
errorReply->type = ICE_CONNECTION_ERROR;
errorReply->error_message =
-   "Received bad version index in Connection Reply";
+   strdup("Received bad version index in Connection Reply");
}
else
{
@@ -2300,7 +2300,7 @@ ProcessProtocolReply (
 
errorReply->type = ICE_PROTOCOL_ERROR;
errorReply->error_message =
-   "Received bad version index in Protocol Reply";
+   strdup("Received bad version index in Protocol Reply");
}
else
{
-- 
Cheers,
  Eric

___
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 libICE 1/3] Make sure errorStr is a free-able string

2017-07-07 Thread Eric Engestrom
If the `errorClass` isn't handled by the switch, `errorStr`'s initial
value would be a pointer to some static memory with an empty string,
and freeing it would most likely crash.

Let's set it to NULL instead, as is done in other similar places.

Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 src/process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/process.c b/src/process.c
index 4100a83..1d7c07a 100644
--- a/src/process.c
+++ b/src/process.c
@@ -715,7 +715,7 @@ ProcessError (
{
_IceProtocolError *errorReply =
&(((_IceReply *) (replyWait->reply))->protocol_error);
-   char *errorStr = "";
+   char *errorStr = NULL;
const char *prefix;
char *temp;
 
-- 
Cheers,
  Eric

___
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 libICE 0/3] Fix memory access

2017-07-07 Thread Eric Engestrom
Fix a few free() of static strings and strncpy() of NULL.

BTW, there hasn't been a release in quite a few years, but some of the
fixes might be interesting, especially ff5e59f322 "Use getentropy() if
arc4random_buf() is not available".

Could it be time to release 1.0.10/1.1.0?

Cc: Alan Coopersmith <alan.coopersm...@oracle.com>

Eric Engestrom (3):
  Make sure errorStr is a free-able string
  Make sure error_message is a free-able string
  Make sure string is never NULL

 src/process.c | 20 +++-
 1 file changed, 15 insertions(+), 5 deletions(-)

-- 
Cheers,
  Eric
___
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: Initial Haiku support

2017-05-15 Thread Eric Engestrom
On Saturday, 2017-05-06 11:54:52 +, James Taylor wrote:
> Hello Everyone,
> 
> I'm mentoring Haiku's GSoC project for porting DRM to Haiku
> (www.haiku-os.org). Since my student will be doing the bulk of the
> work on the DRM kernel drivers proper, I decided to start looking at
> some of the other packages that we'll have to port, the first being
> libDRM. Seeing as libpciaccess is a dependency and it hasn't been
> ported yet, I've gone ahead and prepared a patch that allows it to
> build on Haiku. Please review and if possible merge. Seeing as I don't
> really have a way to test it right now, there may be additional
> patches in the future to tweak the library to work for us. Please feel
> free to contact me with any questions or comments via email or on
> Freenode, my nick is Duggan.
> 
> Thank you.

If you could send your next patches using `git send-email`, it would
make it easier (and thus quicker) for people to review them :)

I had a quick look, and it won't have any effect on non-haiku platforms,
so it should be fine to land, whatever state the haiku bit is.

Acked-by: Eric Engestrom <eric.engest...@imgtec.com>

You are missing the build-system bits to integrate your code, however.
Something like this?

8<
diff --git a/src/Makefile.am b/src/Makefile.am
index 3a46a85..96d9786 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -46,6 +46,10 @@ OS_SUPPORT = openbsd_pci.c
 # VGA Arbiter code is included in openbsd_pci.c
 endif
 
+if HAIKU
+OS_SUPPORT = haiku_pci.c
+endif
+
 if SOLARIS
 OS_SUPPORT = solx_devfs.c pci_tools.h
 VGA_ARBITER = common_vgaarb_stub.c
>8
___
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 4/4] meson: Detect strlcat/strlcpy/reallocarray in libbsd

2017-05-10 Thread Eric Engestrom
On Tuesday, 2017-05-09 19:39:47 -0400, Peter Harris wrote:
> If we're linking with libbsd anyway, we might as well use the functions
> it provides instead of compiling our replacements.
> 
> Signed-off-by: Peter Harris 
> ---
>  include/meson.build | 6 +++---
>  include/os.h| 6 ++
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/include/meson.build b/include/meson.build
> index 40614e23b..7296b47b5 100644
> --- a/include/meson.build
> +++ b/include/meson.build
> @@ -112,15 +112,15 @@ conf_data.set('HAVE_GETZONEID', 
> cc.has_function('getzoneid'))
>  conf_data.set('HAVE_MMAP', cc.has_function('mmap'))
>  conf_data.set('HAVE_POLL', cc.has_function('poll'))
>  conf_data.set('HAVE_POSIX_FALLOCATE', cc.has_function('posix_fallocate'))
> -conf_data.set('HAVE_REALLOCARRAY', cc.has_function('reallocarray'))
> +conf_data.set('HAVE_REALLOCARRAY', cc.has_function('reallocarray', 
> dependencies: libbsd_dep))
>  conf_data.set('HAVE_SETEUID', cc.has_function('seteuid'))
>  conf_data.set('HAVE_SETITIMER', cc.has_function('setitimer'))
>  conf_data.set('HAVE_SHMCTL64', cc.has_function('shmctl64'))
>  conf_data.set('HAVE_SIGACTION', cc.has_function('sigaction'))
>  conf_data.set('HAVE_STRCASECMP', cc.has_function('strcasecmp'))
>  conf_data.set('HAVE_STRCASESTR', cc.has_function('strcasestr'))
> -conf_data.set('HAVE_STRLCAT', cc.has_function('strlcat'))
> -conf_data.set('HAVE_STRLCPY', cc.has_function('strlcpy'))
> +conf_data.set('HAVE_STRLCAT', cc.has_function('strlcat', dependencies: 
> libbsd_dep))
> +conf_data.set('HAVE_STRLCPY', cc.has_function('strlcpy', dependencies: 
> libbsd_dep))
>  conf_data.set('HAVE_STRNCASECMP', cc.has_function('strncasecmp'))
>  conf_data.set('HAVE_STRNDUP', cc.has_function('strndup'))
>  conf_data.set('HAVE_TIMINGSAFE_MEMCMP', cc.has_function('timingsafe_memcmp'))
> diff --git a/include/os.h b/include/os.h
> index fb09d00c7..8fd8fb212 100644
> --- a/include/os.h
> +++ b/include/os.h
> @@ -54,6 +54,12 @@ SOFTWARE.
>  #ifdef MONOTONIC_CLOCK
>  #include 
>  #endif
> +#if defined HAVE_LIBBSD && defined HAVE_REALLOCARRAY

nit: most of the codebase uses `defined(FOO)` (313 vs 5 occurences)
quick sed to fix it: s/defined\s+(\w+)/defined\(\1\)/g

> +#include/* for reallocarray */
> +#endif
> +#if defined HAVE_LIBBSD && defined HAVE_STRLCPY
> +#include/* for strlcpy, strlcat */
> +#endif
>  
>  #define SCREEN_SAVER_ON   0
>  #define SCREEN_SAVER_OFF  1
> -- 
> 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 v2 xserver] Makefile.am: add the meson files to the tarball

2017-05-01 Thread Eric Engestrom
Reviewed-by: Eric Engestrom <e...@engestrom.ch>

On 1 May 2017 10:29:16 BST, Peter Hutterer <peter.hutte...@who-t.net> wrote:
>While we're shipping both build systems, we'll likely have 'make dist'
>generated tarballs - those tarballs should be buildable with meson to
>have more exposure.
>
>Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
>---
>Changes to v1:
>- include the config.h.meson.in manually, reduce match to 'meson.build'
>only
>
> Makefile.am | 7 +++
> 1 file changed, 7 insertions(+)
>
>diff --git a/Makefile.am b/Makefile.am
>index f0fa2d8..c28969e 100644
>--- a/Makefile.am
>+++ b/Makefile.am
>@@ -74,6 +74,13 @@ endif
> 
> EXTRA_DIST = xorg-server.pc.in xorg-server.m4 autogen.sh
> 
>+meson_files = $(shell find . -type f -name 'meson.build' -print
>2>/dev/null)
>+EXTRA_DIST += meson_options.txt \
>+  include/xorg-config.h.meson.in \
>+  hw/xfree86/loader/symbol-test.c \
>+  hw/xfree86/common/xf86Build.sh \
>+  $(meson_files)
>+
> DISTCHECK_CONFIGURE_FLAGS=\
>   --with-xkb-path=$(XKB_BASE_DIRECTORY) \
>   --with-xkb-bin-directory=$(XKB_BIN_DIRECTORY) \
>-- 
>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

Cheers,
  Eric
___
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] Makefile.am: add the meson files to the tarball

2017-04-28 Thread Eric Engestrom
On Friday, 2017-04-28 11:30:08 +0100, Eric Engestrom wrote:
> On Friday, 2017-04-28 16:09:55 +1000, Peter Hutterer wrote:
> > While we're providing both build systems, we'll likely have 'make dist'
> > generated tarballs - those tarballs should be buildable with meson to
> > have more exposure.
> > 
> > Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
> > ---
> > triggered by:
> > https://mail.gnome.org/archives/desktop-devel-list/2017-April/msg00091.html
> > 
> > I opted to keep all the meson-specifics in one location rather than
> > sprinkling it across the various Makefile.am's.
> > 
> >  Makefile.am | 6 ++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/Makefile.am b/Makefile.am
> > index f0fa2d8..2c51f5e 100644
> > --- a/Makefile.am
> > +++ b/Makefile.am
> > @@ -74,6 +74,12 @@ endif
> >  
> >  EXTRA_DIST = xorg-server.pc.in xorg-server.m4 autogen.sh
> >  
> > +meson_files = $(shell find . -type f -name '*meson.*' -print 2>/dev/null)
> 
> What is '*meson.*' matching, other than 'meson.build'?

I could've simply ran it instead of asking... :)

The only other file is include/xorg-config.h.meson.in, which I'd argue
could be matched using something like this instead?
find . -type f \( -name meson.build -o -name '*.meson.in' \) -print

> 
> > +EXTRA_DIST += meson_options.txt \
> > +  hw/xfree86/loader/symbol-test.c \
> > +  hw/xfree86/common/xf86Build.sh \
> > +  $(meson_files)
> > +
> >  DISTCHECK_CONFIGURE_FLAGS=\
> > --with-xkb-path=$(XKB_BASE_DIRECTORY) \
> > --with-xkb-bin-directory=$(XKB_BIN_DIRECTORY) \
> > -- 
> > 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] Makefile.am: add the meson files to the tarball

2017-04-28 Thread Eric Engestrom
On Friday, 2017-04-28 16:09:55 +1000, Peter Hutterer wrote:
> While we're providing both build systems, we'll likely have 'make dist'
> generated tarballs - those tarballs should be buildable with meson to
> have more exposure.
> 
> Signed-off-by: Peter Hutterer 
> ---
> triggered by:
> https://mail.gnome.org/archives/desktop-devel-list/2017-April/msg00091.html
> 
> I opted to keep all the meson-specifics in one location rather than
> sprinkling it across the various Makefile.am's.
> 
>  Makefile.am | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Makefile.am b/Makefile.am
> index f0fa2d8..2c51f5e 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -74,6 +74,12 @@ endif
>  
>  EXTRA_DIST = xorg-server.pc.in xorg-server.m4 autogen.sh
>  
> +meson_files = $(shell find . -type f -name '*meson.*' -print 2>/dev/null)

What is '*meson.*' matching, other than 'meson.build'?

> +EXTRA_DIST += meson_options.txt \
> +  hw/xfree86/loader/symbol-test.c \
> +  hw/xfree86/common/xf86Build.sh \
> +  $(meson_files)
> +
>  DISTCHECK_CONFIGURE_FLAGS=\
>   --with-xkb-path=$(XKB_BASE_DIRECTORY) \
>   --with-xkb-bin-directory=$(XKB_BIN_DIRECTORY) \
> -- 
> 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 rendercheck v3 4/4] Explain how to build using meson in the README.

2017-03-31 Thread Eric Engestrom
On Wednesday, 2017-03-29 13:19:35 -0700, Eric Anholt wrote:
> Signed-off-by: Eric Anholt <e...@anholt.net>
> ---
>  README | 8 
>  1 file changed, 8 insertions(+)
> 
> diff --git a/README b/README
> index f5af0b0c64eb..2f8ec1ab0e46 100644
> --- a/README
> +++ b/README
> @@ -10,3 +10,11 @@ Tests currently include:
>  - Linear gradients
>  - Repeating sources/masks at POT and non-POT sizes
>  - Some regression tests for bugs from freedesktop.org bugzilla.
> +
> +rendercheck uses the Meson build system, which uses the "ninja" build
> +backend on Linux.  The three commands to configure (building into the
> +build/ directory), build, and install are:
> +
> +meson build
> +ninja -C build
> +sudo ninja -C build install

s,build,build/, on all three lines, to make it clear this is the dir
name, not some target?

Series is:
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> -- 
> 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 v2 util-modular] release.sh: create a worktree structure that's out of reach of libtool

2017-03-09 Thread Eric Engestrom
On Thursday, 2017-03-09 08:23:24 +1000, Peter Hutterer wrote:
> The comment in the diff says it all, we need to put our worktree root at least
> two directories away from our normal checkout because most repos don't have
> AC_CONFIG_AUX_DIR() set.
> 
> This fixes the issue of release.sh failing in git trees that haven't been git
> cleaned:
> 
> ERROR: files left in build directory after distclean:
> ./config.sub
> ./test-driver
> ./ltmain.sh
> ./config.guess
> ./install-sh
> ./missing
> ./depcomp
> ./compile
> make[1]: *** [distcleancheck] Error 1
> make: *** [distcheck] Error 1
> 
> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
> ---
> Changes to v1:
> - now with new and improved typos :)
> - add note about AC_CONFIG_AUX_DIR
> - change path to release/$section/, section is the only thing we have
>   available this early
> 
>  release.sh | 15 ++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/release.sh b/release.sh
> index c824dea..0e9261b 100755
> --- a/release.sh
> +++ b/release.sh
> @@ -357,13 +357,26 @@ process_module() {
>   return 1
>  fi
>  
> +# If AC_CONFIG_AUX_DIR isn't set, libtool will search down to ../.. for
> +# install-sh and then just guess that's the aux dir, dumping config.sub
> +# and other files into that directory. make distclean then complains
> +# about leftover files. So let's put our real module dir out of reach of
> +# libtool.
> +#
> +# We use release/$section/$build_dir because git worktree will pick the
> +# last part as branch identifier, so it needs to be random to avoid
> +# conflicts.
> +build_dir="release/$section"
> +mkdir -p "$build_dir"
> +
>  # Create tmpdir for the release
> -build_dir=`mktemp -d -p . build.XX`
> +tmpdir=`mktemp -d -p . build.XX`

I'm pretty sure that should be `-p "$build_dir"` :P

And the output already contains `-p`, so this line should read:
  build_dir=`mktemp -d -p "$build_dir" build.XX`

>  if [ $? -ne 0 ]; then
>  echo "Error: could not create a temporary directory for the release"
>  echo "Do you have coreutils' mktemp ?"
>  return 1
>  fi
> +build_dir="$build_dir/$tmpdir"

And this line should be dropped.

With that, the patch is:
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

Cheers,
  Eric

>  
>  # Worktree removal is intentionally left to the user, due to:
>  #  - currently we cannot select only one worktree to prune
> -- 
> 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] xwayland: add envvar XWAYLAND_NO_GLAMOR

2017-03-01 Thread Eric Engestrom
On Wednesday, 2017-03-01 17:45:12 +0100, Olivier Fourdan wrote:
> Not all compositors allow for customizing the Xwayland command line,
> gnome-shell/mutter for example have the command line and path to
> Xwayland binary hardcoded, which makes it harder for users to disable
> glamor acceleration in Xwayland (glamor being used by default).
> 
> Add an environment variable XWAYLAND_NO_GLAMOR t odiable glamor support

"to disable"

The change itself looks good to me.
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

As to whether it's a good idea to allow this, I'd say it is, but you
might want the opinion of someone who's more involved in this project :)

Cheers,
  Eric

> in Xwayland.
> 
> Signed-off-by: Olivier Fourdan <ofour...@redhat.com>
> ---
>  hw/xwayland/xwayland-glamor.c | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c
> index b3d0aab..45de54f 100644
> --- a/hw/xwayland/xwayland-glamor.c
> +++ b/hw/xwayland/xwayland-glamor.c
> @@ -549,6 +549,13 @@ Bool
>  xwl_glamor_init(struct xwl_screen *xwl_screen)
>  {
>  ScreenPtr screen = xwl_screen->screen;
> +const char *no_glamor_env;
> +
> +no_glamor_env = getenv("XWAYLAND_NO_GLAMOR");
> +if (no_glamor_env && *no_glamor_env != '0') {

Nit: `XWAYLAND_NO_GLAMOR=` evaluates to true here, disabling glamor.
Not sure how much we care about this case though, or if we do want this
behaviour, but this would fix it:

if (no_glamor_env && *no_glamor_env && *no_glamor_env != '0') {

> +ErrorF("Disabling glamor and dri3 support, XWAYLAND_NO_GLAMOR is 
> set\n");
> +return FALSE;
> +}
>  
>  if (xwl_screen->egl_context == EGL_NO_CONTEXT) {
>  ErrorF("Disabling glamor and dri3, EGL setup failed\n");
> -- 
> 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 2/3] Use arc4random_buf(3) if available to generate cookies.

2017-03-01 Thread Eric Engestrom
On Tuesday, 2017-02-28 19:18:43 +0100, Matthieu Herrb wrote:
> Signed-off-by: Matthieu Herrb 
> ---
>  configure.ac| 2 ++
>  include/dix-config.h.in | 6 ++
>  os/auth.c   | 7 +++
>  3 files changed, 15 insertions(+)
> 
> diff --git a/configure.ac b/configure.ac
> index f6a49302f..6a7c4cc6f 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -225,6 +225,8 @@ AC_REPLACE_FUNCS([reallocarray strcasecmp strcasestr 
> strlcat strlcpy strndup\
>   timingsafe_memcmp])
>  AM_CONDITIONAL(POLL, [test "x$ac_cv_func_poll" = "xyes"])
>  
> +AC_CHECK_LIB([bsd], [arc4random_buf])
> +
>  AC_CHECK_DECLS([program_invocation_short_name], [], [], [[#include 
> ]])
>  
>  dnl Check for SO_PEERCRED #define
> diff --git a/include/dix-config.h.in b/include/dix-config.h.in
> index 4b86c1a3c..d357910a6 100644
> --- a/include/dix-config.h.in
> +++ b/include/dix-config.h.in
> @@ -125,6 +125,9 @@
>  /* Build a standalone xpbproxy */
>  #undef STANDALONE_XPBPROXY
>  
> +/* Define to 1 if you have the `bsd' library (-lbsd). */
> +#undef HAVE_LIBBSD
> +
>  /* Define to 1 if you have the `m' library (-lm). */
>  #undef HAVE_LIBM
>  
> @@ -161,6 +164,9 @@
>  /* Define to 1 if you have the  header file. */
>  #undef HAVE_RPCSVC_DBM_H
>  
> +/* Define to 1 if you have the `arc4random_buf' function. */
> +#undef HAVE_ARC4RANDOM_BUF
> +
>  /* Define to use libc SHA1 functions */
>  #undef HAVE_SHA1_IN_LIBC
>  
> diff --git a/os/auth.c b/os/auth.c
> index 7da6fc6ed..81164a2f5 100644
> --- a/os/auth.c
> +++ b/os/auth.c
> @@ -45,6 +45,9 @@ from The Open Group.
>  #ifdef WIN32
>  #include
>  #endif
> +#ifdef HAVE_LIBBSD
> +#include  /* for arc4random_buf() */
> +#endif
>  
>  struct protocol {
>  unsigned short name_length;
> @@ -303,11 +306,15 @@ GenerateAuthorization(unsigned name_length,
>  void
>  GenerateRandomData(int len, char *buf)
>  {
> +#ifdef HAVE_ARC4RANDOMBUF

HAVE_ARC4RANDOM_BUF (missing underscore)

> +arc4random_buf(buf, len);
> +#else
>  int fd;
>  
>  fd = open("/dev/urandom", O_RDONLY);
>  read(fd, buf, len);
>  close(fd);
> +#endif
>  }
>  
>  #endif  /* XCSECURITY */
> -- 
> 2.11.1
> 
___
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 xf86-input-libinput 1/3] Add streq() macro, replace strcmp instances with it

2017-02-24 Thread Eric Engestrom
On Friday, 2017-02-24 14:13:39 +, Eric Engestrom wrote:
> On Friday, 2017-02-24 13:10:17 +1000, Peter Hutterer wrote:
> > And why isn't this a thing in glibc yet
> 
> Indeed :(
> So many bugs caused by someone assuming `if (strcmp(a, b))` means a==b...
> 
> > 
> > Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
> > ---
> >  src/xf86libinput.c | 21 -
> >  1 file changed, 12 insertions(+), 9 deletions(-)
> > 
> > diff --git a/src/xf86libinput.c b/src/xf86libinput.c
> > index 703d872..c1214b7 100644
> > --- a/src/xf86libinput.c
> > +++ b/src/xf86libinput.c
> > @@ -65,6 +65,9 @@
> >  #define TOUCH_MAX_SLOTS 15
> >  #define XORG_KEYCODE_OFFSET 8
> >  
> > +#define streq(a, b) (strcmp(a, b) == 0)
> > +#define strneq(a, b, n) (strncmp(a, b, n) == 0)
> 
> strneq() reads to me as "string not equal"...
> streqn() might be a better name?

Actually, strneq() seems to be already used in a few places, like
systemd [1] or the kernel's dtc script [2], whereas streqn() doesn't
seem to be used much anywhere.

Feel free to ignore my previous message and keep the name :)

[1] https://github.com/systemd/systemd/blob/master/src/basic/string-util.h#L43
[2] http://lxr.free-electrons.com/source/scripts/dtc/dtc.h#L66

> 
> And a bit of a nitpick, but could you move its introduction to the patch
> that starts using it (ie. 3/3)?
> 
> Otherwise, this patch is:
> Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>
> 
> (the other patches require more knowledge than I have)
> 
> > +
> >  /*
> > libinput does not provide axis information for absolute devices, instead
> > it scales into the screen dimensions provided. So we set up the axes 
> > with
> > @@ -259,7 +262,7 @@ xf86libinput_is_subdevice(InputInfoPtr pInfo)
> > BOOL is_subdevice;
> >  
> > source = xf86SetStrOption(pInfo->options, "_source", "");
> > -   is_subdevice = strcmp(source, "_driver/libinput") == 0;
> > +   is_subdevice = streq(source, "_driver/libinput");
> > free(source);
> >  
> > return is_subdevice;
> > @@ -1213,7 +1216,7 @@ is_libinput_device(InputInfoPtr pInfo)
> > BOOL rc;
> >  
> > driver = xf86CheckStrOption(pInfo->options, "driver", "");
> > -   rc = strcmp(driver, "libinput") == 0;
> > +   rc = streq(driver, "libinput");
> > free(driver);
> >  
> > return rc;
> > @@ -2187,7 +2190,7 @@ open_restricted(const char *path, int flags, void 
> > *data)
> > nt_list_for_each_entry(pInfo, xf86FirstLocalDevice(), next) {
> > char *device = xf86CheckStrOption(pInfo->options, "Device", 
> > NULL);
> >  
> > -   if (device != NULL && strcmp(path, device) == 0) {
> > +   if (device != NULL && streq(path, device)) {
> > free(device);
> > break;
> > }
> > @@ -2353,9 +2356,9 @@ xf86libinput_parse_tap_buttonmap_option(InputInfoPtr 
> > pInfo,
> >"TappingButtonMap",
> >NULL);
> > if (str) {
> > -   if (strcmp(str, "lmr") == 0)
> > +   if (streq(str, "lmr"))
> > map = LIBINPUT_CONFIG_TAP_MAP_LMR;
> > -   else if (strcmp(str, "lrm") == 0)
> > +   else if (streq(str, "lrm"))
> > map = LIBINPUT_CONFIG_TAP_MAP_LRM;
> > else
> > xf86IDrvMsg(pInfo, X_ERROR,
> > @@ -2468,11 +2471,11 @@ xf86libinput_parse_sendevents_option(InputInfoPtr 
> > pInfo,
> >"SendEventsMode",
> >NULL);
> > if (modestr) {
> > -   if (strcmp(modestr, "enabled") == 0)
> > +   if (streq(modestr, "enabled"))
> > mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED;
> > -   else if (strcmp(modestr, "disabled") == 0)
> > +   else if (streq(modestr, "disabled"))
> > mode = LIBINPUT_CONFIG_SEND_EVENTS_DISABLED;
> > -   else if (strcmp(modestr, "disabled-on-external-mouse") == 0)
> > +   else if (streq(modestr, "disabled-on-external-mouse"))
> > mode = 
> > LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE;
> > else
> > xf86IDrvMsg(pInfo, X_ERROR,
> > @@ -2866,7 +2869,7 @@ xf86libinput_parse_tablet_area_option(InputInfoPtr 
> > pInfo,
> > str = xf86SetStrOption(pInfo->options,
> >"TabletToolAreaRatio",
> >NULL);
> > -   if (!str || strcmp(str, "default") == 0)
> > +   if (!str || streq(str, "default"))
> > goto out;
> >  
> > rc = sscanf(str, "%d:%d", , );
> > -- 
> > 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 xf86-input-libinput 1/3] Add streq() macro, replace strcmp instances with it

2017-02-24 Thread Eric Engestrom
On Friday, 2017-02-24 13:10:17 +1000, Peter Hutterer wrote:
> And why isn't this a thing in glibc yet

Indeed :(
So many bugs caused by someone assuming `if (strcmp(a, b))` means a==b...

> 
> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
> ---
>  src/xf86libinput.c | 21 -
>  1 file changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/src/xf86libinput.c b/src/xf86libinput.c
> index 703d872..c1214b7 100644
> --- a/src/xf86libinput.c
> +++ b/src/xf86libinput.c
> @@ -65,6 +65,9 @@
>  #define TOUCH_MAX_SLOTS 15
>  #define XORG_KEYCODE_OFFSET 8
>  
> +#define streq(a, b) (strcmp(a, b) == 0)
> +#define strneq(a, b, n) (strncmp(a, b, n) == 0)

strneq() reads to me as "string not equal"...
streqn() might be a better name?

And a bit of a nitpick, but could you move its introduction to the patch
that starts using it (ie. 3/3)?

Otherwise, this patch is:
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

(the other patches require more knowledge than I have)

> +
>  /*
> libinput does not provide axis information for absolute devices, instead
> it scales into the screen dimensions provided. So we set up the axes with
> @@ -259,7 +262,7 @@ xf86libinput_is_subdevice(InputInfoPtr pInfo)
>   BOOL is_subdevice;
>  
>   source = xf86SetStrOption(pInfo->options, "_source", "");
> - is_subdevice = strcmp(source, "_driver/libinput") == 0;
> + is_subdevice = streq(source, "_driver/libinput");
>   free(source);
>  
>   return is_subdevice;
> @@ -1213,7 +1216,7 @@ is_libinput_device(InputInfoPtr pInfo)
>   BOOL rc;
>  
>   driver = xf86CheckStrOption(pInfo->options, "driver", "");
> - rc = strcmp(driver, "libinput") == 0;
> + rc = streq(driver, "libinput");
>   free(driver);
>  
>   return rc;
> @@ -2187,7 +2190,7 @@ open_restricted(const char *path, int flags, void *data)
>   nt_list_for_each_entry(pInfo, xf86FirstLocalDevice(), next) {
>   char *device = xf86CheckStrOption(pInfo->options, "Device", 
> NULL);
>  
> - if (device != NULL && strcmp(path, device) == 0) {
> + if (device != NULL && streq(path, device)) {
>   free(device);
>   break;
>   }
> @@ -2353,9 +2356,9 @@ xf86libinput_parse_tap_buttonmap_option(InputInfoPtr 
> pInfo,
>  "TappingButtonMap",
>  NULL);
>   if (str) {
> - if (strcmp(str, "lmr") == 0)
> + if (streq(str, "lmr"))
>   map = LIBINPUT_CONFIG_TAP_MAP_LMR;
> - else if (strcmp(str, "lrm") == 0)
> + else if (streq(str, "lrm"))
>   map = LIBINPUT_CONFIG_TAP_MAP_LRM;
>   else
>   xf86IDrvMsg(pInfo, X_ERROR,
> @@ -2468,11 +2471,11 @@ xf86libinput_parse_sendevents_option(InputInfoPtr 
> pInfo,
>  "SendEventsMode",
>  NULL);
>   if (modestr) {
> - if (strcmp(modestr, "enabled") == 0)
> + if (streq(modestr, "enabled"))
>   mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED;
> - else if (strcmp(modestr, "disabled") == 0)
> + else if (streq(modestr, "disabled"))
>   mode = LIBINPUT_CONFIG_SEND_EVENTS_DISABLED;
> - else if (strcmp(modestr, "disabled-on-external-mouse") == 0)
> + else if (streq(modestr, "disabled-on-external-mouse"))
>   mode = 
> LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE;
>   else
>   xf86IDrvMsg(pInfo, X_ERROR,
> @@ -2866,7 +2869,7 @@ xf86libinput_parse_tablet_area_option(InputInfoPtr 
> pInfo,
>   str = xf86SetStrOption(pInfo->options,
>  "TabletToolAreaRatio",
>  NULL);
> - if (!str || strcmp(str, "default") == 0)
> + if (!str || streq(str, "default"))
>   goto out;
>  
>   rc = sscanf(str, "%d:%d", , );
> -- 
> 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: Declare "pos" in glamor_dash.c

2017-02-23 Thread Eric Engestrom
From: "Dr.-Ing. Dieter Jurzitza" 

Fixes compile failure:

 Failed to compile VS: 0:13(43): error: `pos' undeclared
0:13(14): error: operands to arithmetic operators must be numeric
0:13(13): error: operands to arithmetic operators must be numeric

 Program source:
#version 130
attribute vec3 primitive;
varying float dash_offset;
uniform vec2 fill_offset;
uniform vec2 fill_size_inv;
varying vec2 fill_pos;
uniform float dash_length;
uniform vec4 v_matrix;
void main() {
   dash_offset = primitive.z / dash_length;
   gl_Position.xy = primitive.xy.xy * v_matrix.xz + v_matrix.yw;
   gl_Position.zw = vec2(0.0,1.0);
   fill_pos = (fill_offset + primitive.xy + pos) * fill_size_inv;
}
 (EE) Fatal server error:
 (EE) GLSL compile failure

Signed-off-by: Dr.-Ing. Dieter Jurzitza 
Tested-by: Stefan Dirsch 
---


I looked a bit more into this, and while I don't know much about glamor
(or glsl, to be honest), I don't think this fix is correct.

Was `pos` in glamor_program.c intended to be `gl_Position`, by any
chance?  That would make more sense to me.

Cc: Keith Packard 


---
 glamor/glamor_dash.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/glamor/glamor_dash.c b/glamor/glamor_dash.c
index 3c19dba32..78a4fa37a 100644
--- a/glamor/glamor_dash.c
+++ b/glamor/glamor_dash.c
@@ -32,6 +32,7 @@ static const char dash_vs_vars[] =
 
 static const char dash_vs_exec[] =
 "   dash_offset = primitive.z / dash_length;\n"
+"   vec2 pos = vec2(0,0);\n"
 GLAMOR_POS(gl_Position, primitive.xy);
 
 static const char dash_fs_vars[] =
-- 
Cheers,
  Eric

___
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] glamor: Declare "pos" in glamor_dash.c

2017-02-22 Thread Eric Engestrom
On Wednesday, 2017-02-22 11:47:44 +0100, dieter.jurzi...@t-online.de wrote:
> 
> From: Dr.-Ing. Dieter Jurzitza 
> 
> Fixes compile failure:
> 
>  Failed to compile VS: 0:13(43): error: `pos' undeclared
> 0:13(14): error: operands to arithmetic operators must be numeric
> 0:13(13): error: operands to arithmetic operators must be numeric
>  
>  Program source:
> #version 130
> attribute vec3 primitive;
> varying float dash_offset;
> uniform vec2 fill_offset;
> uniform vec2 fill_size_inv;
> varying vec2 fill_pos;
> uniform float dash_length;
> uniform vec4 v_matrix;
> void main() {
>dash_offset = primitive.z / dash_length;
>gl_Position.xy = primitive.xy.xy * v_matrix.xz + v_matrix.yw;
>gl_Position.zw = vec2(0.0,1.0);
>fill_pos = (fill_offset + primitive.xy + pos) * fill_size_inv;
> }
>  (EE) Fatal server error:
>  (EE) GLSL compile failure
> 
> Signed-off-by: Dr.-Ing. Dieter Jurzitza 

You should insert a line with just `---` after your signoff, or better
yet, use git and let `git send-email` handle the formatting to make it
a valid patch :)

Since Stefan tested your patch, you can also add this line (see his
reply to your previous mail) after your signoff, when you send the
properly formatted patch:
Tested-by: Stefan Dirsch 

> 
> 
> [PATCH xserver] glamor: Declare "pos" in glamor_dash.c

This will be ignored, the subject of the mail is what's used as the
commit title.

> 
> --- glamor/glamor_dash.c.original   2016-03-11 19:43:16.0 +0100
> +++ glamor/glamor_dash.c2017-02-19 20:00:11.883218927 +0100

git syntax is:
--- a/glamor/glamor_dash.c
+++ b/glamor/glamor_dash.c


Without these fixes, applying the patch requires a lot of manual work
from the maintainers, who are likely to not even bother ;)

Using git simplifies everything for you, the reviewers and
the maintainers, so it's highly recommended.

The link Stefan gave you [1] explains how to do this if you're not
familiar with git yet.

Cheers,
  Eric

[1] https://www.x.org/wiki/Development/Documentation/SubmittingPatches/


> @@ -32,6 +32,7 @@
> 
>  static const char dash_vs_exec[] =
>  "   dash_offset = primitive.z / dash_length;\n"
> +"   vec2 pos = vec2(0,0);\n"
>  GLAMOR_POS(gl_Position, primitive.xy);
> 
>  static const char dash_fs_vars[] =
> 
> 
> ___
> 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 xf86-input-libinput] Don't init the AccelSpeed/LeftHanded properties on the base tablet device

2016-10-26 Thread Eric Engestrom
On Wednesday, 2016-10-26 15:08:23 +1000, Peter Hutterer wrote:
> This device never sends events, no point in exposing these options
> 
> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>

Does what it says on the tin :)
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  src/xf86libinput.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/xf86libinput.c b/src/xf86libinput.c
> index 8ee6cbe..07b4d4e 100644
> --- a/src/xf86libinput.c
> +++ b/src/xf86libinput.c
> @@ -4092,7 +4092,8 @@ LibinputInitAccelProperty(DeviceIntPtr dev,
>   enum libinput_config_accel_profile profile;
>   BOOL profiles[2] = {FALSE};
>  
> - if (!libinput_device_config_accel_is_available(device))
> + if (!libinput_device_config_accel_is_available(device) ||
> + driver_data->capabilities & CAP_TABLET)
>   return;
>  
>   prop_accel = LibinputMakeProperty(dev,
> @@ -4260,7 +4261,8 @@ LibinputInitLeftHandedProperty(DeviceIntPtr dev,
>  {
>   BOOL left_handed = driver_data->options.left_handed;
>  
> - if (!libinput_device_config_left_handed_is_available(device))
> + if (!libinput_device_config_left_handed_is_available(device) ||
> + driver_data->capabilities & CAP_TABLET)
>   return;
>  
>   prop_left_handed = LibinputMakeProperty(dev,
> -- 
> 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] xwayland: Transform pointer enter event coordinates

2016-10-25 Thread Eric Engestrom
On Tuesday, 2016-10-25 19:24:49 +0200, Rui Matos wrote:
> Pointer enter event coordinates are surface relative and we need them
> to be screen relative for pScreen->SetCursorPosition().
> 
> https://bugzilla.gnome.org/show_bug.cgi?id=758283
> 
> Signed-off-by: Rui Matos <tiagoma...@gmail.com>

LGTM :)
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  hw/xwayland/xwayland-input.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
> index f2327dc..1352197 100644
> --- a/hw/xwayland/xwayland-input.c
> +++ b/hw/xwayland/xwayland-input.c
> @@ -298,6 +298,7 @@ pointer_handle_enter(void *data, struct wl_pointer 
> *pointer,
>  int i;
>  int sx = wl_fixed_to_int(sx_w);
>  int sy = wl_fixed_to_int(sy_w);
> +int dx, dy;
>  ScreenPtr pScreen = xwl_seat->xwl_screen->screen;
>  ValuatorMask mask;
>  
> @@ -314,9 +315,11 @@ pointer_handle_enter(void *data, struct wl_pointer 
> *pointer,
>  xwl_seat->pointer_enter_serial = serial;
>  
>  xwl_seat->focus_window = wl_surface_get_user_data(surface);
> +dx = xwl_seat->focus_window->window->drawable.x;
> +dy = xwl_seat->focus_window->window->drawable.y;
>  
>  master = GetMaster(dev, POINTER_OR_FLOAT);
> -(*pScreen->SetCursorPosition) (dev, pScreen, sx, sy, TRUE);
> +(*pScreen->SetCursorPosition) (dev, pScreen, dx + sx, dy + sy, TRUE);
>  
>  miPointerInvalidateSprite(master);
>  
> -- 
> 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] xfree86: Xorg.wrap: Do not require root rights for cards with 0 outputs

2016-10-18 Thread Eric Engestrom
On Tuesday, 2016-10-18 16:36:32 +0200, Hans de Goede wrote:
> Prior to this commit the Xorg.wrap code to detect if root rights
> are necessary checked for DRM_IOCTL_MODE_GETRESOURCES succeeding *and*
> reporting more then 0 output connectors.
> 
> DRM_IOCTL_MODE_GETRESOURCES succeeding alone is enough to differentiate
> between old drm only cards (which need ums and thus root) and kms capable
> cards.
> 
> Some hybrid gfx laptops have 0 output connectors on one of their 2 GPUs,
> resulting in Xorg needlessly running as root. This commits removes the
> res.count_connectors > 0 check, fixing this.
> 
> Signed-off-by: Hans de Goede <hdego...@redhat.com>

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  hw/xfree86/xorg-wrapper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/xfree86/xorg-wrapper.c b/hw/xfree86/xorg-wrapper.c
> index d930962..a25e6ff 100644
> --- a/hw/xfree86/xorg-wrapper.c
> +++ b/hw/xfree86/xorg-wrapper.c
> @@ -240,7 +240,7 @@ int main(int argc, char *argv[])
>  
>  memset(, 0, sizeof(struct drm_mode_card_res));
>  r = ioctl(fd, DRM_IOCTL_MODE_GETRESOURCES, );
> -if (r == 0 && res.count_connectors > 0)
> +if (r == 0)
>  kms_cards++;
>  
>  close(fd);
> -- 
> 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: Add xorg-xserver 1.19 support to tigervnc

2016-10-03 Thread Eric Engestrom
On Mon, Oct 03, 2016 at 05:59:33PM +0200, Hans de Goede wrote:
> Hello tigervnc devs,
> 
> As part of updating Fedora to xserver 1.19 I've written
> a tiger vnc patch to make tigervnc work with xserver 1.19.
> 
> Since xserver 1.19 switches from select to poll the changes
> are non trivial and require some #ifdef-s. The new code is
> a lot cleaner then the old code though, which is good.
> 
> And with server 1.19 the os/WaitFor.c changes are no longer
> necessary.
> 
> Attached is a tigervnc-1.7.0 patch, as well as a patch
> to apply to the xserver sources to patch in the tigervnc
> ext and hw/vnc dir into the buidlsys.
> 
> Regards,
> 
> Hans

[snip]

> --- tigervnc-1.7.0/unix/xserver/hw/vnc/xorg-version.h 2016-09-08 
> 12:31:18.0 +0200
> +++ tigervnc-1.7.0.new/unix/xserver/hw/vnc/xorg-version.h 2016-10-03 
> 10:27:53.721116357 +0200
> @@ -50,8 +50,10 @@
>  #define XORG 117
>  #elif XORG_VERSION_CURRENT < ((1 * 1000) + (18 * 10) + (99 * 1000))
>  #define XORG 118
> +#elif XORG_VERSION_CURRENT < ((1 * 1000) + (19 * 10) + (99 * 1000))
> +#define XORG 119
>  #else
> -#error "X.Org newer than 1.18 is not supported"
> +#error "X.Org newer than 1.18 is not supported"

This seems like a git bug? (Not the first time I've seen this in a patch)
There doesn't seem to be a difference here, but it's obvious the change
was means to be s/18/19/.
This will just need to be done manually while applying this patch :)
___
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: xfree86: Fix null pointer dereference

2016-09-23 Thread Eric Engestrom
On Fri, Sep 23, 2016 at 03:12:18PM +0300, Hans de Goede wrote:
> Hi,
> 
> On 01/13/2016 07:47 AM, Kyle Guinn wrote:
> > Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=93675
> > 
> > Signed-off-by: Kyle Guinn 
> 
> Thanks for the patch, I've queued this up at:
> 
> https://cgit.freedesktop.org/~jwrdegoede/xserver
> 
> For a 1.19 bug-fix pull-req I'm preparing at.
> 
> Note I've simplified the patch to:
> 
> -if (d) {
> +if (d && d->pI2CBus) {
> 
> Instead of the nested ifs you used, still many thanks
> for tracking this crashed down!

I find this better too, but if you do that you need to move

if (unalloc)
free(d);

out of that `if (d && d->pI2CBus)` :)

(It had no reason to be there in the first place anyway, as free(NULL) is safe)

Cheers,
  Eric

> 
> Regards,
> 
> Hans
> 
> 
> 
> > ---
> >  hw/xfree86/i2c/xf86i2c.c | 22 --
> >  1 file changed, 12 insertions(+), 10 deletions(-)
> > 
> > diff --git a/hw/xfree86/i2c/xf86i2c.c b/hw/xfree86/i2c/xf86i2c.c
> > index 2a8b8df..62b647c 100644
> > --- a/hw/xfree86/i2c/xf86i2c.c
> > +++ b/hw/xfree86/i2c/xf86i2c.c
> > @@ -615,19 +615,21 @@ void
> >  xf86DestroyI2CDevRec(I2CDevPtr d, Bool unalloc)
> >  {
> >  if (d) {
> > -I2CDevPtr *p;
> > +if (d->pI2CBus) {
> > +I2CDevPtr *p;
> > 
> > -/* Remove this from the list of active I2C devices. */
> > +/* Remove this from the list of active I2C devices. */
> > 
> > -for (p = >pI2CBus->FirstDev; *p != NULL; p = &(*p)->NextDev)
> > -if (*p == d) {
> > -*p = (*p)->NextDev;
> > -break;
> > -}
> > +for (p = >pI2CBus->FirstDev; *p != NULL; p = &(*p)->NextDev)
> > +if (*p == d) {
> > +*p = (*p)->NextDev;
> > +break;
> > +}
> > 
> > -xf86DrvMsg(d->pI2CBus->scrnIndex, X_INFO,
> > -   "I2C device \"%s:%s\" removed.\n",
> > -   d->pI2CBus->BusName, d->DevName);
> > +xf86DrvMsg(d->pI2CBus->scrnIndex, X_INFO,
> > +   "I2C device \"%s:%s\" removed.\n",
> > +   d->pI2CBus->BusName, d->DevName);
> > +}
> > 
> >  if (unalloc)
> >  free(d);
> > 
___
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] remove dead code in dummy driver

2016-09-20 Thread Eric Engestrom
On Tue, Sep 20, 2016 at 01:34:40PM +0700, Antoine Martin wrote:
> Signed-off-by: Antoine Martin <anto...@nagafix.co.uk>

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> ---
>  src/dummy_driver.c | 19 ---
>  1 file changed, 19 deletions(-)
> 
> diff --git a/src/dummy_driver.c b/src/dummy_driver.c
> index c84000f..ec1acf3 100644
> --- a/src/dummy_driver.c
> +++ b/src/dummy_driver.c
> @@ -700,25 +700,6 @@ DUMMYSwitchMode(SWITCH_MODE_ARGS_DECL)
>  void
>  DUMMYAdjustFrame(ADJUST_FRAME_ARGS_DECL)
>  {
> -SCRN_INFO_PTR(arg);
> -int Base; 
> -
> -Base = (y * pScrn->displayWidth + x) >> 2;
> -
> -/* Scale Base by the number of bytes per pixel. */
> -switch (pScrn->depth) {
> -case  8 :
> - break;
> -case 15 :
> -case 16 :
> - Base *= 2;
> - break;
> -case 24 :
> - Base *= 3;
> - break;
> -default :
> - break;
> -}
>  }
>  
>  /* Mandatory */
> -- 
> 2.7.4
___
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] modesetting: Hide cursor when initializing crtc

2016-08-31 Thread Eric Engestrom
On Wed, Aug 31, 2016 at 01:55:14PM +0200, Hans de Goede wrote:
> When Xorg gets started directly from a wayland-gdm the crtc still has the
> wayland hw cursor set. Combine this with Xorg immediately falling back to
> a sw cursor because a slave-output has a monitor attached at startup; and
> we end up with the wayland hardware cursor overlay fixed in its last
> position + the Xorg sw cursor resulting in 2 cursors.
> 
> This commit fixes this by hiding any left-over cursors when initializing
> the crtc.
> 
> Signed-off-by: Hans de Goede <hdego...@redhat.com>
> ---
>  hw/xfree86/drivers/modesetting/drmmode_display.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c 
> b/hw/xfree86/drivers/modesetting/drmmode_display.c
> index e9fce81..645d54c 100644
> --- a/hw/xfree86/drivers/modesetting/drmmode_display.c
> +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
> @@ -1147,6 +1147,9 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr 
> drmmode, drmModeResPtr mode_res
>  drmmode_crtc->vblank_pipe = drmmode_crtc_vblank_pipe(num);
>  crtc->driver_private = drmmode_crtc;
>  
> +/* Hide any cursors which me be active from previous users */

s/me/may/ :)

This looks reasonable:
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

> +drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, 0, 0, 0);
> +
>  /* Mark num'th crtc as in use on this device. */
>  ms_ent->assigned_crtcs |= (1 << num);
>  xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, MS_LOGLEVEL_DEBUG,
> -- 
> 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 util-modular] build.sh: add libinput and xf86-input-libinput

2016-08-31 Thread Eric Engestrom
On Wed, Aug 31, 2016 at 10:16:34AM +1000, Peter Hutterer wrote:
> Signed-off-by: Peter Hutterer 
> ---
>  build.sh | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/build.sh b/build.sh
> index 369afc8..3006ebc 100755
> --- a/build.sh
> +++ b/build.sh
> @@ -1155,11 +1155,13 @@ build_all_modules() {
>  build xserver ""
>  case $HOST_OS in
>   Linux) build libevdev "";;
> + Linux) build wayland libinput "";;

I don't think that's going to work. You should remove the break (;;) from
the previous line and simply add the `build` instruction on the next.

Cheers,
  Eric

>  esac
>  case $HOST_OS in
>   Linux)
>   build driver xf86-input-evdev
>   build driver xf86-input-joystick
> + build driver xf86-input-libinput
>   ;;
>   FreeBSD | NetBSD | OpenBSD | Dragonfly | GNU/kFreeBSD)
>   build driver xf86-input-joystick
> -- 
> 2.7.4
___
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 libX11] XFree will accept NULL as argument

2016-08-16 Thread Eric Engestrom
On Tue, Aug 16, 2016 at 11:56:50AM +0100, Eric Engestrom wrote:
> On Mon, Aug 15, 2016 at 07:18:14PM +0200, walter harms wrote:
> > since Xfree is a define for free()
> >   Xlibint.h:#define Xfree(ptr) free((ptr))
> > 
> > Xfree will accept NULL and do nothing.
> > 
> > the patch is also available on github.com/xtforever/libX11.git
> > 

Actually, that commit message could use some changes: remove the last
line (eg. move it under the ---), and add a Signed-off-by line :)

I was just reminded of that by Keith's mail:
> A patch is ready for merging when it has been has been 'generally agreed
> to be useful', has been reviewed on the xorg-devel list and has both
> Signed-off-by: and Reviewed-by: lines.

It's hard to keep track as not all projects require it, but this one
does ;)

Cheers,
  Eric

> > ---
> >  man/XFree.man | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/man/XFree.man b/man/XFree.man
> > index ffc513b..72674a5 100644
> > --- a/man/XFree.man
> > +++ b/man/XFree.man
> > @@ -90,8 +90,9 @@ Specifies the data that are to be freed.
> >  The
> >  .ZN XFree
> >  function is a general-purpose Xlib routine that frees the specified data.
> > -You must use it to free any objects that were allocated by Xlib,
> > +You must use it to free any objects that were allocated by Xlib,
> 
> What's the change here?
> 
> The rest is:
> Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>
> 
> >  unless an alternate function is explicitly specified for the object.
> > -A NULL pointer cannot be passed to this function.
> > +
> > +If data is NULL, no operation is performed.
> >  .SH "SEE ALSO"
> >  \fI\*(xL\fP
> > -- 
> > 2.1.4
> > 
___
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 libX11] XFree will accept NULL as argument

2016-08-16 Thread Eric Engestrom
On Mon, Aug 15, 2016 at 07:18:14PM +0200, walter harms wrote:
> since Xfree is a define for free()
>   Xlibint.h:#define Xfree(ptr) free((ptr))
> 
> Xfree will accept NULL and do nothing.
> 
> the patch is also available on github.com/xtforever/libX11.git
> 
> ---
>  man/XFree.man | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/man/XFree.man b/man/XFree.man
> index ffc513b..72674a5 100644
> --- a/man/XFree.man
> +++ b/man/XFree.man
> @@ -90,8 +90,9 @@ Specifies the data that are to be freed.
>  The
>  .ZN XFree
>  function is a general-purpose Xlib routine that frees the specified data.
> -You must use it to free any objects that were allocated by Xlib,
> +You must use it to free any objects that were allocated by Xlib,

What's the change here?

The rest is:
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

>  unless an alternate function is explicitly specified for the object.
> -A NULL pointer cannot be passed to this function.
> +
> +If data is NULL, no operation is performed.
>  .SH "SEE ALSO"
>  \fI\*(xL\fP
> -- 
> 2.1.4
> 
___
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 xf86-input-libinput] man: fix a couple typos

2016-07-03 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <e...@engestrom.ch>
---

The first fix makes a long line longer; should I reflow it?

---
 man/libinput.man | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man/libinput.man b/man/libinput.man
index 43beda7..798aff5 100644
--- a/man/libinput.man
+++ b/man/libinput.man
@@ -56,7 +56,7 @@ are
 .BI adaptive,
 .BI flat.
 Not all devices support this option or all profiles. If a profile is
-unsupported, the default profile for this is used. For a description on the
+unsupported, the default profile for this device is used. For a description on 
the
 profiles and their behavior, see the libinput documentation.
 .TP 7
 .BI "Option \*qAccelSpeed\*q \*q" float \*q
@@ -116,7 +116,7 @@ Enables a scroll method. Permitted values are
 Not all devices support all options, if an option is unsupported, the
 default scroll option for this device is used.
 .TP 7
-.BI "Option \*qHorizontalScrolling\*q" bool \*q
+.BI "Option \*qHorizontalScrolling\*q \*q" bool \*q
 Disables horizontal scrolling. When disabled, this driver will discard any
 horizontal scroll events from libinput. Note that this does not disable
 horizontal scrolling, it merely discards the horizontal axis from any scroll
-- 
2.9.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 xserver 1/2] modesetting: Fix swapping of provider sink / source capabilities

2016-06-22 Thread Eric Engestrom
On Thu, Jun 16, 2016 at 03:37:51PM +0200, Hans de Goede wrote:
> When a card has import capability it can be an offload _sink_, not
> a source and vice versa for export capability.
> 
> This commit fixes the modesetting driver to properly set these
> capabilities, this went unnoticed sofar because most gpus have both
> import and export capability.
> 
> Signed-off-by: Hans de Goede <hdego...@redhat.com>

Both patches are:
Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>
___
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 synaptics] conf: rename to 70-synaptics.conf

2016-05-19 Thread Eric Engestrom
On Thu, May 19, 2016 at 05:35:57PM +0200, Stefan Dirsch wrote:
> ---
>  conf/50-synaptics.conf | 46 --
>  conf/70-synaptics.conf | 46 ++

Also, `git format-patch` supports -M, which avoids all this "delete whole file
and create a whole new file" in favour of "move this file" ;)
___
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 dummy] fix pointer limits when resizing v2

2016-05-05 Thread Eric Engestrom
On Thu, May 05, 2016 at 01:07:26PM +0700, Antoine Martin wrote:
> Pointer events are clipped to the original screen dimensions with the
> dummy driver when using RandR to switch to a higher resolution at
> runtime. This fixes it.

Please use `git send-email` [1] to send patches, and add the quoted
text to the commit message.

Cheers,
  Eric

[1] https://git-scm.com/docs/git-send-email
___
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] fix typo in supported sample sizes and maximum bit rate

2016-04-28 Thread Eric Engestrom
On Wed, Apr 27, 2016 at 07:23:15PM +, Reinhard Zitzmann wrote:
> git://anongit.freedesktop.org/xorg/app/edid-decode master
> 

You should always CC: the mailing list, so everyone can see the answer.

Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com>

Thanks for the patch :]

> On Tue, Apr 26, 2016 at 5:03 PM Eric Engestrom <eric.engest...@imgtec.com>
> wrote:
> 
> > On Tue, Apr 26, 2016 at 09:00:42AM +0200, reinhard.zitzm...@gmail.com
> > wrote:
> > > From: Reinhard Zitzmann <reinhard.zitzm...@gmail.com>
> > >
> > > Signed-off-by: Reinhard Zitzmann <reinhard.zitzm...@gmail.com>
> > > ---
> > >  edid-decode.c | 8 
> > >  1 file changed, 4 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/edid-decode.c b/edid-decode.c
> > > index 0b94ad5..62c732d 100644
> > > --- a/edid-decode.c
> > > +++ b/edid-decode.c
> > > @@ -629,11 +629,11 @@ cea_audio_block(unsigned char *x)
> > >  (x[i+1] & 0x01) ? " 32" : "");
> > >   if (format == 1) {
> > >   printf("Supported sample sizes (bits):%s%s%s\n",
> > > -   (x[2] & 0x04) ? " 24" : "",
> > > -   (x[2] & 0x02) ? " 20" : "",
> > > -   (x[2] & 0x01) ? " 16" : "");
> > > +   (x[i+2] & 0x04) ? " 24" : "",
> > > +   (x[i+2] & 0x02) ? " 20" : "",
> > > +   (x[i+2] & 0x01) ? " 16" : "");
> > >   } else if (format <= 8) {
> > > - printf("Maximum bit rate: %d kHz\n", x[2] * 8);
> > > + printf("Maximum bit rate: %d kHz\n", x[i+2] * 8);
> > >   }
> > >  }
> > >  }
> > > --
> > > 2.5.5
> >
> > The change looks good, but I can't figure out which tree it applies to?
> >
> > Tip:  git config format.subjectprefix "PATCH $(basename "$PWD")"
> >
> -- 
> Viele Grüße,
> 
> Reinhard Zitzmann
> 
> Mail: reinhard.zitzm...@gmail.com
> Mobil: +49 151 7004 7001
> Fax: +49 9133 4799403
___
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] fix typo in supported sample sizes and maximum bit rate

2016-04-26 Thread Eric Engestrom
On Tue, Apr 26, 2016 at 09:00:42AM +0200, reinhard.zitzm...@gmail.com wrote:
> From: Reinhard Zitzmann 
> 
> Signed-off-by: Reinhard Zitzmann 
> ---
>  edid-decode.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/edid-decode.c b/edid-decode.c
> index 0b94ad5..62c732d 100644
> --- a/edid-decode.c
> +++ b/edid-decode.c
> @@ -629,11 +629,11 @@ cea_audio_block(unsigned char *x)
>  (x[i+1] & 0x01) ? " 32" : "");
>   if (format == 1) {
>   printf("Supported sample sizes (bits):%s%s%s\n",
> -   (x[2] & 0x04) ? " 24" : "",
> -   (x[2] & 0x02) ? " 20" : "",
> -   (x[2] & 0x01) ? " 16" : "");
> +   (x[i+2] & 0x04) ? " 24" : "",
> +   (x[i+2] & 0x02) ? " 20" : "",
> +   (x[i+2] & 0x01) ? " 16" : "");
>   } else if (format <= 8) {
> - printf("Maximum bit rate: %d kHz\n", x[2] * 8);
> + printf("Maximum bit rate: %d kHz\n", x[i+2] * 8);
>   }
>  }
>  }
> -- 
> 2.5.5

The change looks good, but I can't figure out which tree it applies to?

Tip:  git config format.subjectprefix "PATCH $(basename "$PWD")"
___
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 libX11 4/5] fix memleak in error path

2016-04-26 Thread Eric Engestrom
On Tue, Apr 26, 2016 at 04:29:41PM +0200, walter harms wrote:
> 
> 
> free all memory on error
> 
> Signed-off-by: walter harms 
> 
> 
> ---
>  src/xlibi18n/lcPublic.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/xlibi18n/lcPublic.c b/src/xlibi18n/lcPublic.c
> index 98a7435..08122b9 100644
> --- a/src/xlibi18n/lcPublic.c
> +++ b/src/xlibi18n/lcPublic.c
> @@ -78,7 +78,7 @@ create(
>  XLCdMethods methods)
>  {
>  XLCd lcd;
> -XLCdPublicMethods new;
> +XLCdPublicMethods new=NULL;

This is unnecessary: `new` will be overwritten a few lines below, or
discarded as a local var if we return before that.

> 
>  lcd = Xcalloc(1, sizeof(XLCdRec));
>  if (lcd == NULL)
> @@ -97,6 +97,7 @@ create(
>  return lcd;
> 
>  err:
> +Xfree(lcd->core);

This bit is right though. Feel free to cleanup this patch & re-send.

>  Xfree(lcd);
>  return (XLCd) NULL;
>  }
> -- 
> 2.1.4
___
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 09/18] xfree86: fix spelling mistakes

2016-04-11 Thread Eric Engestrom
On Fri, Apr 08, 2016 at 11:47:33AM -0400, Adam Jackson wrote:
> On Sat, 2016-04-02 at 19:53 +0100, Eric Engestrom wrote:
> 
> > index 5391b72..221c631 100755
> > --- a/hw/xfree86/sdksyms.sh
> > +++ b/hw/xfree86/sdksyms.sh
> > @@ -389,7 +389,7 @@ BEGIN {
> >     getline;
> >     }
> >  
> > -   # dont modify $0 or $n
> > +   # don't modify $0 or $n
> >     symbol = $n;
> >  
> >     # remove starting non word chars
> 
> This breaks the build, that comment is in the middle of an inline awk
> script encased in single-quotes, adding the apostrophe terminates the
> script early. You want "do not".
> 
> - ajax

Yes, it looks like I didn't proof-read enough (cf. your other comments),
and I obviously didn't test anything (I was only changing comments and
strings, what could go wrong? :P)

I'll fix all that up and resend those 3 patches in the next few days.

Cheers,
Eric
___
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 02/18] Xi: fix spelling mistakes

2016-04-03 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <e...@engestrom.ch>
---
 Xi/exevents.c   | 4 ++--
 Xi/xiproperty.c | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 74e49ed..570352f 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -653,7 +653,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
  * Copies the CONTENT of the classes of device from into the classes in device
  * to. From and to are identical after finishing.
  *
- * If to does not have classes from currenly has, the classes are stored in
+ * If to does not have classes from currently has, the classes are stored in
  * to's devPrivates system. Later, we recover it again from there if needed.
  * Saves a few memory allocations.
  */
@@ -2660,7 +2660,7 @@ SendEvent(ClientPtr client, DeviceIntPtr d, Window dest, 
Bool propagate,
 return Success;
 
 /* If the input focus is PointerRootWin, send the event to where
- * the pointer is if possible, then perhaps propogate up to root. */
+ * the pointer is if possible, then perhaps propagate up to root. */
 if (inputFocus == PointerRootWin)
 inputFocus = GetCurrentRootWindow(d);
 
diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index e3b8f5a..5a68d7a 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -416,7 +416,7 @@ XIResetProperties(void)
  * @param val The property value
  * @param nelem_return The maximum number of elements to return.
  * @param buf_return Pointer to an array of at least @nelem_return values.
- * @return Success or the error code if an error occured.
+ * @return Success or the error code if an error occurred.
  */
 _X_EXPORT int
 XIPropToInt(XIPropertyValuePtr val, int *nelem_return, int **buf_return)
@@ -486,7 +486,7 @@ XIPropToInt(XIPropertyValuePtr val, int *nelem_return, int 
**buf_return)
  * @param val The property value
  * @param nelem_return The maximum number of elements to return.
  * @param buf_return Pointer to an array of at least @nelem_return values.
- * @return Success or the error code if an error occured.
+ * @return Success or the error code if an error occurred.
  */
 _X_EXPORT int
 XIPropToFloat(XIPropertyValuePtr val, int *nelem_return, float **buf_return)
@@ -523,7 +523,7 @@ XIPropToFloat(XIPropertyValuePtr val, int *nelem_return, 
float **buf_return)
 /* Registers a new property handler on the given device and returns a unique
  * identifier for this handler. This identifier is required to unregister the
  * property handler again.
- * @return The handler's identifier or 0 if an error occured.
+ * @return The handler's identifier or 0 if an error occurred.
  */
 long
 XIRegisterPropertyHandler(DeviceIntPtr dev,
-- 
2.8.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

[PATCH 11/18] xwayland: fix spelling mistake

2016-04-03 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <e...@engestrom.ch>
---
 hw/xwayland/xwayland-input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index f9e3255..67edea4 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -268,7 +268,7 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
 if (BitIsOn(dev->button->down, i))
 QueuePointerEvents(dev, ButtonRelease, i, 0, );
 
-/* The last cursor frame we commited before the pointer left one
+/* The last cursor frame we committed before the pointer left one
  * of our surfaces might not have been shown. In that case we'll
  * have a cursor surface frame callback pending which we need to
  * clear so that we can continue submitting new cursor frames. */
-- 
2.8.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

[PATCH 18/18] configure: fix spelling mistake

2016-04-03 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <e...@engestrom.ch>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index dff06ef..715cbcc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -242,7 +242,7 @@ if test "x$ac_cv_func_getpeereid" = xno && test 
"x$ac_cv_func_getpeerucred" = xn
AC_DEFINE([NO_LOCAL_CLIENT_CRED], 1, [Define to 1 if no local socket 
credentials interface exists])
 fi
 
-dnl Find the math libary, then check for cbrt function in it.
+dnl Find the math library, then check for cbrt function in it.
 AC_CHECK_LIB(m, sqrt)
 AC_CHECK_FUNCS([cbrt])
 
-- 
2.8.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

[PATCH 01/18] Xext: fix spelling mistakes

2016-04-03 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <e...@engestrom.ch>
---
 Xext/vidmode.c | 2 +-
 Xext/xres.c| 8 
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Xext/vidmode.c b/Xext/vidmode.c
index 499a2a8..14d625b 100644
--- a/Xext/vidmode.c
+++ b/Xext/vidmode.c
@@ -277,7 +277,7 @@ ProcVidModeGetModeLine(ClientPtr client)
 
 /*
  * Older servers sometimes had server privates that the VidMode
- * extention made available. So to be compatiable pretend that
+ * extension made available. So to be compatible pretend that
  * there are no server privates to pass to the client
  */
 rep.privsize = 0;
diff --git a/Xext/xres.c b/Xext/xres.c
index 83cc691..798cc5f 100644
--- a/Xext/xres.c
+++ b/Xext/xres.c
@@ -526,7 +526,7 @@ WillConstructMask(ClientPtr client, CARD32 mask,
client id spec
 
 @param sendClient Which client wishes to receive this answer. Used for
-  byte endianess.
+  byte endianness.
 @param client Which client are we considering.
 @param mask   The client id spec mask indicating which information
   we want about this client.
@@ -693,7 +693,7 @@ ProcXResQueryClientIds (ClientPtr client)
 return rc;
 }
 
-/** @brief Swaps xXResResourceIdSpec endianess */
+/** @brief Swaps xXResResourceIdSpec endianness */
 static void
 SwapXResResourceIdSpec(xXResResourceIdSpec *spec)
 {
@@ -701,7 +701,7 @@ SwapXResResourceIdSpec(xXResResourceIdSpec *spec)
 swapl(>type);
 }
 
-/** @brief Swaps xXResResourceSizeSpec endianess */
+/** @brief Swaps xXResResourceSizeSpec endianness */
 static void
 SwapXResResourceSizeSpec(xXResResourceSizeSpec *size)
 {
@@ -711,7 +711,7 @@ SwapXResResourceSizeSpec(xXResResourceSizeSpec *size)
 swapl(>useCount);
 }
 
-/** @brief Swaps xXResResourceSizeValue endianess */
+/** @brief Swaps xXResResourceSizeValue endianness */
 static void
 SwapXResResourceSizeValue(xXResResourceSizeValue *rep)
 {
-- 
2.8.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

[PATCH 09/18] xfree86: fix spelling mistakes

2016-04-03 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <e...@engestrom.ch>
---
 hw/xfree86/common/xf86Cursor.c   |  2 +-
 hw/xfree86/common/xf86Events.c   |  2 +-
 hw/xfree86/common/xf86Helper.c   |  2 +-
 hw/xfree86/common/xf86pciBus.c   |  2 +-
 hw/xfree86/dri/dri.c |  2 +-
 hw/xfree86/dri2/dri2.h   |  2 +-
 hw/xfree86/dri2/dri2ext.c|  2 +-
 hw/xfree86/drivers/modesetting/present.c |  4 ++--
 hw/xfree86/i2c/xf86i2c.c |  8 
 hw/xfree86/int10/INT10.HOWTO |  2 +-
 hw/xfree86/int10/generic.c   |  2 +-
 hw/xfree86/int10/helper_exec.c   |  2 +-
 hw/xfree86/modes/xf86Cursors.c   |  2 +-
 hw/xfree86/modes/xf86EdidModes.c |  4 ++--
 hw/xfree86/os-support/bsd/bsd_apm.c  |  2 +-
 hw/xfree86/os-support/bsd/bsd_init.c |  6 +++---
 hw/xfree86/os-support/bsd/memrange.h |  2 +-
 hw/xfree86/os-support/xf86_OSproc.h  |  4 ++--
 hw/xfree86/parser/Configint.h|  2 +-
 hw/xfree86/parser/write.c|  2 +-
 hw/xfree86/ramdac/CURSOR.NOTES   |  2 +-
 hw/xfree86/sdksyms.sh|  2 +-
 hw/xfree86/utils/cvt/cvt.c   |  2 +-
 hw/xfree86/vbe/vbe.c |  4 ++--
 hw/xfree86/vgahw/vgaHW.h |  2 +-
 hw/xfree86/x86emu/decode.c   |  2 +-
 hw/xfree86/x86emu/ops.c  | 14 +++---
 hw/xfree86/x86emu/prim_ops.c | 12 ++--
 hw/xfree86/x86emu/x86emu/debug.h |  2 +-
 29 files changed, 49 insertions(+), 49 deletions(-)

diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c
index 92c08af..5e859d1 100644
--- a/hw/xfree86/common/xf86Cursor.c
+++ b/hw/xfree86/common/xf86Cursor.c
@@ -138,7 +138,7 @@ xf86PointerMoved(ScrnInfoPtr pScr, int x, int y)
 
 /*
  * check wether (x,y) belongs to the visual part of the screen
- * if not, change the base of the displayed frame accoring
+ * if not, change the base of the displayed frame according
  */
 if (pScr->frameX0 > x) {
 pScr->frameX0 = x;
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 709afd6..35a27b8 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -391,7 +391,7 @@ xf86ReleaseKeys(DeviceIntPtr pDev)
 /*
  * Hmm... here is the biggest hack of every time !
  * It may be possible that a switch-vt procedure has finished BEFORE
- * you released all keys neccessary to do this. That peculiar behavior
+ * you released all keys necessary to do this. That peculiar behavior
  * can fool the X-server pretty much, cause it assumes that some keys
  * were not released. TWM may stuck alsmost completly
  * OK, what we are doing here is after returning from the vt-switch
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 3b01a49..b142a5b 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -894,7 +894,7 @@ xf86SetGamma(ScrnInfoPtr scrp, Gamma gamma)
 scrp->gamma.red = SET_GAMMA(DDC->features.gamma);
 scrp->gamma.green = SET_GAMMA(DDC->features.gamma);
 scrp->gamma.blue = SET_GAMMA(DDC->features.gamma);
-/* EDID structure version 2 gives optional seperate red, green & blue 
gamma values
+/* EDID structure version 2 gives optional separate red, green & blue 
gamma values
  * in bytes 0x57-0x59 */
 #endif
 }
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 8158c2b..5cf3a30 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -629,7 +629,7 @@ struct Inst {
  * \param devListList of Device sections parsed from the config file.
  * \param numDevsNumber of entries in \c devList.
  * \param drvp   Pointer the driver's control structure.
- * \param foundEntities  Returned list of entity indicies associated with the
+ * \param foundEntities  Returned list of entity indices associated with the
  *   driver.
  *
  * \returns
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index 0046e52..4e0e38a 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -1698,7 +1698,7 @@ DRISwapContext(int drmFD, void *oldctx, void *newctx)
 return;
 }
 
-/* usefull for debugging, just print out after n context switches */
+/* useful for debugging, just print out after n context switches */
 if (!count || !(count % 1)) {
 DRIDrvMsg(pScreen->myNum, X_INFO,
   "[DRI] Context switch %5d from %p/0x%08x (%d)\n",
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index 1e7afdd..5278ec7 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -305,7 +305,7 @@ extern _X_EXPORT int DRI2CopyRegion(DrawablePtr pDraw,
  * \note
  * This interface was

[PATCH 12/18] xwin: fix spelling mistakes

2016-04-03 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <e...@engestrom.ch>
---
 hw/xwin/InitOutput.c   | 2 +-
 hw/xwin/ddraw.h| 2 +-
 hw/xwin/glx/indirect.c | 2 +-
 hw/xwin/man/XWin.man   | 2 +-
 hw/xwin/win.h  | 2 +-
 hw/xwin/wincreatewnd.c | 2 +-
 hw/xwin/winscrinit.c   | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 1190124..0d56bb4 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -140,7 +140,7 @@ void XwinExtensionInit(void)
 #if defined(DDXBEFORERESET)
 /*
  * Called right before KillAllClients when the server is going to reset,
- * allows us to shutdown our seperate threads cleanly.
+ * allows us to shutdown our separate threads cleanly.
  */
 
 void
diff --git a/hw/xwin/ddraw.h b/hw/xwin/ddraw.h
index 4c9af77..99d1ec9 100644
--- a/hw/xwin/ddraw.h
+++ b/hw/xwin/ddraw.h
@@ -827,7 +827,7 @@ extern "C" {
 
 /* DDCAPS.dwSVCaps */
 /* the first 4 of these are now obsolete */
-#if DIRECTDRAW_VERSION >= 0x700 /* FIXME: I'm not sure when this switch 
occured */
+#if DIRECTDRAW_VERSION >= 0x700 /* FIXME: I'm not sure when this switch 
occurred */
 #define DDSVCAPS_RESERVED1 0x0001
 #define DDSVCAPS_RESERVED2 0x0002
 #define DDSVCAPS_RESERVED3 0x0004
diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index 26832e6..77be1d6 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -772,7 +772,7 @@ glxWinCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, 
RegionPtr prgnSrc)
Discard any CopyWindow requests if a GL drawing context is pointing at 
the window
 
For regions which are being drawn by GL, the shadow framebuffer doesn't 
have the
-   correct bits, so we wish to avoid shadow framebuffer damage occuring, 
which will
+   correct bits, so we wish to avoid shadow framebuffer damage occurring, 
which will
cause those incorrect bits to be transferred to the display
  */
 if (pGlxDraw && pGlxDraw->drawContext) {
diff --git a/hw/xwin/man/XWin.man b/hw/xwin/man/XWin.man
index 7ffdd6c..44afc54 100644
--- a/hw/xwin/man/XWin.man
+++ b/hw/xwin/man/XWin.man
@@ -71,7 +71,7 @@ Screen specific parameters can be applied as a
 default to all screens by placing those screen specific parameters
 before any \fB\-screen\fP parameter.  Screen specific parameters placed after
 the first \fB\-screen\fP parameter will apply only to the immediately
-preceeding \fB\-screen\fP parameter.
+preceding \fB\-screen\fP parameter.
 .TP 8
 .B \-[no]multimonitors or \-[no]multiplemonitors
 Create a screen 0 that covers all monitors [the primary monitor] on a system 
with
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index f9c44b3..897322f 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -486,7 +486,7 @@ typedef struct _winPrivScreenRec {
 #endif
 
 #if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
-/* Privates used for any module running in a seperate thread */
+/* Privates used for any module running in a separate thread */
 pthread_mutex_t pmServerStarted;
 Bool fServerStarted;
 #endif
diff --git a/hw/xwin/wincreatewnd.c b/hw/xwin/wincreatewnd.c
index b2f797c..36ce915 100644
--- a/hw/xwin/wincreatewnd.c
+++ b/hw/xwin/wincreatewnd.c
@@ -231,7 +231,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
 
 /* Did the user specify a height and width? */
 if (pScreenInfo->fUserGaveHeightAndWidth) {
-/* User gave a desired height and width, try to accomodate */
+/* User gave a desired height and width, try to accommodate */
 #if CYGDEBUG
 winDebug("winCreateBoundingWindowWindowed - User gave height "
  "and width\n");
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index 6cbf08d..ae1d1df 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -321,7 +321,7 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, 
char **argv)
  * own colormap, as it cannot allocate 7 planes in the default
  * colormap.  Setting whitePixel to 1 allows Magic to get 7
  * planes in the default colormap, so it doesn't create its
- * own colormap.  This latter situation is highly desireable,
+ * own colormap.  This latter situation is highly desirable,
  * as it keeps the Magic window viewable when switching to
  * other X clients that use the default colormap.
  */
-- 
2.8.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

[PATCH 03/18] dix: fix spelling mistakes

2016-04-03 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <e...@engestrom.ch>
---
 dix/BuiltInAtoms | 2 +-
 dix/colormap.c   | 2 +-
 dix/events.c | 2 +-
 dix/ptrveloc.c   | 4 ++--
 dix/touch.c  | 2 +-
 dix/window.c | 6 +++---
 6 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/dix/BuiltInAtoms b/dix/BuiltInAtoms
index 910c627..7995940 100644
--- a/dix/BuiltInAtoms
+++ b/dix/BuiltInAtoms
@@ -195,7 +195,7 @@ WM_HINTS
  @
2   zoomed
3   iconic
4   inactive -> application believes
-   itself to be seldomly used. WM may wish to
+   itself to be seldom used. WM may wish to
place it on an inactive menu.
This type is potentially extensible. The order is critical;
append to the end only.
diff --git a/dix/colormap.c b/dix/colormap.c
index 12a85b2..3038707 100644
--- a/dix/colormap.c
+++ b/dix/colormap.c
@@ -1095,7 +1095,7 @@ AllocColor(ColormapPtr pmap,
 
 /*
  * FakeAllocColor -- fake an AllocColor request by
- * returning a free pixel if availible, otherwise returning
+ * returning a free pixel if available, otherwise returning
  * the closest matching pixel.  This is used by the mi
  * software sprite code to recolor cursors.  A nice side-effect
  * is that this routine will never return failure.
diff --git a/dix/events.c b/dix/events.c
index efaf91d..3c5a8ff 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -5375,7 +5375,7 @@ ProcSendEvent(ClientPtr client)
 return Success;
 
 /* If the input focus is PointerRootWin, send the event to where
-   the pointer is if possible, then perhaps propogate up to root. */
+   the pointer is if possible, then perhaps propagate up to root. */
 if (inputFocus == PointerRootWin)
 inputFocus = GetCurrentRootWindow(dev);
 
diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index e75300a..0d4ef86 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -591,7 +591,7 @@ CalcTracker(const MotionTracker * tracker, int cur_t)
 /* find the most plausible velocity. That is, the most distant
  * (in time) tracker which isn't too old, the movement vector was
  * in the same octant, and where the velocity is within an
- * acceptable range to the inital velocity.
+ * acceptable range to the initial velocity.
  *
  * @return The tracker's velocity or 0 if the above conditions are unmet
  */
@@ -854,7 +854,7 @@ PowerProfile(DeviceIntPtr dev,
 {
 double vel_dist;
 
-acc = (acc - 1.0) * 0.1f + 1.0; /* without this, acc of 2 is unuseable 
*/
+acc = (acc - 1.0) * 0.1f + 1.0; /* without this, acc of 2 is unusable 
*/
 
 if (velocity <= threshold)
 return vel->min_acceleration;
diff --git a/dix/touch.c b/dix/touch.c
index 54da132..744c4e6 100644
--- a/dix/touch.c
+++ b/dix/touch.c
@@ -608,7 +608,7 @@ TouchBuildSprite(DeviceIntPtr sourcedev, TouchPointInfoPtr 
ti,
  * @param[in] button_event The respective button event (if any)
  *
  * @returns The number of converted events.
- * @retval 0 An error occured
+ * @retval 0 An error occurred
  * @retval 1 only the motion event is valid
  * @retval 2 motion and button event are valid
  */
diff --git a/dix/window.c b/dix/window.c
index ead4dc2..6bee433 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -458,7 +458,7 @@ TraverseTree(WindowPtr pWin, VisitWindowProcPtr func, void 
*data)
  * WalkTree
  *   Walk the window tree, for SCREEN, preforming FUNC(pWin, data) on
  *   each window.  If FUNC returns WT_WALKCHILDREN, traverse the children,
- *   if it returns WT_DONTWALKCHILDREN, dont.  If it returns WT_STOPWALKING
+ *   if it returns WT_DONTWALKCHILDREN, don't.  If it returns WT_STOPWALKING
  *   exit WalkTree.  Does depth-first traverse.
  */
 
@@ -2285,7 +2285,7 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, 
ClientPtr client)
 if (!pParent)
 return Success;
 
-/* Figure out if the window should be moved.  Doesnt
+/* Figure out if the window should be moved.  Doesn't
make the changes to the window if event sent */
 
 if (mask & CWStackMode)
@@ -2558,7 +2558,7 @@ ReparentWindow(WindowPtr pWin, WindowPtr pParent,
 if (pWin->prevSib)
 pWin->prevSib->nextSib = pWin->nextSib;
 
-/* insert at begining of pParent */
+/* insert at beginning of pParent */
 pWin->parent = pParent;
 pPrev = RealChildHead(pParent);
 if (pPrev) {
-- 
2.8.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

[PATCH 05/18] glamor: fix spelling mistakes

2016-04-03 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <e...@engestrom.ch>
---
 glamor/glamor_gradient.c| 8 
 glamor/glamor_largepixmap.c | 2 +-
 glamor/glamor_render.c  | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/glamor/glamor_gradient.c b/glamor/glamor_gradient.c
index c50542a..f7b67ce 100644
--- a/glamor/glamor_gradient.c
+++ b/glamor/glamor_gradient.c
@@ -603,7 +603,7 @@ _glamor_gradient_convert_trans_matrix(PictTransform *from, 
float to[3][3],
  * So, to get the correct v_s, we need to cacula1 the matrix: 
(A*T*inv(A)), and
  * we name this matrix T_s.
  *
- * Firstly, because A is for the scale convertion, we find
+ * Firstly, because A is for the scale conversion, we find
  *  -- --
  *  |1/w  0   0 |
  * A =  | 0  1/h  0 |
@@ -884,7 +884,7 @@ glamor_generate_radial_gradient_picture(ScreenPtr screen,
 
 stops_count = src_picture->pSourcePict->radial.nstops + 2;
 
-/* Because the max value of nstops is unkown, so create a program
+/* Because the max value of nstops is unknown, so create a program
when nstops > LINEAR_LARGE_STOPS. */
 if (stops_count <= RADIAL_SMALL_STOPS) {
 gradient_prog = glamor_priv->gradient_prog[SHADER_GRADIENT_RADIAL][0];
@@ -1193,7 +1193,7 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen,
 
 stops_count = src_picture->pSourcePict->linear.nstops + 2;
 
-/* Because the max value of nstops is unkown, so create a program
+/* Because the max value of nstops is unknown, so create a program
when nstops > LINEAR_LARGE_STOPS. */
 if (stops_count <= LINEAR_SMALL_STOPS) {
 gradient_prog = glamor_priv->gradient_prog[SHADER_GRADIENT_LINEAR][0];
@@ -1403,7 +1403,7 @@ glamor_generate_linear_gradient_picture(ScreenPtr screen,
 }
 else {
 /* The slope need to compute here. In shader, the viewport set will 
change
-   the orginal slope and the slope which is vertical to it will not be 
correct. */
+   the orignal slope and the slope which is vertical to it will not be 
correct. */
 slope = -(float) (src_picture->pSourcePict->linear.p2.x
   - src_picture->pSourcePict->linear.p1.x) /
 (float) (src_picture->pSourcePict->linear.p2.y
diff --git a/glamor/glamor_largepixmap.c b/glamor/glamor_largepixmap.c
index 9a6c95e..ebfdc95 100644
--- a/glamor/glamor_largepixmap.c
+++ b/glamor/glamor_largepixmap.c
@@ -1259,7 +1259,7 @@ glamor_composite_largepixmap_region(CARD8 op,
 is_normal_mask_fbo = 1;
 }
 else {
-/* This mask region has transform or repeatpad, we 
need clip it agains the previous
+/* This mask region has transform or repeatpad, we 
need clip it against the previous
  * valid region rather than the mask region. */
 if (!is_normal_source_fbo)
 clipped_mask_regions =
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index 65f7059..9890b3e 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -1425,7 +1425,7 @@ glamor_composite_clipped_region(CARD8 op,
  && (mask_pixmap->drawable.width != width
  || mask_pixmap->drawable.height != height {
 /* XXX if mask->pDrawable is the same as source->pDrawable, we have an 
opportunity
- * to do reduce one convertion. */
+ * to do reduce one conversion. */
 temp_mask =
 glamor_convert_gradient_picture(screen, mask,
 extent->x1 + x_mask - x_dest - 
dest->pDrawable->x,
-- 
2.8.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

[PATCH 14/18] miext: fix spelling mistakes

2016-04-03 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <e...@engestrom.ch>
---
 miext/rootless/rootless.h   | 2 +-
 miext/rootless/rootlessWindow.c | 2 +-
 miext/shadow/shadow.c   | 2 +-
 miext/shadow/shalloc.c  | 2 +-
 miext/sync/misyncstr.h  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/miext/rootless/rootless.h b/miext/rootless/rootless.h
index 1be61cd..16035a3 100644
--- a/miext/rootless/rootless.h
+++ b/miext/rootless/rootless.h
@@ -41,7 +41,7 @@
 
 /*
Each top-level rootless window has a one-to-one correspondence to a physical
-   on-screen window. The physical window is refered to as a "frame".
+   on-screen window. The physical window is referred to as a "frame".
  */
 
 typedef void *RootlessFrameID;
diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index e304299..9373979 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -561,7 +561,7 @@ RootlessReorderWindow(WindowPtr pWin)
 
 /* Find the next window above this one that has a mapped frame.
  * Only include cases where the windows are in the same category of
- * hittability to ensure offscreen windows dont get restacked
+ * hittability to ensure offscreen windows don't get restacked
  * relative to onscreen ones (but that the offscreen ones maintain
  * their stacking order if they are explicitly asked to Reorder
  */
diff --git a/miext/shadow/shadow.c b/miext/shadow/shadow.c
index 0dd3604a..e01b775 100644
--- a/miext/shadow/shadow.c
+++ b/miext/shadow/shadow.c
@@ -85,7 +85,7 @@ shadowGetImage(DrawablePtr pDrawable, int sx, int sy, int w, 
int h,
 
 shadowBuf(pScreen);
 
-/* Many apps use GetImage to sync with the visable frame buffer */
+/* Many apps use GetImage to sync with the visible frame buffer */
 if (pDrawable->type == DRAWABLE_WINDOW)
 shadowRedisplay(pScreen);
 unwrap(pBuf, pScreen, GetImage);
diff --git a/miext/shadow/shalloc.c b/miext/shadow/shalloc.c
index 6a79085..206c328 100644
--- a/miext/shadow/shalloc.c
+++ b/miext/shadow/shalloc.c
@@ -42,7 +42,7 @@ shadowAlloc(int width, int height, int bpp)
 int stride;
 void *fb;
 
-/* Cant use PixmapBytePad -- the structure is probably not initialized yet 
*/
+/* Can't use PixmapBytePad -- the structure is probably not initialized 
yet */
 stride = BitmapBytePad(width * bpp);
 fb = xallocarray(stride, height);
 return fb;
diff --git a/miext/sync/misyncstr.h b/miext/sync/misyncstr.h
index ad69e8e..0ea8dbc 100644
--- a/miext/sync/misyncstr.h
+++ b/miext/sync/misyncstr.h
@@ -65,7 +65,7 @@ struct _SyncTrigger {
 SyncObject *pSync;
 CARD64 wait_value;  /* wait value */
 unsigned int value_type;/* Absolute or Relative */
-unsigned int test_type; /* transition or Comparision type */
+unsigned int test_type; /* transition or Comparison type */
 CARD64 test_value;  /* trigger event threshold value */
 Bool (*CheckTrigger) (struct _SyncTrigger * /*pTrigger */ ,
   CARD64/*newval */
-- 
2.8.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

[PATCH 10/18] xquartz: fix spelling mistakes

2016-04-03 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <e...@engestrom.ch>
---
 hw/xquartz/GL/capabilities.c |  6 +++---
 hw/xquartz/GL/glcontextmodes.c   |  2 +-
 hw/xquartz/X11Controller.h   |  2 +-
 hw/xquartz/pbproxy/x-selection.m | 10 +-
 hw/xquartz/xpr/appledri.h|  2 +-
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/hw/xquartz/GL/capabilities.c b/hw/xquartz/GL/capabilities.c
index 5573629..770278a 100644
--- a/hw/xquartz/GL/capabilities.c
+++ b/hw/xquartz/GL/capabilities.c
@@ -369,7 +369,7 @@ handleDepthModes(struct glCapabilitiesConfig *c, GLint 
dmodes)
 assert(c->total_depth_buffer_depths < GLCAPS_DEPTH_BUFFERS);
 }
 
-/* Return non-zero if an error occured. */
+/* Return non-zero if an error occurred. */
 static CGLError
 handleRendererDescriptions(CGLRendererInfoObj info, GLint r,
struct glCapabilitiesConfig *c)
@@ -521,7 +521,7 @@ freeGlCapabilities(struct glCapabilities *cap)
 cap->configurations = NULL;
 }
 
-/*Return true if an error occured. */
+/*Return true if an error occurred. */
 bool
 getGlCapabilities(struct glCapabilities *cap)
 {
@@ -566,6 +566,6 @@ getGlCapabilities(struct glCapabilities *cap)
 
 CGLDestroyRendererInfo(info);
 
-/* No error occured.  We are done. */
+/* No error occurred.  We are done. */
 return kCGLNoError;
 }
diff --git a/hw/xquartz/GL/glcontextmodes.c b/hw/xquartz/GL/glcontextmodes.c
index 1ce3570..b1e36cb 100644
--- a/hw/xquartz/GL/glcontextmodes.c
+++ b/hw/xquartz/GL/glcontextmodes.c
@@ -409,7 +409,7 @@ _gl_get_context_mode_data(const __GLcontextModes *mode, int 
attribute,
  * \param count Number of structures to allocate.
  * \param minimum_size  Minimum size of a structure to allocate.  This allows
  *  for differences in the version of the
- *  \c __GLcontextModes stucture used in libGL and in a
+ *  \c __GLcontextModes structure used in libGL and in a
  *  DRI-based driver.
  * \returns A pointer to the first element in a linked list of \c count
  *  stuctures on success, or \c NULL on failure.
diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h
index 1e60270..564c4c1 100644
--- a/hw/xquartz/X11Controller.h
+++ b/hw/xquartz/X11Controller.h
@@ -88,7 +88,7 @@ typedef unsigned int NSUInteger;
 IBOutlet NSMenuItem *window_separator;
 // window_separator is DEPRECATED due to this radar:
 //  NSApplication releases the separator in the 
Windows menu even though it's an IBOutlet
-// It is kept around for localization compatability and is subject to 
removal "eventually"
+// It is kept around for localization compatibility and is subject to 
removal "eventually"
 // If it is !NULL (meaning it is in the nib), it is removed from the menu 
and released
 
 IBOutlet NSMenuItem *x11_about_item;
diff --git a/hw/xquartz/pbproxy/x-selection.m b/hw/xquartz/pbproxy/x-selection.m
index f4f4de8..b89a576 100644
--- a/hw/xquartz/pbproxy/x-selection.m
+++ b/hw/xquartz/pbproxy/x-selection.m
@@ -787,7 +787,7 @@
 [self send_reply:];
 }
 
-/* Return nil if an error occured. */
+/* Return nil if an error occurred. */
 /* DO NOT retain the encdata for longer than the length of an event response.
  * The autorelease pool will reuse/free it.
  */
@@ -818,8 +818,8 @@
 return encdata;
 }
 
-/* Return YES when an error has occured when trying to send the PICT. */
-/* The caller should send a default reponse with a property of None when an 
error occurs. */
+/* Return YES when an error has occurred when trying to send the PICT. */
+/* The caller should send a default response with a property of None when an 
error occurs. */
 - (BOOL) send_image_pict_reply:(XSelectionRequestEvent *)e
 pasteboard:(NSPasteboard *)pb
   type:(NSBitmapImageFileType)imagetype
@@ -866,7 +866,7 @@
 return NO; /*no error*/
 }
 
-/* Return YES if an error occured. */
+/* Return YES if an error occurred. */
 /* The caller should send a reply with a property of None when an error 
occurs. */
 - (BOOL) send_image_tiff_reply:(XSelectionRequestEvent *)e
 pasteboard:(NSPasteboard *)pb
@@ -1049,7 +1049,7 @@
 if (get_property(e->requestor, e->property, , /*Delete*/ True,
  )) {
 /*
- * An error occured, so we should invoke the copy_completed:, but
+ * An error occurred, so we should invoke the copy_completed:, but
  * not handle_selection:type:propdata:
  */
 [self copy_completed:e->selection];
diff --git a/hw/xquartz/xpr/appledri.h b/hw/xquartz/xpr/appledri.h
index a96c96f..98991fc 100644
--- a/hw/xquartz/xpr/appledri.h
+++ b/hw/xquartz/xpr/appledri.h
@@ -75,7 +75,7 @@
 typedef struct {
 int type;   /* of event */
 unsigned long serial;   /* # of last request

[PATCH 15/18] os: fix spelling mistakes

2016-04-03 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <e...@engestrom.ch>
---
 os/io.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/os/io.c b/os/io.c
index 19a449a..18f1497 100644
--- a/os/io.c
+++ b/os/io.c
@@ -338,7 +338,7 @@ ReadRequestFromClient(ClientPtr client)
 /* save the data we've already read */
 memmove(oci->buffer, oci->bufptr, gotnow);
 if (needed > oci->size) {
-/* make buffer bigger to accomodate request */
+/* make buffer bigger to accommodate request */
 char *ibuf;
 
 ibuf = (char *) realloc(oci->buffer, needed);
@@ -358,7 +358,7 @@ ReadRequestFromClient(ClientPtr client)
  *  never get here in those circumstances.
  */
 if (!oc->trans_conn) {
-/*  treat as if an error occured on the read, which is what
+/*  treat as if an error occurred on the read, which is what
  *  used to happen
  */
 YieldControlDeath();
@@ -861,7 +861,7 @@ WriteToClient(ClientPtr who, int count, const void *__buf)
  /
  * FlushClient()
  *If the client isn't keeping up with us, then we try to continue
- *buffering the data and set the apropriate bit in ClientsWritable
+ *buffering the data and set the appropriate bit in ClientsWritable
  *(which is used by WaitFor in the select).  If the connection yields
  *a permanent error, or we can't allocate any more space, we then
  *close the connection.
-- 
2.8.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

[PATCH 06/18] glx: fix spelling mistake

2016-04-03 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <e...@engestrom.ch>
---
 glx/glxcmds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 0f0b714..1088fa8 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -224,7 +224,7 @@ __glXdirectContextCreate(__GLXscreen * screen,
 /**
  * Create a GL context with the given properties.  This routine is used
  * to implement \c glXCreateContext, \c glXCreateNewContext, and
- * \c glXCreateContextWithConfigSGIX.  This works becuase of the hack way
+ * \c glXCreateContextWithConfigSGIX.  This works because of the hack way
  * that GLXFBConfigs are implemented.  Basically, the FBConfigID is the
  * same as the VisualID.
  */
-- 
2.8.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

[PATCH 04/18] exa: fix spelling mistake

2016-04-03 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <e...@engestrom.ch>
---
 exa/exa_priv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index ca4db72..2ad6760 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -130,7 +130,7 @@ typedef struct {
 
 PicturePtr picture; /* Where the glyphs of the cache are stored */
 int yOffset;/* y location within the picture where the 
cache starts */
-int columns;/* Number of columns the glyphs are layed out 
in */
+int columns;/* Number of columns the glyphs are laid out 
in */
 int evictionPosition;   /* Next random position to evict a glyph */
 } ExaGlyphCacheRec, *ExaGlyphCachePtr;
 
-- 
2.8.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

[PATCH 13/18] mi: fix spelling mistakes

2016-04-03 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <e...@engestrom.ch>
---
 mi/mibitblt.c  | 2 +-
 mi/miscrinit.c | 2 +-
 mi/mizerline.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index 28296a4..63e3abf 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -449,7 +449,7 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr 
prgnSrc,
 ValidateGC(pDraw, pGC);
 
 /* Fill the drawable with the stipple.  This will draw the
- * foreground color whereever 1 bits are set, leaving everything
+ * foreground color wherever 1 bits are set, leaving everything
  * with 0 bits untouched.  Note that the part outside the clip
  * region is all 0s.  */
 rect.x = dstx;
diff --git a/mi/miscrinit.c b/mi/miscrinit.c
index 9c6af0d..cf64cb3 100644
--- a/mi/miscrinit.c
+++ b/mi/miscrinit.c
@@ -43,7 +43,7 @@ from The Open Group.
 #include "shmint.h"
 #endif
 
-/* We use this structure to propogate some information from miScreenInit to
+/* We use this structure to propagate some information from miScreenInit to
  * miCreateScreenResources.  miScreenInit allocates the structure, fills it
  * in, and puts it into pScreen->devPrivate.  miCreateScreenResources
  * extracts the info and frees the structure.  We could've accomplished the
diff --git a/mi/mizerline.c b/mi/mizerline.c
index 2f22d23..1a0ca34 100644
--- a/mi/mizerline.c
+++ b/mi/mizerline.c
@@ -60,7 +60,7 @@ SOFTWARE.
 /* Draw lineSolid, fillStyle-independent zero width lines.
  *
  * Must keep X and Y coordinates in "ints" at least until after they're
- * translated and clipped to accomodate CoordModePrevious lines with very
+ * translated and clipped to accommodate CoordModePrevious lines with very
  * large coordinates.
  *
  * Draws the same pixels regardless of sign(dx) or sign(dy).
-- 
2.8.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

[PATCH 17/18] include: fix spelling mistake

2016-04-03 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <e...@engestrom.ch>
---
 include/pixmap.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/pixmap.h b/include/pixmap.h
index c6a7736..926289d 100644
--- a/include/pixmap.h
+++ b/include/pixmap.h
@@ -126,7 +126,7 @@ extern _X_EXPORT Bool
 PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst);
 
 /* helper function, drivers can do this themselves if they can do it more
-   efficently */
+   efficiently */
 extern _X_EXPORT Bool
 PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty);
 
-- 
2.8.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

[PATCH 08/18] kdrive: fix spelling mistake

2016-04-03 Thread Eric Engestrom
Signed-off-by: Eric Engestrom <e...@engestrom.ch>
---
 hw/kdrive/ephyr/README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/kdrive/ephyr/README b/hw/kdrive/ephyr/README
index 6d6a222..f347dc2 100644
--- a/hw/kdrive/ephyr/README
+++ b/hw/kdrive/ephyr/README
@@ -54,7 +54,7 @@ Caveats
is slower than a normal oprientated display. Debug mode will
therefor not be of much use rotated.  
 
- - The '-host-cursor' cursor is static in its appearence. 
+ - The '-host-cursor' cursor is static in its appearance. 
 
  - The build gets a warning about 'nanosleep'. I think the various '-D'
build flags are causing this. I havn't figured as yet how to work
-- 
2.8.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] xres: Return the atom naming the type, not its internal type number

2015-12-09 Thread Eric Engestrom

On 08/12/15 20:08, Adam Jackson wrote:

Signed-off-by: Adam Jackson 
---
  Xext/xres.c | 34 +-
  1 file changed, 21 insertions(+), 13 deletions(-)

diff --git a/Xext/xres.c b/Xext/xres.c
index 83cc691..5d3faa3 100644
--- a/Xext/xres.c
+++ b/Xext/xres.c
@@ -274,6 +274,24 @@ ResFindAllRes(void *value, XID id, RESTYPE type, void 
*cdata)
  counts[(type & TypeMask) - 1]++;
  }

+static CARD32
+resourceTypeAtom(int i)
+{
+CARD32 ret;
+
+const char *name = LookupResourceName(i);
+if (strcmp(name, XREGISTRY_UNKNOWN))
+ret = MakeAtom(name, strlen(name), TRUE);
+else {
+char buf[40];
+
+snprintf(buf, sizeof(buf), "Unregistered resource %i", i + 1);


Shouldn't that be just `i` ?


+ret = MakeAtom(buf, strlen(buf), TRUE);
+}
+
+return ret;
+}
+
  static int
  ProcXResQueryClientResources(ClientPtr client)
  {
@@ -318,22 +336,12 @@ ProcXResQueryClientResources(ClientPtr client)

  if (num_types) {
  xXResType scratch;
-const char *name;

  for (i = 0; i < lastResourceType; i++) {
  if (!counts[i])
  continue;

-name = LookupResourceName(i + 1);
-if (strcmp(name, XREGISTRY_UNKNOWN))
-scratch.resource_type = MakeAtom(name, strlen(name), TRUE);
-else {
-char buf[40];
-
-snprintf(buf, sizeof(buf), "Unregistered resource %i", i + 1);
-scratch.resource_type = MakeAtom(buf, strlen(buf), TRUE);
-}
-
+scratch.resource_type = resourceTypeAtom(i + 1);
  scratch.count = counts[i];

  if (client->swapped) {
@@ -785,7 +793,7 @@ AddSubResourceSizeSpec(void *value,
  sizeFunc(value, id, );

  crossRef->spec.resource = id;
-crossRef->spec.type = type;
+crossRef->spec.type = resourceTypeAtom(type);
  crossRef->bytes = size.resourceSize;
  crossRef->refCount = size.refCnt;
  crossRef->useCount = 1;
@@ -858,7 +866,7 @@ AddResourceSizeValue(void *ptr, XID id, RESTYPE type, void 
*cdata)
  sizeFunc(ptr, id, );

  value->size.spec.resource = id;
-value->size.spec.type = type;
+value->size.spec.type = resourceTypeAtom(type);
  value->size.bytes = size.resourceSize;
  value->size.refCount = size.refCnt;
  value->size.useCount = 1;


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