Re: [PATCH weston] libweston-desktop/xdg-shell: Properly properly handle ack_configure

2017-07-26 Thread Derek Foreman

On 2017-07-26 03:32 PM, Quentin Glidic wrote:

On 7/26/17 9:39 PM, Derek Foreman wrote:

commit 749637a8a306588964885fe6b25fda6087a84ccd
introduced this feature, but the break is outside of any conditional
so only the first item in the list is ever tested.

If a client skips a few configures and then acks the most recent
it's still operating within spec, so the break should only occur
when a match is found.


That is indeed the intended behaviour, I overlooked the conditionals.
Do you have a client that triggered it?


terminology, the efl terminal emulator.  Just attempting a corner drag 
to resize.


Others haven't hit this, so it may be the silly gamer mouse (1000hz 
update rate) I have plugged in causing the configures to come in too 
fast to keep up with.





Signed-off-by: Derek Foreman 
---
  libweston-desktop/xdg-shell-v5.c | 2 +-
  libweston-desktop/xdg-shell-v6.c | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libweston-desktop/xdg-shell-v5.c 
b/libweston-desktop/xdg-shell-v5.c

index 77d004e1..32ece586 100644
--- a/libweston-desktop/xdg-shell-v5.c
+++ b/libweston-desktop/xdg-shell-v5.c
@@ -481,8 +481,8 @@ 
weston_desktop_xdg_surface_protocol_ack_configure(struct wl_client 
*wl_client,

  } else if (configure->serial == serial) {
  wl_list_remove(>link);
  found = true;
+break;
  }
-break;


I wanted to optimize the “serial is not in the list” case (since the 
list is ordered) but I failed. The wanted code is

else if (==) { found = true; break; } else break;

Anyway, this is:
Reviewed-by: Quentin Glidic 
either with the optimized break or not.


Well, the not present case is just going to result in the same list walk 
later to free the list?  I'll probably be lazy and land it as-is 
sometime tomorrow if nobody objects in the meantime. :)


Thanks for the speedy review,
Derek


Thanks for catching this,


  }
  if (!found) {
  struct weston_desktop_client *client =
diff --git a/libweston-desktop/xdg-shell-v6.c 
b/libweston-desktop/xdg-shell-v6.c

index 1344dda0..04233e7f 100644
--- a/libweston-desktop/xdg-shell-v6.c
+++ b/libweston-desktop/xdg-shell-v6.c
@@ -1106,8 +1106,8 @@ 
weston_desktop_xdg_surface_protocol_ack_configure(struct wl_client 
*wl_client,

  } else if (configure->serial == serial) {
  wl_list_remove(>link);
  found = true;
+break;
  }
-break;
  }
  if (!found) {
  struct weston_desktop_client *client =






___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] input: Stop leaking libinput event source on session deactivation

2017-07-26 Thread Peter Hutterer
On Tue, Jul 25, 2017 at 04:49:52PM -0500, Derek Foreman wrote:
> On 2017-07-25 04:39 PM, Derek Foreman wrote:
> > This is easily noticed as a leaked fd on every VC switch.
> > 
> > Signed-off-by: Derek Foreman 
> > ---
> >   libweston/libinput-seat.c | 5 -
> >   1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libweston/libinput-seat.c b/libweston/libinput-seat.c
> > index 8cf5666b..953f6205 100644
> > --- a/libweston/libinput-seat.c
> > +++ b/libweston/libinput-seat.c
> > @@ -134,6 +134,8 @@ udev_input_disable(struct udev_input *input)
> > if (input->suspended)
> > return;
> > +   wl_event_source_remove(input->libinput_source);
> > +   input->libinput_source = NULL;
> 
> Actually having second thoughts about this - can this fd ever change on us?
> Or can we just keep the event source we added in the first call to
> udev_input_enable forever?
> 
> Peter - can you school me on libinput usage here?

the fd you get from libinput is an epoll fd, so it won't ever change for
this libinput ontext. And the API is designed around it, so we have to guarantee
that the fd is always the same anyway.

this patch lgtm, Reviewed-by: Peter Hutterer 

Cheers,
   Peter

> 
> > libinput_suspend(input->libinput);
> > process_events(input);
> > input->suspended = 1;
> > @@ -337,7 +339,8 @@ udev_input_destroy(struct udev_input *input)
> >   {
> > struct udev_seat *seat, *next;
> > -   wl_event_source_remove(input->libinput_source);
> > +   if (input->libinput_source)
> > +   wl_event_source_remove(input->libinput_source);
> > wl_list_for_each_safe(seat, next, >compositor->seat_list, 
> > base.link)
> > udev_seat_destroy(seat);
> > libinput_unref(input->libinput);
> > 
> 
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston] libweston-desktop/xdg-shell: Properly properly handle ack_configure

2017-07-26 Thread Derek Foreman
commit 749637a8a306588964885fe6b25fda6087a84ccd
introduced this feature, but the break is outside of any conditional
so only the first item in the list is ever tested.

If a client skips a few configures and then acks the most recent
it's still operating within spec, so the break should only occur
when a match is found.

Signed-off-by: Derek Foreman 
---
 libweston-desktop/xdg-shell-v5.c | 2 +-
 libweston-desktop/xdg-shell-v6.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libweston-desktop/xdg-shell-v5.c b/libweston-desktop/xdg-shell-v5.c
index 77d004e1..32ece586 100644
--- a/libweston-desktop/xdg-shell-v5.c
+++ b/libweston-desktop/xdg-shell-v5.c
@@ -481,8 +481,8 @@ weston_desktop_xdg_surface_protocol_ack_configure(struct 
wl_client *wl_client,
} else if (configure->serial == serial) {
wl_list_remove(>link);
found = true;
+   break;
}
-   break;
}
if (!found) {
struct weston_desktop_client *client =
diff --git a/libweston-desktop/xdg-shell-v6.c b/libweston-desktop/xdg-shell-v6.c
index 1344dda0..04233e7f 100644
--- a/libweston-desktop/xdg-shell-v6.c
+++ b/libweston-desktop/xdg-shell-v6.c
@@ -1106,8 +1106,8 @@ weston_desktop_xdg_surface_protocol_ack_configure(struct 
wl_client *wl_client,
} else if (configure->serial == serial) {
wl_list_remove(>link);
found = true;
+   break;
}
-   break;
}
if (!found) {
struct weston_desktop_client *client =
-- 
2.13.3

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland 2/3] scanner: Allow adding a prefix to exported symbols

2017-07-26 Thread Emil Velikov
On 25 July 2017 at 10:24, Pekka Paalanen  wrote:
> On Tue, 25 Jul 2017 15:25:58 +0800
> Jonas Ådahl  wrote:
>
>> On Mon, Jul 24, 2017 at 02:16:04PM +0300, Pekka Paalanen wrote:
>> > On Mon,  3 Jul 2017 17:16:45 +0800
>> > Jonas Ådahl  wrote:
>> >
>> > > Two different protocols may use interfaces with identical names.
>> > > Implementing support for both those protocols would result in symbol
>> > > clashes, as wayland-scanner generates symbols from the interface names.
>> > >
>> > > Make it possible to avoiding these clashes by adding a way to add a
>> > > prefix to the symbols generated by wayland-scanner. Implementations
>> > > (servers and clients) can then use these prefix:ed symbols to implement
>> > > different objects with the same name.
>> > >
>> > > Signed-off-by: Jonas Ådahl 
>> > > ---
>> > >
>> > > Something like this would be needed if a compositor/client wants to 
>> > > implement
>> > > xdg-shell unstable v5 alongside xdg-shell stable, unless we want to 
>> > > rename all
>> > > our xdg-shell interfaces. Implementing xdg-shell unstable v6 alongside
>> > > xdg-shell stable does not have this issue.
>> > >
>> > > See issue raised here:
>> > > https://lists.freedesktop.org/archives/wayland-devel/2017-June/034380.html
>> > >
>> > >
>> > > Jonas
>> > >
>> > >
>> > >  src/scanner.c | 94 
>> > > ++-
>> > >  1 file changed, 73 insertions(+), 21 deletions(-)
>> >
>> >
>> > Hi,
>> >
>> > while this seems to change the ABI symbol names, it does not change the
>> > names in the documentation, and it does not change the names of
>> > #defines of enums, or the inline functions. That means that this is not
>> > enough to fulfill the purpose: being able to use two similarly named
>> > but different protocols by adding a prefix.
>>
>> The idea I had was rather that one would avoid changing any names on
>> non-symbols. It'd still be possible to implement both by doing it in
>> separate C files. I can see the point in adding the prefix on everything
>> though, so I'll provide a patch for that.
>>
>
> Hi,
>
> recapping the discussion from IRC, we pretty much agreed that prefixing
> is not a nice solution. Jonas found out that we cannot actually prefix
> everything, because there usually are references to other protocol
> things (like you would never want to prefix wl_surface). So it becomes
> very hard to prefix things appropriately.
>
> The alternative we discussed is solving a different problem: scanner
> makes all the public symbols in the generated .c files WL_EXPORT, which
> makes them leak into DSO ABI, which is bad. In my opinion, it should
> have never happened in the first place. But we missed it, and now it has
> spread, so we cannot just fix scanner to stop exporting, the decision
> must be with the consumers. So we need a scanner option to stop
> exporting.
>
> Quentin proposed we add a scanner option
> --visibility={static|compiler|export}. It would affect all the symbols
> exported from the generated .c files as follows:
>
> - static: the symbols will be static.
> - compiler: the symbols will get whatever the default visibility is
>   with the compiler, i.e. not explicitly static and not exported
> - export: the symbols are exported (this the old behaviour, and will be
>   the default)
>
> Obviously, the only way to actually make use of the 'static' option is
> for the consumer to #include the generated .c file. It's ugly, yes, but
> it solves the conflicting symbol names issue Jonas was looking into.
>
> In my opinion, the prefixing approach where we still cannot prefix
> everything in a way that one could use conflicting protocols in the
> same compilation unit, and where e.g. the static inline functions are
> not prefixed, is more ugly than the 'static' option.
>
> We are going to need an option to stop the exports anyway, and it seems
> like we can piggyback on that solution for the problem underlying the
> prefixing proposal as well.
>
It sounds like Quentin proposal is trying to address two distinct
things at the same time:
 - expose correct symbol visiblity
 - avoid symbol crashes due to conflicting naming used for "different" protocols

Former is addressed by swapping WL_EXPORT with WL_PRIVATE, or alike
While the latter can be tackled in a couple of says:
 - manually update the sources to use separate distinct name for the protocol
 - convince the generator (scanner) to produce ones for us

I think convincing the scanner is a perfectly reasonable solution.

HTH
Emil
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] logind: actually close fd in launcher_logind_close

2017-07-26 Thread Pekka Paalanen
On Tue, 25 Jul 2017 16:17:36 -0500
Derek Foreman  wrote:

> We still need to close fds passed to us - or we leak quite a few fds
> on VC switch.
> 
> Regression, originally fixed in 8f5acc2f3a29c3831af4ddd6bed57f703c98dc77
> and re-broken in commit 72dea06d7952e3ce8dd8057f7106186da4fa2678
> but only for the logind launcher.
> 
> Signed-off-by: Derek Foreman 
> ---
>  libweston/launcher-logind.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libweston/launcher-logind.c b/libweston/launcher-logind.c
> index f10a2831..a069bd4f 100644
> --- a/libweston/launcher-logind.c
> +++ b/libweston/launcher-logind.c
> @@ -216,6 +216,7 @@ launcher_logind_close(struct weston_launcher *launcher, 
> int fd)
>   int r;
>  
>   r = fstat(fd, );
> + close(fd);
>   if (r < 0) {
>   weston_log("logind: cannot fstat fd: %m\n");
>   return;

Reviewed-by: Pekka Paalanen 

But I didn't push this yet, because I probably hit an unrelated issue
with VT switching in the DRM backend, and will need to test more.


Thanks,
pq


pgpAIsA64Wp0P.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland 1/3] Pass input/output files as arguments to wayland-scanner

2017-07-26 Thread Emil Velikov
On 3 July 2017 at 10:16, Jonas Ådahl  wrote:
> When input/output files are passed as arguments to wayland-scanner,
> instead of using stdin/stdout, warning and error messages will contain
> the file name, together with line number, of the warning/error. Doing
> this helps IDEs jump to the correct line.
>
I really like the idea, there is one concern though - some projects do
invoke wayland_scanner directly in their build system.
Thus this patch will break things for them.

If devs are OK with that (personally I'll say "yes please"), a big fat
warning in the release notes & announcement is due.

Fwiw the patch is
Reviewed-by: Emil Velikov 

-Emil
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH] libweston-desktop/xdg-shell: Check window geometry instead of surface size against configured size

2017-07-26 Thread Quentin Glidic

Nit:
You should do "git config format.subjectprefix 'PATCH weston'" to your 
repo, to keep patches linked to Weston.


On 7/26/17 2:02 PM, Philipp Kerling wrote:

Shell surfaces may have a geometry that is different to the size of
their main surface, e.g. due to subcompositing.

In states where size is strictly enforced (fullscreen and maximized),
the size that the compositor wants must be checked against the window
geometry and not just the main surface size.

Fix by calling weston_desktop_surface_get_geometry and using that size
instead of main surface size.

Signed-off-by: Philipp Kerling 
---
  libweston-desktop/xdg-shell-v5.c | 7 +--
  libweston-desktop/xdg-shell-v6.c | 7 +--
  2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/libweston-desktop/xdg-shell-v5.c b/libweston-desktop/xdg-shell-v5.c
index d7c49b15..3f97cd23 100644
--- a/libweston-desktop/xdg-shell-v5.c
+++ b/libweston-desktop/xdg-shell-v5.c
@@ -264,9 +264,12 @@ weston_desktop_xdg_surface_committed(struct 
weston_desktop_surface *dsurface,
weston_desktop_surface_get_surface(surface->surface);
bool reconfigure = false;
  
+	struct weston_geometry geometry =

+   weston_desktop_surface_get_geometry(surface->surface);
+
if (surface->next.state.maximized || surface->next.state.fullscreen)
-   reconfigure = surface->next.size.width != wsurface->width ||
- surface->next.size.height != wsurface->height;
+   reconfigure = surface->next.size.width != geometry.width ||
+ surface->next.size.height != geometry.height;
  


Actually, there is more to do on this part, and we /might/ ditch v5 
support on the next cycle, so I’ll replace this hunk with a TODO comment 
and push it.




if (reconfigure) {
weston_desktop_xdg_surface_schedule_configure(surface, true);
diff --git a/libweston-desktop/xdg-shell-v6.c b/libweston-desktop/xdg-shell-v6.c
index dda0bf92..1344dda0 100644
--- a/libweston-desktop/xdg-shell-v6.c
+++ b/libweston-desktop/xdg-shell-v6.c
@@ -644,9 +644,12 @@ weston_desktop_xdg_toplevel_committed(struct 
weston_desktop_xdg_toplevel *toplev
if (!wsurface->buffer_ref.buffer)
return;
  
+	struct weston_geometry geometry =

+   
weston_desktop_surface_get_geometry(toplevel->base.desktop_surface);
+
if ((toplevel->next.state.maximized || toplevel->next.state.fullscreen) 
&&
-   (toplevel->next.size.width != wsurface->width ||
-toplevel->next.size.height != wsurface->height)) {
+   (toplevel->next.size.width != geometry.width ||
+toplevel->next.size.height != geometry.height)) {
struct weston_desktop_client *client =

weston_desktop_surface_get_client(toplevel->base.desktop_surface);
struct wl_resource *client_resource =


So:
Reviewed-by: Quentin Glidic 

And pushed:
ba8a0d04..c623902e  master -> master

Thanks,


--

Quentin “Sardem FF7” Glidic
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re Weston with fbdev-backend shows blank screen on display

2017-07-26 Thread saikishore
-- Forwarded message --
From: "saikishore" <saik...@gmail.com>
Date: 26-Jul-2017 8:14 PM
Subject: Re: wayland-devel Digest, Vol 83, Issue 72
To: <wayland-devel@lists.freedesktop.org>
Cc:



On 26-Jul-2017 7:32 PM, <wayland-devel-requ...@lists.freedesktop.org> wrote:

Send wayland-devel mailing list submissions to
wayland-devel@lists.freedesktop.org

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.freedesktop.org/mailman/listinfo/wayland-devel
or, via email, send a message with subject or body 'help' to
wayland-devel-requ...@lists.freedesktop.org

You can reach the person managing the list at
wayland-devel-ow...@lists.freedesktop.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of wayland-devel digest..."


Today's Topics:

   1. Re: Weston with fbdev-backend shows blank screen on display
  (Pekka Paalanen)
   2. Re: [PATCH weston] ivi-shell: Added tests for
  screen-remove-layer API (Pekka Paalanen)
   3. [PATCH 0/5] Allow user to specify how the code is used
  (Emil Velikov)
   4. [PATCH 1/5] scanner: remove unused scanner.mk (Emil Velikov)
   5. [PATCH 2/5] scanner: use tabs for indentation. (Emil Velikov)
   6. [PATCH 3/5] scanner: introduce --object-type option (Emil Velikov)


--

Message: 1
Date: Wed, 26 Jul 2017 16:38:53 +0300
From: Pekka Paalanen <ppaala...@gmail.com>
To: saikishore <saik...@gmail.com>
Cc: wayland-devel@lists.freedesktop.org
Subject: Re: Weston with fbdev-backend shows blank screen on display
Message-ID: <20170726163853.4ec8913f@eldfell>
Content-Type: text/plain; charset="utf-8"

On Wed, 26 Jul 2017 17:24:33 +0530
saikishore <saik...@gmail.com> wrote:

> Hi,
> I have ran weston with fbdev-backend  on my embedded platform with no
input
> devices (evdev is not enabled) and the below is log and i see blank
screen.
> Any advice on this please? it will be great help to me
>
>
> #  weston-launch -- --backend=fbdev-backend.so
>
>
> Date: 1970-01-01 UTC
> [00:00:00.439] weston 1.7.0

Hi,

any reason why so old Weston?

Nothing in the log looks wrong, Weston thinks everything works fine.
Try running weston-simple-shm when Weston is running. If that shows up,
then weston-desktop-shell has problems.

Weston usually does not like running without input devices, but in that
case it should just exit gracefully.

Is fbcon working right? Can you run any old fbdev programs like 'fbi'?


Thanks,
pq


Hi pekka
Thanks for your reply. We internally use buildroot for building embedded
Linux and in that when I enable Weston package it's coming as 1.7 version
hence using it.

And in weston-launch app I have commented out code lines of ioctl call for
input devices because I am running on emulation environment hence initally
trying to bring up Weston on FB first.

On FB we are booting with default image which is coming fine with Linux
boot.

After Linux boot I have launched this weston-launch app then immediately
this display goes blank screen.

By the way I didn't used any Weston.ini file and as per log it is taking
some default. How to give Weston.ini as input this app weston-launch??.

Is weston-simple-shm can also run similar to weston-launch ? By the way I
am running from shell terminal of Linux boot. And what is the command line
parameters of weston-simple-shm.



Thanks
Sai

-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attach
ments/20170726/51ddd8d2/attachment-0001.sig>

--

Message: 2
Date: Wed, 26 Jul 2017 16:55:40 +0300
From: Pekka Paalanen <ppaala...@gmail.com>
To: Michael Teyfel <mtey...@de.adit-jv.com>
Cc: efriedr...@de.adit-jv.com, eu...@de.adit-jv.com,
wayland-devel@lists.freedesktop.org
Subject: Re: [PATCH weston] ivi-shell: Added tests for
screen-remove-layer API
Message-ID: <20170726165540.7f3ef300@eldfell>
Content-Type: text/plain; charset="utf-8"

On Wed, 26 Jul 2017 14:22:49 +0200
Michael Teyfel <mtey...@de.adit-jv.com> wrote:

> Two cases are tested: success and fail case of the screen-remove-layer
API.
>
> Signed-off-by: Michael Teyfel <mtey...@de.adit-jv.com>
> ---
>  tests/ivi_layout-internal-test.c | 69 ++
++
>  1 file changed, 69 insertions(+)

Hi Michael,

looks good, so:
Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk>

Unfortunately we are past the beta release, so I believe merging this
needs to wait for the next development cycle. I'll try to remember to
push this then.

Or if I get a second opinion that this is ok to push before the 

Re: wayland-devel Digest, Vol 83, Issue 72

2017-07-26 Thread saikishore
On 26-Jul-2017 7:32 PM, <wayland-devel-requ...@lists.freedesktop.org> wrote:

Send wayland-devel mailing list submissions to
wayland-devel@lists.freedesktop.org

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.freedesktop.org/mailman/listinfo/wayland-devel
or, via email, send a message with subject or body 'help' to
wayland-devel-requ...@lists.freedesktop.org

You can reach the person managing the list at
wayland-devel-ow...@lists.freedesktop.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of wayland-devel digest..."


Today's Topics:

   1. Re: Weston with fbdev-backend shows blank screen on display
  (Pekka Paalanen)
   2. Re: [PATCH weston] ivi-shell: Added tests for
  screen-remove-layer API (Pekka Paalanen)
   3. [PATCH 0/5] Allow user to specify how the code is used
  (Emil Velikov)
   4. [PATCH 1/5] scanner: remove unused scanner.mk (Emil Velikov)
   5. [PATCH 2/5] scanner: use tabs for indentation. (Emil Velikov)
   6. [PATCH 3/5] scanner: introduce --object-type option (Emil Velikov)


--

Message: 1
Date: Wed, 26 Jul 2017 16:38:53 +0300
From: Pekka Paalanen <ppaala...@gmail.com>
To: saikishore <saik...@gmail.com>
Cc: wayland-devel@lists.freedesktop.org
Subject: Re: Weston with fbdev-backend shows blank screen on display
Message-ID: <20170726163853.4ec8913f@eldfell>
Content-Type: text/plain; charset="utf-8"

On Wed, 26 Jul 2017 17:24:33 +0530
saikishore <saik...@gmail.com> wrote:

> Hi,
> I have ran weston with fbdev-backend  on my embedded platform with no
input
> devices (evdev is not enabled) and the below is log and i see blank
screen.
> Any advice on this please? it will be great help to me
>
>
> #  weston-launch -- --backend=fbdev-backend.so
>
>
> Date: 1970-01-01 UTC
> [00:00:00.439] weston 1.7.0

Hi,

any reason why so old Weston?

Nothing in the log looks wrong, Weston thinks everything works fine.
Try running weston-simple-shm when Weston is running. If that shows up,
then weston-desktop-shell has problems.

Weston usually does not like running without input devices, but in that
case it should just exit gracefully.

Is fbcon working right? Can you run any old fbdev programs like 'fbi'?


Thanks,
pq


Hi pekka
Thanks for your reply. We internally use buildroot for building embedded
Linux and in that when I enable Weston package it's coming as 1.7 version
hence using it.

And in weston-launch app I have commented out code lines of ioctl call for
input devices because I am running on emulation environment hence initally
trying to bring up Weston on FB first.

On FB we are booting with default image which is coming fine with Linux
boot.

After Linux boot I have launched this weston-launch app then immediately
this display goes blank screen.

By the way I didn't used any Weston.ini file and as per log it is taking
some default. How to give Weston.ini as input this app weston-launch??.

Is weston-simple-shm can also run similar to weston-launch ? By the way I
am running from shell terminal of Linux boot. And what is the command line
parameters of weston-simple-shm.



Thanks
Sai

-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/
attachments/20170726/51ddd8d2/attachment-0001.sig>

--

Message: 2
Date: Wed, 26 Jul 2017 16:55:40 +0300
From: Pekka Paalanen <ppaala...@gmail.com>
To: Michael Teyfel <mtey...@de.adit-jv.com>
Cc: efriedr...@de.adit-jv.com, eu...@de.adit-jv.com,
wayland-devel@lists.freedesktop.org
Subject: Re: [PATCH weston] ivi-shell: Added tests for
screen-remove-layer API
Message-ID: <20170726165540.7f3ef300@eldfell>
Content-Type: text/plain; charset="utf-8"

On Wed, 26 Jul 2017 14:22:49 +0200
Michael Teyfel <mtey...@de.adit-jv.com> wrote:

> Two cases are tested: success and fail case of the screen-remove-layer
API.
>
> Signed-off-by: Michael Teyfel <mtey...@de.adit-jv.com>
> ---
>  tests/ivi_layout-internal-test.c | 69 ++
++
>  1 file changed, 69 insertions(+)

Hi Michael,

looks good, so:
Reviewed-by: Pekka Paalanen <pekka.paala...@collabora.co.uk>

Unfortunately we are past the beta release, so I believe merging this
needs to wait for the next development cycle. I'll try to remember to
push this then.

Or if I get a second opinion that this is ok to push before the RC, I
can do that too.


Thanks,
pq
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <ht

[PATCH 5/5] wayland-scanner.mk: default --object-type to static

2017-07-26 Thread Emil Velikov
From: Emil Velikov 

Unlike the core wayland library, it's recommended that one statically
embeds the protocol within their binary.

Signed-off-by: Emil Velikov 
---
 wayland-scanner.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/wayland-scanner.mk b/wayland-scanner.mk
index 0a72062..57f91f0 100644
--- a/wayland-scanner.mk
+++ b/wayland-scanner.mk
@@ -1,5 +1,5 @@
 %-protocol.c : $(wayland_protocoldir)/%.xml
-   $(AM_V_GEN)$(wayland_scanner) code < $< > $@
+   $(AM_V_GEN)$(wayland_scanner) --object-type=static code < $< > $@
 
 %-server-protocol.h : $(wayland_protocoldir)/%.xml
$(AM_V_GEN)$(wayland_scanner) server-header < $< > $@
-- 
2.13.0

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH 4/5] build: set the scanner --object-type option

2017-07-26 Thread Emil Velikov
From: Emil Velikov 

Unlike most other scanner users, the core wayland interfaces are
public ally available via the libwayland DSO.

Signed-off-by: Emil Velikov 
---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index d0c8bd3..4055d04 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -97,7 +97,7 @@ nodist_libwayland_client_la_SOURCES = \
 pkgconfig_DATA += src/wayland-client.pc src/wayland-server.pc
 
 protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
-   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
+   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) 
--object-type=shared code < $< > $@
 
 protocol/%-server-protocol.h : $(top_srcdir)/protocol/%.xml
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < 
$< > $@
-- 
2.13.0

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH 1/5] scanner: remove unused scanner.mk

2017-07-26 Thread Emil Velikov
From: Emil Velikov 

Nothing in the existing codebase references the file.

Signed-off-by: Emil Velikov 
---
 src/scanner.mk | 8 
 1 file changed, 8 deletions(-)
 delete mode 100644 src/scanner.mk

diff --git a/src/scanner.mk b/src/scanner.mk
deleted file mode 100644
index 1b6963c..000
--- a/src/scanner.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-%-protocol.c : $(protocoldir)/%.xml
-   $(AM_V_GEN)$(wayland_scanner) code < $< > $@
-
-%-server-protocol.h : $(protocoldir)/%.xml
-   $(AM_V_GEN)$(wayland_scanner) server-header < $< > $@
-
-%-client-protocol.h : $(protocoldir)/%.xml
-   $(AM_V_GEN)$(wayland_scanner) client-header < $< > $@
-- 
2.13.0

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH 3/5] scanner: introduce --object-type option

2017-07-26 Thread Emil Velikov
From: Emil Velikov 

The option is used to indicate how the code will be used - would it be a
part of shared or static one.

In the former case one needs to export the specific symbols, although
normally people want to statically build the protocol code into their
project.

If the option is missing a warning is emitted, to point people and do
the right thing.

Signed-off-by: Emil Velikov 
---
 src/scanner.c | 61 ++-
 1 file changed, 56 insertions(+), 5 deletions(-)

diff --git a/src/scanner.c b/src/scanner.c
index c345ed6..cc45b74 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -57,6 +57,11 @@ enum side {
SERVER,
 };
 
+enum object_type {
+   SHARED,
+   STATIC,
+};
+
 static int
 usage(int ret)
 {
@@ -70,6 +75,11 @@ usage(int ret)
fprintf(stderr, "-h,  --help  display this help and 
exit.\n"
"-v,  --version   print the wayland 
library version that\n"
" the scanner was built 
against.\n"
+   "-t,  --object-type=[static,shared]\n"
+   " How is the resulting 
code going to be built/used\n"
+   " static - standalone 
static object, used internally\n"
+   " shared - shared 
library, to be used by multiple projects\n"
+   " Using static is 
highly recommened.\n"
"-c,  --include-core-only include the core 
version of the headers,\n"
" that is e.g. 
wayland-client-core.h instead\n"
" of 
wayland-client.h.\n");
@@ -1712,9 +1722,11 @@ emit_messages(struct wl_list *message_list,
printf("};\n\n");
 }
 
+
 static void
-emit_code(struct protocol *protocol)
+emit_code(struct protocol *protocol, enum object_type obj_type)
 {
+   const char *symbol_visibility;
struct interface *i, *next;
struct wl_array types;
char **p, *prev;
@@ -1728,6 +1740,19 @@ emit_code(struct protocol *protocol)
   "#include \n"
   "#include \"wayland-util.h\"\n\n");
 
+   /* When building a shared library symbols must be exported, otherwise
+* we want to have the symbols hidden. */
+   if (obj_type == STATIC) {
+   symbol_visibility = "WL_PRIVATE";
+   printf("#if defined(__GNUC__) && __GNUC__ >= 4\n"
+  "#define WL_PRIVATE __attribute__ 
((visibility(\"hidden\")))\n"
+  "#else\n"
+  "#define WL_PRIVATE\n"
+  "#endif\n\n");
+   } else {
+   symbol_visibility = "WL_EXPORT";
+   }
+
wl_array_init();
wl_list_for_each(i, >interface_list, link) {
emit_types_forward_declarations(protocol, >request_list, 
);
@@ -1757,10 +1782,10 @@ emit_code(struct protocol *protocol)
emit_messages(>request_list, i, "requests");
emit_messages(>event_list, i, "events");
 
-   printf("WL_EXPORT const struct wl_interface "
+   printf("%s const struct wl_interface "
   "%s_interface = {\n"
   "\t\"%s\", %d,\n",
-  i->name, i->name, i->version);
+  symbol_visibility, i->name, i->name, i->version);
 
if (!wl_list_empty(>request_list))
printf("\t%d, %s_requests,\n",
@@ -1790,6 +1815,24 @@ free_protocol(struct protocol *protocol)
free_description(protocol->description);
 }
 
+static enum object_type
+parse_obj_type(const char *obj_type_str)
+{
+   if (!obj_type_str) {
+   fprintf(stderr, "Warning: --object-type is not specified, 
assuming shared.\n");
+   return SHARED;
+}
+
+   if (strcmp(obj_type_str, "static") == 0)
+   return STATIC;
+
+   if (strcmp(obj_type_str, "shared") == 0)
+   return SHARED;
+
+   fprintf(stderr, "Error: invalid object type string '%s'\n", 
obj_type_str);
+   usage(EXIT_FAILURE);
+}
+
 int main(int argc, char *argv[])
 {
struct parse_context ctx;
@@ -1802,6 +1845,8 @@ int main(int argc, char *argv[])
bool core_headers = false;
bool version = false;
bool fail = false;
+   char *obj_type_str = NULL;
+   enum object_type obj_type;
int opt;
enum {
CLIENT_HEADER,
@@ -1812,12 +1857,13 @@ int main(int argc, char *argv[])
static const struct option options[] = {
{ "help",  no_argument, NULL, 'h' },
{ "version",   no_argument, 

[PATCH 2/5] scanner: use tabs for indentation.

2017-07-26 Thread Emil Velikov
From: Emil Velikov 

File uses tabs, barring the few instances fixed with this patch.

Signed-off-by: Emil Velikov 
---
 src/scanner.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/scanner.c b/src/scanner.c
index 517068c..c345ed6 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -70,9 +70,9 @@ usage(int ret)
fprintf(stderr, "-h,  --help  display this help and 
exit.\n"
"-v,  --version   print the wayland 
library version that\n"
" the scanner was built 
against.\n"
-   "-c,  --include-core-only include the core 
version of the headers,\n"
-   " that is e.g. 
wayland-client-core.h instead\n"
-   " of 
wayland-client.h.\n");
+   "-c,  --include-core-only include the core 
version of the headers,\n"
+   " that is e.g. 
wayland-client-core.h instead\n"
+   " of 
wayland-client.h.\n");
exit(ret);
 }
 
-- 
2.13.0

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH 0/5] Allow user to specify how the code is used

2017-07-26 Thread Emil Velikov
Hi all,

Here is an alternative version of the "symbol visibility" series by Jonas.

It starts with a couple of mildly related cleanups, which are trivial and 
can be applied irrespective of the rest.

Key goals/differences:
 - use "object type" as opposed to "symbol visibility"
Defines the goal, as opposed to the means.
 - there's no "static" option
Including .c files from another is considered a bad practise - don't trick
people into using it.
 - The default option, as provided by wayland-scanner.mk, is STATIC
 - No tests, yet
If people are OK with the idea/approach I can spin some.


Emil Velikov (5):
  scanner: remove unused scanner.mk
  scanner: use tabs for indentation.
  scanner: introduce --object-type option
  build: set the scanner --object-type option
  wayland-scanner.mk: default --object-type to static

 Makefile.am|  2 +-
 src/scanner.c  | 67 +++---
 src/scanner.mk |  8 ---
 wayland-scanner.mk |  2 +-
 4 files changed, 61 insertions(+), 18 deletions(-)
 delete mode 100644 src/scanner.mk

-- 
2.13.0

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] ivi-shell: Added tests for screen-remove-layer API

2017-07-26 Thread Pekka Paalanen
On Wed, 26 Jul 2017 14:22:49 +0200
Michael Teyfel  wrote:

> Two cases are tested: success and fail case of the screen-remove-layer API.
> 
> Signed-off-by: Michael Teyfel 
> ---
>  tests/ivi_layout-internal-test.c | 69 
> 
>  1 file changed, 69 insertions(+)

Hi Michael,

looks good, so:
Reviewed-by: Pekka Paalanen 

Unfortunately we are past the beta release, so I believe merging this
needs to wait for the next development cycle. I'll try to remember to
push this then.

Or if I get a second opinion that this is ok to push before the RC, I
can do that too.


Thanks,
pq


pgpk84x3dCzIl.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: Weston with fbdev-backend shows blank screen on display

2017-07-26 Thread Pekka Paalanen
On Wed, 26 Jul 2017 17:24:33 +0530
saikishore  wrote:

> Hi,
> I have ran weston with fbdev-backend  on my embedded platform with no input
> devices (evdev is not enabled) and the below is log and i see blank screen.
> Any advice on this please? it will be great help to me
> 
> 
> #  weston-launch -- --backend=fbdev-backend.so
> 
> 
> Date: 1970-01-01 UTC
> [00:00:00.439] weston 1.7.0

Hi,

any reason why so old Weston?

Nothing in the log looks wrong, Weston thinks everything works fine.
Try running weston-simple-shm when Weston is running. If that shows up,
then weston-desktop-shell has problems.

Weston usually does not like running without input devices, but in that
case it should just exit gracefully.

Is fbcon working right? Can you run any old fbdev programs like 'fbi'?


Thanks,
pq


pgpQYWKGoqlMz.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland v2 1/4] scanner: Add --visibility flag for setting symbol visibility

2017-07-26 Thread Pekka Paalanen
On Wed, 26 Jul 2017 16:16:33 +0800
Jonas Ådahl  wrote:

> Add a --visibility flag that enables the user to tweak the visibility
> of the symbols generated by wayland-scanner. Three alternatives are
> exposed:
> 
> 'export': as has always been done up until now, export the symbols
> using WL_EXPORT, making making them exposed externally. This is the
> default in order to not break backward compatibility.
> 
> 'compiler-default': use whatever visibility the compiler defaults to.
> This is most likely the most visibility that protocol implementations
> or users actually wants, as it doesn't expose any unwanted
> implementation details.
> 
> 'static': each symbol will only be visible to the compilation unit it
> is included in. This means that a protocol implementations and users
> needs to include both the 'code' file and either the 'client-header' or
> 'server-header' (or both) in the source file implementing or using the
> protocol in question.
> 
> Using 'static' is a method to avoid situations where otherwise exposed
> symbols of different protocols would conflict, for example if they have
> the same interface name.
> 
> When no visibility is specified, 'export' is assumed, but a warning is
> printed to stderr, as it is unlikely that 'export' is what is actually
> desired.
> 
> Signed-off-by: Jonas Ådahl 
> ---
> 
> Changes since v1:
> 
> - Use 'extern' tag also for compiler default declarations.
> 
> - "see --help" message to the warning
> 
> - Added 'what visibility to choose' kind of documentation to --help
> 
> 
>  Makefile.am   |  10 ++---
>  src/scanner.c | 135 
> +++---
>  2 files changed, 125 insertions(+), 20 deletions(-)

Hi,

patches 2-4 are:
Reviewed-by: Pekka Paalanen 

Patch 1 looks good, except for one detail we have missed completely and
ruins almost everything.


> diff --git a/src/scanner.c b/src/scanner.c
> index 517068c..3e43f90 100644
> --- a/src/scanner.c
> +++ b/src/scanner.c

> @@ -1507,11 +1537,14 @@ emit_mainpage_blurb(const struct protocol *protocol, 
> enum side side)
>  }
>  
>  static void
> -emit_header(struct protocol *protocol, enum side side)
> +emit_header(struct parse_context *ctx,
> + struct protocol *protocol,
> + enum side side)
>  {
>   struct interface *i, *i_next;
>   struct wl_array types;
>   const char *s = (side == SERVER) ? "SERVER" : "CLIENT";
> + const char *symbol_decl_tag = NULL;
>   char **p, *prev;
>  
>   printf("/* Generated by %s %s */\n\n", PROGRAM_NAME, WAYLAND_VERSION);
> @@ -1556,6 +1589,16 @@ emit_header(struct protocol *protocol, enum side side)
>   wl_array_release();
>   printf("\n");
>  
> + switch (ctx->visibility) {
> + case VISIBILITY_EXPORT:
> + case VISIBILITY_COMPILER_DEFAULT:
> + symbol_decl_tag = "extern ";
> + break;
> + case VISIBILITY_STATIC:
> + symbol_decl_tag = "static ";
> + break;
> + }
> +
>   wl_list_for_each(i, >interface_list, link) {
>   printf("/**\n"
>  " * @page page_iface_%s %s\n",
> @@ -1575,8 +1618,9 @@ emit_header(struct protocol *protocol, enum side side)
>   if (i->description && i->description->text)
>   format_text_to_comment(i->description->text, false);
>   printf(" */\n");
> - printf("extern const struct wl_interface "
> -"%s_interface;\n", i->name);
> + printf("%sconst struct wl_interface "
> +"%s_interface;\n",
> +symbol_decl_tag, i->name);
>   }
>  
>   printf("\n");
> @@ -1713,11 +1757,13 @@ emit_messages(struct wl_list *message_list,
>  }
>  
>  static void
> -emit_code(struct protocol *protocol)
> +emit_code(struct parse_context *ctx, struct protocol *protocol)
>  {
>   struct interface *i, *next;
>   struct wl_array types;
>   char **p, *prev;
> + const char *visibility_tag = NULL;
> + const char *symbol_decl_tag = NULL;
>  
>   printf("/* Generated by %s %s */\n\n", PROGRAM_NAME, WAYLAND_VERSION);
>  
> @@ -1728,6 +1774,16 @@ emit_code(struct protocol *protocol)
>  "#include \n"
>  "#include \"wayland-util.h\"\n\n");
>  
> + switch (ctx->visibility) {
> + case VISIBILITY_EXPORT:
> + case VISIBILITY_COMPILER_DEFAULT:
> + symbol_decl_tag = "extern ";
> + break;
> + case VISIBILITY_STATIC:
> + symbol_decl_tag = "static ";
> + break;
> + }
> +
>   wl_array_init();
>   wl_list_for_each(i, >interface_list, link) {
>   emit_types_forward_declarations(protocol, >request_list, 
> );
> @@ -1738,7 +1794,8 @@ emit_code(struct protocol *protocol)
>   wl_array_for_each(p, ) {
>   if (prev && strcmp(*p, prev) == 0)
>   continue;
> - 

RE: [PATCH weston] ivi-shell: Added tests for screen-remove-layer API

2017-07-26 Thread Teyfel, Michael (ADITG/ESB)
Hi Pekka,

thank you for reviewing and also your remarks. I adjusted my patch accordingly 
and resent it to ML.


Best regards

Michael Teyfel
Engineering Software Base (ADITG/ESB)

Tel. +49 5121 49 6932

-Original Message-
From: Pekka Paalanen [mailto:ppaala...@gmail.com] 
Sent: Mittwoch, 26. Juli 2017 11:18
To: Teyfel, Michael (ADITG/ESB)
Cc: wayland-devel@lists.freedesktop.org; Ucan, Emre (ADITG/ESB); Friedrich, 
Eugen (ADITG/ESB)
Subject: Re: [PATCH weston] ivi-shell: Added tests for screen-remove-layer API

On Tue, 25 Jul 2017 15:59:06 +0200
Michael Teyfel  wrote:

> Two cases are tested: success and fail case of the screen-remove-layer API.
> 
> Signed-off-by: Michael Teyfel 
> ---
>  tests/ivi_layout-internal-test.c | 62 
> 
>  1 file changed, 62 insertions(+)

Hi Michael,

thanks for these, they look mostly good, just some polishing required.
Comments inline.

> 
> diff --git a/tests/ivi_layout-internal-test.c 
> b/tests/ivi_layout-internal-test.c
> index 37a2356..64380ec 100644
> --- a/tests/ivi_layout-internal-test.c
> +++ b/tests/ivi_layout-internal-test.c
> @@ -341,6 +341,66 @@ test_layer_source_rectangle(struct test_context 
> *ctx)  }
>  
>  static void
> +test_screen_remove_layer(struct test_context *ctx) {
> + const struct ivi_layout_interface *lyt = ctx->layout_interface;
> + struct ivi_layout_layer *ivilayer;
> + struct weston_output *output;
> + struct ivi_layout_layer **array;
> + int32_t length = 0;
> +
> + ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 
> 300);
> + iassert(ivilayer != NULL);
> +
> + if (wl_list_empty(>compositor->output_list))
> + return;

This leaks the ivilayer, possibly affecting also further tests. Move the check 
before the layer creation.

> +
> + output = wl_container_of(ctx->compositor->output_list.next, output, 
> +link);
> +
> + iassert(lyt->screen_add_layer(output, ivilayer) == IVI_SUCCEEDED);
> + lyt->commit_changes();
> +
> + iassert(lyt->get_layers_on_screen(output, , ) == 
> IVI_SUCCEEDED);
> + iassert(length == 1);
> + iassert(array[0] == ivilayer);
> +
> + iassert(lyt->screen_remove_layer(output ,ivilayer) == 
> +IVI_SUCCEEDED);

Space on the wrong side of comma.

> + lyt->commit_changes();
> +

'array' gets leaked.

> + iassert(lyt->get_layers_on_screen(output, , ) == 
> IVI_SUCCEEDED);
> + iassert(length == 0);

'array' would get leaked if there were any layers, but since we fail the test 
in that case, it doesn't matter.

> +
> + lyt->layer_destroy(ivilayer);
> +}
> +
> +static void
> +test_screen_bad_remove_layer(struct test_context *ctx) {
> + const struct ivi_layout_interface *lyt = ctx->layout_interface;
> + struct ivi_layout_layer *ivilayer;
> + struct weston_output *output;
> +
> + ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 
> 300);
> + iassert(ivilayer != NULL);
> +
> + if (wl_list_empty(>compositor->output_list))
> + return;

The same leak of ivilayer as before.

> +
> + output = wl_container_of(ctx->compositor->output_list.next, output, 
> +link);
> +
> + iassert(lyt->screen_remove_layer(NULL, ivilayer) == IVI_FAILED);
> + lyt->commit_changes();
> +
> + iassert(lyt->screen_remove_layer(output, NULL) == IVI_FAILED);
> + lyt->commit_changes();
> +
> + iassert(lyt->screen_remove_layer(NULL, NULL) == IVI_FAILED);
> + lyt->commit_changes();
> +
> + lyt->layer_destroy(ivilayer);
> +}
> +
> +static void
>  test_layer_bad_remove(struct test_context *ctx)  {
>   const struct ivi_layout_interface *lyt = ctx->layout_interface; @@ 
> -951,6 +1011,8 @@ run_internal_tests(void *data)
>   test_layer_position(ctx);
>   test_layer_destination_rectangle(ctx);
>   test_layer_source_rectangle(ctx);
> + test_screen_remove_layer(ctx);
> + test_screen_bad_remove_layer(ctx);

These two would be better grouped with the other screen tests, I think.

>   test_layer_bad_remove(ctx);
>   test_layer_bad_visibility(ctx);
>   test_layer_bad_opacity(ctx);


Thanks,
pq
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston] ivi-shell: Added tests for screen-remove-layer API

2017-07-26 Thread Michael Teyfel
Two cases are tested: success and fail case of the screen-remove-layer API.

Signed-off-by: Michael Teyfel 
---
 tests/ivi_layout-internal-test.c | 69 
 1 file changed, 69 insertions(+)

diff --git a/tests/ivi_layout-internal-test.c b/tests/ivi_layout-internal-test.c
index 37a2356..6d1c91c 100644
--- a/tests/ivi_layout-internal-test.c
+++ b/tests/ivi_layout-internal-test.c
@@ -682,6 +682,73 @@ test_screen_add_layers(struct test_context *ctx)
 }
 
 static void
+test_screen_remove_layer(struct test_context *ctx)
+{
+   const struct ivi_layout_interface *lyt = ctx->layout_interface;
+   struct ivi_layout_layer *ivilayer;
+   struct weston_output *output;
+   struct ivi_layout_layer **array;
+   int32_t length = 0;
+
+   if (wl_list_empty(>compositor->output_list))
+   return;
+
+   ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 
300);
+   iassert(ivilayer != NULL);
+
+   output = wl_container_of(ctx->compositor->output_list.next, output, 
link);
+
+   iassert(lyt->screen_add_layer(output, ivilayer) == IVI_SUCCEEDED);
+   lyt->commit_changes();
+
+   iassert(lyt->get_layers_on_screen(output, , ) == 
IVI_SUCCEEDED);
+   iassert(length == 1);
+   iassert(array[0] == ivilayer);
+
+   iassert(lyt->screen_remove_layer(output, ivilayer) == IVI_SUCCEEDED);
+   lyt->commit_changes();
+
+   if (length > 0)
+   free(array);
+
+   array = NULL;
+
+   iassert(lyt->get_layers_on_screen(output, , ) == 
IVI_SUCCEEDED);
+   iassert(length == 0);
+   iassert(array == NULL);
+
+   lyt->layer_destroy(ivilayer);
+}
+
+static void
+test_screen_bad_remove_layer(struct test_context *ctx)
+{
+   const struct ivi_layout_interface *lyt = ctx->layout_interface;
+   struct ivi_layout_layer *ivilayer;
+   struct weston_output *output;
+
+   if (wl_list_empty(>compositor->output_list))
+   return;
+
+   ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 
300);
+   iassert(ivilayer != NULL);
+
+   output = wl_container_of(ctx->compositor->output_list.next, output, 
link);
+
+   iassert(lyt->screen_remove_layer(NULL, ivilayer) == IVI_FAILED);
+   lyt->commit_changes();
+
+   iassert(lyt->screen_remove_layer(output, NULL) == IVI_FAILED);
+   lyt->commit_changes();
+
+   iassert(lyt->screen_remove_layer(NULL, NULL) == IVI_FAILED);
+   lyt->commit_changes();
+
+   lyt->layer_destroy(ivilayer);
+}
+
+
+static void
 test_commit_changes_after_render_order_set_layer_destroy(
struct test_context *ctx)
 {
@@ -969,6 +1036,8 @@ run_internal_tests(void *data)
test_screen_render_order(ctx);
test_screen_bad_render_order(ctx);
test_screen_add_layers(ctx);
+   test_screen_remove_layer(ctx);
+   test_screen_bad_remove_layer(ctx);
test_commit_changes_after_render_order_set_layer_destroy(ctx);
 
test_layer_properties_changed_notification(ctx);
-- 
2.7.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH 1/2] scanner: Add --visibility flag for setting symbol visibility

2017-07-26 Thread Emil Velikov
Hi guys,

On 25 July 2017 at 11:39, Jonas Ådahl  wrote:
> Add a --visibility flag that enables the user to tweak the visibility
> of the symbols generated by wayland-scanner. Three alternatives are
> exposed:
>
> 'export': as has always been done up until now, export the symbols
> using WL_EXPORT, making making them exposed externally. This is the
> default in order to not break backward compatibility.
>
> 'compiler-default': use whatever visibility the compiler defaults to.
> This is most likely the most visibility that protocol implementations
> or users actually wants, as it doesn't expose any unwanted
> implementation details.
>
> 'static': each symbol will only be visible to the compilation unit it
> is included in. This means that a protocol implementations and users
> needs to include both the 'code' file and either the 'client-header' or
> 'server-header' (or both) in the source file implementing or using the
> protocol in question.
>
> Using 'static' is a method to avoid situations where otherwise exposed
> symbols of different protocols would conflict, for example if they have
> the same interface name.
>
> When no visibility is specified, 'export' is assumed, but a warning is
> printed to stderr, as it is unlikely that 'export' is what is actually
> desired.
>
I have some patches with similar idea, although different in a number of ways.

Rather than nitpicking like an old bat, I'll rebase mine and send them
out in a couple of hours.
Perhaps people will see some value in the bits I've used there?

-Emil
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH] libweston-desktop/xdg-shell: Check window geometry instead of surface size against configured size

2017-07-26 Thread Philipp Kerling
Shell surfaces may have a geometry that is different to the size of
their main surface, e.g. due to subcompositing.

In states where size is strictly enforced (fullscreen and maximized),
the size that the compositor wants must be checked against the window
geometry and not just the main surface size.

Fix by calling weston_desktop_surface_get_geometry and using that size
instead of main surface size.

Signed-off-by: Philipp Kerling 
---
 libweston-desktop/xdg-shell-v5.c | 7 +--
 libweston-desktop/xdg-shell-v6.c | 7 +--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/libweston-desktop/xdg-shell-v5.c b/libweston-desktop/xdg-shell-v5.c
index d7c49b15..3f97cd23 100644
--- a/libweston-desktop/xdg-shell-v5.c
+++ b/libweston-desktop/xdg-shell-v5.c
@@ -264,9 +264,12 @@ weston_desktop_xdg_surface_committed(struct 
weston_desktop_surface *dsurface,
weston_desktop_surface_get_surface(surface->surface);
bool reconfigure = false;
 
+   struct weston_geometry geometry =
+   weston_desktop_surface_get_geometry(surface->surface);
+
if (surface->next.state.maximized || surface->next.state.fullscreen)
-   reconfigure = surface->next.size.width != wsurface->width ||
- surface->next.size.height != wsurface->height;
+   reconfigure = surface->next.size.width != geometry.width ||
+ surface->next.size.height != geometry.height;
 
if (reconfigure) {
weston_desktop_xdg_surface_schedule_configure(surface, true);
diff --git a/libweston-desktop/xdg-shell-v6.c b/libweston-desktop/xdg-shell-v6.c
index dda0bf92..1344dda0 100644
--- a/libweston-desktop/xdg-shell-v6.c
+++ b/libweston-desktop/xdg-shell-v6.c
@@ -644,9 +644,12 @@ weston_desktop_xdg_toplevel_committed(struct 
weston_desktop_xdg_toplevel *toplev
if (!wsurface->buffer_ref.buffer)
return;
 
+   struct weston_geometry geometry =
+   
weston_desktop_surface_get_geometry(toplevel->base.desktop_surface);
+
if ((toplevel->next.state.maximized || toplevel->next.state.fullscreen) 
&&
-   (toplevel->next.size.width != wsurface->width ||
-toplevel->next.size.height != wsurface->height)) {
+   (toplevel->next.size.width != geometry.width ||
+toplevel->next.size.height != geometry.height)) {
struct weston_desktop_client *client =

weston_desktop_surface_get_client(toplevel->base.desktop_surface);
struct wl_resource *client_resource =
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Weston with fbdev-backend shows blank screen on display

2017-07-26 Thread saikishore
Hi,
I have ran weston with fbdev-backend  on my embedded platform with no input
devices (evdev is not enabled) and the below is log and i see blank screen.
Any advice on this please? it will be great help to me


#  weston-launch -- --backend=fbdev-backend.so


Date: 1970-01-01 UTC



[00:00:00.439] weston 1.7.0



   http://wayland.freedesktop.org



   Bug reports to: https://bugs.freedesktop.org/
enter_bug.cgi?product=Wayland=weston=1.7.0



   Build: 1.6.93-9-gdbd8606 configure.ac: bump to version 1.7.0
for release (2015-02-13 20:47:09 -0800)



[00:00:00.439] OS: Linux, 4.1.10+, #6 PREEMPT Wed Jul 26 10:54:06 IST 2017,
aarch64



[00:00:00.440] Starting with no config file.



[00:00:00.440] Loading module '/usr/lib/weston/fbdev-backend.so'



[00:00:00.443] initializing fbdev backend



[00:00:00.445] Creating fbdev output.



[00:00:00.445] Opening fbdev frame buffer.



[00:00:00.445] Calculating pixman format from:



- type: 0 (aux: 0)



- visual: 2



- bpp: 32 (grayscale: 0)



- red: offset: 16, length: 8, MSB: 0



- green: offset: 8, length: 8, MSB: 0



- blue: offset: 0, length: 8, MSB: 0



- transp: offset: 24, length: 8, MSB: 0



[00:00:00.445] Mapping fbdev frame buffer.



[00:00:00.445] fbdev output 1280×720 px



   guessing 60 Hz and 96 dpi



[00:00:00.447] warning: no input devices on entering Weston. Possible
causes:



- no permissions to read /dev/input/event*



- seats misconfigured (Weston backend option 'seat', udev device property
ID_SEAT)



[00:00:00.447] Compositor capabilities:



   arbitrary surface rotation: yes



   screen capture uses y-flip: yes



   presentation clock: CLOCK_MONOTONIC_RAW, id 4



[00:00:00.447] Loading module '/usr/lib/weston/desktop-shell.so'



[00:00:00.471] launching '/usr/libexec/weston-desktop-shell'


thanks
saikishore
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland 2/3] scanner: Allow adding a prefix to exported symbols

2017-07-26 Thread Pekka Paalanen
On Wed, 26 Jul 2017 18:39:52 +0800
Jonas Ådahl  wrote:

> On Wed, Jul 26, 2017 at 09:28:45AM +0100, Daniel Stone wrote:
> > Hi,
> > 
> > On 25 July 2017 at 10:24, Pekka Paalanen  wrote:  

> > > Quentin proposed we add a scanner option
> > > --visibility={static|compiler|export}. It would affect all the symbols
> > > exported from the generated .c files as follows:
> > >
> > > - static: the symbols will be static.
> > > - compiler: the symbols will get whatever the default visibility is
> > >   with the compiler, i.e. not explicitly static and not exported
> > > - export: the symbols are exported (this the old behaviour, and will be
> > >   the default)

> > > We are going to need an option to stop the exports anyway, and it seems
> > > like we can piggyback on that solution for the problem underlying the
> > > prefixing proposal as well.  
> > 
> > This sounds really good to me.
> > 
> > Unfortunately, the release just went out last night without waiting
> > for any of these patches (or even pinging to see what their status
> > was?), so I guess we're not able to make xdg-shell stable for another
> > cycle. >:(  
> 
> Well, we can still, just that anyone wanting to implement it in
> parallel to xdg-shell unstable v5 would have to wait.
> 
> > 
> > It's either that or just merge it post-beta anyway - which I wouldn't
> > actually mind to be honest.  
> 
> That's an option too. I don't have any objections really.

I could be ok merging it before the first RC.

So are we sure enough that RC1 will give enough testing for the feature
to be carved in stone?


Thanks,
pq


pgpnBCmUYEQAU.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH] desktop-shell: Track focused shell surface by main surface

2017-07-26 Thread Quentin Glidic

On 7/26/17 12:02 PM, Philipp Kerling wrote:

The focused surface is used for determining whether shell surfaces
are activated. They should also be considered activated when a
subsurface has focus. Inserting a call to
weston_surface_get_main_surface fixes this.

seat->focused_surface is only used for shell_surface keyboard focus
tracking.


As said on IRC, added your Sob, and:
Reviewed-by: Quentin Glidic 

And pushed:
4c4b9cfb..ba8a0d04  master -> master

Thanks!


---
  desktop-shell/shell.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 832a7b74..4608cf2f 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -1852,7 +1852,7 @@ handle_keyboard_focus(struct wl_listener *listener, void 
*data)
shell_surface_lose_keyboard_focus(shsurf);
}
  
-	seat->focused_surface = keyboard->focus;

+   seat->focused_surface = 
weston_surface_get_main_surface(keyboard->focus);
  
  	if (seat->focused_surface) {

struct shell_surface *shsurf = 
get_shell_surface(seat->focused_surface);
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel




--

Quentin “Sardem FF7” Glidic
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland 2/3] scanner: Allow adding a prefix to exported symbols

2017-07-26 Thread Jonas Ådahl
On Wed, Jul 26, 2017 at 09:28:45AM +0100, Daniel Stone wrote:
> Hi,
> 
> On 25 July 2017 at 10:24, Pekka Paalanen  wrote:
> > recapping the discussion from IRC, we pretty much agreed that prefixing
> > is not a nice solution. Jonas found out that we cannot actually prefix
> > everything, because there usually are references to other protocol
> > things (like you would never want to prefix wl_surface). So it becomes
> > very hard to prefix things appropriately.
> >
> > The alternative we discussed is solving a different problem: scanner
> > makes all the public symbols in the generated .c files WL_EXPORT, which
> > makes them leak into DSO ABI, which is bad. In my opinion, it should
> > have never happened in the first place. But we missed it, and now it has
> > spread, so we cannot just fix scanner to stop exporting, the decision
> > must be with the consumers. So we need a scanner option to stop
> > exporting.
> >
> > Quentin proposed we add a scanner option
> > --visibility={static|compiler|export}. It would affect all the symbols
> > exported from the generated .c files as follows:
> >
> > - static: the symbols will be static.
> > - compiler: the symbols will get whatever the default visibility is
> >   with the compiler, i.e. not explicitly static and not exported
> > - export: the symbols are exported (this the old behaviour, and will be
> >   the default)
> >
> > Obviously, the only way to actually make use of the 'static' option is
> > for the consumer to #include the generated .c file. It's ugly, yes, but
> > it solves the conflicting symbol names issue Jonas was looking into.
> >
> > In my opinion, the prefixing approach where we still cannot prefix
> > everything in a way that one could use conflicting protocols in the
> > same compilation unit, and where e.g. the static inline functions are
> > not prefixed, is more ugly than the 'static' option.
> >
> > We are going to need an option to stop the exports anyway, and it seems
> > like we can piggyback on that solution for the problem underlying the
> > prefixing proposal as well.
> 
> This sounds really good to me.
> 
> Unfortunately, the release just went out last night without waiting
> for any of these patches (or even pinging to see what their status
> was?), so I guess we're not able to make xdg-shell stable for another
> cycle. >:(

Well, we can still, just that anyone wanting to implement it in
parallel to xdg-shell unstable v5 would have to wait.

> 
> It's either that or just merge it post-beta anyway - which I wouldn't
> actually mind to be honest.

That's an option too. I don't have any objections really.


Jonas

> 
> Cheers,
> Daniel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH] desktop-shell: Track focused shell surface by main surface

2017-07-26 Thread Philipp Kerling
The focused surface is used for determining whether shell surfaces
are activated. They should also be considered activated when a
subsurface has focus. Inserting a call to
weston_surface_get_main_surface fixes this.

seat->focused_surface is only used for shell_surface keyboard focus
tracking.
---
 desktop-shell/shell.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 832a7b74..4608cf2f 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -1852,7 +1852,7 @@ handle_keyboard_focus(struct wl_listener *listener, void 
*data)
shell_surface_lose_keyboard_focus(shsurf);
}
 
-   seat->focused_surface = keyboard->focus;
+   seat->focused_surface = 
weston_surface_get_main_surface(keyboard->focus);
 
if (seat->focused_surface) {
struct shell_surface *shsurf = 
get_shell_surface(seat->focused_surface);
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH 1/2] scanner: Add --visibility flag for setting symbol visibility

2017-07-26 Thread Pekka Paalanen
On Wed, 26 Jul 2017 15:49:57 +0800
Jonas Ådahl  wrote:

> On Tue, Jul 25, 2017 at 02:44:29PM +0300, Pekka Paalanen wrote:
> > On Tue, 25 Jul 2017 18:39:56 +0800
> > Jonas Ådahl  wrote:
> >   
> > > Add a --visibility flag that enables the user to tweak the visibility
> > > of the symbols generated by wayland-scanner. Three alternatives are
> > > exposed:
> > > 
> > > 'export': as has always been done up until now, export the symbols
> > > using WL_EXPORT, making making them exposed externally. This is the
> > > default in order to not break backward compatibility.
> > > 
> > > 'compiler-default': use whatever visibility the compiler defaults to.
> > > This is most likely the most visibility that protocol implementations
> > > or users actually wants, as it doesn't expose any unwanted
> > > implementation details.
> > > 
> > > 'static': each symbol will only be visible to the compilation unit it
> > > is included in. This means that a protocol implementations and users
> > > needs to include both the 'code' file and either the 'client-header' or
> > > 'server-header' (or both) in the source file implementing or using the
> > > protocol in question.
> > > 
> > > Using 'static' is a method to avoid situations where otherwise exposed
> > > symbols of different protocols would conflict, for example if they have
> > > the same interface name.
> > > 
> > > When no visibility is specified, 'export' is assumed, but a warning is
> > > printed to stderr, as it is unlikely that 'export' is what is actually
> > > desired.
> > > 
> > > Signed-off-by: Jonas Ådahl 
> > > ---
> > >  Makefile.am   |  10 ++---
> > >  src/scanner.c | 124 
> > > +++---
> > >  2 files changed, 114 insertions(+), 20 deletions(-)  
> > 
> > Hi Jonas,
> > 
> > thanks for writing this patch. The commit message is well written.

> > > @@ -1556,6 +1575,18 @@ emit_header(struct protocol *protocol, enum side 
> > > side)
> > >   wl_array_release();
> > >   printf("\n");
> > >  
> > > + switch (ctx->visibility) {
> > > + case VISIBILITY_EXPORT:
> > > + symbol_decl_tag = "extern ";
> > > + break;
> > > + case VISIBILITY_COMPILER_DEFAULT:
> > > + symbol_decl_tag = "";
> > > + break;
> > > + case VISIBILITY_STATIC:
> > > + symbol_decl_tag = "static ";
> > > + break;
> > > + }
> > > +
> > >   wl_list_for_each(i, >interface_list, link) {
> > >   printf("/**\n"
> > >  " * @page page_iface_%s %s\n",
> > > @@ -1575,8 +1606,9 @@ emit_header(struct protocol *protocol, enum side 
> > > side)
> > >   if (i->description && i->description->text)
> > >   format_text_to_comment(i->description->text, false);
> > >   printf(" */\n");
> > > - printf("extern const struct wl_interface "
> > > -"%s_interface;\n", i->name);
> > > + printf("%sconst struct wl_interface "
> > > +"%s_interface;\n",
> > > +symbol_decl_tag, i->name);  
> > 
> > I believe the "extern" here is correct and required in all cases, so it
> > should be left untouched. It just tells the compiler that this is not
> > the definition of the global symbol, it is just a declaration.
> > 
> > If you drop "extern", this becomes a definition filled with zeroes.
> > 
> > What I do not understand is why do I not see any compiler warnings
> > about duplicate variable definitions. When I looked through the
> > generated files, we clearly have the same static variable defined
> > multiple times in the same compilation unit - in case of the .inc file
> > even in literally the same file.  
> 
> We need to make it 'static ' when using static visibility still,
> otherwise we get a compilation error:
> 
> error: static declaration of ‘tiny_intf_obj_interface’ follows non-static 
> declaration

Argh. Ok, so static it must be for the static visibility.

> For 'compiler-default' I suppose it makes more sense to still use
> 'extern', as 'compiler-default' vs 'export' only affects how the same
> "type" of variable is made visible externally.

Yes.


Thanks,
pq


pgpQqrEVEO0YV.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] ivi-shell: Added tests for screen-remove-layer API

2017-07-26 Thread Pekka Paalanen
On Tue, 25 Jul 2017 15:59:06 +0200
Michael Teyfel  wrote:

> Two cases are tested: success and fail case of the screen-remove-layer API.
> 
> Signed-off-by: Michael Teyfel 
> ---
>  tests/ivi_layout-internal-test.c | 62 
> 
>  1 file changed, 62 insertions(+)

Hi Michael,

thanks for these, they look mostly good, just some polishing required.
Comments inline.

> 
> diff --git a/tests/ivi_layout-internal-test.c 
> b/tests/ivi_layout-internal-test.c
> index 37a2356..64380ec 100644
> --- a/tests/ivi_layout-internal-test.c
> +++ b/tests/ivi_layout-internal-test.c
> @@ -341,6 +341,66 @@ test_layer_source_rectangle(struct test_context *ctx)
>  }
>  
>  static void
> +test_screen_remove_layer(struct test_context *ctx)
> +{
> + const struct ivi_layout_interface *lyt = ctx->layout_interface;
> + struct ivi_layout_layer *ivilayer;
> + struct weston_output *output;
> + struct ivi_layout_layer **array;
> + int32_t length = 0;
> +
> + ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 
> 300);
> + iassert(ivilayer != NULL);
> +
> + if (wl_list_empty(>compositor->output_list))
> + return;

This leaks the ivilayer, possibly affecting also further tests. Move
the check before the layer creation.

> +
> + output = wl_container_of(ctx->compositor->output_list.next, output, 
> link);
> +
> + iassert(lyt->screen_add_layer(output, ivilayer) == IVI_SUCCEEDED);
> + lyt->commit_changes();
> +
> + iassert(lyt->get_layers_on_screen(output, , ) == 
> IVI_SUCCEEDED);
> + iassert(length == 1);
> + iassert(array[0] == ivilayer);
> +
> + iassert(lyt->screen_remove_layer(output ,ivilayer) == IVI_SUCCEEDED);

Space on the wrong side of comma.

> + lyt->commit_changes();
> +

'array' gets leaked.

> + iassert(lyt->get_layers_on_screen(output, , ) == 
> IVI_SUCCEEDED);
> + iassert(length == 0);

'array' would get leaked if there were any layers, but since we fail
the test in that case, it doesn't matter.

> +
> + lyt->layer_destroy(ivilayer);
> +}
> +
> +static void
> +test_screen_bad_remove_layer(struct test_context *ctx)
> +{
> + const struct ivi_layout_interface *lyt = ctx->layout_interface;
> + struct ivi_layout_layer *ivilayer;
> + struct weston_output *output;
> +
> + ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 
> 300);
> + iassert(ivilayer != NULL);
> +
> + if (wl_list_empty(>compositor->output_list))
> + return;

The same leak of ivilayer as before.

> +
> + output = wl_container_of(ctx->compositor->output_list.next, output, 
> link);
> +
> + iassert(lyt->screen_remove_layer(NULL, ivilayer) == IVI_FAILED);
> + lyt->commit_changes();
> +
> + iassert(lyt->screen_remove_layer(output, NULL) == IVI_FAILED);
> + lyt->commit_changes();
> +
> + iassert(lyt->screen_remove_layer(NULL, NULL) == IVI_FAILED);
> + lyt->commit_changes();
> +
> + lyt->layer_destroy(ivilayer);
> +}
> +
> +static void
>  test_layer_bad_remove(struct test_context *ctx)
>  {
>   const struct ivi_layout_interface *lyt = ctx->layout_interface;
> @@ -951,6 +1011,8 @@ run_internal_tests(void *data)
>   test_layer_position(ctx);
>   test_layer_destination_rectangle(ctx);
>   test_layer_source_rectangle(ctx);
> + test_screen_remove_layer(ctx);
> + test_screen_bad_remove_layer(ctx);

These two would be better grouped with the other screen tests, I think.

>   test_layer_bad_remove(ctx);
>   test_layer_bad_visibility(ctx);
>   test_layer_bad_opacity(ctx);


Thanks,
pq


pgpjuuuLU6znk.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland 2/3] scanner: Allow adding a prefix to exported symbols

2017-07-26 Thread Daniel Stone
Hi,

On 25 July 2017 at 10:24, Pekka Paalanen  wrote:
> recapping the discussion from IRC, we pretty much agreed that prefixing
> is not a nice solution. Jonas found out that we cannot actually prefix
> everything, because there usually are references to other protocol
> things (like you would never want to prefix wl_surface). So it becomes
> very hard to prefix things appropriately.
>
> The alternative we discussed is solving a different problem: scanner
> makes all the public symbols in the generated .c files WL_EXPORT, which
> makes them leak into DSO ABI, which is bad. In my opinion, it should
> have never happened in the first place. But we missed it, and now it has
> spread, so we cannot just fix scanner to stop exporting, the decision
> must be with the consumers. So we need a scanner option to stop
> exporting.
>
> Quentin proposed we add a scanner option
> --visibility={static|compiler|export}. It would affect all the symbols
> exported from the generated .c files as follows:
>
> - static: the symbols will be static.
> - compiler: the symbols will get whatever the default visibility is
>   with the compiler, i.e. not explicitly static and not exported
> - export: the symbols are exported (this the old behaviour, and will be
>   the default)
>
> Obviously, the only way to actually make use of the 'static' option is
> for the consumer to #include the generated .c file. It's ugly, yes, but
> it solves the conflicting symbol names issue Jonas was looking into.
>
> In my opinion, the prefixing approach where we still cannot prefix
> everything in a way that one could use conflicting protocols in the
> same compilation unit, and where e.g. the static inline functions are
> not prefixed, is more ugly than the 'static' option.
>
> We are going to need an option to stop the exports anyway, and it seems
> like we can piggyback on that solution for the problem underlying the
> prefixing proposal as well.

This sounds really good to me.

Unfortunately, the release just went out last night without waiting
for any of these patches (or even pinging to see what their status
was?), so I guess we're not able to make xdg-shell stable for another
cycle. >:(

It's either that or just merge it post-beta anyway - which I wouldn't
actually mind to be honest.

Cheers,
Daniel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH wayland v2 1/4] scanner: Add --visibility flag for setting symbol visibility

2017-07-26 Thread Jonas Ådahl
Add a --visibility flag that enables the user to tweak the visibility
of the symbols generated by wayland-scanner. Three alternatives are
exposed:

'export': as has always been done up until now, export the symbols
using WL_EXPORT, making making them exposed externally. This is the
default in order to not break backward compatibility.

'compiler-default': use whatever visibility the compiler defaults to.
This is most likely the most visibility that protocol implementations
or users actually wants, as it doesn't expose any unwanted
implementation details.

'static': each symbol will only be visible to the compilation unit it
is included in. This means that a protocol implementations and users
needs to include both the 'code' file and either the 'client-header' or
'server-header' (or both) in the source file implementing or using the
protocol in question.

Using 'static' is a method to avoid situations where otherwise exposed
symbols of different protocols would conflict, for example if they have
the same interface name.

When no visibility is specified, 'export' is assumed, but a warning is
printed to stderr, as it is unlikely that 'export' is what is actually
desired.

Signed-off-by: Jonas Ådahl 
---

Changes since v1:

- Use 'extern' tag also for compiler default declarations.

- "see --help" message to the warning

- Added 'what visibility to choose' kind of documentation to --help


 Makefile.am   |  10 ++---
 src/scanner.c | 135 +++---
 2 files changed, 125 insertions(+), 20 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index d0c8bd3..d570525 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -97,19 +97,19 @@ nodist_libwayland_client_la_SOURCES =   \
 pkgconfig_DATA += src/wayland-client.pc src/wayland-server.pc
 
 protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
-   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
+   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -Vexport code < 
$< > $@
 
 protocol/%-server-protocol.h : $(top_srcdir)/protocol/%.xml
-   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < 
$< > $@
+   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -Vexport 
server-header < $< > $@
 
 protocol/%-client-protocol.h : $(top_srcdir)/protocol/%.xml
-   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < 
$< > $@
+   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -Vexport 
client-header < $< > $@
 
 protocol/%-server-protocol-core.h : $(top_srcdir)/protocol/%.xml
-   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header -c 
< $< > $@
+   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -Vexport 
server-header -c < $< > $@
 
 protocol/%-client-protocol-core.h : $(top_srcdir)/protocol/%.xml
-   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header -c 
< $< > $@
+   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -Vexport 
client-header -c < $< > $@
 
 BUILT_SOURCES =\
$(nodist_libwayland_server_la_SOURCES)  \
diff --git a/src/scanner.c b/src/scanner.c
index 517068c..3e43f90 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -57,6 +57,12 @@ enum side {
SERVER,
 };
 
+enum visibility {
+   VISIBILITY_EXPORT,
+   VISIBILITY_COMPILER_DEFAULT,
+   VISIBILITY_STATIC
+};
+
 static int
 usage(int ret)
 {
@@ -72,7 +78,30 @@ usage(int ret)
" the scanner was built 
against.\n"
"-c,  --include-core-only include the core 
version of the headers,\n"
" that is e.g. 
wayland-client-core.h instead\n"
-   " of 
wayland-client.h.\n");
+   " of 
wayland-client.h.\n"
+   "-V,  
--visibility=[export|compiler-default|static]\n"
+   " select what type of 
visibility protocol\n"
+   " symbols should have. 
'export' will cause the\n"
+   " symbols to be 
exported, 'compiler-default'\n"
+   " will use the compiler 
default (often visible\n"
+   " only within the same 
DSO), 'static' will make\n"
+   " all symbols static 
(note that the file\n"
+   " generated with 'code' 
must be included in the\n"
+   " same file as the 
symbols are used\n"
+   "\n"
+   " When in 

[PATCH wayland v2 2/4] tests: Test static symbol visibility

2017-07-26 Thread Jonas Ådahl
Test that it is possible to inline the protocol 'code' file generated
by wayland-scanner in the source code files using it.

Signed-off-by: Jonas Ådahl 
---

Changes since v1: none.


 .gitignore|   5 ++
 Makefile.am   |  32 -
 tests/data/tiny.xml   |  38 ++
 tests/static-symbol-test-client.c |  78 
 tests/static-symbol-test-server.c | 147 ++
 5 files changed, 297 insertions(+), 3 deletions(-)
 create mode 100644 tests/data/tiny.xml
 create mode 100644 tests/static-symbol-test-client.c
 create mode 100644 tests/static-symbol-test-server.c

diff --git a/.gitignore b/.gitignore
index 8da9861..553ffd0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,3 +45,8 @@ exec-fd-leak-checker
 fixed-benchmark
 /wayland-scanner
 protocol/*.[ch]
+static-tiny-protocol.inc
+static-tiny-server-protocol-core.h
+static-tiny-client-protocol-core.h
+static-symbol-test-server
+static-symbol-test-client
diff --git a/Makefile.am b/Makefile.am
index d570525..bbd5107 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -114,7 +114,10 @@ protocol/%-client-protocol-core.h : 
$(top_srcdir)/protocol/%.xml
 BUILT_SOURCES =\
$(nodist_libwayland_server_la_SOURCES)  \
$(nodist_libwayland_client_la_SOURCES)  \
-   $(nodist_headers_test_SOURCES)
+   $(nodist_headers_test_SOURCES)  \
+   $(nodist_static_symbol_test_server_SOURCES) \
+   $(nodist_static_symbol_test_client_SOURCES) \
+   static-tiny-protocol.inc
 
 CLEANFILES = $(BUILT_SOURCES) doc/doxygen/doxygen_sqlite3.db
 DISTCLEANFILES = src/wayland-version.h
@@ -164,7 +167,11 @@ built_test_programs =  \
message-test\
headers-test\
compositor-introspection-test   \
-   protocol-logger-test
+   protocol-logger-test\
+   static-symbol-test-server
+
+built_test_program_helpers =   \
+   static-symbol-test-client
 
 if ENABLE_CPP_TEST
 built_test_programs += cpp-compile-test
@@ -172,6 +179,7 @@ endif
 
 AM_TESTS_ENVIRONMENT = \
export WAYLAND_SCANNER='$(top_builddir)/wayland-scanner'\
+   export TOP_BUILDDIR='$(top_builddir)'   \
TEST_DATA_DIR='$(top_srcdir)/tests/data'\
TEST_OUTPUT_DIR='$(top_builddir)/tests/output'  \
SED=$(SED)  \
@@ -182,6 +190,7 @@ TESTS = $(built_test_programs)  \
 
 noinst_PROGRAMS =  \
$(built_test_programs)  \
+   $(built_test_program_helpers)   \
exec-fd-leak-checker\
fixed-benchmark
 
@@ -200,6 +209,14 @@ libtest_runner_la_LIBADD = \
libwayland-server.la\
-lrt -ldl $(FFI_LIBS)
 
+static-tiny-protocol.inc : tests/data/tiny.xml
+   $(AM_V_GEN)$(wayland_scanner) -c -Vstatic code $< $@
+
+static-tiny-server-protocol-core.h : tests/data/tiny.xml
+   $(AM_V_GEN)$(wayland_scanner) -c -Vstatic server-header $< $@
+
+static-tiny-client-protocol-core.h : tests/data/tiny.xml
+   $(AM_V_GEN)$(wayland_scanner) -c -Vstatic client-header $< $@
 
 array_test_SOURCES = tests/array-test.c
 array_test_LDADD = libtest-runner.la
@@ -245,6 +262,14 @@ headers_test_LDADD = libtest-runner.la
 nodist_headers_test_SOURCES =  \
protocol/wayland-server-protocol-core.h \
protocol/wayland-client-protocol-core.h
+static_symbol_test_server_SOURCES = tests/static-symbol-test-server.c
+nodist_static_symbol_test_server_SOURCES = \
+   static-tiny-server-protocol-core.h
+static_symbol_test_server_LDADD = libtest-runner.la
+static_symbol_test_client_SOURCES = tests/static-symbol-test-client.c
+nodist_static_symbol_test_client_SOURCES = \
+   static-tiny-client-protocol-core.h
+static_symbol_test_client_LDADD = libtest-runner.la
 
 if ENABLE_CPP_TEST
 cpp_compile_test_SOURCES = tests/cpp-compile-test.cpp
@@ -270,7 +295,8 @@ EXTRA_DIST += tests/scanner-test.sh \
tests/data/small-server.h   \
tests/data/small-code-core.c\
tests/data/small-client-core.h  \
-   tests/data/small-server-core.h
+   tests/data/small-server-core.h  \
+   tests/data/tiny.xml
 
 tests/scanner-test.sh: $(top_builddir)/wayland-scanner
 
diff --git a/tests/data/tiny.xml b/tests/data/tiny.xml
new file mode 100644
index 000..0b8cdde
--- /dev/null
+++ b/tests/data/tiny.xml
@@ -0,0 +1,38 @@
+
+
+
+  
+Copyright © 2017 Red Hat Inc.
+
+Permission is hereby granted, free of charge, to any person

[PATCH wayland v2 4/4] tests/scanner-test: Add tests for visibility

2017-07-26 Thread Jonas Ådahl
Signed-off-by: Jonas Ådahl 
---
 tests/data/noexport-small-client-core.h | 195 
 tests/data/noexport-small-code-core.c   |  61 ++
 tests/data/noexport-small-server-core.h | 154 +
 tests/data/static-small-client-core.h   | 195 
 tests/data/static-small-code-core.c |  61 ++
 tests/data/static-small-server-core.h   | 154 +
 tests/scanner-test.sh   |  12 ++
 7 files changed, 832 insertions(+)
 create mode 100644 tests/data/noexport-small-client-core.h
 create mode 100644 tests/data/noexport-small-code-core.c
 create mode 100644 tests/data/noexport-small-server-core.h
 create mode 100644 tests/data/static-small-client-core.h
 create mode 100644 tests/data/static-small-code-core.c
 create mode 100644 tests/data/static-small-server-core.h

diff --git a/tests/data/noexport-small-client-core.h 
b/tests/data/noexport-small-client-core.h
new file mode 100644
index 000..c85cca6
--- /dev/null
+++ b/tests/data/noexport-small-client-core.h
@@ -0,0 +1,195 @@
+/* SCANNER TEST */
+
+#ifndef SMALL_TEST_CLIENT_PROTOCOL_H
+#define SMALL_TEST_CLIENT_PROTOCOL_H
+
+#include 
+#include 
+#include "wayland-client-core.h"
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_small_test The small_test protocol
+ * @section page_ifaces_small_test Interfaces
+ * - @subpage page_iface_intf_A - the thing A
+ * @section page_copyright_small_test Copyright
+ * 
+ *
+ * Copyright © 2016 Collabora, Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ * 
+ */
+struct another_intf;
+struct intf_A;
+struct intf_not_here;
+
+/**
+ * @page page_iface_intf_A intf_A
+ * @section page_iface_intf_A_desc Description
+ *
+ * A useless example trying to tickle the scanner.
+ * @section page_iface_intf_A_api API
+ * See @ref iface_intf_A.
+ */
+/**
+ * @defgroup iface_intf_A The intf_A interface
+ *
+ * A useless example trying to tickle the scanner.
+ */
+extern const struct wl_interface intf_A_interface;
+
+#ifndef INTF_A_FOO_ENUM
+#define INTF_A_FOO_ENUM
+enum intf_A_foo {
+   /**
+* this is the first
+*/
+   INTF_A_FOO_FIRST = 0,
+   /**
+* this is the second
+*/
+   INTF_A_FOO_SECOND = 1,
+   /**
+* this is the third
+* @since 2
+*/
+   INTF_A_FOO_THIRD = 2,
+};
+/**
+ * @ingroup iface_intf_A
+ */
+#define INTF_A_FOO_THIRD_SINCE_VERSION 2
+#endif /* INTF_A_FOO_ENUM */
+
+/**
+ * @ingroup iface_intf_A
+ * @struct intf_A_listener
+ */
+struct intf_A_listener {
+   /**
+*/
+   void (*hey)(void *data,
+   struct intf_A *intf_A);
+};
+
+/**
+ * @ingroup iface_intf_A
+ */
+static inline int
+intf_A_add_listener(struct intf_A *intf_A,
+   const struct intf_A_listener *listener, void *data)
+{
+   return wl_proxy_add_listener((struct wl_proxy *) intf_A,
+(void (**)(void)) listener, data);
+}
+
+#define INTF_A_RQ1 0
+#define INTF_A_RQ2 1
+#define INTF_A_DESTROY 2
+
+/**
+ * @ingroup iface_intf_A
+ */
+#define INTF_A_HEY_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_intf_A
+ */
+#define INTF_A_RQ1_SINCE_VERSION 1
+/**
+ * @ingroup iface_intf_A
+ */
+#define INTF_A_RQ2_SINCE_VERSION 1
+/**
+ * @ingroup iface_intf_A
+ */
+#define INTF_A_DESTROY_SINCE_VERSION 1
+
+/** @ingroup iface_intf_A */
+static inline void
+intf_A_set_user_data(struct intf_A *intf_A, void *user_data)
+{
+   wl_proxy_set_user_data((struct wl_proxy *) intf_A, user_data);
+}
+
+/** @ingroup iface_intf_A */
+static inline void *
+intf_A_get_user_data(struct intf_A *intf_A)
+{
+   return wl_proxy_get_user_data((struct wl_proxy *) intf_A);
+}
+
+static inline uint32_t
+intf_A_get_version(struct intf_A *intf_A)
+{
+   return wl_proxy_get_version((struct wl_proxy *) intf_A);

[PATCH wayland v2 3/4] tests: Test compiler-default symbol visibility

2017-07-26 Thread Jonas Ådahl
Test that it is possible to not export protocol symbols.

Signed-off-by: Jonas Ådahl 
---
 .gitignore  |   5 ++
 Makefile.am |  27 ++-
 tests/noexport-symbol-test-client.c |  77 +++
 tests/noexport-symbol-test-server.c | 146 
 4 files changed, 253 insertions(+), 2 deletions(-)
 create mode 100644 tests/noexport-symbol-test-client.c
 create mode 100644 tests/noexport-symbol-test-server.c

diff --git a/.gitignore b/.gitignore
index 553ffd0..e61d193 100644
--- a/.gitignore
+++ b/.gitignore
@@ -50,3 +50,8 @@ static-tiny-server-protocol-core.h
 static-tiny-client-protocol-core.h
 static-symbol-test-server
 static-symbol-test-client
+noexport-tiny-protocol.c
+noexport-tiny-server-protocol-core.h
+noexport-tiny-client-protocol-core.h
+noexport-symbol-test-server
+noexport-symbol-test-client
diff --git a/Makefile.am b/Makefile.am
index bbd5107..40f73d6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -117,6 +117,8 @@ BUILT_SOURCES = \
$(nodist_headers_test_SOURCES)  \
$(nodist_static_symbol_test_server_SOURCES) \
$(nodist_static_symbol_test_client_SOURCES) \
+   $(nodist_noexport_symbol_test_server_SOURCES)   \
+   $(nodist_noexport_symbol_test_client_SOURCES)   \
static-tiny-protocol.inc
 
 CLEANFILES = $(BUILT_SOURCES) doc/doxygen/doxygen_sqlite3.db
@@ -168,10 +170,12 @@ built_test_programs = \
headers-test\
compositor-introspection-test   \
protocol-logger-test\
-   static-symbol-test-server
+   static-symbol-test-server   \
+   noexport-symbol-test-server
 
 built_test_program_helpers =   \
-   static-symbol-test-client
+   static-symbol-test-client   \
+   noexport-symbol-test-client
 
 if ENABLE_CPP_TEST
 built_test_programs += cpp-compile-test
@@ -218,6 +222,15 @@ static-tiny-server-protocol-core.h : tests/data/tiny.xml
 static-tiny-client-protocol-core.h : tests/data/tiny.xml
$(AM_V_GEN)$(wayland_scanner) -c -Vstatic client-header $< $@
 
+noexport-tiny-protocol.c : tests/data/tiny.xml
+   $(AM_V_GEN)$(wayland_scanner) -c -Vcompiler-default code $< $@
+
+noexport-tiny-server-protocol-core.h : tests/data/tiny.xml
+   $(AM_V_GEN)$(wayland_scanner) -c -Vcompiler-default server-header $< $@
+
+noexport-tiny-client-protocol-core.h : tests/data/tiny.xml
+   $(AM_V_GEN)$(wayland_scanner) -c -Vcompiler-default client-header $< $@
+
 array_test_SOURCES = tests/array-test.c
 array_test_LDADD = libtest-runner.la
 client_test_SOURCES = tests/client-test.c
@@ -270,6 +283,16 @@ static_symbol_test_client_SOURCES = 
tests/static-symbol-test-client.c
 nodist_static_symbol_test_client_SOURCES = \
static-tiny-client-protocol-core.h
 static_symbol_test_client_LDADD = libtest-runner.la
+noexport_symbol_test_server_SOURCES = tests/noexport-symbol-test-server.c
+nodist_noexport_symbol_test_server_SOURCES = \
+   noexport-tiny-protocol.c \
+   noexport-tiny-server-protocol-core.h
+noexport_symbol_test_server_LDADD = libtest-runner.la
+noexport_symbol_test_client_SOURCES = tests/noexport-symbol-test-client.c
+nodist_noexport_symbol_test_client_SOURCES = \
+   noexport-tiny-protocol.c \
+   noexport-tiny-client-protocol-core.h
+noexport_symbol_test_client_LDADD = libtest-runner.la
 
 if ENABLE_CPP_TEST
 cpp_compile_test_SOURCES = tests/cpp-compile-test.cpp
diff --git a/tests/noexport-symbol-test-client.c 
b/tests/noexport-symbol-test-client.c
new file mode 100644
index 000..11e02b9
--- /dev/null
+++ b/tests/noexport-symbol-test-client.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright © 2017 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ 

[PATCH v5] Add xdg-output protocol

2017-07-26 Thread Olivier Fourdan
This protocol aims at describing outputs in way which is more in line
with the concept of an output on desktop oriented systems.

Some information are more specific to the concept of an output for a
desktop oriented system and may not make sense in other applications,
such as IVI systems for example.

The goal is to gradually move the desktop specific concepts out of the
core wl_output protocol.

For now it just features the position and logical size which describe
the output position and size in the global compositor space.

Signed-off-by: Olivier Fourdan 
Reviewed-by: Jonas Ådahl 
Reviewed-by: Pekka Paalanen 
---
 v2: use "destroy" instead of "release" for destructor
 v3: adopt a more conventional global factory interface with a
 get_xdg_output() method, add some clarification and example.
 v4: Rebase on current master
 Add major version in interface name as per Pekka's review
 Add that objects already created are not affected by the manager
 destroy method.
 Remove the word "mode" from argument summary for logical_size as
 per Pekka's review
 Add A-b Pekka and R-b Jonas following their respective feedback.
 v5: Forgot to update the interface name in the get_xdg_output argument.
 Upgrade Pekka's Acked-by to a Review-by as per his comment.
 (Resending this v5 to make sure the last changes don't get lost)

 Makefile.am|   1 +
 unstable/xdg-output/README |   4 +
 unstable/xdg-output/xdg-output-unstable-v1.xml | 162 +
 3 files changed, 167 insertions(+)
 create mode 100644 unstable/xdg-output/README
 create mode 100644 unstable/xdg-output/xdg-output-unstable-v1.xml

diff --git a/Makefile.am b/Makefile.am
index d100c13..5b5ae96 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,6 +14,7 @@ unstable_protocols =  
\
unstable/idle-inhibit/idle-inhibit-unstable-v1.xml  
\
unstable/xwayland-keyboard-grab/xwayland-keyboard-grab-unstable-v1.xml  
\

unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml \
+   unstable/xdg-output/xdg-output-unstable-v1.xml  
\
$(NULL)
 
 stable_protocols = 
\
diff --git a/unstable/xdg-output/README b/unstable/xdg-output/README
new file mode 100644
index 000..e42b711
--- /dev/null
+++ b/unstable/xdg-output/README
@@ -0,0 +1,4 @@
+xdg_output protocol
+
+Maintainers:
+Olivier Fourdan 
diff --git a/unstable/xdg-output/xdg-output-unstable-v1.xml 
b/unstable/xdg-output/xdg-output-unstable-v1.xml
new file mode 100644
index 000..ef22806
--- /dev/null
+++ b/unstable/xdg-output/xdg-output-unstable-v1.xml
@@ -0,0 +1,162 @@
+
+
+
+  
+Copyright © 2017 Red Hat Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+  
+
+  
+This protocol aims at describing outputs in a way which is more in line
+with the concept of an output on desktop oriented systems.
+
+Some information are more specific to the concept of an output for
+a desktop oriented system and may not make sense in other applications,
+such as IVI systems for example.
+
+Typically, the global compositor space on a desktop system is made of
+a contiguous or overlapping set of rectangular regions.
+
+Some of the information provided in this protocol might be identical
+to their counterparts already available from wl_output, in which case
+the information provided by this protocol should be preferred to their
+equivalent in wl_output. The goal is to move the desktop specific
+concepts (such as output location within the global compositor space,
+the connector name and types, etc.) out of 

Re: [PATCH 1/2] scanner: Add --visibility flag for setting symbol visibility

2017-07-26 Thread Jonas Ådahl
On Tue, Jul 25, 2017 at 02:44:29PM +0300, Pekka Paalanen wrote:
> On Tue, 25 Jul 2017 18:39:56 +0800
> Jonas Ådahl  wrote:
> 
> > Add a --visibility flag that enables the user to tweak the visibility
> > of the symbols generated by wayland-scanner. Three alternatives are
> > exposed:
> > 
> > 'export': as has always been done up until now, export the symbols
> > using WL_EXPORT, making making them exposed externally. This is the
> > default in order to not break backward compatibility.
> > 
> > 'compiler-default': use whatever visibility the compiler defaults to.
> > This is most likely the most visibility that protocol implementations
> > or users actually wants, as it doesn't expose any unwanted
> > implementation details.
> > 
> > 'static': each symbol will only be visible to the compilation unit it
> > is included in. This means that a protocol implementations and users
> > needs to include both the 'code' file and either the 'client-header' or
> > 'server-header' (or both) in the source file implementing or using the
> > protocol in question.
> > 
> > Using 'static' is a method to avoid situations where otherwise exposed
> > symbols of different protocols would conflict, for example if they have
> > the same interface name.
> > 
> > When no visibility is specified, 'export' is assumed, but a warning is
> > printed to stderr, as it is unlikely that 'export' is what is actually
> > desired.
> > 
> > Signed-off-by: Jonas Ådahl 
> > ---
> >  Makefile.am   |  10 ++---
> >  src/scanner.c | 124 
> > +++---
> >  2 files changed, 114 insertions(+), 20 deletions(-)
> 
> Hi Jonas,
> 
> thanks for writing this patch. The commit message is well written.
> 
> I wonder where we could write down the guidelines on what visiblity to
> prefer:
> 
> - always go for 'compiler-default' unless...
> 
> - you already exported the symbols previously and cannot stop exporting
>   them so choose 'export' to stop the warnings, or
> 
> - you have to support protocols with conflicting symbol names and you
>   have no choice but to use 'static' with the caveat it implies.
> 
> Maybe this could be a new paragraph in usage()?

I don't see why not.

> 
> > 
> > diff --git a/Makefile.am b/Makefile.am
> > index d0c8bd3..d570525 100644
> > --- a/Makefile.am
> > +++ b/Makefile.am
> > @@ -97,19 +97,19 @@ nodist_libwayland_client_la_SOURCES =   \
> >  pkgconfig_DATA += src/wayland-client.pc src/wayland-server.pc
> >  
> >  protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
> > -   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
> > +   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -Vexport code < 
> > $< > $@
> >  
> >  protocol/%-server-protocol.h : $(top_srcdir)/protocol/%.xml
> > -   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < 
> > $< > $@
> > +   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -Vexport 
> > server-header < $< > $@
> >  
> >  protocol/%-client-protocol.h : $(top_srcdir)/protocol/%.xml
> > -   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < 
> > $< > $@
> > +   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -Vexport 
> > client-header < $< > $@
> >  
> >  protocol/%-server-protocol-core.h : $(top_srcdir)/protocol/%.xml
> > -   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header -c 
> > < $< > $@
> > +   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -Vexport 
> > server-header -c < $< > $@
> >  
> >  protocol/%-client-protocol-core.h : $(top_srcdir)/protocol/%.xml
> > -   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header -c 
> > < $< > $@
> > +   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -Vexport 
> > client-header -c < $< > $@
> >  
> >  BUILT_SOURCES =\
> > $(nodist_libwayland_server_la_SOURCES)  \
> > diff --git a/src/scanner.c b/src/scanner.c
> > index 517068c..d9152e3 100644
> > --- a/src/scanner.c
> > +++ b/src/scanner.c
> > @@ -57,6 +57,12 @@ enum side {
> > SERVER,
> >  };
> >  
> > +enum visibility {
> > +   VISIBILITY_EXPORT,
> > +   VISIBILITY_COMPILER_DEFAULT,
> > +   VISIBILITY_STATIC
> > +};
> > +
> >  static int
> >  usage(int ret)
> >  {
> > @@ -72,7 +78,16 @@ usage(int ret)
> > " the scanner was built 
> > against.\n"
> > "-c,  --include-core-only include the core 
> > version of the headers,\n"
> > " that is e.g. 
> > wayland-client-core.h instead\n"
> > -   " of 
> > wayland-client.h.\n");
> > +   " of 
> > wayland-client.h.\n"
> > +   "-V,  
> > --visibility=[export|compiler-default|static]\n"
> > +   " select what type of 
> >