diff options
Diffstat (limited to 'recipes-graphics/wayland/weston/0001-MGS-2352-ccc-Add-GPU-VIV-support-for-weston-1.11.patch')
-rw-r--r-- | recipes-graphics/wayland/weston/0001-MGS-2352-ccc-Add-GPU-VIV-support-for-weston-1.11.patch | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/recipes-graphics/wayland/weston/0001-MGS-2352-ccc-Add-GPU-VIV-support-for-weston-1.11.patch b/recipes-graphics/wayland/weston/0001-MGS-2352-ccc-Add-GPU-VIV-support-for-weston-1.11.patch new file mode 100644 index 00000000..37a2d4c2 --- /dev/null +++ b/recipes-graphics/wayland/weston/0001-MGS-2352-ccc-Add-GPU-VIV-support-for-weston-1.11.patch | |||
@@ -0,0 +1,135 @@ | |||
1 | From dfad4d734412e4ec53bfff29c7c503479857f66c 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 1/5] MGS-2352 [#ccc] Add GPU-VIV support for weston 1.11 | ||
5 | |||
6 | Add GPU-VIV support for weston 1.11 | ||
7 | |||
8 | Upstream Status: Inappropriate [i.MX specific] | ||
9 | |||
10 | Date: Jan 09, 2017 | ||
11 | Signed-off-by: Meng Mingming <mingming.meng@nxp.com> | ||
12 | --- | ||
13 | src/compositor-fbdev.c | 37 ++++++++++++++++++++++++++++--------- | ||
14 | 1 file changed, 28 insertions(+), 9 deletions(-) | ||
15 | |||
16 | diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c | ||
17 | index ee762e3..06f4696 100644 | ||
18 | --- a/src/compositor-fbdev.c | ||
19 | +++ b/src/compositor-fbdev.c | ||
20 | @@ -61,6 +61,7 @@ struct fbdev_backend { | ||
21 | int use_pixman; | ||
22 | uint32_t output_transform; | ||
23 | struct wl_listener session_listener; | ||
24 | + NativeDisplayType display; | ||
25 | }; | ||
26 | |||
27 | struct fbdev_screeninfo { | ||
28 | @@ -93,6 +94,9 @@ struct fbdev_output { | ||
29 | /* pixman details. */ | ||
30 | pixman_image_t *hw_surface; | ||
31 | uint8_t depth; | ||
32 | + | ||
33 | + NativeDisplayType display; | ||
34 | + NativeWindowType window; | ||
35 | }; | ||
36 | |||
37 | struct gl_renderer_interface *gl_renderer; | ||
38 | @@ -443,6 +447,10 @@ fbdev_frame_buffer_destroy(struct fbdev_output *output) | ||
39 | strerror(errno)); | ||
40 | |||
41 | output->fb = NULL; | ||
42 | + if(output->window) | ||
43 | + fbDestroyWindow(output->window); | ||
44 | + if(output->display) | ||
45 | + fbDestroyDisplay(output->display); | ||
46 | } | ||
47 | |||
48 | static void fbdev_output_destroy(struct weston_output *base); | ||
49 | @@ -450,13 +458,13 @@ static void fbdev_output_disable(struct weston_output *base); | ||
50 | |||
51 | static int | ||
52 | fbdev_output_create(struct fbdev_backend *backend, | ||
53 | - const char *device) | ||
54 | + int x, int y, const char *device) | ||
55 | { | ||
56 | struct fbdev_output *output; | ||
57 | int fb_fd; | ||
58 | struct wl_event_loop *loop; | ||
59 | |||
60 | - weston_log("Creating fbdev output.\n"); | ||
61 | + weston_log("Creating fbdev output. %s x=%d y=%d\n", device, x, y); | ||
62 | |||
63 | output = zalloc(sizeof *output); | ||
64 | if (output == NULL) | ||
65 | @@ -500,7 +508,7 @@ fbdev_output_create(struct fbdev_backend *backend, | ||
66 | output->base.name = strdup("fbdev"); | ||
67 | |||
68 | weston_output_init(&output->base, backend->compositor, | ||
69 | - 0, 0, output->fb_info.width_mm, | ||
70 | + x, y, output->fb_info.width_mm, | ||
71 | output->fb_info.height_mm, | ||
72 | backend->output_transform, | ||
73 | 1); | ||
74 | @@ -510,8 +518,13 @@ fbdev_output_create(struct fbdev_backend *backend, | ||
75 | goto out_hw_surface; | ||
76 | } else { | ||
77 | setenv("HYBRIS_EGLPLATFORM", "wayland", 1); | ||
78 | + output->window = fbCreateWindow(backend->display, -1, -1, 0, 0); | ||
79 | + if (output->window == NULL) { | ||
80 | + fprintf(stderr, "failed to create window\n"); | ||
81 | + return 0; | ||
82 | + } | ||
83 | if (gl_renderer->output_create(&output->base, | ||
84 | - (EGLNativeWindowType)NULL, NULL, | ||
85 | + (EGLNativeWindowType)output->window, NULL, | ||
86 | gl_renderer->opaque_attribs, | ||
87 | NULL, 0) < 0) { | ||
88 | weston_log("gl_renderer_output_create failed.\n"); | ||
89 | @@ -622,7 +635,7 @@ fbdev_output_reenable(struct fbdev_backend *backend, | ||
90 | * are re-initialised. */ | ||
91 | device = strdup(output->device); | ||
92 | fbdev_output_destroy(&output->base); | ||
93 | - fbdev_output_create(backend, device); | ||
94 | + fbdev_output_create(backend, 0, 0, device); | ||
95 | free(device); | ||
96 | |||
97 | return 0; | ||
98 | @@ -785,17 +798,21 @@ fbdev_backend_create(struct weston_compositor *compositor, int *argc, char *argv | ||
99 | goto out_launcher; | ||
100 | } | ||
101 | |||
102 | + backend->display = fbGetDisplay(backend->compositor->wl_display); | ||
103 | + if (backend->display == NULL) { | ||
104 | + weston_log("fbGetDisplay failed.\n"); | ||
105 | + goto out_launcher; | ||
106 | + } | ||
107 | if (gl_renderer->create(compositor, NO_EGL_PLATFORM, | ||
108 | - EGL_DEFAULT_DISPLAY, | ||
109 | + backend->display, | ||
110 | gl_renderer->opaque_attribs, | ||
111 | NULL, 0) < 0) { | ||
112 | weston_log("gl_renderer_create failed.\n"); | ||
113 | goto out_launcher; | ||
114 | } | ||
115 | } | ||
116 | - | ||
117 | - if (fbdev_output_create(backend, param->device) < 0) | ||
118 | - goto out_launcher; | ||
119 | + if (fbdev_output_create(backend, 0, 0, param->device) < 0) | ||
120 | + goto out_launcher; | ||
121 | |||
122 | udev_input_init(&backend->input, compositor, backend->udev, seat_id); | ||
123 | |||
124 | @@ -844,6 +861,8 @@ backend_init(struct weston_compositor *compositor, int *argc, char *argv[], | ||
125 | config_init_to_defaults(&config); | ||
126 | memcpy(&config, config_base, config_base->struct_size); | ||
127 | |||
128 | + config.use_gl = 1; | ||
129 | + | ||
130 | b = fbdev_backend_create(compositor, argc, argv, wc, &config); | ||
131 | if (b == NULL) | ||
132 | return -1; | ||
133 | -- | ||
134 | 2.7.4 | ||
135 | |||