Merge "Add rpi network drivers by default"
[AGL/meta-agl.git] / meta-agl-bsp / meta-freescale-layer / recipes-graphics / wayland / weston-2.0.0 / 0002-MGS-2352-ccc-Add-GPU-VIV-support-for-weston-2.0.patch
1 From ca6720b1c19f1581112e6ee371dff6d06aeae569 Mon Sep 17 00:00:00 2001
2 From: Meng Mingming <mingming.meng@nxp.com>
3 Date: Mon, 9 Jan 2017 15:04:27 +0800
4 Subject: [PATCH 2/5] MGS-2352 [#ccc] Add GPU-VIV support for weston 2.0
5
6 Add GPU-VIV support for weston 2.0
7
8 Upstream Status: Inappropriate [i.MX specific]
9
10 Date: Jan 09, 2017
11
12 * Weston 2.0
13 This requires re-enabling the EGL initialization support
14 in the fbdev-backend.
15
16 Signed-off-by: Meng Mingming <mingming.meng@nxp.com>
17 Signed-off-by: Georgi Vlaev <georgi.vlaev@konsulko.com>
18 ---
19  libweston/compositor-fbdev.c | 22 ++++++++++++++++++++--
20  1 file changed, 20 insertions(+), 2 deletions(-)
21
22 diff --git a/libweston/compositor-fbdev.c b/libweston/compositor-fbdev.c
23 index 4ca53b67..f87fccac 100644
24 --- a/libweston/compositor-fbdev.c
25 +++ b/libweston/compositor-fbdev.c
26 @@ -62,6 +62,7 @@ struct fbdev_backend {
27         int use_pixman;
28         uint32_t output_transform;
29         struct wl_listener session_listener;
30 +       NativeDisplayType display;
31  };
32  
33  struct fbdev_screeninfo {
34 @@ -94,6 +95,9 @@ struct fbdev_output {
35         /* pixman details. */
36         pixman_image_t *hw_surface;
37         uint8_t depth;
38 +
39 +       NativeDisplayType display;
40 +       NativeWindowType  window;
41  };
42  
43  struct gl_renderer_interface *gl_renderer;
44 @@ -444,6 +448,10 @@ fbdev_frame_buffer_destroy(struct fbdev_output *output)
45                            strerror(errno));
46  
47         output->fb = NULL;
48 +       if(output->window)
49 +               fbDestroyWindow(output->window);
50 +       if(output->display)
51 +               fbDestroyDisplay(output->display);
52  }
53  
54  static void fbdev_output_destroy(struct weston_output *base);
55 @@ -480,8 +488,13 @@ fbdev_output_enable(struct weston_output *base)
56                         goto out_hw_surface;
57         } else {
58                 setenv("HYBRIS_EGLPLATFORM", "wayland", 1);
59 +               output->window = fbCreateWindow(backend->display, -1, -1, 0, 0);
60 +               if (output->window == NULL) {
61 +                       fprintf(stderr, "failed to create window\n");
62 +                       return 0;
63 +               }
64                 if (gl_renderer->output_window_create(&output->base,
65 -                                               (EGLNativeWindowType)NULL, NULL,
66 +                                               (EGLNativeWindowType)output->window, NULL,
67                                                 gl_renderer->opaque_attribs,
68                                                 NULL, 0) < 0) {
69                         weston_log("gl_renderer_output_create failed.\n");
70 @@ -808,8 +821,13 @@ fbdev_backend_create(struct weston_compositor *compositor,
71                         goto out_launcher;
72                 }
73  
74 +               backend->display = fbGetDisplay(backend->compositor->wl_display);
75 +               if (backend->display == NULL) {
76 +                       weston_log("fbGetDisplay failed.\n");
77 +                       goto out_launcher;
78 +               }
79                 if (gl_renderer->display_create(compositor, NO_EGL_PLATFORM,
80 -                                       EGL_DEFAULT_DISPLAY,
81 +                                       backend->display,
82                                         NULL,
83                                         gl_renderer->opaque_attribs,
84                                         NULL, 0) < 0) {
85 -- 
86 2.11.0
87