summaryrefslogtreecommitdiffstats
path: root/meta-ivi-common/recipes-graphics/wayland/wayland-ivi-extension/apply_weston-1.5.x.patch
.highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# Biuld of aribrator

## 1. Overview

This document describes build of Rule Based Arbitrator

## 2. Directory structure and library

|Path|Contents|
|:---|:---|
| rba/include/ | header files  |
| rba/src/ | source code files |
| rba/lib/ | libraries |
| rba/lib/librba.a | Arbitrator staticl lib<br>(on Linux) |
| rba/lib/librba.so | Arbitrator shared lib<br>(on Linux) |
| rba/lib/rba.dll | Arbitrator DLL<br>(on Windows) |
| rba/unittest/ | for unit test |
| rba/doc/ | Documents |
| rba/script/ | include script file |
| rba/script/make_dll_x64.bat | for creation of DLL |


## 3. Build step

### 3-1. Linux 

#### 3-1-1. Environment

* OS
  - Ubuntu 16.04
  - Ubuntu 18.04
  - Windows Subsystem for Linux (Ubuntu 16.04.5 LTS)
* Development env.
  - g++ 5.4.0
  - make 4.1
  - CMake 3.5.1

#### 3-1-2. Build

```
$ cd rba
$ mkdir build
$ cd build
$ cmake ..
$ make
$ ls -F ../lib
librba.a    librba.so
```
If build will be succeed,you can get **librba.a** and **librba.so**.

### 3-2. Windows

#### 3-2-1. Environment

* OS
  - Microsoft Windows 7 Professional 64bit
  - Microsoft Windows 10 Pro 64bit
* Development Env
  - Visual Studio Professional 2017
    - Desktop for C++
      - include Visual C++ tool of CMake

#### 3-2-2. Build

Execute command prompt for VS 2017, then executer bat file like below.

```
> cd rba
> script¥make_dll_x64.bat
> dir lib /w
[.]      
From fb66405f4f8ee200a443e22d3b4f56a0e917f785 Mon Sep 17 00:00:00 2001
From: Manuel Bachmann <mbc@iot.bzh>
Date: Wed, 30 Sep 2015 05:22:25 +0200
Subject: [PATCH] Backport to Wayland/Weston 1.9.0 > 1.5.0.

Downgrade requirements to Wayland/Weston 1.9.0 > 1.5.0.

"wl_display_roundtrip_queue()" did not exist at the time,
so just use the wrapper functions instead.

Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
---
 .../ilmClient/src/ilm_client_wayland_platform.c    | 15 ++-----
 .../ilmControl/src/ilm_control_wayland_platform.c  | 52 +++++++++++++++++++---
 protocol/CMakeLists.txt                            |  4 +-
 weston-ivi-shell/CMakeLists.txt                    |  4 +-
 4 files changed, 53 insertions(+), 22 deletions(-)

diff --git a/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c b/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c
index 55b1621..8730616 100644
--- a/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c
+++ b/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c
@@ -61,7 +61,6 @@ struct ilm_client_context {
     struct wl_registry *registry;
     struct wl_compositor *compositor;
     struct ivi_application *ivi_application;
-    struct wl_event_queue *queue;
 
     struct wl_list list_surface;
 
@@ -167,12 +166,6 @@ destroy_client_resouses(void)
         ctx->ivi_application = NULL;
     }
 
-    if (ctx->queue)
-    {
-        wl_event_queue_destroy(ctx->queue);
-        ctx->queue = NULL;
-    }
-
     if (ctx->registry)
     {
         wl_registry_destroy(ctx->registry);
@@ -203,21 +196,19 @@ init_client(void)
 
     wl_list_init(&ctx->list_surface);
 
-    ctx->queue = wl_display_create_queue(ctx->display);
     ctx->registry = wl_display_get_registry(ctx->display);
     if (ctx->registry == NULL) {
-        wl_event_queue_destroy(ctx->queue);
         fprintf(stderr, "Failed to get registry\n");
         return;
     }
 
-    wl_proxy_set_queue((void*)ctx->registry, ctx->queue);
     if (wl_registry_add_listener(ctx->registry,
                              &registry_client_listener, ctx)) {
         fprintf(stderr, "Failed to add registry listener\n");
         return;
     }
-    wl_display_roundtrip_queue(ctx->display, ctx->queue);
+    wl_display_dispatch(ctx->display);
+    wl_display_roundtrip(ctx->display);
 
     if ((ctx->display == NULL) || (ctx->ivi_application == NULL)) {
         fprintf(stderr, "Failed to connect display at ilm_client\n");
@@ -239,7 +230,7 @@ get_client_instance(void)
         exit(0);
     }
 
-    wl_display_roundtrip_queue(ctx->display, ctx->queue);
+    wl_display_roundtrip(ctx->display);
 
     return ctx;
 }
diff --git a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c
index 8910df5..61bdfc5 100644
--- a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c
+++ b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c
@@ -76,6 +76,46 @@ struct screen_context {
     struct ilm_control_context *ctx;
 };
 
+static void roundtrip_done(void *data, struct wl_callback *callback,
+                           uint32_t serial)
+{
+    (void) serial;
+
+    *(int *)data = 1;
+
+    wl_callback_destroy(callback);
+}
+
+static struct wl_callback_listener roundtrip_listener = {roundtrip_done};
+
+int display_roundtrip_queue(struct wl_display *display,
+                            struct wl_event_queue *queue)
+{
+    int done = 0;
+    int ret = 0;
+    struct wl_callback *callback = wl_display_sync(display);
+
+    if (! callback)
+    {
+        return -1;
+    }
+
+    wl_proxy_set_queue((void *)callback, queue);
+    wl_callback_add_listener(callback, &roundtrip_listener, &done);
+
+    while (ret != -1 && !done)
+    {
+        ret = wl_display_dispatch_queue(display, queue);
+    }
+
+    if (ret == -1 && !done)
+    {
+        wl_callback_destroy(callback);
+    }
+
+    return ret;
+}
+
 static inline void lock_context(struct ilm_control_context *ctx)
 {
    pthread_mutex_lock(&ctx->mutex);
@@ -1304,11 +1344,11 @@ init_control(void)
 
     if (
        // first level objects; ivi_controller
-       wl_display_roundtrip_queue(wl->display, wl->queue) == -1 ||
+       display_roundtrip_queue(wl->display, wl->queue) == -1 ||
        // second level object: ivi_controller_surfaces/layers
-       wl_display_roundtrip_queue(wl->display, wl->queue) == -1 ||
+       display_roundtrip_queue(wl->display, wl->queue) == -1 ||
        // third level objects: ivi_controller_surfaces/layers properties
-       wl_display_roundtrip_queue(wl->display, wl->queue) == -1)
+       display_roundtrip_queue(wl->display, wl->queue) == -1)
     {
         fprintf(stderr, "Failed to initialize wayland connection: %s\n", strerror(errno));
         return -1;
@@ -1349,7 +1389,7 @@ ilmErrorTypes impl_sync_and_acquire_instance(struct ilm_control_context *ctx)
 
     lock_context(ctx);
 
-    if (wl_display_roundtrip_queue(ctx->wl.display, ctx->wl.queue) == -1) {
+    if (display_roundtrip_queue(ctx->wl.display, ctx->wl.queue) == -1) {
         int err = wl_display_get_error(ctx->wl.display);
         fprintf(stderr, "Error communicating with wayland: %s\n", strerror(err));
         unlock_context(ctx);
@@ -2454,7 +2494,7 @@ ilm_getPropertiesOfSurface(t_ilm_uint surfaceID,
             // request statistics for surface
             ivi_controller_surface_send_stats(ctx_surf->controller);
             // force submission
-            int ret = wl_display_roundtrip_queue(ctx->wl.display, ctx->wl.queue);
+            int ret = display_roundtrip_queue(ctx->wl.display, ctx->wl.queue);
 
             // If we got an error here, there is really no sense
             // in returning the properties as something is fundamentally
@@ -2567,7 +2607,7 @@ ilm_commitChanges(void)
     if (ctx->wl.controller != NULL) {
         ivi_controller_commit_changes(ctx->wl.controller);
 
-        if (wl_display_roundtrip_queue(ctx->wl.display, ctx->wl.queue) != -1)
+        if (display_roundtrip_queue(ctx->wl.display, ctx->wl.queue) != -1)
         {
             returnValue = ILM_SUCCESS;
         }
diff --git a/protocol/CMakeLists.txt b/protocol/CMakeLists.txt
index 6842131..207b8f1 100644
--- a/protocol/CMakeLists.txt
+++ b/protocol/CMakeLists.txt
@@ -22,8 +22,8 @@ cmake_minimum_required (VERSION 2.6)
 project(ivi-extension-protocol)
 
 find_package(PkgConfig REQUIRED)
-pkg_check_modules(WAYLAND_CLIENT wayland-client>=1.9.0 REQUIRED)
-pkg_check_modules(WAYLAND_SERVER wayland-server>=1.9.0 REQUIRED)
+pkg_check_modules(WAYLAND_CLIENT wayland-client>=1.5.0 REQUIRED)
+pkg_check_modules(WAYLAND_SERVER wayland-server>=1.5.0 REQUIRED)
 
 find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner)
 
diff --git a/weston-ivi-shell/CMakeLists.txt b/weston-ivi-shell/CMakeLists.txt
index c2664df..927e3f5 100644
--- a/weston-ivi-shell/CMakeLists.txt
+++ b/weston-ivi-shell/CMakeLists.txt
@@ -23,8 +23,8 @@ cmake_minimum_required (VERSION 2.6)
 project(ivi-controller)
 
 find_package(PkgConfig REQUIRED)
-pkg_check_modules(WAYLAND_SERVER wayland-server>=1.9.0 REQUIRED)
-pkg_check_modules(WESTON weston>=1.9.0 REQUIRED)
+pkg_check_modules(WAYLAND_SERVER wayland-server>=1.5.0 REQUIRED)
+pkg_check_modules(WESTON weston>=1.5.0 REQUIRED)
 pkg_check_modules(PIXMAN pixman-1 REQUIRED)
 
 GET_TARGET_PROPERTY(IVI_EXTENSION_INCLUDE_DIRS ivi-extension-protocol INCLUDE_DIRECTORIES)
-- 
1.8.3.1