diff options
author | Aaron Plattner | 2016-09-21 10:32:55 -0700 |
---|---|---|
committer | Aaron Plattner | 2016-09-21 11:17:26 -0700 |
commit | 41d80de186af84ee0c026369166eceadb3be3327 (patch) | |
tree | d45a11a563b7bbd174e4ad326f605f260eb46de0 | |
parent | 527fba43a5628b8e2697ff253b162622e321b201 (diff) | |
download | aur-41d80de186af84ee0c026369166eceadb3be3327.tar.gz |
Update to Weston 1.12.0
12 files changed, 363 insertions, 406 deletions
diff --git a/0001-gl-renderer-Rename-gl_renderer_create-to-gl_renderer.patch b/0001-gl-renderer-Rename-gl_renderer_create-to-gl_renderer.patch index 6a11a96238e1..9d3ee0363394 100644 --- a/0001-gl-renderer-Rename-gl_renderer_create-to-gl_renderer.patch +++ b/0001-gl-renderer-Rename-gl_renderer_create-to-gl_renderer.patch @@ -1,4 +1,4 @@ -From 986ecf2624930070e2d89dfe68459cd893179ca2 Mon Sep 17 00:00:00 2001 +From 1f96676539f06d5b92bccf98a1d388cad0bf0c41 Mon Sep 17 00:00:00 2001 From: "Miguel A. Vico" <mvicomoya@nvidia.com> Date: Wed, 30 Mar 2016 15:44:09 +0200 Subject: [PATCH 01/11] gl-renderer: Rename gl_renderer_create to @@ -11,20 +11,21 @@ what the function does. Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> Reviewed-by: James Jones <jajones@nvidia.com> + +[aplattner@nvidia.com: rebased on top of Weston 1.12.0] --- - src/compositor-drm.c | 2 +- - src/compositor-fbdev.c | 2 +- - src/compositor-wayland.c | 2 +- - src/compositor-x11.c | 5 +++-- - src/gl-renderer.c | 4 ++-- - src/gl-renderer.h | 2 +- - 6 files changed, 9 insertions(+), 8 deletions(-) + libweston/compositor-drm.c | 2 +- + libweston/compositor-wayland.c | 2 +- + libweston/compositor-x11.c | 5 +++-- + libweston/gl-renderer.c | 4 ++-- + libweston/gl-renderer.h | 2 +- + 5 files changed, 8 insertions(+), 7 deletions(-) -diff --git a/src/compositor-drm.c b/src/compositor-drm.c -index 893877d946ff..0e217e075713 100644 ---- a/src/compositor-drm.c -+++ b/src/compositor-drm.c -@@ -1577,7 +1577,7 @@ drm_backend_create_gl_renderer(struct drm_backend *b) +diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c +index 8319d7cf3ede..4046c8d6435c 100644 +--- a/libweston/compositor-drm.c ++++ b/libweston/compositor-drm.c +@@ -1619,7 +1619,7 @@ drm_backend_create_gl_renderer(struct drm_backend *b) if (format[1]) n_formats = 3; @@ -33,24 +34,11 @@ index 893877d946ff..0e217e075713 100644 EGL_PLATFORM_GBM_KHR, (void *)b->gbm, gl_renderer->opaque_attribs, -diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c -index ee762e312c59..c6ffcd7e8696 100644 ---- a/src/compositor-fbdev.c -+++ b/src/compositor-fbdev.c -@@ -785,7 +785,7 @@ fbdev_backend_create(struct weston_compositor *compositor, int *argc, char *argv - goto out_launcher; - } - -- if (gl_renderer->create(compositor, NO_EGL_PLATFORM, -+ if (gl_renderer->display_create(compositor, NO_EGL_PLATFORM, - EGL_DEFAULT_DISPLAY, - gl_renderer->opaque_attribs, - NULL, 0) < 0) { -diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c -index fe8b082b43fd..ba99b2af7f9c 100644 ---- a/src/compositor-wayland.c -+++ b/src/compositor-wayland.c -@@ -2208,7 +2208,7 @@ wayland_backend_create(struct weston_compositor *compositor, +diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c +index c223baa3db26..1a9db60cd644 100644 +--- a/libweston/compositor-wayland.c ++++ b/libweston/compositor-wayland.c +@@ -2220,7 +2220,7 @@ wayland_backend_create(struct weston_compositor *compositor, } if (!b->use_pixman) { @@ -59,11 +47,11 @@ index fe8b082b43fd..ba99b2af7f9c 100644 EGL_PLATFORM_WAYLAND_KHR, b->parent.wl_display, gl_renderer->alpha_attribs, -diff --git a/src/compositor-x11.c b/src/compositor-x11.c -index 629b5f39a217..78b9c62f873b 100644 ---- a/src/compositor-x11.c -+++ b/src/compositor-x11.c -@@ -1557,8 +1557,9 @@ init_gl_renderer(struct x11_backend *b) +diff --git a/libweston/compositor-x11.c b/libweston/compositor-x11.c +index 3e0d20fbb768..97e151b27b71 100644 +--- a/libweston/compositor-x11.c ++++ b/libweston/compositor-x11.c +@@ -1582,8 +1582,9 @@ init_gl_renderer(struct x11_backend *b) if (!gl_renderer) return -1; @@ -75,11 +63,11 @@ index 629b5f39a217..78b9c62f873b 100644 return ret; } -diff --git a/src/gl-renderer.c b/src/gl-renderer.c -index 23c0cd722df8..197e5c2a3123 100644 ---- a/src/gl-renderer.c -+++ b/src/gl-renderer.c -@@ -2873,7 +2873,7 @@ platform_to_extension(EGLenum platform) +diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c +index 031576bcf997..9d5d65b03e46 100644 +--- a/libweston/gl-renderer.c ++++ b/libweston/gl-renderer.c +@@ -2890,7 +2890,7 @@ gl_renderer_create_pbuffer_surface(struct gl_renderer *gr) { } static int @@ -88,7 +76,7 @@ index 23c0cd722df8..197e5c2a3123 100644 void *native_window, const EGLint *attribs, const EGLint *visual_id, int n_ids) { -@@ -3147,7 +3147,7 @@ WL_EXPORT struct gl_renderer_interface gl_renderer_interface = { +@@ -3181,7 +3181,7 @@ WL_EXPORT struct gl_renderer_interface gl_renderer_interface = { .opaque_attribs = gl_renderer_opaque_attribs, .alpha_attribs = gl_renderer_alpha_attribs, @@ -97,11 +85,11 @@ index 23c0cd722df8..197e5c2a3123 100644 .display = gl_renderer_display, .output_create = gl_renderer_output_create, .output_destroy = gl_renderer_output_destroy, -diff --git a/src/gl-renderer.h b/src/gl-renderer.h -index 71f6b46e49e1..cd67a890aae9 100644 ---- a/src/gl-renderer.h -+++ b/src/gl-renderer.h -@@ -75,7 +75,7 @@ struct gl_renderer_interface { +diff --git a/libweston/gl-renderer.h b/libweston/gl-renderer.h +index 37d000fefb85..71d5aab51c76 100644 +--- a/libweston/gl-renderer.h ++++ b/libweston/gl-renderer.h +@@ -60,7 +60,7 @@ struct gl_renderer_interface { const EGLint *opaque_attribs; const EGLint *alpha_attribs; @@ -111,5 +99,5 @@ index 71f6b46e49e1..cd67a890aae9 100644 void *native_window, const EGLint *attribs, -- -2.8.3 +2.10.0 diff --git a/0002-gl-renderer-Rename-gl_renderer-output_create-to-outp.patch b/0002-gl-renderer-Rename-gl_renderer-output_create-to-outp.patch index 13d64e389864..5617c5aba5d2 100644 --- a/0002-gl-renderer-Rename-gl_renderer-output_create-to-outp.patch +++ b/0002-gl-renderer-Rename-gl_renderer-output_create-to-outp.patch @@ -1,4 +1,4 @@ -From 32a49cc3fce7d2a48b4d07ef542c21cac26e7177 Mon Sep 17 00:00:00 2001 +From 4aeeb96a3381cc2bde66ca437f150a6764cf0c95 Mon Sep 17 00:00:00 2001 From: "Miguel A. Vico" <mvicomoya@nvidia.com> Date: Wed, 30 Mar 2016 15:09:14 +0200 Subject: [PATCH 02/11] gl-renderer: Rename gl_renderer::output_create to @@ -12,20 +12,21 @@ of what the function does. Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> Reviewed-by: Andy Ritger <aritger@nvidia.com> Reviewed-by: James Jones <jajones@nvidia.com> + +[aplattner@nvidia.com: rebased on top of Weston 1.12.0] --- - src/compositor-drm.c | 2 +- - src/compositor-fbdev.c | 2 +- - src/compositor-wayland.c | 2 +- - src/compositor-x11.c | 2 +- - src/gl-renderer.c | 4 ++-- - src/gl-renderer.h | 2 +- - 6 files changed, 7 insertions(+), 7 deletions(-) + libweston/compositor-drm.c | 2 +- + libweston/compositor-wayland.c | 2 +- + libweston/compositor-x11.c | 2 +- + libweston/gl-renderer.c | 4 ++-- + libweston/gl-renderer.h | 2 +- + 5 files changed, 6 insertions(+), 6 deletions(-) -diff --git a/src/compositor-drm.c b/src/compositor-drm.c -index 0e217e075713..20e6474511ef 100644 ---- a/src/compositor-drm.c -+++ b/src/compositor-drm.c -@@ -1844,7 +1844,7 @@ drm_output_init_egl(struct drm_output *output, struct drm_backend *b) +diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c +index 4046c8d6435c..87cd7be22344 100644 +--- a/libweston/compositor-drm.c ++++ b/libweston/compositor-drm.c +@@ -1886,7 +1886,7 @@ drm_output_init_egl(struct drm_output *output, struct drm_backend *b) if (format[1]) n_formats = 2; @@ -34,24 +35,11 @@ index 0e217e075713..20e6474511ef 100644 (EGLNativeWindowType)output->gbm_surface, output->gbm_surface, gl_renderer->opaque_attribs, -diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c -index c6ffcd7e8696..21a24fd4c4e3 100644 ---- a/src/compositor-fbdev.c -+++ b/src/compositor-fbdev.c -@@ -510,7 +510,7 @@ fbdev_output_create(struct fbdev_backend *backend, - goto out_hw_surface; - } else { - setenv("HYBRIS_EGLPLATFORM", "wayland", 1); -- if (gl_renderer->output_create(&output->base, -+ if (gl_renderer->output_window_create(&output->base, - (EGLNativeWindowType)NULL, NULL, - gl_renderer->opaque_attribs, - NULL, 0) < 0) { -diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c -index ba99b2af7f9c..85e755a52d84 100644 ---- a/src/compositor-wayland.c -+++ b/src/compositor-wayland.c -@@ -658,7 +658,7 @@ wayland_output_init_gl_renderer(struct wayland_output *output) +diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c +index 1a9db60cd644..b434700fa0ff 100644 +--- a/libweston/compositor-wayland.c ++++ b/libweston/compositor-wayland.c +@@ -671,7 +671,7 @@ wayland_output_init_gl_renderer(struct wayland_output *output) return -1; } @@ -60,11 +48,11 @@ index ba99b2af7f9c..85e755a52d84 100644 output->gl.egl_window, output->gl.egl_window, gl_renderer->alpha_attribs, -diff --git a/src/compositor-x11.c b/src/compositor-x11.c -index 78b9c62f873b..6b61cee6bbed 100644 ---- a/src/compositor-x11.c -+++ b/src/compositor-x11.c -@@ -928,7 +928,7 @@ x11_backend_create_output(struct x11_backend *b, int x, int y, +diff --git a/libweston/compositor-x11.c b/libweston/compositor-x11.c +index 97e151b27b71..0664e220d10f 100644 +--- a/libweston/compositor-x11.c ++++ b/libweston/compositor-x11.c +@@ -953,7 +953,7 @@ x11_backend_create_output(struct x11_backend *b, int x, int y, * but eglCreateWindowSurface takes a Window. */ Window xid = (Window) output->window; @@ -73,11 +61,11 @@ index 78b9c62f873b..6b61cee6bbed 100644 (EGLNativeWindowType) output->window, &xid, gl_renderer->opaque_attribs, -diff --git a/src/gl-renderer.c b/src/gl-renderer.c -index 197e5c2a3123..784cacbc2619 100644 ---- a/src/gl-renderer.c -+++ b/src/gl-renderer.c -@@ -2547,7 +2547,7 @@ static int +diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c +index 9d5d65b03e46..0015268d210a 100644 +--- a/libweston/gl-renderer.c ++++ b/libweston/gl-renderer.c +@@ -2544,7 +2544,7 @@ static int gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface); static int @@ -86,7 +74,7 @@ index 197e5c2a3123..784cacbc2619 100644 EGLNativeWindowType window_for_legacy, void *window_for_platform, const EGLint *attribs, -@@ -3149,7 +3149,7 @@ WL_EXPORT struct gl_renderer_interface gl_renderer_interface = { +@@ -3183,7 +3183,7 @@ WL_EXPORT struct gl_renderer_interface gl_renderer_interface = { .display_create = gl_renderer_display_create, .display = gl_renderer_display, @@ -95,11 +83,11 @@ index 197e5c2a3123..784cacbc2619 100644 .output_destroy = gl_renderer_output_destroy, .output_surface = gl_renderer_output_surface, .output_set_border = gl_renderer_output_set_border, -diff --git a/src/gl-renderer.h b/src/gl-renderer.h -index cd67a890aae9..ae9bf0f0aee2 100644 ---- a/src/gl-renderer.h -+++ b/src/gl-renderer.h -@@ -84,7 +84,7 @@ struct gl_renderer_interface { +diff --git a/libweston/gl-renderer.h b/libweston/gl-renderer.h +index 71d5aab51c76..5b3b68a8e4fa 100644 +--- a/libweston/gl-renderer.h ++++ b/libweston/gl-renderer.h +@@ -69,7 +69,7 @@ struct gl_renderer_interface { EGLDisplay (*display)(struct weston_compositor *ec); @@ -109,5 +97,5 @@ index cd67a890aae9..ae9bf0f0aee2 100644 void *window_for_platform, const EGLint *attribs, -- -2.8.3 +2.10.0 diff --git a/0003-gl-renderer-Rename-attribs-param-of-gl_renderer-to-c.patch b/0003-gl-renderer-Rename-attribs-param-of-gl_renderer-to-c.patch index 320e8f964339..e0e7703e7e07 100644 --- a/0003-gl-renderer-Rename-attribs-param-of-gl_renderer-to-c.patch +++ b/0003-gl-renderer-Rename-attribs-param-of-gl_renderer-to-c.patch @@ -1,4 +1,4 @@ -From f0598cde32ca1af3fecd71d8592f34e56f6bdae0 Mon Sep 17 00:00:00 2001 +From 31f40175f702c8799bd69d5d9612d90e247501f3 Mon Sep 17 00:00:00 2001 From: "Miguel A. Vico" <mvicomoya@nvidia.com> Date: Wed, 30 Mar 2016 15:23:49 +0200 Subject: [PATCH 03/11] gl-renderer: Rename <attribs> param of gl_renderer to @@ -13,16 +13,18 @@ to <config_attribs> Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> Reviewed-by: Andy Ritger <aritger@nvidia.com> Reviewed-by: James Jones <jajones@nvidia.com> + +[aplattner@nvidia.com: rebased on top of Weston 1.12.0] --- - src/gl-renderer.c | 8 ++++---- - src/gl-renderer.h | 4 ++-- + libweston/gl-renderer.c | 8 ++++---- + libweston/gl-renderer.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) -diff --git a/src/gl-renderer.c b/src/gl-renderer.c -index 784cacbc2619..b0bee7f6a94f 100644 ---- a/src/gl-renderer.c -+++ b/src/gl-renderer.c -@@ -2550,7 +2550,7 @@ static int +diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c +index 0015268d210a..e11c22cf3f05 100644 +--- a/libweston/gl-renderer.c ++++ b/libweston/gl-renderer.c +@@ -2547,7 +2547,7 @@ static int gl_renderer_output_window_create(struct weston_output *output, EGLNativeWindowType window_for_legacy, void *window_for_platform, @@ -31,7 +33,7 @@ index 784cacbc2619..b0bee7f6a94f 100644 const EGLint *visual_id, int n_ids) { -@@ -2560,7 +2560,7 @@ gl_renderer_output_window_create(struct weston_output *output, +@@ -2557,7 +2557,7 @@ gl_renderer_output_window_create(struct weston_output *output, EGLConfig egl_config; int i; @@ -40,7 +42,7 @@ index 784cacbc2619..b0bee7f6a94f 100644 n_ids, &egl_config) == -1) { weston_log("failed to choose EGL config for output\n"); return -1; -@@ -2874,7 +2874,7 @@ platform_to_extension(EGLenum platform) +@@ -2891,7 +2891,7 @@ gl_renderer_create_pbuffer_surface(struct gl_renderer *gr) { static int gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, @@ -49,7 +51,7 @@ index 784cacbc2619..b0bee7f6a94f 100644 const EGLint *visual_id, int n_ids) { struct gl_renderer *gr; -@@ -2938,7 +2938,7 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, +@@ -2955,7 +2955,7 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, goto fail_with_error; } @@ -58,11 +60,11 @@ index 784cacbc2619..b0bee7f6a94f 100644 n_ids, &gr->egl_config) < 0) { weston_log("failed to choose EGL config\n"); goto fail_terminate; -diff --git a/src/gl-renderer.h b/src/gl-renderer.h -index ae9bf0f0aee2..d43131940f43 100644 ---- a/src/gl-renderer.h -+++ b/src/gl-renderer.h -@@ -78,7 +78,7 @@ struct gl_renderer_interface { +diff --git a/libweston/gl-renderer.h b/libweston/gl-renderer.h +index 5b3b68a8e4fa..9d6648680533 100644 +--- a/libweston/gl-renderer.h ++++ b/libweston/gl-renderer.h +@@ -63,7 +63,7 @@ struct gl_renderer_interface { int (*display_create)(struct weston_compositor *ec, EGLenum platform, void *native_window, @@ -71,7 +73,7 @@ index ae9bf0f0aee2..d43131940f43 100644 const EGLint *visual_id, const int n_ids); -@@ -87,7 +87,7 @@ struct gl_renderer_interface { +@@ -72,7 +72,7 @@ struct gl_renderer_interface { int (*output_window_create)(struct weston_output *output, EGLNativeWindowType window_for_legacy, void *window_for_platform, @@ -81,5 +83,5 @@ index ae9bf0f0aee2..d43131940f43 100644 const int n_ids); -- -2.8.3 +2.10.0 diff --git a/0004-gl-renderer-Add-platform_attribs-param-to-gl_rendere.patch b/0004-gl-renderer-Add-platform_attribs-param-to-gl_rendere.patch index 12cf967fdc4f..6f71a7ac89b7 100644 --- a/0004-gl-renderer-Add-platform_attribs-param-to-gl_rendere.patch +++ b/0004-gl-renderer-Add-platform_attribs-param-to-gl_rendere.patch @@ -1,4 +1,4 @@ -From 0e4bc3d227912df81c275ccddc48cae5b058d65c Mon Sep 17 00:00:00 2001 +From 4e02c69b513e5cb02451c794a9ed5091c74abc04 Mon Sep 17 00:00:00 2001 From: "Miguel A. Vico" <mvicomoya@nvidia.com> Date: Wed, 30 Mar 2016 15:17:01 +0200 Subject: [PATCH 04/11] gl-renderer: Add <platform_attribs> param to @@ -12,20 +12,21 @@ parameter to gl_renderer_display_create(). Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> Reviewed-by: Andy Ritger <aritger@nvidia.com> Reviewed-by: James Jones <jajones@nvidia.com> + +[aplattner@nvidia.com: rebased on top of Weston 1.12.0] --- - src/compositor-drm.c | 1 + - src/compositor-fbdev.c | 1 + - src/compositor-wayland.c | 1 + - src/compositor-x11.c | 2 +- - src/gl-renderer.c | 6 +++--- - src/gl-renderer.h | 1 + - 6 files changed, 8 insertions(+), 4 deletions(-) + libweston/compositor-drm.c | 1 + + libweston/compositor-wayland.c | 1 + + libweston/compositor-x11.c | 2 +- + libweston/gl-renderer.c | 6 +++--- + libweston/gl-renderer.h | 1 + + 5 files changed, 7 insertions(+), 4 deletions(-) -diff --git a/src/compositor-drm.c b/src/compositor-drm.c -index 20e6474511ef..dd545de1ccc0 100644 ---- a/src/compositor-drm.c -+++ b/src/compositor-drm.c -@@ -1580,6 +1580,7 @@ drm_backend_create_gl_renderer(struct drm_backend *b) +diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c +index 87cd7be22344..888881880e16 100644 +--- a/libweston/compositor-drm.c ++++ b/libweston/compositor-drm.c +@@ -1622,6 +1622,7 @@ drm_backend_create_gl_renderer(struct drm_backend *b) if (gl_renderer->display_create(b->compositor, EGL_PLATFORM_GBM_KHR, (void *)b->gbm, @@ -33,23 +34,11 @@ index 20e6474511ef..dd545de1ccc0 100644 gl_renderer->opaque_attribs, format, n_formats) < 0) { -diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c -index 21a24fd4c4e3..7a7c32915c8c 100644 ---- a/src/compositor-fbdev.c -+++ b/src/compositor-fbdev.c -@@ -787,6 +787,7 @@ fbdev_backend_create(struct weston_compositor *compositor, int *argc, char *argv - - if (gl_renderer->display_create(compositor, NO_EGL_PLATFORM, - EGL_DEFAULT_DISPLAY, -+ NULL, - gl_renderer->opaque_attribs, - NULL, 0) < 0) { - weston_log("gl_renderer_create failed.\n"); -diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c -index 85e755a52d84..88992dbeec23 100644 ---- a/src/compositor-wayland.c -+++ b/src/compositor-wayland.c -@@ -2211,6 +2211,7 @@ wayland_backend_create(struct weston_compositor *compositor, +diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c +index b434700fa0ff..359a3c85624f 100644 +--- a/libweston/compositor-wayland.c ++++ b/libweston/compositor-wayland.c +@@ -2223,6 +2223,7 @@ wayland_backend_create(struct weston_compositor *compositor, if (gl_renderer->display_create(compositor, EGL_PLATFORM_WAYLAND_KHR, b->parent.wl_display, @@ -57,11 +46,11 @@ index 85e755a52d84..88992dbeec23 100644 gl_renderer->alpha_attribs, NULL, 0) < 0) { -diff --git a/src/compositor-x11.c b/src/compositor-x11.c -index 6b61cee6bbed..52b7a7e16cd7 100644 ---- a/src/compositor-x11.c -+++ b/src/compositor-x11.c -@@ -1558,7 +1558,7 @@ init_gl_renderer(struct x11_backend *b) +diff --git a/libweston/compositor-x11.c b/libweston/compositor-x11.c +index 0664e220d10f..8b03274814dc 100644 +--- a/libweston/compositor-x11.c ++++ b/libweston/compositor-x11.c +@@ -1583,7 +1583,7 @@ init_gl_renderer(struct x11_backend *b) return -1; ret = gl_renderer->display_create(b->compositor, EGL_PLATFORM_X11_KHR, @@ -70,11 +59,11 @@ index 6b61cee6bbed..52b7a7e16cd7 100644 gl_renderer->opaque_attribs, NULL, 0); return ret; -diff --git a/src/gl-renderer.c b/src/gl-renderer.c -index b0bee7f6a94f..7f522055fac8 100644 ---- a/src/gl-renderer.c -+++ b/src/gl-renderer.c -@@ -2874,8 +2874,8 @@ platform_to_extension(EGLenum platform) +diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c +index e11c22cf3f05..729abd62c0d6 100644 +--- a/libweston/gl-renderer.c ++++ b/libweston/gl-renderer.c +@@ -2891,8 +2891,8 @@ gl_renderer_create_pbuffer_surface(struct gl_renderer *gr) { static int gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, @@ -85,7 +74,7 @@ index b0bee7f6a94f..7f522055fac8 100644 { struct gl_renderer *gr; EGLint major, minor; -@@ -2917,7 +2917,7 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, +@@ -2934,7 +2934,7 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, if (get_platform_display && platform) { gr->egl_display = get_platform_display(platform, native_window, @@ -94,11 +83,11 @@ index b0bee7f6a94f..7f522055fac8 100644 } } -diff --git a/src/gl-renderer.h b/src/gl-renderer.h -index d43131940f43..f778cd9b6f69 100644 ---- a/src/gl-renderer.h -+++ b/src/gl-renderer.h -@@ -78,6 +78,7 @@ struct gl_renderer_interface { +diff --git a/libweston/gl-renderer.h b/libweston/gl-renderer.h +index 9d6648680533..02f8011247db 100644 +--- a/libweston/gl-renderer.h ++++ b/libweston/gl-renderer.h +@@ -63,6 +63,7 @@ struct gl_renderer_interface { int (*display_create)(struct weston_compositor *ec, EGLenum platform, void *native_window, @@ -107,5 +96,5 @@ index d43131940f43..f778cd9b6f69 100644 const EGLint *visual_id, const int n_ids); -- -2.8.3 +2.10.0 diff --git a/0005-gl-renderer-Accept-non-NULL-empty-visual_id-arrays.patch b/0005-gl-renderer-Accept-non-NULL-empty-visual_id-arrays.patch index 8af11b537299..1743dc23258a 100644 --- a/0005-gl-renderer-Accept-non-NULL-empty-visual_id-arrays.patch +++ b/0005-gl-renderer-Accept-non-NULL-empty-visual_id-arrays.patch @@ -1,4 +1,4 @@ -From d55b51e9bdd451c0ff635d8937e1e818a6de1216 Mon Sep 17 00:00:00 2001 +From 4c883f42265ecdddada48ba12818fdf373931f04 Mon Sep 17 00:00:00 2001 From: "Miguel A. Vico" <mvicomoya@nvidia.com> Date: Wed, 30 Mar 2016 15:29:37 +0200 Subject: [PATCH 05/11] gl-renderer: Accept non-NULL empty <visual_id> arrays @@ -10,15 +10,17 @@ This change modifies egl_choose_config() to accept a non-NULL but empty Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> Reviewed-by: Andy Ritger <aritger@nvidia.com> Reviewed-by: James Jones <jajones@nvidia.com> + +[aplattner@nvidia.com: rebased on top of Weston 1.12.0] --- - src/gl-renderer.c | 2 +- + libweston/gl-renderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/src/gl-renderer.c b/src/gl-renderer.c -index 7f522055fac8..1d76488c2165 100644 ---- a/src/gl-renderer.c -+++ b/src/gl-renderer.c -@@ -2493,7 +2493,7 @@ egl_choose_config(struct gl_renderer *gr, const EGLint *attribs, +diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c +index 729abd62c0d6..dd04caa87102 100644 +--- a/libweston/gl-renderer.c ++++ b/libweston/gl-renderer.c +@@ -2490,7 +2490,7 @@ egl_choose_config(struct gl_renderer *gr, const EGLint *attribs, goto out; } @@ -28,5 +30,5 @@ index 7f522055fac8..1d76488c2165 100644 for (i = 0; config_index == -1 && i < n_ids; i++) -- -2.8.3 +2.10.0 diff --git a/0006-gl-renderer-Refactor-gl_renderer_output_window_creat.patch b/0006-gl-renderer-Refactor-gl_renderer_output_window_creat.patch index 1f009b7f7547..fac32737ef28 100644 --- a/0006-gl-renderer-Refactor-gl_renderer_output_window_creat.patch +++ b/0006-gl-renderer-Refactor-gl_renderer_output_window_creat.patch @@ -1,4 +1,4 @@ -From 2309d0381a9353651f7d080190c43702c76d2075 Mon Sep 17 00:00:00 2001 +From d53c17a0c190f240b71e573c03bdf3abb264126f Mon Sep 17 00:00:00 2001 From: "Miguel A. Vico" <mvicomoya@nvidia.com> Date: Fri, 26 Feb 2016 15:44:59 +0100 Subject: [PATCH 06/11] gl-renderer: Refactor @@ -15,14 +15,16 @@ Bonus: Fix EGLSurface leakage upon gl_renderer_setup() failure. Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> Reviewed-by: Andy Ritger <aritger@nvidia.com> Reviewed-by: James Jones <jajones@nvidia.com> + +[aplattner@nvidia.com: rebased on top of Weston 1.12.0] --- - src/gl-renderer.c | 96 ++++++++++++++++++++++++++++++++++++------------------- - 1 file changed, 64 insertions(+), 32 deletions(-) + libweston/gl-renderer.c | 87 +++++++++++++++++++++++++++++++++---------------- + 1 file changed, 59 insertions(+), 28 deletions(-) -diff --git a/src/gl-renderer.c b/src/gl-renderer.c -index 1d76488c2165..c208f36a5165 100644 ---- a/src/gl-renderer.c -+++ b/src/gl-renderer.c +diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c +index dd04caa87102..067e677f8a7b 100644 +--- a/libweston/gl-renderer.c ++++ b/libweston/gl-renderer.c @@ -1,6 +1,7 @@ /* * Copyright © 2012 Intel Corporation @@ -31,7 +33,7 @@ index 1d76488c2165..c208f36a5165 100644 * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the -@@ -2546,24 +2547,21 @@ gl_renderer_output_set_border(struct weston_output *output, +@@ -2543,24 +2544,21 @@ gl_renderer_output_set_border(struct weston_output *output, static int gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface); @@ -60,7 +62,7 @@ index 1d76488c2165..c208f36a5165 100644 } if (egl_config != gr->egl_config && -@@ -2571,48 +2569,82 @@ gl_renderer_output_window_create(struct weston_output *output, +@@ -2568,42 +2566,75 @@ gl_renderer_output_window_create(struct weston_output *output, weston_log("attempted to use a different EGL config for an " "output but EGL_MESA_configless_context is not " "supported\n"); @@ -68,10 +70,31 @@ index 1d76488c2165..c208f36a5165 100644 + return EGL_NO_SURFACE; } -- go = zalloc(sizeof *go); -- if (go == NULL) -- return -1; + log_egl_config_info(gr->egl_display, egl_config); ++ ++ if (gr->create_platform_window) ++ egl_surface = gr->create_platform_window(gr->egl_display, ++ egl_config, ++ window_for_platform, ++ NULL); ++ else ++ egl_surface = eglCreateWindowSurface(gr->egl_display, ++ egl_config, ++ window_for_legacy, NULL); ++ ++ return egl_surface; ++} ++ ++static int ++gl_renderer_output_create(struct weston_output *output, ++ EGLSurface surface) ++{ ++ struct gl_output_state *go; ++ int i; ++ + go = zalloc(sizeof *go); + if (go == NULL) + return -1; - if (gr->create_platform_window) { - go->egl_surface = @@ -85,46 +108,14 @@ index 1d76488c2165..c208f36a5165 100644 - egl_config, - window_for_legacy, NULL); - } -+ if (gr->create_platform_window) -+ egl_surface = gr->create_platform_window(gr->egl_display, -+ egl_config, -+ window_for_platform, -+ NULL); -+ else -+ egl_surface = eglCreateWindowSurface(gr->egl_display, -+ egl_config, -+ window_for_legacy, NULL); - +- - if (go->egl_surface == EGL_NO_SURFACE) { - weston_log("failed to create egl surface\n"); - free(go); - return -1; - } -+ return egl_surface; -+} -+ -+static int -+gl_renderer_output_create(struct weston_output *output, -+ EGLSurface surface) -+{ -+ struct weston_compositor *ec = output->compositor; -+ struct gl_renderer *gr = get_renderer(ec); -+ struct gl_output_state *go; -+ int i; - - if (gr->egl_context == NULL) -- if (gl_renderer_setup(ec, go->egl_surface) < 0) { -- free(go); -+ if (gl_renderer_setup(ec, surface) < 0) { - return -1; - } - -+ go = zalloc(sizeof *go); -+ if (go == NULL) -+ return -1; -+ + go->egl_surface = surface; -+ + for (i = 0; i < BUFFER_DAMAGE_COUNT; i++) pixman_region32_init(&go->buffer_damage[i]); @@ -149,10 +140,10 @@ index 1d76488c2165..c208f36a5165 100644 + int ret = 0; + + egl_surface = gl_renderer_create_window_surface(gr, -+ window_for_legacy, -+ window_for_platform, -+ config_attribs, -+ visual_id, n_ids); ++ window_for_legacy, ++ window_for_platform, ++ config_attribs, ++ visual_id, n_ids); + if (egl_surface == EGL_NO_SURFACE) { + weston_log("failed to create egl surface\n"); + return -1; @@ -169,5 +160,5 @@ index 1d76488c2165..c208f36a5165 100644 gl_renderer_output_destroy(struct weston_output *output) { -- -2.8.3 +2.10.0 diff --git a/0007-gl-renderer-Add-EGLDevice-enumeration-support.patch b/0007-gl-renderer-Add-EGLDevice-enumeration-support.patch index d0e2d74a7594..322e011e16af 100644 --- a/0007-gl-renderer-Add-EGLDevice-enumeration-support.patch +++ b/0007-gl-renderer-Add-EGLDevice-enumeration-support.patch @@ -1,4 +1,4 @@ -From 1ba420dd543f35b3f5b9988efb5368c26f34c270 Mon Sep 17 00:00:00 2001 +From 21f53facea84443ed09fbd400530a58e3695906b Mon Sep 17 00:00:00 2001 From: "Miguel A. Vico" <mvicomoya@nvidia.com> Date: Mon, 2 May 2016 15:56:37 +0200 Subject: [PATCH 07/11] gl-renderer: Add EGLDevice enumeration support @@ -16,16 +16,18 @@ Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> Reviewed-by: Andy Ritger <aritger@nvidia.com> Reviewed-by: Adam Cheney <acheney@nvidia.com> Reviewed-by: James Jones <jajones@nvidia.com> + +[aplattner@nvidia.com: rebased on top of Weston 1.12.0] --- - src/gl-renderer.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- - src/gl-renderer.h | 7 +++++ + libweston/gl-renderer.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++- + libweston/gl-renderer.h | 7 ++++ 2 files changed, 93 insertions(+), 1 deletion(-) -diff --git a/src/gl-renderer.c b/src/gl-renderer.c -index c208f36a5165..098440ce30a2 100644 ---- a/src/gl-renderer.c -+++ b/src/gl-renderer.c -@@ -3175,6 +3175,88 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface) +diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c +index 067e677f8a7b..b5d93531c944 100644 +--- a/libweston/gl-renderer.c ++++ b/libweston/gl-renderer.c +@@ -3208,6 +3208,88 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface) return 0; } @@ -42,9 +44,9 @@ index c208f36a5165..098440ce30a2 100644 + return -1; + } + -+ if (!check_extension(extensions, "EGL_EXT_device_base") && -+ (!check_extension(extensions, "EGL_EXT_device_query") || -+ !check_extension(extensions, "EGL_EXT_device_enumeration"))) { ++ if (!weston_check_egl_extension(extensions, "EGL_EXT_device_base") && ++ (!weston_check_egl_extension(extensions, "EGL_EXT_device_query") || ++ !weston_check_egl_extension(extensions, "EGL_EXT_device_enumeration"))) { + weston_log("EGL_EXT_device_base not supported\n"); + return -1; + } @@ -77,9 +79,9 @@ index c208f36a5165..098440ce30a2 100644 + return -1; + } + -+ if (!check_extension(extensions, "EGL_EXT_device_base") && -+ (!check_extension(extensions, "EGL_EXT_device_query") || -+ !check_extension(extensions, "EGL_EXT_device_enumeration"))) { ++ if (!weston_check_egl_extension(extensions, "EGL_EXT_device_base") && ++ (!weston_check_egl_extension(extensions, "EGL_EXT_device_query") || ++ !weston_check_egl_extension(extensions, "EGL_EXT_device_enumeration"))) { + weston_log("EGL_EXT_device_base not supported.\n"); + return -1; + } @@ -96,7 +98,7 @@ index c208f36a5165..098440ce30a2 100644 + return -1; + } + -+ if (!check_extension(extensions, "EGL_EXT_device_drm")) { ++ if (!weston_check_egl_extension(extensions, "EGL_EXT_device_drm")) { + weston_log("EGL_EXT_device_drm not supported.\n"); + return -1; + } @@ -114,7 +116,7 @@ index c208f36a5165..098440ce30a2 100644 WL_EXPORT struct gl_renderer_interface gl_renderer_interface = { .opaque_attribs = gl_renderer_opaque_attribs, .alpha_attribs = gl_renderer_alpha_attribs, -@@ -3185,5 +3267,8 @@ WL_EXPORT struct gl_renderer_interface gl_renderer_interface = { +@@ -3218,5 +3300,8 @@ WL_EXPORT struct gl_renderer_interface gl_renderer_interface = { .output_destroy = gl_renderer_output_destroy, .output_surface = gl_renderer_output_surface, .output_set_border = gl_renderer_output_set_border, @@ -124,11 +126,11 @@ index c208f36a5165..098440ce30a2 100644 + .get_devices = gl_renderer_get_devices, + .get_drm_device_file = gl_renderer_get_drm_device_file }; -diff --git a/src/gl-renderer.h b/src/gl-renderer.h -index f778cd9b6f69..f376edd80106 100644 ---- a/src/gl-renderer.h -+++ b/src/gl-renderer.h -@@ -129,5 +129,12 @@ struct gl_renderer_interface { +diff --git a/libweston/gl-renderer.h b/libweston/gl-renderer.h +index 02f8011247db..871aa6589b01 100644 +--- a/libweston/gl-renderer.h ++++ b/libweston/gl-renderer.h +@@ -114,5 +114,12 @@ struct gl_renderer_interface { int32_t tex_width, unsigned char *data); void (*print_egl_error_state)(void); @@ -142,5 +144,5 @@ index f778cd9b6f69..f376edd80106 100644 }; -- -2.8.3 +2.10.0 diff --git a/0008-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch b/0008-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch index 72d9ef25c95f..7309529cda4b 100644 --- a/0008-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch +++ b/0008-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch @@ -1,4 +1,4 @@ -From 13ffa3ad89037a8e686633468b762fb9b92c95c8 Mon Sep 17 00:00:00 2001 +From 4a84caec21fa650c8919db504dea94b3ad352a71 Mon Sep 17 00:00:00 2001 From: "Miguel A. Vico" <mvicomoya@nvidia.com> Date: Mon, 2 May 2016 16:34:01 +0200 Subject: [PATCH 08/11] gl-renderer: Add support for EGLDevice composited frame @@ -41,17 +41,19 @@ Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> Reviewed-by: Andy Ritger <aritger@nvidia.com> Reviewed-by: Adam Cheney <acheney@nvidia.com> Reviewed-by: James Jones <jajones@nvidia.com> + +[aplattner@nvidia.com: rebased on top of Weston 1.12.0] --- - src/gl-renderer.c | 251 ++++++++++++++++++++++++++++++++++++++++++++++++++- - src/gl-renderer.h | 19 ++++ - src/weston-egl-ext.h | 18 ++++ - 3 files changed, 285 insertions(+), 3 deletions(-) + libweston/gl-renderer.c | 251 ++++++++++++++++++++++++++++++++++++++++++++- + libweston/gl-renderer.h | 15 +++ + libweston/weston-egl-ext.h | 18 ++++ + 3 files changed, 281 insertions(+), 3 deletions(-) -diff --git a/src/gl-renderer.c b/src/gl-renderer.c -index 098440ce30a2..764bd880d743 100644 ---- a/src/gl-renderer.c -+++ b/src/gl-renderer.c -@@ -84,6 +84,8 @@ struct gl_output_state { +diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c +index b5d93531c944..01c5933966ca 100644 +--- a/libweston/gl-renderer.c ++++ b/libweston/gl-renderer.c +@@ -86,6 +86,8 @@ struct gl_output_state { struct gl_border_image borders[4]; enum gl_border_status border_status; @@ -60,9 +62,9 @@ index 098440ce30a2..764bd880d743 100644 struct weston_matrix output_matrix; }; -@@ -202,6 +204,27 @@ struct gl_renderer { +@@ -204,6 +206,27 @@ struct gl_renderer { - int has_configless_context; + int has_surfaceless_context; + PFNEGLGETOUTPUTLAYERSEXTPROC get_output_layers; + PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC query_output_layer_attrib; @@ -88,7 +90,7 @@ index 098440ce30a2..764bd880d743 100644 int has_dmabuf_import; struct wl_list dmabuf_images; -@@ -1193,6 +1216,37 @@ gl_renderer_repaint_output(struct weston_output *output, +@@ -1189,6 +1212,37 @@ gl_renderer_repaint_output(struct weston_output *output, } static int @@ -126,7 +128,7 @@ index 098440ce30a2..764bd880d743 100644 gl_renderer_read_pixels(struct weston_output *output, pixman_format_code_t format, void *pixels, uint32_t x, uint32_t y, -@@ -2587,9 +2641,92 @@ gl_renderer_create_window_surface(struct gl_renderer *gr, +@@ -2584,9 +2638,92 @@ gl_renderer_create_window_surface(struct gl_renderer *gr, return egl_surface; } @@ -218,9 +220,9 @@ index 098440ce30a2..764bd880d743 100644 + EGLSurface surface, + EGLStreamKHR stream) { - struct weston_compositor *ec = output->compositor; - struct gl_renderer *gr = get_renderer(ec); -@@ -2606,6 +2743,7 @@ gl_renderer_output_create(struct weston_output *output, + struct gl_output_state *go; + int i; +@@ -2596,6 +2733,7 @@ gl_renderer_output_create(struct weston_output *output, return -1; go->egl_surface = surface; @@ -228,7 +230,7 @@ index 098440ce30a2..764bd880d743 100644 for (i = 0; i < BUFFER_DAMAGE_COUNT; i++) pixman_region32_init(&go->buffer_damage[i]); -@@ -2638,13 +2776,41 @@ gl_renderer_output_window_create(struct weston_output *output, +@@ -2628,13 +2766,41 @@ gl_renderer_output_window_create(struct weston_output *output, return -1; } @@ -271,7 +273,7 @@ index 098440ce30a2..764bd880d743 100644 static void gl_renderer_output_destroy(struct weston_output *output) { -@@ -2657,6 +2823,9 @@ gl_renderer_output_destroy(struct weston_output *output) +@@ -2647,6 +2813,9 @@ gl_renderer_output_destroy(struct weston_output *output) eglDestroySurface(gr->egl_display, go->egl_surface); @@ -281,7 +283,7 @@ index 098440ce30a2..764bd880d743 100644 free(go); } -@@ -2761,6 +2930,19 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) +@@ -2728,6 +2897,19 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) (void *) eglGetProcAddress("eglUnbindWaylandDisplayWL"); gr->query_buffer = (void *) eglGetProcAddress("eglQueryWaylandBufferWL"); @@ -301,35 +303,35 @@ index 098440ce30a2..764bd880d743 100644 extensions = (const char *) eglQueryString(gr->egl_display, EGL_EXTENSIONS); -@@ -2802,6 +2984,27 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) +@@ -2766,6 +2948,27 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) + if (weston_check_egl_extension(extensions, "EGL_EXT_image_dma_buf_import")) gr->has_dmabuf_import = 1; - #endif -+ if (check_extension(extensions, "EGL_EXT_output_base")) ++ if (weston_check_egl_extension(extensions, "EGL_EXT_output_base")) + gr->has_egl_output_base = 1; + -+ if (check_extension(extensions, "EGL_EXT_output_drm")) ++ if (weston_check_egl_extension(extensions, "EGL_EXT_output_drm")) + gr->has_egl_output_drm = 1; + -+ if (check_extension(extensions, "EGL_NV_output_drm_flip_event")) ++ if (weston_check_egl_extension(extensions, "EGL_NV_output_drm_flip_event")) + gr->has_egl_output_drm_flip_event = 1; + -+ if (check_extension(extensions, "EGL_KHR_stream")) ++ if (weston_check_egl_extension(extensions, "EGL_KHR_stream")) + gr->has_egl_stream = 1; + -+ if (check_extension(extensions, "EGL_KHR_stream_producer_eglsurface")) ++ if (weston_check_egl_extension(extensions, "EGL_KHR_stream_producer_eglsurface")) + gr->has_egl_stream_producer_eglsurface = 1; + -+ if (check_extension(extensions, "EGL_EXT_stream_consumer_egloutput")) ++ if (weston_check_egl_extension(extensions, "EGL_EXT_stream_consumer_egloutput")) + gr->has_egl_stream_consumer_egloutput = 1; + -+ if (check_extension(extensions, "EGL_EXT_stream_acquire_mode")) ++ if (weston_check_egl_extension(extensions, "EGL_EXT_stream_acquire_mode")) + gr->has_egl_stream_acquire_mode = 1; + renderer_setup_egl_client_extensions(gr); return 0; -@@ -2827,6 +3030,16 @@ static const EGLint gl_renderer_alpha_attribs[] = { +@@ -2791,6 +2994,16 @@ static const EGLint gl_renderer_alpha_attribs[] = { EGL_NONE }; @@ -343,10 +345,10 @@ index 098440ce30a2..764bd880d743 100644 + EGL_NONE +}; + + /** Checks whether a platform EGL client extension is supported * - * \param ec The weston compositor -@@ -2899,6 +3112,8 @@ platform_to_extension(EGLenum platform) +@@ -2864,6 +3077,8 @@ platform_to_extension(EGLenum platform) return "wayland"; case EGL_PLATFORM_X11_KHR: return "x11"; @@ -355,7 +357,7 @@ index 098440ce30a2..764bd880d743 100644 default: assert(0 && "bad EGL platform enum"); } -@@ -2984,6 +3199,32 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, +@@ -3000,6 +3215,32 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, if (gl_renderer_setup_egl_extensions(ec) < 0) goto fail_with_error; @@ -388,7 +390,7 @@ index 098440ce30a2..764bd880d743 100644 wl_list_init(&gr->dmabuf_images); if (gr->has_dmabuf_import) gr->base.import_dmabuf = gl_renderer_import_dmabuf; -@@ -3260,15 +3501,19 @@ gl_renderer_get_drm_device_file(EGLDeviceEXT device, +@@ -3293,15 +3534,19 @@ gl_renderer_get_drm_device_file(EGLDeviceEXT device, WL_EXPORT struct gl_renderer_interface gl_renderer_interface = { .opaque_attribs = gl_renderer_opaque_attribs, .alpha_attribs = gl_renderer_alpha_attribs, @@ -409,22 +411,11 @@ index 098440ce30a2..764bd880d743 100644 + + .output_stream_flip = gl_renderer_output_stream_flip }; -diff --git a/src/gl-renderer.h b/src/gl-renderer.h -index f376edd80106..958caa19e38b 100644 ---- a/src/gl-renderer.h -+++ b/src/gl-renderer.h -@@ -62,6 +62,10 @@ typedef EGLSurface (*PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, - #define EGL_PLATFORM_X11_KHR 0x31D5 - #endif - -+#ifndef EGL_PLATFORM_DEVICE_EXT -+#define EGL_PLATFORM_DEVICE_EXT 0x313F -+#endif -+ - #define NO_EGL_PLATFORM 0 - - enum gl_renderer_border_side { -@@ -74,6 +78,7 @@ enum gl_renderer_border_side { +diff --git a/libweston/gl-renderer.h b/libweston/gl-renderer.h +index 871aa6589b01..02c79c355b47 100644 +--- a/libweston/gl-renderer.h ++++ b/libweston/gl-renderer.h +@@ -59,6 +59,7 @@ enum gl_renderer_border_side { struct gl_renderer_interface { const EGLint *opaque_attribs; const EGLint *alpha_attribs; @@ -432,7 +423,7 @@ index f376edd80106..958caa19e38b 100644 int (*display_create)(struct weston_compositor *ec, EGLenum platform, -@@ -92,6 +97,9 @@ struct gl_renderer_interface { +@@ -77,6 +78,9 @@ struct gl_renderer_interface { const EGLint *visual_id, const int n_ids); @@ -442,7 +433,7 @@ index f376edd80106..958caa19e38b 100644 void (*output_destroy)(struct weston_output *output); EGLSurface (*output_surface)(struct weston_output *output); -@@ -136,5 +144,16 @@ struct gl_renderer_interface { +@@ -121,5 +125,16 @@ struct gl_renderer_interface { int (*get_drm_device_file)(EGLDeviceEXT device, const char **drm_device_file); @@ -459,12 +450,12 @@ index f376edd80106..958caa19e38b 100644 + int (*output_stream_flip)(struct weston_output *output, void *flip_data); }; -diff --git a/src/weston-egl-ext.h b/src/weston-egl-ext.h -index 32f6108fbb83..6597e1143fea 100644 ---- a/src/weston-egl-ext.h -+++ b/src/weston-egl-ext.h -@@ -116,5 +116,23 @@ typedef struct wl_buffer * (EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL) ( - #define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A +diff --git a/libweston/weston-egl-ext.h b/libweston/weston-egl-ext.h +index 6e3699602b5b..79aa2de2b09f 100644 +--- a/libweston/weston-egl-ext.h ++++ b/libweston/weston-egl-ext.h +@@ -152,5 +152,23 @@ typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLD + #define EGL_PLATFORM_X11_KHR 0x31D5 #endif +/* @@ -488,5 +479,5 @@ index 32f6108fbb83..6597e1143fea 100644 #endif -- -2.8.3 +2.10.0 diff --git a/0009-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch b/0009-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch index 52f93c374617..c802e157a4d4 100644 --- a/0009-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch +++ b/0009-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch @@ -1,4 +1,4 @@ -From 1b660d12f9586b8d7b58fc0d18a22728febaf727 Mon Sep 17 00:00:00 2001 +From c3a7bff36253229bfbfed8c72a82f334819ba3e5 Mon Sep 17 00:00:00 2001 From: "Miguel A. Vico" <mvicomoya@nvidia.com> Date: Mon, 2 May 2016 18:22:47 +0200 Subject: [PATCH 09/11] gl-renderer: Add EGL client support for EGLStream frame @@ -23,23 +23,25 @@ Note that some unpublished EGL extensions were needed: Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> Reviewed-by: Adam Cheney <acheney@nvidia.com> Reviewed-by: James Jones <jajones@nvidia.com> + +[aplattner@nvidia.com: rebased on top of Weston 1.12.0] --- - src/gl-renderer.c | 175 +++++++++++++++++++++++++++++++++++++++++++++++++++++- + libweston/gl-renderer.c | 175 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 174 insertions(+), 1 deletion(-) -diff --git a/src/gl-renderer.c b/src/gl-renderer.c -index 764bd880d743..608f4bf4cb92 100644 ---- a/src/gl-renderer.c -+++ b/src/gl-renderer.c +diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c +index 01c5933966ca..be0c5e9b4745 100644 +--- a/libweston/gl-renderer.c ++++ b/libweston/gl-renderer.c @@ -30,6 +30,7 @@ #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> +#include <unistd.h> #include <stdbool.h> + #include <stdint.h> #include <stdlib.h> - #include <string.h> -@@ -161,6 +162,9 @@ struct gl_surface_state { +@@ -163,6 +164,9 @@ struct gl_surface_state { int height; /* in pixels */ int y_inverted; @@ -49,7 +51,7 @@ index 764bd880d743..608f4bf4cb92 100644 struct weston_surface *surface; struct wl_listener surface_destroy_listener; -@@ -212,6 +216,7 @@ struct gl_renderer { +@@ -214,6 +218,7 @@ struct gl_renderer { PFNEGLCREATESTREAMKHRPROC create_stream; PFNEGLDESTROYSTREAMKHRPROC destroy_stream; @@ -57,7 +59,7 @@ index 764bd880d743..608f4bf4cb92 100644 int has_egl_stream; PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC create_stream_producer_surface; -@@ -225,6 +230,13 @@ struct gl_renderer { +@@ -227,6 +232,13 @@ struct gl_renderer { #endif int has_egl_stream_acquire_mode; @@ -71,7 +73,7 @@ index 764bd880d743..608f4bf4cb92 100644 int has_dmabuf_import; struct wl_list dmabuf_images; -@@ -1937,6 +1949,132 @@ gl_renderer_attach_dmabuf(struct weston_surface *surface, +@@ -1934,6 +1946,132 @@ gl_renderer_attach_dmabuf(struct weston_surface *surface, gs->y_inverted = buffer->y_inverted; } @@ -204,7 +206,7 @@ index 764bd880d743..608f4bf4cb92 100644 static void gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) { -@@ -1960,6 +2098,12 @@ gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) +@@ -1957,6 +2095,12 @@ gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) gs->num_textures = 0; gs->buffer_type = BUFFER_TYPE_NULL; gs->y_inverted = 1; @@ -217,7 +219,7 @@ index 764bd880d743..608f4bf4cb92 100644 return; } -@@ -1972,7 +2116,7 @@ gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) +@@ -1969,7 +2113,7 @@ gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) gl_renderer_attach_egl(es, buffer, format); else if ((dmabuf = linux_dmabuf_buffer_get(buffer->resource))) gl_renderer_attach_dmabuf(es, buffer, dmabuf); @@ -226,7 +228,7 @@ index 764bd880d743..608f4bf4cb92 100644 weston_log("unhandled buffer type!\n"); weston_buffer_reference(&gs->buffer_ref, NULL); gs->buffer_type = BUFFER_TYPE_NULL; -@@ -2160,6 +2304,10 @@ surface_state_destroy(struct gl_surface_state *gs, struct gl_renderer *gr) +@@ -2157,6 +2301,10 @@ surface_state_destroy(struct gl_surface_state *gs, struct gl_renderer *gr) weston_buffer_reference(&gs->buffer_ref, NULL); pixman_region32_fini(&gs->texture_damage); @@ -237,7 +239,7 @@ index 764bd880d743..608f4bf4cb92 100644 free(gs); } -@@ -2210,6 +2358,8 @@ gl_renderer_create_surface(struct weston_surface *surface) +@@ -2207,6 +2355,8 @@ gl_renderer_create_surface(struct weston_surface *surface) gs->surface = surface; @@ -246,7 +248,7 @@ index 764bd880d743..608f4bf4cb92 100644 pixman_region32_init(&gs->texture_damage); surface->renderer_state = gs; -@@ -2935,6 +3085,7 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) +@@ -2902,6 +3052,7 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) (void *) eglGetProcAddress("eglQueryOutputLayerAttribEXT"); gr->create_stream = (void *) eglGetProcAddress("eglCreateStreamKHR"); gr->destroy_stream = (void *) eglGetProcAddress("eglDestroyStreamKHR"); @@ -254,7 +256,7 @@ index 764bd880d743..608f4bf4cb92 100644 gr->create_stream_producer_surface = (void *) eglGetProcAddress("eglCreateStreamProducerSurfaceKHR"); gr->stream_consumer_output = -@@ -2943,6 +3094,12 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) +@@ -2910,6 +3061,12 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) gr->stream_consumer_acquire_attrib = (void *) eglGetProcAddress("eglStreamConsumerAcquireAttribEXT"); #endif @@ -267,20 +269,20 @@ index 764bd880d743..608f4bf4cb92 100644 extensions = (const char *) eglQueryString(gr->egl_display, EGL_EXTENSIONS); -@@ -3005,6 +3162,12 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) - if (check_extension(extensions, "EGL_EXT_stream_acquire_mode")) +@@ -2969,6 +3126,12 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) + if (weston_check_egl_extension(extensions, "EGL_EXT_stream_acquire_mode")) gr->has_egl_stream_acquire_mode = 1; -+ if (check_extension(extensions, "EGL_KHR_stream_consumer_gltexture")) ++ if (weston_check_egl_extension(extensions, "EGL_KHR_stream_consumer_gltexture")) + gr->has_egl_stream_consumer_gltexture = 1; + -+ if (check_extension(extensions, "EGL_KHR_stream_cross_process_fd")) ++ if (weston_check_egl_extension(extensions, "EGL_KHR_stream_cross_process_fd")) + gr->has_egl_stream_cross_process_fd = 1; + renderer_setup_egl_client_extensions(gr); return 0; -@@ -3220,6 +3383,16 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, +@@ -3236,6 +3399,16 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, goto fail_terminate; } @@ -298,5 +300,5 @@ index 764bd880d743..608f4bf4cb92 100644 weston_log("warning: EGL page flip event notification not" " supported\n"); -- -2.8.3 +2.10.0 diff --git a/0010-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch b/0010-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch index b294073b9061..1a9de4173f9e 100644 --- a/0010-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch +++ b/0010-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch @@ -1,4 +1,4 @@ -From 8e93cad203be5983ea01fdd4a1b044465c3b8ac0 Mon Sep 17 00:00:00 2001 +From 3aabc17a3b83d255d3a2fd2f597746af20c9647e Mon Sep 17 00:00:00 2001 From: "Miguel A. Vico" <mvicomoya@nvidia.com> Date: Tue, 1 Mar 2016 22:19:14 +0100 Subject: [PATCH 10/11] compositor-drm: Gracefully handle vblank and flip @@ -17,14 +17,16 @@ situations above. Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> Reviewed-by: Andy Ritger <aritger@nvidia.com> + +[aplattner@nvidia.com: rebased on top of Weston 1.12.0] --- - src/compositor-drm.c | 26 +++++++++++++++++++++++--- + libweston/compositor-drm.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) -diff --git a/src/compositor-drm.c b/src/compositor-drm.c -index dd545de1ccc0..51d90e1d6437 100644 ---- a/src/compositor-drm.c -+++ b/src/compositor-drm.c +diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c +index 888881880e16..d1cb21c6b37a 100644 +--- a/libweston/compositor-drm.c ++++ b/libweston/compositor-drm.c @@ -1,6 +1,7 @@ /* * Copyright © 2008-2011 Kristian Høgsberg @@ -33,7 +35,7 @@ index dd545de1ccc0..51d90e1d6437 100644 * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the -@@ -753,8 +754,16 @@ drm_output_start_repaint_loop(struct weston_output *output_base) +@@ -799,8 +800,16 @@ drm_output_start_repaint_loop(struct weston_output *output_base) vbl.request.type |= drm_waitvblank_pipe(output); ret = drmWaitVBlank(backend->drm.fd, &vbl); @@ -52,7 +54,7 @@ index dd545de1ccc0..51d90e1d6437 100644 ts.tv_sec = vbl.reply.tval_sec; ts.tv_nsec = vbl.reply.tval_usec * 1000; -@@ -775,7 +784,7 @@ drm_output_start_repaint_loop(struct weston_output *output_base) +@@ -821,7 +830,7 @@ drm_output_start_repaint_loop(struct weston_output *output_base) } } @@ -61,7 +63,7 @@ index dd545de1ccc0..51d90e1d6437 100644 * Use pageflip fallback. */ fb_id = output->current->fb_id; -@@ -861,6 +870,17 @@ page_flip_handler(int fd, unsigned int frame, +@@ -907,6 +916,17 @@ page_flip_handler(int fd, unsigned int frame, else if (!output->vblank_pending) { ts.tv_sec = sec; ts.tv_nsec = usec * 1000; @@ -80,5 +82,5 @@ index dd545de1ccc0..51d90e1d6437 100644 /* We can't call this from frame_notify, because the output's -- -2.8.3 +2.10.0 diff --git a/0011-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch b/0011-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch index 8fb95c0c0f71..bca79fe7726b 100644 --- a/0011-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch +++ b/0011-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch @@ -1,4 +1,4 @@ -From cb241882dc1903c2330dc68f08c21c76c9a14e91 Mon Sep 17 00:00:00 2001 +From fa43bbf17f0f06a1b7c70087fe9d172fb691bd35 Mon Sep 17 00:00:00 2001 From: "Miguel A. Vico" <mvicomoya@nvidia.com> Date: Thu, 28 Jan 2016 19:37:10 +0100 Subject: [PATCH 11/11] compositor-drm: Add support for EGLDevice+EGLOutput @@ -25,18 +25,38 @@ Reviewed-by: Andy Ritger <aritger@nvidia.com> Reviewed-by: Adam Cheney <acheney@nvidia.com> Reviewed-by: James Jones <jajones@nvidia.com> -[aplattner@nvidia.com: rebased on top of Weston 1.11.0] +[aplattner@nvidia.com: rebased on top of Weston 1.12.0] --- - src/compositor-drm.c | 328 +++++++++++++++++++++++++++++++++++---------------- - src/compositor-drm.h | 3 + - src/main.c | 2 + + compositor/main.c | 2 + + libweston/compositor-drm.c | 328 +++++++++++++++++++++++++++++++-------------- + libweston/compositor-drm.h | 3 + 3 files changed, 233 insertions(+), 100 deletions(-) -diff --git a/src/compositor-drm.c b/src/compositor-drm.c -index 51d90e1d6437..0844cec9f570 100644 ---- a/src/compositor-drm.c -+++ b/src/compositor-drm.c -@@ -76,6 +76,10 @@ +diff --git a/compositor/main.c b/compositor/main.c +index 0e5af5b17fe6..9e9758253eeb 100644 +--- a/compositor/main.c ++++ b/compositor/main.c +@@ -522,6 +522,7 @@ usage(int error_code) + " --seat=SEAT\t\tThe seat that weston should run on\n" + " --tty=TTY\t\tThe tty to use\n" + " --use-pixman\t\tUse the pixman (CPU) renderer\n" ++ " --use-egldevice\tUse EGLDevice and EGLOutput with the GL renderer\n" + " --current-mode\tPrefer current KMS mode over EDID preferred mode\n\n"); + #endif + +@@ -1020,6 +1021,7 @@ load_drm_backend(struct weston_compositor *c, + { WESTON_OPTION_INTEGER, "tty", 0, &config.tty }, + { WESTON_OPTION_BOOLEAN, "current-mode", 0, &config.use_current_mode }, + { WESTON_OPTION_BOOLEAN, "use-pixman", 0, &config.use_pixman }, ++ { WESTON_OPTION_BOOLEAN, "use-egldevice", 0, &config.use_egldevice }, + }; + + parse_options(options, ARRAY_LENGTH(options), argc, argv); +diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c +index d1cb21c6b37a..096ca79a3e2b 100644 +--- a/libweston/compositor-drm.c ++++ b/libweston/compositor-drm.c +@@ -77,6 +77,10 @@ #define GBM_BO_USE_CURSOR GBM_BO_USE_CURSOR_64X64 #endif @@ -47,7 +67,7 @@ index 51d90e1d6437..0844cec9f570 100644 struct drm_backend { struct weston_backend base; struct weston_compositor *compositor; -@@ -91,7 +95,10 @@ struct drm_backend { +@@ -92,7 +96,10 @@ struct drm_backend { int fd; char *filename; } drm; @@ -58,7 +78,7 @@ index 51d90e1d6437..0844cec9f570 100644 uint32_t *crtcs; int num_crtcs; uint32_t crtc_allocator; -@@ -114,6 +121,7 @@ struct drm_backend { +@@ -115,6 +122,7 @@ struct drm_backend { int cursors_are_broken; int use_pixman; @@ -66,7 +86,7 @@ index 51d90e1d6437..0844cec9f570 100644 uint32_t prev_state; -@@ -523,17 +531,21 @@ drm_output_render_gl(struct drm_output *output, pixman_region32_t *damage) +@@ -569,17 +577,21 @@ drm_output_render_gl(struct drm_output *output, pixman_region32_t *damage) output->base.compositor->renderer->repaint_output(&output->base, damage); @@ -98,7 +118,7 @@ index 51d90e1d6437..0844cec9f570 100644 } } -@@ -658,9 +670,14 @@ drm_output_repaint(struct weston_output *output_base, +@@ -704,9 +716,14 @@ drm_output_repaint(struct weston_output *output_base, output_base->set_dpms(output_base, WESTON_DPMS_ON); } @@ -116,15 +136,15 @@ index 51d90e1d6437..0844cec9f570 100644 weston_log("queueing pageflip failed: %m\n"); goto err_pageflip; } -@@ -731,7 +748,6 @@ drm_output_start_repaint_loop(struct weston_output *output_base) - struct drm_output *output = (struct drm_output *) output_base; - struct drm_backend *backend = (struct drm_backend *) - output_base->compositor->backend; +@@ -777,7 +794,6 @@ drm_output_start_repaint_loop(struct weston_output *output_base) + struct drm_output *output = to_drm_output(output_base); + struct drm_backend *backend = + to_drm_backend(output_base->compositor); - uint32_t fb_id; struct timespec ts, tnow; struct timespec vbl2now; int64_t refresh_nsec; -@@ -787,10 +803,14 @@ drm_output_start_repaint_loop(struct weston_output *output_base) +@@ -833,10 +849,14 @@ drm_output_start_repaint_loop(struct weston_output *output_base) /* Immediate query succeeded, but didn't provide valid timestamp. * Use pageflip fallback. */ @@ -142,7 +162,7 @@ index 51d90e1d6437..0844cec9f570 100644 weston_log("queueing pageflip failed: %m\n"); goto finish_frame; } -@@ -1322,6 +1342,9 @@ static void +@@ -1365,6 +1385,9 @@ static void drm_output_fini_pixman(struct drm_output *output); static void @@ -151,8 +171,8 @@ index 51d90e1d6437..0844cec9f570 100644 +static void drm_output_destroy(struct weston_output *output_base) { - struct drm_output *output = (struct drm_output *) output_base; -@@ -1352,12 +1375,10 @@ drm_output_destroy(struct weston_output *output_base) + struct drm_output *output = to_drm_output(output_base); +@@ -1394,12 +1417,10 @@ drm_output_destroy(struct weston_output *output_base) b->crtc_allocator &= ~(1 << output->crtc_id); b->connector_allocator &= ~(1 << output->connector_id); @@ -168,7 +188,7 @@ index 51d90e1d6437..0844cec9f570 100644 weston_plane_release(&output->fb_plane); weston_plane_release(&output->cursor_plane); -@@ -1456,9 +1477,7 @@ drm_output_switch_mode(struct weston_output *output_base, struct weston_mode *mo +@@ -1498,9 +1519,7 @@ drm_output_switch_mode(struct weston_output *output_base, struct weston_mode *mo return -1; } } else { @@ -179,7 +199,7 @@ index 51d90e1d6437..0844cec9f570 100644 if (drm_output_init_egl(output, b) < 0) { weston_log("failed to init output egl state with " "new mode"); -@@ -1545,11 +1564,6 @@ create_gbm_device(int fd) +@@ -1587,11 +1606,6 @@ create_gbm_device(int fd) { struct gbm_device *gbm; @@ -191,7 +211,7 @@ index 51d90e1d6437..0844cec9f570 100644 /* GBM will load a dri driver, but even though they need symbols from * libglapi, in some version of Mesa they are not linked to it. Since * only the gl-renderer module links to it, the call above won't make -@@ -1562,6 +1576,39 @@ create_gbm_device(int fd) +@@ -1604,6 +1618,39 @@ create_gbm_device(int fd) return gbm; } @@ -231,7 +251,7 @@ index 51d90e1d6437..0844cec9f570 100644 /* When initializing EGL, if the preferred buffer format isn't available * we may be able to substitute an ARGB format for an XRGB one. * -@@ -1588,38 +1635,61 @@ fallback_format_for(uint32_t format) +@@ -1630,38 +1677,61 @@ fallback_format_for(uint32_t format) static int drm_backend_create_gl_renderer(struct drm_backend *b) { @@ -316,7 +336,7 @@ index 51d90e1d6437..0844cec9f570 100644 return -1; } -@@ -1846,55 +1916,95 @@ find_crtc_for_connector(struct drm_backend *b, +@@ -1888,55 +1958,95 @@ find_crtc_for_connector(struct drm_backend *b, static int drm_output_init_egl(struct drm_output *output, struct drm_backend *b) { @@ -353,7 +373,7 @@ index 51d90e1d6437..0844cec9f570 100644 - return -1; - } + /* Create a black dumb fb for modesetting */ -+ output->dumb[0] = drm_fb_create_dumb(b, w, h); ++ output->dumb[0] = drm_fb_create_dumb(b, w, h, b->gbm_format); + if (!output->dumb[0]) { + weston_log("failed to create dumb framebuffer\n"); + return -1; @@ -451,7 +471,7 @@ index 51d90e1d6437..0844cec9f570 100644 static int drm_output_init_pixman(struct drm_output *output, struct drm_backend *b) { -@@ -2344,8 +2454,10 @@ create_output_for_connector(struct drm_backend *b, +@@ -2399,8 +2509,10 @@ create_output_for_connector(struct drm_backend *b, mode = b->configure_output(b->compositor, b->use_current_mode, output->base.name, &config); @@ -464,7 +484,7 @@ index 51d90e1d6437..0844cec9f570 100644 setup_output_seat_constraint(b, &output->base, config.seat ? config.seat : ""); -@@ -2955,6 +3067,11 @@ recorder_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, +@@ -3003,6 +3115,11 @@ recorder_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, struct drm_output *output; int width, height; @@ -476,7 +496,7 @@ index 51d90e1d6437..0844cec9f570 100644 output = container_of(b->compositor->output_list.next, struct drm_output, base.link); -@@ -3010,11 +3127,20 @@ switch_to_gl_renderer(struct drm_backend *b) +@@ -3058,11 +3175,20 @@ switch_to_gl_renderer(struct drm_backend *b) weston_log("Switching to GL renderer\n"); @@ -502,7 +522,7 @@ index 51d90e1d6437..0844cec9f570 100644 } wl_list_for_each(output, &b->compositor->output_list, base.link) -@@ -3023,7 +3149,8 @@ switch_to_gl_renderer(struct drm_backend *b) +@@ -3071,7 +3197,8 @@ switch_to_gl_renderer(struct drm_backend *b) b->compositor->renderer->destroy(b->compositor); if (drm_backend_create_gl_renderer(b) < 0) { @@ -512,7 +532,7 @@ index 51d90e1d6437..0844cec9f570 100644 weston_log("Failed to create GL renderer. Quitting.\n"); /* FIXME: we need a function to shutdown cleanly */ assert(0); -@@ -3080,6 +3207,7 @@ drm_backend_create(struct weston_compositor *compositor, +@@ -3128,6 +3255,7 @@ drm_backend_create(struct weston_compositor *compositor, b->sprites_are_broken = 1; b->compositor = compositor; b->use_pixman = config->use_pixman; @@ -520,11 +540,11 @@ index 51d90e1d6437..0844cec9f570 100644 b->configure_output = config->configure_output; b->use_current_mode = config->use_current_mode; -diff --git a/src/compositor-drm.h b/src/compositor-drm.h -index 3f150dba28b3..816830434aeb 100644 ---- a/src/compositor-drm.h -+++ b/src/compositor-drm.h -@@ -87,6 +87,9 @@ struct weston_drm_backend_config { +diff --git a/libweston/compositor-drm.h b/libweston/compositor-drm.h +index 1266031f09f1..feb423d8f49c 100644 +--- a/libweston/compositor-drm.h ++++ b/libweston/compositor-drm.h +@@ -89,6 +89,9 @@ struct weston_drm_backend_config { /** Whether to use the pixman renderer instead of the OpenGL ES renderer. */ bool use_pixman; @@ -534,26 +554,6 @@ index 3f150dba28b3..816830434aeb 100644 /** The seat to be used for input and output. * * If NULL the default "seat0" will be used. The backend will -diff --git a/src/main.c b/src/main.c -index 3279ac6a8b02..ad1a1fc98344 100644 ---- a/src/main.c -+++ b/src/main.c -@@ -277,6 +277,7 @@ usage(int error_code) - " --seat=SEAT\t\tThe seat that weston should run on\n" - " --tty=TTY\t\tThe tty to use\n" - " --use-pixman\t\tUse the pixman (CPU) renderer\n" -+ " --use-egldevice\tUse EGLDevice and EGLOutput with the GL renderer\n" - " --current-mode\tPrefer current KMS mode over EDID preferred mode\n\n"); - #endif - -@@ -750,6 +751,7 @@ load_drm_backend(struct weston_compositor *c, const char *backend, - { WESTON_OPTION_INTEGER, "tty", 0, &config.tty }, - { WESTON_OPTION_BOOLEAN, "current-mode", 0, &config.use_current_mode }, - { WESTON_OPTION_BOOLEAN, "use-pixman", 0, &config.use_pixman }, -+ { WESTON_OPTION_BOOLEAN, "use-egldevice", 0, &config.use_egldevice }, - }; - - parse_options(options, ARRAY_LENGTH(options), argc, argv); -- -2.8.3 +2.10.0 @@ -3,7 +3,7 @@ # Contributor: Joel Teichroeb <joel@teichroeb.net> pkgname=weston-eglstream -pkgver=1.11.0 +pkgver=1.12.0 pkgrel=1 pkgdesc='Reference implementation of a Wayland compositor with EGLStream support' arch=('i686' 'x86_64') @@ -25,18 +25,18 @@ source=("http://wayland.freedesktop.org/releases/weston-$pkgver.tar.xz" '0009-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch' '0010-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch' '0011-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch') -sha1sums=('8b051ee16b785b6db16657161aeed6cd6724f028' - '67741bea89d102740e1d8726d20cf6d278d6d51e' - '63b21515874749572d515266d49c202dbc560a43' - '551571daaabab0ded8c1dc58cd45035fad3a6387' - '96b73103c25811a7721a40487ad7ec5d9436fa11' - 'd1aab8b491b50dbcfceb96aa154df0bac04ec4f4' - 'c74abfd3e5ee691a889be8d03a841c96da6602c0' - '5148c5ec24a98af3d33f65eabbba065f4556b212' - '25634c91c587af648cb2428e2124c23e22e6025b' - 'a51dfacd54988910e909789e31bea43b9c2156fe' - '350c82bee9bd06c0b678fabf08fcef405e832083' - 'c1db4cb0ac1d685a0c6e9d020238f8ea0c163318') +sha256sums=('ac7ac2a32e3b9f50131fccded5d2326bd36b2226712d90b61999118a09af5033' + 'f8186d1d5229e838ca77b655792a3b0b4d9c329859df1d900d501f5ef4aec1af' + 'f600db2a8e71697a229b4f7f8052992b5ad41a99e273adf7119cb9e428de59a9' + 'bb807ce209fbf0381bc2fb61ad3251ecf0f266dfb20f90a54cc3c2517b6ba1b8' + '09fcb3685832ac3c891004029cc2863ea999b18af2ce3f9806bc208a8da368b5' + '02e232526a7c4ad3b543645135eddd5f945a8531e1436bfccebccf07b193fd87' + 'c789174b8f44f5c8835ad125f9f3a3b3637e2ca47c8ec1424202dc0b96cfb266' + '4a3ed4667158da25511f113df87e93bb73dd053a7593fb754486f3a44495f617' + 'c3a4dbe92e5e16fc486a389dc5e09e55ff064c4e7ac96cdf2bc7edc4f7bd0387' + 'f3bab7e342e8267b8f60a33a3fdd839fb3461869945b55783e2a726119394aab' + '995691ee0dbdd21b864d806281c832ea6ed42623315176d9774a0a078999029a' + 'd12b9820df5331dd0bb7e99a28a862009e0def600166d735dda330ea41e8b15e') prepare() { cd weston-$pkgver |