diff options
-rw-r--r-- | .SRCINFO | 26 | ||||
-rw-r--r-- | 0001-gl-renderer-Rename-gl_renderer_create-to-gl_renderer.patch | 86 | ||||
-rw-r--r-- | 0002-gl-renderer-Rename-gl_renderer-output_create-to-outp.patch | 123 | ||||
-rw-r--r-- | 0003-gl-renderer-Rename-attribs-param-of-gl_renderer-to-c.patch | 48 | ||||
-rw-r--r-- | 0004-gl-renderer-Add-platform_attribs-param-to-gl_rendere.patch | 62 | ||||
-rw-r--r-- | 0005-gl-renderer-Accept-non-NULL-empty-visual_id-arrays.patch | 10 | ||||
-rw-r--r-- | 0006-gl-renderer-Refactor-gl_renderer_output_window_creat.patch | 48 | ||||
-rw-r--r-- | 0007-gl-renderer-Add-EGLDevice-enumeration-support.patch | 54 | ||||
-rw-r--r-- | 0008-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch | 188 | ||||
-rw-r--r-- | 0009-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch | 224 | ||||
-rw-r--r-- | 0010-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch | 34 | ||||
-rw-r--r-- | 0011-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch | 207 | ||||
-rw-r--r-- | 0012-Add-nvidia-release-notes-file.patch | 37 | ||||
-rw-r--r-- | PKGBUILD | 29 |
14 files changed, 668 insertions, 508 deletions
@@ -1,7 +1,7 @@ pkgbase = weston-eglstream pkgdesc = Reference implementation of a Wayland compositor with EGLStream support pkgver = 1.12.0 - pkgrel = 1 + pkgrel = 2 url = http://wayland.freedesktop.org arch = i686 arch = x86_64 @@ -31,18 +31,20 @@ pkgbase = weston-eglstream source = 0009-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch source = 0010-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch source = 0011-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch + source = 0012-Add-nvidia-release-notes-file.patch sha256sums = ac7ac2a32e3b9f50131fccded5d2326bd36b2226712d90b61999118a09af5033 - sha256sums = f8186d1d5229e838ca77b655792a3b0b4d9c329859df1d900d501f5ef4aec1af - sha256sums = f600db2a8e71697a229b4f7f8052992b5ad41a99e273adf7119cb9e428de59a9 - sha256sums = bb807ce209fbf0381bc2fb61ad3251ecf0f266dfb20f90a54cc3c2517b6ba1b8 - sha256sums = 09fcb3685832ac3c891004029cc2863ea999b18af2ce3f9806bc208a8da368b5 - sha256sums = 02e232526a7c4ad3b543645135eddd5f945a8531e1436bfccebccf07b193fd87 - sha256sums = c789174b8f44f5c8835ad125f9f3a3b3637e2ca47c8ec1424202dc0b96cfb266 - sha256sums = 4a3ed4667158da25511f113df87e93bb73dd053a7593fb754486f3a44495f617 - sha256sums = c3a4dbe92e5e16fc486a389dc5e09e55ff064c4e7ac96cdf2bc7edc4f7bd0387 - sha256sums = f3bab7e342e8267b8f60a33a3fdd839fb3461869945b55783e2a726119394aab - sha256sums = 995691ee0dbdd21b864d806281c832ea6ed42623315176d9774a0a078999029a - sha256sums = d12b9820df5331dd0bb7e99a28a862009e0def600166d735dda330ea41e8b15e + sha256sums = dc51d39b460385eff7694f11aa3096896a58246f0d0ffdcd77ac9d07bf4781d7 + sha256sums = e9088f7fa816d8c04bfa0abfcbb0c33b436cea157efce03663202131bcf8a053 + sha256sums = 2abc0c12a7c3465c2289e6940f538cf6cb46f4f9c57eff1884b15134a460ef2e + sha256sums = 9e9cb4ee001d62c09753994225d944b3eb90788d29b69b1d3ffead38c09c8934 + sha256sums = 7492e7d6b3d4d8a95433cbc845117746e48047794422c28b37c16fe60078a6f8 + sha256sums = d7ae91ed894a17d578371be877ebd0ab2204522f5f17388ea3ef0714afe85bba + sha256sums = 1a703d7743b55ccbe934389b1c4430f4f4535f4864439b86097b80d1b42e7e2c + sha256sums = d5a8fddd8ddae650a283915478e8d41669a1dcc953df4317b5d178e14221fa4a + sha256sums = fb759e98bffb406904366b735f7f50f2726a2a1c6700a9cf544d4c763f46bbfa + sha256sums = 8b6ef50772bf02adb951266ad5d973a701dd147fc168d8d6fa7cbafe0900dbda + sha256sums = 7838e7de7ac5b7fe4e98392235907333d4977939a487ff4cf2a2bd8756fc49cb + sha256sums = f916ded74db76cfe3566654b5dc5a90b214a1572ffd7c15aa5e577ceabc22ab4 pkgname = weston-eglstream 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 9d3ee0363394..6d53946b0412 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,7 +1,7 @@ -From 1f96676539f06d5b92bccf98a1d388cad0bf0c41 Mon Sep 17 00:00:00 2001 +From b573a9c1037449125398c49578e286f2da6dcc29 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 +Subject: [PATCH 01/12] gl-renderer: Rename gl_renderer_create to gl_renderer_display_create X-NVConfidentiality: public @@ -11,44 +11,62 @@ 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] --- - 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(-) + libweston/compositor-drm.c | 12 ++++++------ + libweston/compositor-wayland.c | 12 ++++++------ + libweston/compositor-x11.c | 5 +++-- + libweston/gl-renderer.c | 4 ++-- + libweston/gl-renderer.h | 12 ++++++------ + 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c -index 8319d7cf3ede..4046c8d6435c 100644 +index 8319d7cf3ede..c6ec767489ee 100644 --- a/libweston/compositor-drm.c +++ b/libweston/compositor-drm.c -@@ -1619,7 +1619,7 @@ drm_backend_create_gl_renderer(struct drm_backend *b) +@@ -1619,12 +1619,12 @@ drm_backend_create_gl_renderer(struct drm_backend *b) if (format[1]) n_formats = 3; - if (gl_renderer->create(b->compositor, +- EGL_PLATFORM_GBM_KHR, +- (void *)b->gbm, +- gl_renderer->opaque_attribs, +- format, +- n_formats) < 0) { + if (gl_renderer->display_create(b->compositor, - EGL_PLATFORM_GBM_KHR, - (void *)b->gbm, - gl_renderer->opaque_attribs, ++ EGL_PLATFORM_GBM_KHR, ++ (void *)b->gbm, ++ gl_renderer->opaque_attribs, ++ format, ++ n_formats) < 0) { + return -1; + } + diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c -index c223baa3db26..1a9db60cd644 100644 +index c223baa3db26..621e59ecac5a 100644 --- a/libweston/compositor-wayland.c +++ b/libweston/compositor-wayland.c -@@ -2220,7 +2220,7 @@ wayland_backend_create(struct weston_compositor *compositor, +@@ -2220,12 +2220,12 @@ wayland_backend_create(struct weston_compositor *compositor, } if (!b->use_pixman) { - if (gl_renderer->create(compositor, +- EGL_PLATFORM_WAYLAND_KHR, +- b->parent.wl_display, +- gl_renderer->alpha_attribs, +- NULL, +- 0) < 0) { + if (gl_renderer->display_create(compositor, - EGL_PLATFORM_WAYLAND_KHR, - b->parent.wl_display, - gl_renderer->alpha_attribs, ++ EGL_PLATFORM_WAYLAND_KHR, ++ b->parent.wl_display, ++ gl_renderer->alpha_attribs, ++ NULL, ++ 0) < 0) { + weston_log("Failed to initialize the GL renderer; " + "falling back to pixman.\n"); + b->use_pixman = 1; diff --git a/libweston/compositor-x11.c b/libweston/compositor-x11.c -index 3e0d20fbb768..97e151b27b71 100644 +index 3e0d20fbb768..84747a052d10 100644 --- a/libweston/compositor-x11.c +++ b/libweston/compositor-x11.c @@ -1582,8 +1582,9 @@ init_gl_renderer(struct x11_backend *b) @@ -58,8 +76,8 @@ index 3e0d20fbb768..97e151b27b71 100644 - ret = gl_renderer->create(b->compositor, EGL_PLATFORM_X11_KHR, (void *) b->dpy, - gl_renderer->opaque_attribs, NULL, 0); + ret = gl_renderer->display_create(b->compositor, EGL_PLATFORM_X11_KHR, -+ (void *) b->dpy, -+ gl_renderer->opaque_attribs, NULL, 0); ++ (void *) b->dpy, ++ gl_renderer->opaque_attribs, NULL, 0); return ret; } @@ -86,18 +104,28 @@ index 031576bcf997..9d5d65b03e46 100644 .output_create = gl_renderer_output_create, .output_destroy = gl_renderer_output_destroy, diff --git a/libweston/gl-renderer.h b/libweston/gl-renderer.h -index 37d000fefb85..71d5aab51c76 100644 +index 37d000fefb85..32ba1536b60e 100644 --- a/libweston/gl-renderer.h +++ b/libweston/gl-renderer.h -@@ -60,7 +60,7 @@ struct gl_renderer_interface { +@@ -60,12 +60,12 @@ struct gl_renderer_interface { const EGLint *opaque_attribs; const EGLint *alpha_attribs; - int (*create)(struct weston_compositor *ec, +- EGLenum platform, +- void *native_window, +- const EGLint *attribs, +- const EGLint *visual_id, +- const int n_ids); + int (*display_create)(struct weston_compositor *ec, - EGLenum platform, - void *native_window, - const EGLint *attribs, ++ EGLenum platform, ++ void *native_window, ++ const EGLint *attribs, ++ const EGLint *visual_id, ++ const int n_ids); + + EGLDisplay (*display)(struct weston_compositor *ec); + -- -2.10.0 +2.10.2 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 5617c5aba5d2..16d54ff7c08b 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,7 +1,7 @@ -From 4aeeb96a3381cc2bde66ca437f150a6764cf0c95 Mon Sep 17 00:00:00 2001 +From 91a4ade03a1d92f275a046dcf1b616b551e8bbc5 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 +Subject: [PATCH 02/12] gl-renderer: Rename gl_renderer::output_create to output_window_create X-NVConfidentiality: public @@ -12,68 +12,107 @@ 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] --- - 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(-) + libweston/compositor-drm.c | 12 ++++++------ + libweston/compositor-wayland.c | 12 ++++++------ + libweston/compositor-x11.c | 13 +++++++------ + libweston/gl-renderer.c | 14 +++++++------- + libweston/gl-renderer.h | 12 ++++++------ + 5 files changed, 32 insertions(+), 31 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c -index 4046c8d6435c..87cd7be22344 100644 +index c6ec767489ee..d10734a6e777 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) +@@ -1886,12 +1886,12 @@ drm_output_init_egl(struct drm_output *output, struct drm_backend *b) if (format[1]) n_formats = 2; - if (gl_renderer->output_create(&output->base, +- (EGLNativeWindowType)output->gbm_surface, +- output->gbm_surface, +- gl_renderer->opaque_attribs, +- format, +- n_formats) < 0) { + if (gl_renderer->output_window_create(&output->base, - (EGLNativeWindowType)output->gbm_surface, - output->gbm_surface, - gl_renderer->opaque_attribs, ++ (EGLNativeWindowType)output->gbm_surface, ++ output->gbm_surface, ++ gl_renderer->opaque_attribs, ++ format, ++ n_formats) < 0) { + weston_log("failed to create gl renderer output state\n"); + gbm_surface_destroy(output->gbm_surface); + return -1; diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c -index 1a9db60cd644..b434700fa0ff 100644 +index 621e59ecac5a..6370f6a2ecb3 100644 --- a/libweston/compositor-wayland.c +++ b/libweston/compositor-wayland.c -@@ -671,7 +671,7 @@ wayland_output_init_gl_renderer(struct wayland_output *output) +@@ -671,12 +671,12 @@ wayland_output_init_gl_renderer(struct wayland_output *output) return -1; } - if (gl_renderer->output_create(&output->base, +- output->gl.egl_window, +- output->gl.egl_window, +- gl_renderer->alpha_attribs, +- NULL, +- 0) < 0) + if (gl_renderer->output_window_create(&output->base, - output->gl.egl_window, - output->gl.egl_window, - gl_renderer->alpha_attribs, ++ output->gl.egl_window, ++ output->gl.egl_window, ++ gl_renderer->alpha_attribs, ++ NULL, ++ 0) < 0) + goto cleanup_window; + + return 0; diff --git a/libweston/compositor-x11.c b/libweston/compositor-x11.c -index 97e151b27b71..0664e220d10f 100644 +index 84747a052d10..ef98f74bb9da 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, +@@ -953,12 +953,13 @@ x11_backend_create_output(struct x11_backend *b, int x, int y, * but eglCreateWindowSurface takes a Window. */ Window xid = (Window) output->window; - ret = gl_renderer->output_create(&output->base, -+ ret = gl_renderer->output_window_create(&output->base, - (EGLNativeWindowType) output->window, - &xid, - gl_renderer->opaque_attribs, +- (EGLNativeWindowType) output->window, +- &xid, +- gl_renderer->opaque_attribs, +- NULL, +- 0); ++ ret = gl_renderer->output_window_create( ++ &output->base, ++ (EGLNativeWindowType) output->window, ++ &xid, ++ gl_renderer->opaque_attribs, ++ NULL, ++ 0); + if (ret < 0) + return NULL; + } diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c -index 9d5d65b03e46..0015268d210a 100644 +index 9d5d65b03e46..7e6a707406ad 100644 --- a/libweston/gl-renderer.c +++ b/libweston/gl-renderer.c -@@ -2544,7 +2544,7 @@ static int +@@ -2544,12 +2544,12 @@ static int gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface); static int -gl_renderer_output_create(struct weston_output *output, +- EGLNativeWindowType window_for_legacy, +- void *window_for_platform, +- const EGLint *attribs, +- const EGLint *visual_id, +- int n_ids) +gl_renderer_output_window_create(struct weston_output *output, - EGLNativeWindowType window_for_legacy, - void *window_for_platform, - const EGLint *attribs, ++ EGLNativeWindowType window_for_legacy, ++ void *window_for_platform, ++ const EGLint *attribs, ++ const EGLint *visual_id, ++ int n_ids) + { + struct weston_compositor *ec = output->compositor; + struct gl_renderer *gr = get_renderer(ec); @@ -3183,7 +3183,7 @@ WL_EXPORT struct gl_renderer_interface gl_renderer_interface = { .display_create = gl_renderer_display_create, @@ -84,18 +123,28 @@ index 9d5d65b03e46..0015268d210a 100644 .output_surface = gl_renderer_output_surface, .output_set_border = gl_renderer_output_set_border, diff --git a/libweston/gl-renderer.h b/libweston/gl-renderer.h -index 71d5aab51c76..5b3b68a8e4fa 100644 +index 32ba1536b60e..ee32790463aa 100644 --- a/libweston/gl-renderer.h +++ b/libweston/gl-renderer.h -@@ -69,7 +69,7 @@ struct gl_renderer_interface { +@@ -69,12 +69,12 @@ struct gl_renderer_interface { EGLDisplay (*display)(struct weston_compositor *ec); - int (*output_create)(struct weston_output *output, +- EGLNativeWindowType window_for_legacy, +- void *window_for_platform, +- const EGLint *attribs, +- const EGLint *visual_id, +- const int n_ids); + int (*output_window_create)(struct weston_output *output, - EGLNativeWindowType window_for_legacy, - void *window_for_platform, - const EGLint *attribs, ++ EGLNativeWindowType window_for_legacy, ++ void *window_for_platform, ++ const EGLint *attribs, ++ const EGLint *visual_id, ++ const int n_ids); + + void (*output_destroy)(struct weston_output *output); + -- -2.10.0 +2.10.2 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 e0e7703e7e07..906d98d37c5f 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,7 +1,7 @@ -From 31f40175f702c8799bd69d5d9612d90e247501f3 Mon Sep 17 00:00:00 2001 +From 12f63391c5a05d1b6176ac91d8a00b3e9982f996 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 +Subject: [PATCH 03/12] gl-renderer: Rename <attribs> param of gl_renderer to <config_attribs> X-NVConfidentiality: public @@ -13,25 +13,23 @@ 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] --- libweston/gl-renderer.c | 8 ++++---- libweston/gl-renderer.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c -index 0015268d210a..e11c22cf3f05 100644 +index 7e6a707406ad..bb5c079eed92 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, -- const EGLint *attribs, -+ const EGLint *config_attribs, - const EGLint *visual_id, - int n_ids) + EGLNativeWindowType window_for_legacy, + void *window_for_platform, +- const EGLint *attribs, ++ const EGLint *config_attribs, + const EGLint *visual_id, + int n_ids) { @@ -2557,7 +2557,7 @@ gl_renderer_output_window_create(struct weston_output *output, EGLConfig egl_config; @@ -61,27 +59,27 @@ index 0015268d210a..e11c22cf3f05 100644 weston_log("failed to choose EGL config\n"); goto fail_terminate; diff --git a/libweston/gl-renderer.h b/libweston/gl-renderer.h -index 5b3b68a8e4fa..9d6648680533 100644 +index ee32790463aa..1835d2536670 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, -- const EGLint *attribs, -+ const EGLint *config_attribs, - const EGLint *visual_id, - const int n_ids); + EGLenum platform, + void *native_window, +- const EGLint *attribs, ++ const EGLint *config_attribs, + const EGLint *visual_id, + const int n_ids); @@ -72,7 +72,7 @@ struct gl_renderer_interface { int (*output_window_create)(struct weston_output *output, - EGLNativeWindowType window_for_legacy, - void *window_for_platform, -- const EGLint *attribs, -+ const EGLint *config_attribs, - const EGLint *visual_id, - const int n_ids); + EGLNativeWindowType window_for_legacy, + void *window_for_platform, +- const EGLint *attribs, ++ const EGLint *config_attribs, + const EGLint *visual_id, + const int n_ids); -- -2.10.0 +2.10.2 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 6f71a7ac89b7..9e7097b0b3d7 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,7 +1,7 @@ -From 4e02c69b513e5cb02451c794a9ed5091c74abc04 Mon Sep 17 00:00:00 2001 +From d8ff7f97e20b05ae5889a42590df5614845d1f7f 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 +Subject: [PATCH 04/12] gl-renderer: Add <platform_attribs> param to gl_renderer_display_create X-NVConfidentiality: public @@ -12,8 +12,6 @@ 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] --- libweston/compositor-drm.c | 1 + libweston/compositor-wayland.c | 1 + @@ -23,44 +21,44 @@ Reviewed-by: James Jones <jajones@nvidia.com> 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c -index 87cd7be22344..888881880e16 100644 +index d10734a6e777..df357c3c809b 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, -+ NULL, - gl_renderer->opaque_attribs, - format, - n_formats) < 0) { + EGL_PLATFORM_GBM_KHR, + (void *)b->gbm, ++ NULL, + gl_renderer->opaque_attribs, + format, + n_formats) < 0) { diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c -index b434700fa0ff..359a3c85624f 100644 +index 6370f6a2ecb3..7655f8d3e4c8 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, -+ NULL, - gl_renderer->alpha_attribs, - NULL, - 0) < 0) { + EGL_PLATFORM_WAYLAND_KHR, + b->parent.wl_display, ++ NULL, + gl_renderer->alpha_attribs, + NULL, + 0) < 0) { diff --git a/libweston/compositor-x11.c b/libweston/compositor-x11.c -index 0664e220d10f..8b03274814dc 100644 +index ef98f74bb9da..a8246b1ee221 100644 --- a/libweston/compositor-x11.c +++ b/libweston/compositor-x11.c -@@ -1583,7 +1583,7 @@ init_gl_renderer(struct x11_backend *b) +@@ -1584,7 +1584,7 @@ init_gl_renderer(struct x11_backend *b) return -1; ret = gl_renderer->display_create(b->compositor, EGL_PLATFORM_X11_KHR, -- (void *) b->dpy, -+ (void *) b->dpy, NULL, - gl_renderer->opaque_attribs, NULL, 0); +- (void *) b->dpy, ++ (void *) b->dpy, NULL, + gl_renderer->opaque_attribs, NULL, 0); return ret; diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c -index e11c22cf3f05..729abd62c0d6 100644 +index bb5c079eed92..736394a53eed 100644 --- a/libweston/gl-renderer.c +++ b/libweston/gl-renderer.c @@ -2891,8 +2891,8 @@ gl_renderer_create_pbuffer_surface(struct gl_renderer *gr) { @@ -84,17 +82,17 @@ index e11c22cf3f05..729abd62c0d6 100644 } diff --git a/libweston/gl-renderer.h b/libweston/gl-renderer.h -index 9d6648680533..02f8011247db 100644 +index 1835d2536670..b47ea07feaf0 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, -+ const EGLint *platform_attribs, - const EGLint *config_attribs, - const EGLint *visual_id, - const int n_ids); + EGLenum platform, + void *native_window, ++ const EGLint *platform_attribs, + const EGLint *config_attribs, + const EGLint *visual_id, + const int n_ids); -- -2.10.0 +2.10.2 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 1743dc23258a..0b16279fae70 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,7 +1,7 @@ -From 4c883f42265ecdddada48ba12818fdf373931f04 Mon Sep 17 00:00:00 2001 +From 7c056812b4c233b8af919e4d3db44a887e948b03 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 +Subject: [PATCH 05/12] gl-renderer: Accept non-NULL empty <visual_id> arrays X-NVConfidentiality: public This change modifies egl_choose_config() to accept a non-NULL but empty @@ -10,14 +10,12 @@ 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] --- libweston/gl-renderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c -index 729abd62c0d6..dd04caa87102 100644 +index 736394a53eed..3ffd0dd8e3b7 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, @@ -30,5 +28,5 @@ index 729abd62c0d6..dd04caa87102 100644 for (i = 0; config_index == -1 && i < n_ids; i++) -- -2.10.0 +2.10.2 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 fac32737ef28..314b2cfded5e 100644 --- a/0006-gl-renderer-Refactor-gl_renderer_output_window_creat.patch +++ b/0006-gl-renderer-Refactor-gl_renderer_output_window_creat.patch @@ -1,7 +1,7 @@ -From d53c17a0c190f240b71e573c03bdf3abb264126f Mon Sep 17 00:00:00 2001 +From c481d05b7284ec9a8d46267052b773b44043905a 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 +Subject: [PATCH 06/12] gl-renderer: Refactor gl_renderer_output_window_create() X-NVConfidentiality: public @@ -15,14 +15,12 @@ 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] --- - libweston/gl-renderer.c | 87 +++++++++++++++++++++++++++++++++---------------- - 1 file changed, 59 insertions(+), 28 deletions(-) + libweston/gl-renderer.c | 99 ++++++++++++++++++++++++++++++++----------------- + 1 file changed, 65 insertions(+), 34 deletions(-) diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c -index dd04caa87102..067e677f8a7b 100644 +index 3ffd0dd8e3b7..508f8b92797e 100644 --- a/libweston/gl-renderer.c +++ b/libweston/gl-renderer.c @@ -1,6 +1,7 @@ @@ -39,17 +37,23 @@ index dd04caa87102..067e677f8a7b 100644 -static int -gl_renderer_output_window_create(struct weston_output *output, -+static EGLSurface -+gl_renderer_create_window_surface(struct gl_renderer *gr, - EGLNativeWindowType window_for_legacy, - void *window_for_platform, - const EGLint *config_attribs, - const EGLint *visual_id, - int n_ids) - { +- EGLNativeWindowType window_for_legacy, +- void *window_for_platform, +- const EGLint *config_attribs, +- const EGLint *visual_id, +- int n_ids) +-{ - struct weston_compositor *ec = output->compositor; - struct gl_renderer *gr = get_renderer(ec); - struct gl_output_state *go; ++static EGLSurface ++gl_renderer_create_window_surface(struct gl_renderer *gr, ++ EGLNativeWindowType window_for_legacy, ++ void *window_for_platform, ++ const EGLint *config_attribs, ++ const EGLint *visual_id, ++ int n_ids) ++{ + EGLSurface egl_surface = EGL_NO_SURFACE; EGLConfig egl_config; - int i; @@ -87,7 +91,7 @@ index dd04caa87102..067e677f8a7b 100644 + +static int +gl_renderer_output_create(struct weston_output *output, -+ EGLSurface surface) ++ EGLSurface surface) +{ + struct gl_output_state *go; + int i; @@ -128,11 +132,11 @@ index dd04caa87102..067e677f8a7b 100644 +static int +gl_renderer_output_window_create(struct weston_output *output, -+ EGLNativeWindowType window_for_legacy, -+ void *window_for_platform, -+ const EGLint *config_attribs, -+ const EGLint *visual_id, -+ int n_ids) ++ EGLNativeWindowType window_for_legacy, ++ void *window_for_platform, ++ const EGLint *config_attribs, ++ const EGLint *visual_id, ++ int n_ids) +{ + struct weston_compositor *ec = output->compositor; + struct gl_renderer *gr = get_renderer(ec); @@ -160,5 +164,5 @@ index dd04caa87102..067e677f8a7b 100644 gl_renderer_output_destroy(struct weston_output *output) { -- -2.10.0 +2.10.2 diff --git a/0007-gl-renderer-Add-EGLDevice-enumeration-support.patch b/0007-gl-renderer-Add-EGLDevice-enumeration-support.patch index 322e011e16af..59597b09ebb1 100644 --- a/0007-gl-renderer-Add-EGLDevice-enumeration-support.patch +++ b/0007-gl-renderer-Add-EGLDevice-enumeration-support.patch @@ -1,7 +1,7 @@ -From 21f53facea84443ed09fbd400530a58e3695906b Mon Sep 17 00:00:00 2001 +From e57c601797288a2391a3ef177cb3681f2f6ca167 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 +Subject: [PATCH 07/12] gl-renderer: Add EGLDevice enumeration support X-NVConfidentiality: public EGLDevice provides means to enumerate native devices. @@ -16,24 +16,22 @@ 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] --- - libweston/gl-renderer.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++- + libweston/gl-renderer.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++- libweston/gl-renderer.h | 7 ++++ - 2 files changed, 93 insertions(+), 1 deletion(-) + 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c -index 067e677f8a7b..b5d93531c944 100644 +index 508f8b92797e..9ef115ae092f 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) +@@ -3208,6 +3208,90 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface) return 0; } +static int +gl_renderer_get_devices(EGLint max_devices, EGLDeviceEXT *devices, -+ EGLint *num_devices) ++ EGLint *num_devices) +{ + const char *extensions; + PFNEGLQUERYDEVICESEXTPROC query_devices; @@ -68,42 +66,44 @@ index 067e677f8a7b..b5d93531c944 100644 + +static int +gl_renderer_get_drm_device_file(EGLDeviceEXT device, -+ const char **drm_device_file) ++ const char **drm_device_file) +{ -+ const char *extensions; ++ const char *exts; + PFNEGLQUERYDEVICESTRINGEXTPROC query_device_string; + -+ extensions = (const char *)eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); -+ if (!extensions) { ++ exts = (const char *)eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); ++ if (!exts) { + weston_log("Retrieving EGL extension string failed.\n"); + return -1; + } + -+ 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"))) { ++ if (!weston_check_egl_extension(exts, "EGL_EXT_device_base") && ++ (!weston_check_egl_extension(exts, "EGL_EXT_device_query") || ++ !weston_check_egl_extension(exts, "EGL_EXT_device_enumeration"))) { + weston_log("EGL_EXT_device_base not supported.\n"); + return -1; + } + -+ query_device_string = (void *) eglGetProcAddress("eglQueryDeviceStringEXT"); ++ query_device_string = ++ (void *) eglGetProcAddress("eglQueryDeviceStringEXT"); + if (!query_device_string) { + weston_log("Failed to get eglQueryDeviceStringEXT function\n"); + return -1; + } + -+ extensions = query_device_string(device, EGL_EXTENSIONS); -+ if (!extensions) { ++ exts = query_device_string(device, EGL_EXTENSIONS); ++ if (!exts) { + weston_log("Retrieving EGL extension string failed.\n"); + return -1; + } + -+ if (!weston_check_egl_extension(extensions, "EGL_EXT_device_drm")) { ++ if (!weston_check_egl_extension(exts, "EGL_EXT_device_drm")) { + weston_log("EGL_EXT_device_drm not supported.\n"); + return -1; + } + -+ (*drm_device_file) = query_device_string(device, EGL_DRM_DEVICE_FILE_EXT); ++ (*drm_device_file) = query_device_string(device, ++ EGL_DRM_DEVICE_FILE_EXT); + if (*drm_device_file == NULL) { + weston_log("Failed to query DRM device name.\n"); + gl_renderer_print_egl_error_state(); @@ -116,7 +116,7 @@ index 067e677f8a7b..b5d93531c944 100644 WL_EXPORT struct gl_renderer_interface gl_renderer_interface = { .opaque_attribs = gl_renderer_opaque_attribs, .alpha_attribs = gl_renderer_alpha_attribs, -@@ -3218,5 +3300,8 @@ WL_EXPORT struct gl_renderer_interface gl_renderer_interface = { +@@ -3218,5 +3302,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, @@ -127,7 +127,7 @@ index 067e677f8a7b..b5d93531c944 100644 + .get_drm_device_file = gl_renderer_get_drm_device_file }; diff --git a/libweston/gl-renderer.h b/libweston/gl-renderer.h -index 02f8011247db..871aa6589b01 100644 +index b47ea07feaf0..2840ee5bea28 100644 --- a/libweston/gl-renderer.h +++ b/libweston/gl-renderer.h @@ -114,5 +114,12 @@ struct gl_renderer_interface { @@ -136,13 +136,13 @@ index 02f8011247db..871aa6589b01 100644 void (*print_egl_error_state)(void); + + int (*get_devices)(EGLint max_devices, -+ EGLDeviceEXT *devices, -+ EGLint *num_devices); ++ EGLDeviceEXT *devices, ++ EGLint *num_devices); + + int (*get_drm_device_file)(EGLDeviceEXT device, -+ const char **drm_device_file); ++ const char **drm_device_file); }; -- -2.10.0 +2.10.2 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 7309529cda4b..032d2b12b75a 100644 --- a/0008-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch +++ b/0008-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch @@ -1,7 +1,7 @@ -From 4a84caec21fa650c8919db504dea94b3ad352a71 Mon Sep 17 00:00:00 2001 +From 34433e17e968229bce5eca51946fb85fcbc69f3d 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 +Subject: [PATCH 08/12] gl-renderer: Add support for EGLDevice composited frame presentation X-NVConfidentiality: public @@ -41,16 +41,14 @@ 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] --- - libweston/gl-renderer.c | 251 ++++++++++++++++++++++++++++++++++++++++++++- - libweston/gl-renderer.h | 15 +++ - libweston/weston-egl-ext.h | 18 ++++ - 3 files changed, 281 insertions(+), 3 deletions(-) + libweston/gl-renderer.c | 262 ++++++++++++++++++++++++++++++++++++++++++++- + libweston/gl-renderer.h | 16 +++ + libweston/weston-egl-ext.h | 38 +++++++ + 3 files changed, 313 insertions(+), 3 deletions(-) diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c -index b5d93531c944..01c5933966ca 100644 +index 9ef115ae092f..a0efea2ed648 100644 --- a/libweston/gl-renderer.c +++ b/libweston/gl-renderer.c @@ -86,6 +86,8 @@ struct gl_output_state { @@ -62,7 +60,7 @@ index b5d93531c944..01c5933966ca 100644 struct weston_matrix output_matrix; }; -@@ -204,6 +206,27 @@ struct gl_renderer { +@@ -204,6 +206,28 @@ struct gl_renderer { int has_surfaceless_context; @@ -82,22 +80,23 @@ index b5d93531c944..01c5933966ca 100644 + PFNEGLSTREAMCONSUMEROUTPUTEXTPROC stream_consumer_output; + int has_egl_stream_consumer_egloutput; + -+#ifdef EGL_EXT_stream_acquire_mode -+ PFNEGLSTREAMCONSUMERACQUIREATTRIBEXTPROC stream_consumer_acquire_attrib; ++#ifdef EGL_NV_stream_attrib ++ PFNEGLSTREAMCONSUMERACQUIREATTRIBNVPROC stream_consumer_acquire_attrib; +#endif ++ int has_egl_stream_attrib; + int has_egl_stream_acquire_mode; + int has_dmabuf_import; struct wl_list dmabuf_images; -@@ -1189,6 +1212,37 @@ gl_renderer_repaint_output(struct weston_output *output, +@@ -1189,6 +1213,38 @@ gl_renderer_repaint_output(struct weston_output *output, } static int +gl_renderer_output_stream_flip(struct weston_output *output, -+ void *flip_data) ++ void *flip_data) +{ -+#ifdef EGL_EXT_stream_acquire_mode ++#if defined(EGL_NV_stream_attrib) && defined(EGL_EXT_stream_acquire_mode) + struct gl_output_state *go = get_output_state(output); + struct weston_compositor *compositor = output->compositor; + struct gl_renderer *gr = get_renderer(compositor); @@ -113,9 +112,10 @@ index b5d93531c944..01c5933966ca 100644 +#endif + + if (go->egl_stream != EGL_NO_STREAM_KHR) -+ if (EGL_TRUE != gr->stream_consumer_acquire_attrib(gr->egl_display, -+ go->egl_stream, -+ acquire_attribs)) ++ if (gr->stream_consumer_acquire_attrib( ++ gr->egl_display, ++ go->egl_stream, ++ acquire_attribs) != EGL_TRUE) + return -1; + + return 0; @@ -128,16 +128,16 @@ index b5d93531c944..01c5933966ca 100644 gl_renderer_read_pixels(struct weston_output *output, pixman_format_code_t format, void *pixels, uint32_t x, uint32_t y, -@@ -2584,9 +2638,92 @@ gl_renderer_create_window_surface(struct gl_renderer *gr, +@@ -2584,9 +2640,93 @@ gl_renderer_create_window_surface(struct gl_renderer *gr, return egl_surface; } +static EGLSurface +gl_renderer_create_stream_surface(struct gl_renderer *gr, -+ uint32_t plane_id, -+ uint32_t crtc_id, -+ EGLint width, EGLint height, -+ EGLStreamKHR *egl_stream) ++ uint32_t plane_id, ++ uint32_t crtc_id, ++ EGLint width, EGLint height, ++ EGLStreamKHR *egl_stream) +{ + EGLint stream_attribs[] = { + EGL_STREAM_FIFO_LENGTH_KHR, 1, @@ -175,9 +175,9 @@ index b5d93531c944..01c5933966ca 100644 + output_attribs[2] = EGL_NONE; + + if (gr->get_output_layers(gr->egl_display, -+ output_attribs, -+ &output_layer, -+ 1, &num_layers) != EGL_TRUE) { ++ output_attribs, ++ &output_layer, ++ 1, &num_layers) != EGL_TRUE) { + weston_log("Failed to get output layer.\n"); + goto err_egl_create_surf_stream; + } @@ -188,15 +188,16 @@ index b5d93531c944..01c5933966ca 100644 + } + + if (gr->stream_consumer_output(gr->egl_display, *egl_stream, -+ output_layer) != EGL_TRUE) { ++ output_layer) != EGL_TRUE) { + weston_log("Failed to set EGL stream consumer.\n"); + goto err_egl_create_surf_stream; + } + -+ egl_surface = gr->create_stream_producer_surface(gr->egl_display, -+ gr->egl_config, -+ *egl_stream, -+ stream_producer_attribs); ++ egl_surface = gr->create_stream_producer_surface( ++ gr->egl_display, ++ gr->egl_config, ++ *egl_stream, ++ stream_producer_attribs); + + if (egl_surface == EGL_NO_SURFACE) { + weston_log("Failed to create EGL producer surface.\n"); @@ -216,13 +217,13 @@ index b5d93531c944..01c5933966ca 100644 + static int gl_renderer_output_create(struct weston_output *output, -- EGLSurface surface) -+ EGLSurface surface, -+ EGLStreamKHR stream) +- EGLSurface surface) ++ EGLSurface surface, ++ EGLStreamKHR stream) { struct gl_output_state *go; int i; -@@ -2596,6 +2733,7 @@ gl_renderer_output_create(struct weston_output *output, +@@ -2596,6 +2736,7 @@ gl_renderer_output_create(struct weston_output *output, return -1; go->egl_surface = surface; @@ -230,7 +231,7 @@ index b5d93531c944..01c5933966ca 100644 for (i = 0; i < BUFFER_DAMAGE_COUNT; i++) pixman_region32_init(&go->buffer_damage[i]); -@@ -2628,13 +2766,41 @@ gl_renderer_output_window_create(struct weston_output *output, +@@ -2628,13 +2769,41 @@ gl_renderer_output_window_create(struct weston_output *output, return -1; } @@ -244,7 +245,7 @@ index b5d93531c944..01c5933966ca 100644 +static int +gl_renderer_output_stream_create(struct weston_output *output, -+ uint32_t plane_id, uint32_t crtc_id) ++ uint32_t plane_id, uint32_t crtc_id) +{ + struct weston_compositor *ec = output->compositor; + struct gl_renderer *gr = get_renderer(ec); @@ -254,10 +255,10 @@ index b5d93531c944..01c5933966ca 100644 + + egl_surface = + gl_renderer_create_stream_surface(gr, -+ plane_id, crtc_id, -+ output->current_mode->width, -+ output->current_mode->height, -+ &egl_stream); ++ plane_id, crtc_id, ++ output->current_mode->width, ++ output->current_mode->height, ++ &egl_stream); + if (egl_surface == EGL_NO_SURFACE) + return -1; + @@ -273,7 +274,7 @@ index b5d93531c944..01c5933966ca 100644 static void gl_renderer_output_destroy(struct weston_output *output) { -@@ -2647,6 +2813,9 @@ gl_renderer_output_destroy(struct weston_output *output) +@@ -2647,6 +2816,9 @@ gl_renderer_output_destroy(struct weston_output *output) eglDestroySurface(gr->egl_display, go->egl_surface); @@ -283,7 +284,7 @@ index b5d93531c944..01c5933966ca 100644 free(go); } -@@ -2728,6 +2897,19 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) +@@ -2728,6 +2900,19 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) (void *) eglGetProcAddress("eglUnbindWaylandDisplayWL"); gr->query_buffer = (void *) eglGetProcAddress("eglQueryWaylandBufferWL"); @@ -296,14 +297,14 @@ index b5d93531c944..01c5933966ca 100644 + (void *) eglGetProcAddress("eglCreateStreamProducerSurfaceKHR"); + gr->stream_consumer_output = + (void *) eglGetProcAddress("eglStreamConsumerOutputEXT"); -+#ifdef EGL_EXT_stream_acquire_mode ++#ifdef EGL_NV_stream_attrib + gr->stream_consumer_acquire_attrib = -+ (void *) eglGetProcAddress("eglStreamConsumerAcquireAttribEXT"); ++ (void *) eglGetProcAddress("eglStreamConsumerAcquireAttribNV"); +#endif extensions = (const char *) eglQueryString(gr->egl_display, EGL_EXTENSIONS); -@@ -2766,6 +2948,27 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) +@@ -2766,6 +2951,30 @@ 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; @@ -325,13 +326,16 @@ index b5d93531c944..01c5933966ca 100644 + if (weston_check_egl_extension(extensions, "EGL_EXT_stream_consumer_egloutput")) + gr->has_egl_stream_consumer_egloutput = 1; + ++ if (weston_check_egl_extension(extensions, "EGL_NV_stream_attrib")) ++ gr->has_egl_stream_attrib = 1; ++ + 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; -@@ -2791,6 +2994,16 @@ static const EGLint gl_renderer_alpha_attribs[] = { +@@ -2791,6 +3000,15 @@ static const EGLint gl_renderer_alpha_attribs[] = { EGL_NONE }; @@ -344,11 +348,10 @@ index b5d93531c944..01c5933966ca 100644 + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + EGL_NONE +}; -+ /** Checks whether a platform EGL client extension is supported * -@@ -2864,6 +3077,8 @@ platform_to_extension(EGLenum platform) +@@ -2864,6 +3082,8 @@ platform_to_extension(EGLenum platform) return "wayland"; case EGL_PLATFORM_X11_KHR: return "x11"; @@ -357,7 +360,7 @@ index b5d93531c944..01c5933966ca 100644 default: assert(0 && "bad EGL platform enum"); } -@@ -3000,6 +3215,32 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, +@@ -3000,6 +3220,38 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, if (gl_renderer_setup_egl_extensions(ec) < 0) goto fail_with_error; @@ -367,30 +370,36 @@ index b5d93531c944..01c5933966ca 100644 + !gr->has_egl_stream || + !gr->has_egl_stream_producer_eglsurface || + !gr->has_egl_stream_consumer_egloutput || ++ !gr->has_egl_stream_attrib || + !gr->has_egl_stream_acquire_mode) { -+ weston_log("following required extensions not supported:\n" -+ "%s%s%s%s%s%s", -+ (gr->has_egl_output_base ? "" : " EGL_EXT_output_base\n"), -+ (gr->has_egl_output_drm ? "" : " EGL_EXT_output_drm\n"), -+ (gr->has_egl_stream ? "" : " EGL_KHR_stream\n"), -+ (gr->has_egl_stream_producer_eglsurface ? -+ "" : " EGL_KHR_stream_producer_eglsurface\n"), -+ (gr->has_egl_stream_consumer_egloutput ? -+ "" : " EGL_EXT_stream_consumer_egloutput\n"), -+ (gr->has_egl_stream_acquire_mode ? -+ "" : " EGL_EXT_stream_acquire_mode\n")); ++ weston_log("following required extensions not " ++ "supported:\n%s%s%s%s%s%s%s", ++ (gr->has_egl_output_base ? "" : ++ " EGL_EXT_output_base\n"), ++ (gr->has_egl_output_drm ? "" : ++ " EGL_EXT_output_drm\n"), ++ (gr->has_egl_stream ? "" : ++ " EGL_KHR_stream\n"), ++ (gr->has_egl_stream_producer_eglsurface ? "" : ++ " EGL_KHR_stream_producer_eglsurface\n"), ++ (gr->has_egl_stream_consumer_egloutput ? "" : ++ " EGL_EXT_stream_consumer_egloutput\n"), ++ (gr->has_egl_stream_attrib ? "" : ++ " EGL_NV_stream_attrib\n"), ++ (gr->has_egl_stream_acquire_mode ? "" : ++ " EGL_EXT_stream_acquire_mode\n")); + goto fail_terminate; + } + + if (!gr->has_egl_output_drm_flip_event) -+ weston_log("warning: EGL page flip event notification not" -+ " supported\n"); ++ weston_log("warning: EGL page flip event notification " ++ "not supported\n"); + } + wl_list_init(&gr->dmabuf_images); if (gr->has_dmabuf_import) gr->base.import_dmabuf = gl_renderer_import_dmabuf; -@@ -3293,15 +3534,19 @@ gl_renderer_get_drm_device_file(EGLDeviceEXT device, +@@ -3295,15 +3547,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, @@ -412,7 +421,7 @@ index b5d93531c944..01c5933966ca 100644 + .output_stream_flip = gl_renderer_output_stream_flip }; diff --git a/libweston/gl-renderer.h b/libweston/gl-renderer.h -index 871aa6589b01..02c79c355b47 100644 +index 2840ee5bea28..6e2fd34f4257 100644 --- a/libweston/gl-renderer.h +++ b/libweston/gl-renderer.h @@ -59,6 +59,7 @@ enum gl_renderer_border_side { @@ -422,47 +431,68 @@ index 871aa6589b01..02c79c355b47 100644 + const EGLint *opaque_stream_attribs; int (*display_create)(struct weston_compositor *ec, - EGLenum platform, + EGLenum platform, @@ -77,6 +78,9 @@ struct gl_renderer_interface { - const EGLint *visual_id, - const int n_ids); + const EGLint *visual_id, + const int n_ids); + int (*output_stream_create)(struct weston_output *output, -+ uint32_t plane_id, uint32_t crtc_id); ++ uint32_t plane_id, uint32_t crtc_id); + void (*output_destroy)(struct weston_output *output); EGLSurface (*output_surface)(struct weston_output *output); -@@ -121,5 +125,16 @@ struct gl_renderer_interface { +@@ -121,5 +125,17 @@ struct gl_renderer_interface { int (*get_drm_device_file)(EGLDeviceEXT device, - const char **drm_device_file); + const char **drm_device_file); + + /* + * output_stream_flip() makes the EGLOutput consumer attached to the + * corresponding <output> stream acquire the new available frame + * (repaint_output() has been called previously) and queue a page flip. -+ * Whenever DRM is the underlying API and EGL_NV_output_drm_flip_event is -+ * supported, page flip notification can be requested by passing a non-NULL -+ * <flip_data> pointer. Otherwise, compositors should rely on a different -+ * mechanism in order to re-schedule output repaints. ++ * Whenever DRM is the underlying API and EGL_NV_output_drm_flip_event ++ * is supported, page flip notification can be requested by passing a ++ * non-NULL <flip_data> pointer. Otherwise, compositors should rely on a ++ * different mechanism in order to re-schedule output repaints. + */ -+ int (*output_stream_flip)(struct weston_output *output, void *flip_data); ++ int (*output_stream_flip)(struct weston_output *output, ++ void *flip_data); }; diff --git a/libweston/weston-egl-ext.h b/libweston/weston-egl-ext.h -index 6e3699602b5b..79aa2de2b09f 100644 +index 6e3699602b5b..709c80959b66 100644 --- a/libweston/weston-egl-ext.h +++ b/libweston/weston-egl-ext.h -@@ -152,5 +152,23 @@ typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLD +@@ -152,5 +152,43 @@ typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLD #define EGL_PLATFORM_X11_KHR 0x31D5 #endif ++#ifndef EGL_PLATFORM_DEVICE_EXT ++#define EGL_PLATFORM_DEVICE_EXT 0x313F ++#endif ++ +/* + * FIXME: Remove both EGL_EXT_stream_acquire_mode and + * EGL_NV_output_drm_flip_event definitions below once both extensions + * get published by Khronos and incorportated into Khronos' header files + */ ++#ifndef EGL_NV_stream_attrib ++#define EGL_NV_stream_attrib 1 ++#ifdef EGL_EGLEXT_PROTOTYPES ++EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamAttribNV(EGLDisplay dpy, const EGLAttrib *attrib_list); ++EGLAPI EGLBoolean EGLAPIENTRY eglSetStreamAttribNV(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib value); ++EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamAttribNV(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib *value); ++EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireAttribNV(EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list); ++EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseAttribNV(EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list); ++#endif ++typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMATTRIBNVPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list); ++typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSTREAMATTRIBNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib value); ++typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMATTRIBNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib *value); ++typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREATTRIBNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list); ++typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEATTRIBNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list); ++#endif /* EGL_NV_stream_attrib */ ++ +#ifndef EGL_EXT_stream_acquire_mode +#define EGL_EXT_stream_acquire_mode 1 +#define EGL_CONSUMER_AUTO_ACQUIRE_EXT 0x332B @@ -479,5 +509,5 @@ index 6e3699602b5b..79aa2de2b09f 100644 #endif -- -2.10.0 +2.10.2 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 c802e157a4d4..c8700ce21a1d 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,7 +1,7 @@ -From c3a7bff36253229bfbfed8c72a82f334819ba3e5 Mon Sep 17 00:00:00 2001 +From decfa267d12c6b48720e5263c71011b64638bbda 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 +Subject: [PATCH 09/12] gl-renderer: Add EGL client support for EGLStream frame presentation X-NVConfidentiality: public @@ -17,31 +17,22 @@ Note that some unpublished EGL extensions were needed: - EGL_NV_stream_attrib: https://github.com/aritger/eglstreams-kms-example/blob/master/proposed-extensions/EGL_NV_stream_attrib.txt - - EGL_EXT_stream_acquire_mode: - https://github.com/aritger/eglstreams-kms-example/blob/master/proposed-extensions/EGL_EXT_stream_acquire_mode.txt + - EGL_WL_wayland_eglstream: + https://github.com/aritger/eglstreams-kms-example/blob/master/proposed-extensions/EGL_WL_wayland_eglstream.txt 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] --- - libweston/gl-renderer.c | 175 +++++++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 174 insertions(+), 1 deletion(-) + libweston/gl-renderer.c | 183 ++++++++++++++++++++++++++++++++++++++++++++- + libweston/weston-egl-ext.h | 5 ++ + 2 files changed, 187 insertions(+), 1 deletion(-) diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c -index 01c5933966ca..be0c5e9b4745 100644 +index a0efea2ed648..a3440fc7162c 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> -@@ -163,6 +164,9 @@ struct gl_surface_state { +@@ -163,6 +163,9 @@ struct gl_surface_state { int height; /* in pixels */ int y_inverted; @@ -51,7 +42,7 @@ index 01c5933966ca..be0c5e9b4745 100644 struct weston_surface *surface; struct wl_listener surface_destroy_listener; -@@ -214,6 +218,7 @@ struct gl_renderer { +@@ -214,6 +217,7 @@ struct gl_renderer { PFNEGLCREATESTREAMKHRPROC create_stream; PFNEGLDESTROYSTREAMKHRPROC destroy_stream; @@ -59,21 +50,24 @@ index 01c5933966ca..be0c5e9b4745 100644 int has_egl_stream; PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC create_stream_producer_surface; -@@ -227,6 +232,13 @@ struct gl_renderer { +@@ -223,11 +227,16 @@ struct gl_renderer { + int has_egl_stream_consumer_egloutput; + + #ifdef EGL_NV_stream_attrib ++ PFNEGLCREATESTREAMATTRIBNVPROC create_stream_attrib; + PFNEGLSTREAMCONSUMERACQUIREATTRIBNVPROC stream_consumer_acquire_attrib; #endif + int has_egl_stream_attrib; int has_egl_stream_acquire_mode; -+ PFNEGLSTREAMCONSUMERACQUIREKHRPROC stream_consumer_acquire; + PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC stream_consumer_gltexture; + int has_egl_stream_consumer_gltexture; -+ -+ PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC create_stream_from_fd; -+ int has_egl_stream_cross_process_fd; ++ int has_egl_wayland_eglstream; + int has_dmabuf_import; struct wl_list dmabuf_images; -@@ -1934,6 +1946,132 @@ gl_renderer_attach_dmabuf(struct weston_surface *surface, +@@ -1936,6 +1945,145 @@ gl_renderer_attach_dmabuf(struct weston_surface *surface, gs->y_inverted = buffer->y_inverted; } @@ -88,64 +82,73 @@ index 01c5933966ca..be0c5e9b4745 100644 + */ +static bool +gl_renderer_attach_stream_texture(struct weston_surface *es, -+ struct weston_buffer *buffer) ++ struct weston_buffer *buffer) +{ ++#ifdef EGL_NV_stream_attrib + struct weston_compositor *ec = es->compositor; + struct gl_renderer *gr = get_renderer(ec); + struct gl_surface_state *gs = get_surface_state(es); -+ EGLNativeFileDescriptorKHR fd = EGL_NO_FILE_DESCRIPTOR_KHR; ++ EGLStreamKHR stream = EGL_NO_STREAM_KHR; ++ EGLAttrib stream_attribs[] = { ++#ifdef EGL_WL_wayland_eglstream ++ EGL_WAYLAND_EGLSTREAM_WL, (EGLAttrib)buffer->resource, ++#endif ++ EGL_NONE ++ }; + EGLint stream_state = EGL_STREAM_STATE_EMPTY_KHR; + -+ /* Check for required extensions. If they arent supported, there's no way -+ * the given buffer corresponds to an EGLStream */ -+ if (!gr->has_egl_stream_consumer_gltexture || -+ !gr->has_egl_stream_cross_process_fd) ++ /* Check for required extensions. If they arent supported, there's no ++ * way the given buffer corresponds to an EGLStream */ ++ if (!gr->has_egl_stream_attrib || ++ !gr->has_egl_stream_consumer_gltexture || ++ !gr->has_egl_wayland_eglstream) + return false; + -+ /* Try to get the stream file descriptor. If the query fails, the given -+ * buffer does not corresponds to an EGLStream -+ * -+ * FIXME: Use EGL_WL_wayland_eglstream instead */ -+ if (!gr->query_buffer(gr->egl_display, buffer->resource, -+ EGL_WAYLAND_BUFFER_WL, &fd)) -+ return false; ++ stream = gr->create_stream_attrib(gr->egl_display, stream_attribs); ++ if (stream == EGL_NO_STREAM_KHR) { ++ EGLint err = eglGetError(); + -+ /* If invalid file descriptor returned, buffer->resource corresponds to a -+ * previously created stream so we must have a valid stream handle already -+ * we can use to acquire next frame; otherwise, try to create the stream */ -+ if (fd != EGL_NO_FILE_DESCRIPTOR_KHR) { -+ EGLStreamKHR stream = EGL_NO_STREAM_KHR; ++ switch (err) { ++ case EGL_BAD_ACCESS: ++ /* EGL_BAD_ACCESS is generated whenever buffer->resource ++ * does not corresponds to a stream */ ++ return false; + -+ stream = gr->create_stream_from_fd(gr->egl_display, fd); -+ close(fd); ++ case EGL_BAD_STREAM_KHR: ++ /* EGL_BAD_STREAM_KHR is generated whenever ++ * buffer->resource corresponds to a previously created ++ * stream so we must have a valid stream handle already ++ * we can use to acquire next frame */ ++ break; + -+ if (stream == EGL_NO_STREAM_KHR) { -+ gl_renderer_print_egl_error_state(); -+ return true; /* buffer->resource is EGLStream */ -+ } else { -+ /* Clean up current stream resources if needed */ -+ if (gs->egl_stream != EGL_NO_STREAM_KHR) -+ gr->destroy_stream(gr->egl_display, gs->egl_stream); ++ default: ++ /* An unknown error was generated */ ++ assert(0); ++ return false; ++ } ++ } else { ++ /* Clean up current stream resources if needed */ ++ if (gs->egl_stream != EGL_NO_STREAM_KHR) ++ gr->destroy_stream(gr->egl_display, gs->egl_stream); + -+ gs->egl_stream = stream; -+ gs->shader = &gr->texture_shader_egl_external; -+ gs->target = GL_TEXTURE_EXTERNAL_OES; ++ gs->egl_stream = stream; ++ gs->shader = &gr->texture_shader_egl_external; ++ gs->target = GL_TEXTURE_EXTERNAL_OES; + -+ glActiveTexture(GL_TEXTURE0); -+ ensure_textures(gs, 2); -+ glBindTexture(gs->target, gs->textures[1]); ++ glActiveTexture(GL_TEXTURE0); ++ ensure_textures(gs, 2); ++ glBindTexture(gs->target, gs->textures[1]); + -+ gs->new_stream = (EGL_TRUE == gr->stream_consumer_gltexture( -+ gr->egl_display, -+ gs->egl_stream)); ++ gs->new_stream = (gr->stream_consumer_gltexture( ++ gr->egl_display, ++ gs->egl_stream) == EGL_TRUE); + -+ if (!gs->new_stream) { -+ weston_log("failed to set stream consumer\n"); -+ gl_renderer_print_egl_error_state(); -+ gr->destroy_stream(gr->egl_display, gs->egl_stream); -+ gs->egl_stream = EGL_NO_STREAM_KHR; -+ return true; /* buffer->resource is EGLStream */ -+ } ++ if (!gs->new_stream) { ++ weston_log("failed to set stream consumer\n"); ++ gl_renderer_print_egl_error_state(); ++ gr->destroy_stream(gr->egl_display, gs->egl_stream); ++ gs->egl_stream = EGL_NO_STREAM_KHR; ++ return true; /* buffer->resource is EGLStream */ + } + } + @@ -154,9 +157,9 @@ index 01c5933966ca..be0c5e9b4745 100644 + + /* Check whether there are new frames available */ + if (gr->query_stream(gr->egl_display, -+ gs->egl_stream, -+ EGL_STREAM_STATE_KHR, -+ &stream_state) != EGL_TRUE) { ++ gs->egl_stream, ++ EGL_STREAM_STATE_KHR, ++ &stream_state) != EGL_TRUE) { + weston_log("failed to query stream state\n"); + gl_renderer_print_egl_error_state(); + return true; /* buffer->resource is EGLStream */ @@ -170,8 +173,9 @@ index 01c5933966ca..be0c5e9b4745 100644 + return true; /* buffer->resource is EGLStream */ + } + -+ if (gr->stream_consumer_acquire(gr->egl_display, -+ gs->egl_stream) != EGL_TRUE) { ++ if (gr->stream_consumer_acquire_attrib(gr->egl_display, ++ gs->egl_stream, ++ NULL) != EGL_TRUE) { + weston_log("failed to acquire buffer\n"); + gl_renderer_print_egl_error_state(); + return true; /* buffer->resource is EGLStream */ @@ -189,11 +193,11 @@ index 01c5933966ca..be0c5e9b4745 100644 + /* Update buffer and surface data */ + buffer->legacy_buffer = (void *)buffer->resource; + gr->query_buffer(gr->egl_display, buffer->legacy_buffer, -+ EGL_WIDTH, &buffer->width); ++ EGL_WIDTH, &buffer->width); + gr->query_buffer(gr->egl_display, buffer->legacy_buffer, -+ EGL_HEIGHT, &buffer->height); ++ EGL_HEIGHT, &buffer->height); + gr->query_buffer(gr->egl_display, buffer->legacy_buffer, -+ EGL_WAYLAND_Y_INVERTED_WL, &buffer->y_inverted); ++ EGL_WAYLAND_Y_INVERTED_WL, &buffer->y_inverted); + + gs->pitch = buffer->width; + gs->height = buffer->height; @@ -201,12 +205,15 @@ index 01c5933966ca..be0c5e9b4745 100644 + gs->y_inverted = buffer->y_inverted; + + return true; /* buffer->resource is EGLStream */ ++#else ++ return false; ++#endif +} + static void 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) +@@ -1959,6 +2107,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; @@ -219,7 +226,7 @@ index 01c5933966ca..be0c5e9b4745 100644 return; } -@@ -1969,7 +2113,7 @@ gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) +@@ -1971,7 +2125,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); @@ -228,7 +235,7 @@ index 01c5933966ca..be0c5e9b4745 100644 weston_log("unhandled buffer type!\n"); weston_buffer_reference(&gs->buffer_ref, NULL); gs->buffer_type = BUFFER_TYPE_NULL; -@@ -2157,6 +2301,10 @@ surface_state_destroy(struct gl_surface_state *gs, struct gl_renderer *gr) +@@ -2159,6 +2313,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); @@ -239,7 +246,7 @@ index 01c5933966ca..be0c5e9b4745 100644 free(gs); } -@@ -2207,6 +2355,8 @@ gl_renderer_create_surface(struct weston_surface *surface) +@@ -2209,6 +2367,8 @@ gl_renderer_create_surface(struct weston_surface *surface) gs->surface = surface; @@ -248,7 +255,7 @@ index 01c5933966ca..be0c5e9b4745 100644 pixman_region32_init(&gs->texture_damage); surface->renderer_state = gs; -@@ -2902,6 +3052,7 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) +@@ -2905,14 +3065,19 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) (void *) eglGetProcAddress("eglQueryOutputLayerAttribEXT"); gr->create_stream = (void *) eglGetProcAddress("eglCreateStreamKHR"); gr->destroy_stream = (void *) eglGetProcAddress("eglDestroyStreamKHR"); @@ -256,49 +263,62 @@ index 01c5933966ca..be0c5e9b4745 100644 gr->create_stream_producer_surface = (void *) eglGetProcAddress("eglCreateStreamProducerSurfaceKHR"); gr->stream_consumer_output = -@@ -2910,6 +3061,12 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) + (void *) eglGetProcAddress("eglStreamConsumerOutputEXT"); + #ifdef EGL_NV_stream_attrib ++ gr->create_stream_attrib = ++ (void *) eglGetProcAddress("eglCreateStreamAttribNV"); gr->stream_consumer_acquire_attrib = - (void *) eglGetProcAddress("eglStreamConsumerAcquireAttribEXT"); + (void *) eglGetProcAddress("eglStreamConsumerAcquireAttribNV"); #endif -+ gr->stream_consumer_acquire = -+ (void *) eglGetProcAddress("eglStreamConsumerAcquireKHR"); + gr->stream_consumer_gltexture = + (void *) eglGetProcAddress("eglStreamConsumerGLTextureExternalKHR"); -+ gr->create_stream_from_fd = -+ (void *) eglGetProcAddress("eglCreateStreamFromFileDescriptorKHR"); extensions = (const char *) eglQueryString(gr->egl_display, EGL_EXTENSIONS); -@@ -2969,6 +3126,12 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) +@@ -2975,6 +3140,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 (weston_check_egl_extension(extensions, "EGL_KHR_stream_consumer_gltexture")) + gr->has_egl_stream_consumer_gltexture = 1; + -+ if (weston_check_egl_extension(extensions, "EGL_KHR_stream_cross_process_fd")) -+ gr->has_egl_stream_cross_process_fd = 1; ++ if (weston_check_egl_extension(extensions, "EGL_WL_wayland_eglstream")) ++ gr->has_egl_wayland_eglstream = 1; + renderer_setup_egl_client_extensions(gr); return 0; -@@ -3236,6 +3399,16 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, +@@ -3247,6 +3418,16 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, goto fail_terminate; } + if (!gr->has_egl_stream_consumer_gltexture || -+ !gr->has_egl_stream_cross_process_fd) -+ weston_log("warning: following required extensions for EGL client " -+ "frame presentation through EGLDevice not supported:\n" -+ "%s%s", -+ (gr->has_egl_stream_consumer_gltexture ? -+ " EGL_KHR_stream_consumer_gltexture\n" : ""), -+ (gr->has_egl_stream_cross_process_fd ? -+ " EGL_KHR_stream_cross_process_fd\n" : "")); ++ !gr->has_egl_wayland_eglstream) ++ weston_log("warning: following required extensions for " ++ "EGL client frame presentation through " ++ "EGLDevice not supported:\n%s%s", ++ (gr->has_egl_stream_consumer_gltexture ? "" : ++ " EGL_KHR_stream_consumer_gltexture\n"), ++ (gr->has_egl_wayland_eglstream ? "" : ++ " EGL_WL_wayland_eglstream\n")); + if (!gr->has_egl_output_drm_flip_event) - weston_log("warning: EGL page flip event notification not" - " supported\n"); + weston_log("warning: EGL page flip event notification " + "not supported\n"); +diff --git a/libweston/weston-egl-ext.h b/libweston/weston-egl-ext.h +index 709c80959b66..f5ae44848fee 100644 +--- a/libweston/weston-egl-ext.h ++++ b/libweston/weston-egl-ext.h +@@ -191,4 +191,9 @@ EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireAttribEXT (EGLDisplay dpy, + #define EGL_DRM_FLIP_EVENT_DATA_NV 0x333E + #endif /* EGL_NV_output_drm_flip_event */ + ++#ifndef EGL_WL_wayland_eglstream ++#define EGL_WL_wayland_eglstream 1 ++#define EGL_WAYLAND_EGLSTREAM_WL 0x334B ++#endif /* EGL_WL_wayland_eglstream */ ++ + #endif -- -2.10.0 +2.10.2 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 1a9de4173f9e..355329e0f58d 100644 --- a/0010-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch +++ b/0010-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch @@ -1,7 +1,7 @@ -From 3aabc17a3b83d255d3a2fd2f597746af20c9647e Mon Sep 17 00:00:00 2001 +From e08b0882b29ce39ef67742a1caa53af4b6bb18bd 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 +Subject: [PATCH 10/12] compositor-drm: Gracefully handle vblank and flip invalid timestamps X-NVConfidentiality: public @@ -17,14 +17,12 @@ 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] --- - libweston/compositor-drm.c | 26 +++++++++++++++++++++++--- - 1 file changed, 23 insertions(+), 3 deletions(-) + libweston/compositor-drm.c | 28 +++++++++++++++++++++++++--- + 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c -index 888881880e16..d1cb21c6b37a 100644 +index df357c3c809b..044633f7c740 100644 --- a/libweston/compositor-drm.c +++ b/libweston/compositor-drm.c @@ -1,6 +1,7 @@ @@ -42,9 +40,9 @@ index 888881880e16..d1cb21c6b37a 100644 - /* Error ret or zero timestamp means failure to get valid timestamp */ - if ((ret == 0) && (vbl.reply.tval_sec > 0 || vbl.reply.tval_usec > 0)) { + if (ret) { -+ /* Immediate query failed. It may always fail so we'll never get a valid -+ * timestamp to update msc and call into finish frame. Hence, jump to -+ * finish frame here. ++ /* Immediate query failed. It may always fail so we'll never get ++ * a valid timestamp to update msc and call into finish frame. ++ * Hence, jump to finish frame here. + */ + goto finish_frame; + } @@ -63,18 +61,20 @@ index 888881880e16..d1cb21c6b37a 100644 * Use pageflip fallback. */ fb_id = output->current->fb_id; -@@ -907,6 +916,17 @@ page_flip_handler(int fd, unsigned int frame, +@@ -907,6 +916,19 @@ page_flip_handler(int fd, unsigned int frame, else if (!output->vblank_pending) { ts.tv_sec = sec; ts.tv_nsec = usec * 1000; + -+ /* Zero timestamp means failure to get valid timestamp, so immediately -+ * finish frame ++ /* Zero timestamp means failure to get valid timestamp, so ++ * immediately finish frame + * -+ * FIXME: Driver should never return an invalid page flip timestamp */ ++ * FIXME: Driver should never return an invalid page flip ++ * timestamp */ + if (ts.tv_sec == 0 && ts.tv_nsec == 0) { -+ weston_compositor_read_presentation_clock(output->base.compositor, -+ &ts); ++ weston_compositor_read_presentation_clock( ++ output->base.compositor, ++ &ts); + flags = WP_PRESENTATION_FEEDBACK_INVALID; + } + @@ -82,5 +82,5 @@ index 888881880e16..d1cb21c6b37a 100644 /* We can't call this from frame_notify, because the output's -- -2.10.0 +2.10.2 diff --git a/0011-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch b/0011-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch index bca79fe7726b..90b2e289e6b5 100644 --- a/0011-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch +++ b/0011-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch @@ -1,7 +1,7 @@ -From fa43bbf17f0f06a1b7c70087fe9d172fb691bd35 Mon Sep 17 00:00:00 2001 +From 8fbf890397fbd5ceecf6c11007ffb218c235689e 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 +Subject: [PATCH 11/12] compositor-drm: Add support for EGLDevice+EGLOutput X-NVConfidentiality: public As previously stated, EGLDevice and EGLOutput will provide means @@ -24,13 +24,11 @@ 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] --- compositor/main.c | 2 + - libweston/compositor-drm.c | 328 +++++++++++++++++++++++++++++++-------------- - libweston/compositor-drm.h | 3 + - 3 files changed, 233 insertions(+), 100 deletions(-) + libweston/compositor-drm.c | 327 ++++++++++++++++++++++++++++++++------------- + libweston/compositor-drm.h | 4 + + 3 files changed, 237 insertions(+), 96 deletions(-) diff --git a/compositor/main.c b/compositor/main.c index 0e5af5b17fe6..9e9758253eeb 100644 @@ -53,7 +51,7 @@ index 0e5af5b17fe6..9e9758253eeb 100644 parse_options(options, ARRAY_LENGTH(options), argc, argv); diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c -index d1cb21c6b37a..096ca79a3e2b 100644 +index 044633f7c740..eeb63877e862 100644 --- a/libweston/compositor-drm.c +++ b/libweston/compositor-drm.c @@ -77,6 +77,10 @@ @@ -129,8 +127,8 @@ index d1cb21c6b37a..096ca79a3e2b 100644 + ret = gl_renderer->output_stream_flip(&output->base, output); + else + ret = drmModePageFlip(backend->drm.fd, output->crtc_id, -+ output->next->fb_id, -+ DRM_MODE_PAGE_FLIP_EVENT, output); ++ output->next->fb_id, ++ DRM_MODE_PAGE_FLIP_EVENT, output); + + if (ret < 0) { weston_log("queueing pageflip failed: %m\n"); @@ -153,8 +151,8 @@ index d1cb21c6b37a..096ca79a3e2b 100644 + ret = gl_renderer->output_stream_flip(&output->base, output); + else + ret = drmModePageFlip(backend->drm.fd, output->crtc_id, -+ output->current->fb_id, -+ DRM_MODE_PAGE_FLIP_EVENT, output); ++ output->current->fb_id, ++ DRM_MODE_PAGE_FLIP_EVENT, output); - if (drmModePageFlip(backend->drm.fd, output->crtc_id, fb_id, - DRM_MODE_PAGE_FLIP_EVENT, output) < 0) { @@ -162,7 +160,7 @@ index d1cb21c6b37a..096ca79a3e2b 100644 weston_log("queueing pageflip failed: %m\n"); goto finish_frame; } -@@ -1365,6 +1385,9 @@ static void +@@ -1367,6 +1387,9 @@ static void drm_output_fini_pixman(struct drm_output *output); static void @@ -172,7 +170,7 @@ index d1cb21c6b37a..096ca79a3e2b 100644 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) +@@ -1396,12 +1419,10 @@ drm_output_destroy(struct weston_output *output_base) b->crtc_allocator &= ~(1 << output->crtc_id); b->connector_allocator &= ~(1 << output->connector_id); @@ -188,7 +186,7 @@ index d1cb21c6b37a..096ca79a3e2b 100644 weston_plane_release(&output->fb_plane); weston_plane_release(&output->cursor_plane); -@@ -1498,9 +1519,7 @@ drm_output_switch_mode(struct weston_output *output_base, struct weston_mode *mo +@@ -1500,9 +1521,7 @@ drm_output_switch_mode(struct weston_output *output_base, struct weston_mode *mo return -1; } } else { @@ -199,7 +197,7 @@ index d1cb21c6b37a..096ca79a3e2b 100644 if (drm_output_init_egl(output, b) < 0) { weston_log("failed to init output egl state with " "new mode"); -@@ -1587,11 +1606,6 @@ create_gbm_device(int fd) +@@ -1589,11 +1608,6 @@ create_gbm_device(int fd) { struct gbm_device *gbm; @@ -211,7 +209,7 @@ index d1cb21c6b37a..096ca79a3e2b 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 -@@ -1604,6 +1618,39 @@ create_gbm_device(int fd) +@@ -1606,6 +1620,40 @@ create_gbm_device(int fd) return gbm; } @@ -238,7 +236,8 @@ index d1cb21c6b37a..096ca79a3e2b 100644 + } + + for (i = 0; i < num_devices; i++) -+ if (gl_renderer->get_drm_device_file(devices[i], &drm_path) == 0 && ++ if (gl_renderer->get_drm_device_file(devices[i], ++ &drm_path) == 0 && + strcmp(filename, drm_path) == 0) { + egldevice = devices[i]; + break; @@ -251,7 +250,7 @@ index d1cb21c6b37a..096ca79a3e2b 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. * -@@ -1630,38 +1677,61 @@ fallback_format_for(uint32_t format) +@@ -1632,38 +1680,62 @@ fallback_format_for(uint32_t format) static int drm_backend_create_gl_renderer(struct drm_backend *b) { @@ -261,50 +260,49 @@ index d1cb21c6b37a..096ca79a3e2b 100644 - 0, - }; - int n_formats = 2; -- -- if (format[1]) -- n_formats = 3; -- if (gl_renderer->display_create(b->compositor, -- EGL_PLATFORM_GBM_KHR, -- (void *)b->gbm, -- NULL, -- gl_renderer->opaque_attribs, -- format, -- n_formats) < 0) { -- return -1; -- } + if (b->use_egldevice) { + EGLint device_platform_attribs[] = { + EGL_DRM_MASTER_FD_EXT, b->drm.fd, + EGL_NONE + }; -- return 0; -+ return gl_renderer->display_create(b->compositor, -+ EGL_PLATFORM_DEVICE_EXT, -+ (void *)b->egldevice, -+ device_platform_attribs, -+ gl_renderer->opaque_stream_attribs, -+ NULL, -+ 0); +- if (format[1]) +- n_formats = 3; +- if (gl_renderer->display_create(b->compositor, +- EGL_PLATFORM_GBM_KHR, +- (void *)b->gbm, ++ return gl_renderer->display_create( ++ b->compositor, ++ EGL_PLATFORM_DEVICE_EXT, ++ (void *)b->egldevice, ++ device_platform_attribs, ++ gl_renderer->opaque_stream_attribs, + NULL, +- gl_renderer->opaque_attribs, +- format, +- n_formats) < 0) { +- return -1; +- } ++ 0); + } else { -+ EGLint format[] = { ++ EGLint format[3] = { + b->gbm_format, + fallback_format_for(b->gbm_format), -+ 0 ++ 0, + }; + int n_formats = 2; -+ + +- return 0; + if (format[1]) + n_formats = 3; + + return gl_renderer->display_create(b->compositor, -+ EGL_PLATFORM_GBM_KHR, -+ (void *)b->gbm, -+ NULL, -+ gl_renderer->opaque_attribs, -+ format, -+ n_formats); ++ EGL_PLATFORM_GBM_KHR, ++ (void *)b->gbm, ++ NULL, ++ gl_renderer->opaque_attribs, ++ format, ++ n_formats); + } } @@ -315,7 +313,7 @@ index d1cb21c6b37a..096ca79a3e2b 100644 - - if (!b->gbm) + gl_renderer = weston_load_module("gl-renderer.so", -+ "gl_renderer_interface"); ++ "gl_renderer_interface"); + if (!gl_renderer) return -1; @@ -336,7 +334,7 @@ index d1cb21c6b37a..096ca79a3e2b 100644 return -1; } -@@ -1888,55 +1958,95 @@ find_crtc_for_connector(struct drm_backend *b, +@@ -1890,55 +1962,102 @@ find_crtc_for_connector(struct drm_backend *b, static int drm_output_init_egl(struct drm_output *output, struct drm_backend *b) { @@ -363,35 +361,34 @@ index d1cb21c6b37a..096ca79a3e2b 100644 - if (format[1]) - n_formats = 2; - if (gl_renderer->output_window_create(&output->base, -- (EGLNativeWindowType)output->gbm_surface, -- output->gbm_surface, -- gl_renderer->opaque_attribs, -- format, -- n_formats) < 0) { +- (EGLNativeWindowType)output->gbm_surface, +- output->gbm_surface, +- gl_renderer->opaque_attribs, +- format, +- n_formats) < 0) { - weston_log("failed to create gl renderer output state\n"); - gbm_surface_destroy(output->gbm_surface); - return -1; - } + /* Create a black dumb fb for modesetting */ -+ output->dumb[0] = drm_fb_create_dumb(b, w, h, b->gbm_format); ++ output->dumb[0] = drm_fb_create_dumb(b, w, h, ++ DRM_FORMAT_XRGB8888); + if (!output->dumb[0]) { + weston_log("failed to create dumb framebuffer\n"); + return -1; + } + memset(output->dumb[0]->map, 0, output->dumb[0]->size); - -- flags = GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE; ++ + if (gl_renderer->output_stream_create(&output->base, ~0u, -+ output->crtc_id) < 0) { -+ weston_log("failed to create gl renderer output stream state\n"); ++ output->crtc_id) < 0) { ++ weston_log("failed to create gl renderer output stream " ++ "state\n"); + drm_fb_destroy_dumb(output->dumb[0]); + output->dumb[0] = NULL; + return -1; + } -- for (i = 0; i < 2; i++) { -- if (output->gbm_cursor_bo[i]) -- continue; +- flags = GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE; + /* FIXME: Add hw planes and cursors for EGL device when supported */ + b->sprites_are_broken = 1; + b->cursors_are_broken = 1; @@ -402,47 +399,55 @@ index d1cb21c6b37a..096ca79a3e2b 100644 + }; + int i, flags, n_formats = 1; + -+ output->gbm_surface = gbm_surface_create(b->gbm, -+ output->base.current_mode->width, -+ output->base.current_mode->height, -+ format[0], -+ GBM_BO_USE_SCANOUT | -+ GBM_BO_USE_RENDERING); ++ output->gbm_surface = gbm_surface_create( ++ b->gbm, ++ output->base.current_mode->width, ++ output->base.current_mode->height, ++ format[0], ++ GBM_BO_USE_SCANOUT | ++ GBM_BO_USE_RENDERING); + if (!output->gbm_surface) { + weston_log("failed to create gbm surface\n"); + return -1; + } -- output->gbm_cursor_bo[i] = -- gbm_bo_create(b->gbm, b->cursor_width, b->cursor_height, -- GBM_FORMAT_ARGB8888, flags); -- } +- for (i = 0; i < 2; i++) { +- if (output->gbm_cursor_bo[i]) +- continue; + if (format[1]) + n_formats = 2; + if (gl_renderer->output_window_create( -+ &output->base, -+ (EGLNativeWindowType)output->gbm_surface, -+ output->gbm_surface, -+ gl_renderer->opaque_attribs, -+ format, -+ n_formats) < 0) { -+ weston_log("failed to create gl renderer output state\n"); ++ &output->base, ++ (EGLNativeWindowType)output->gbm_surface, ++ output->gbm_surface, ++ gl_renderer->opaque_attribs, ++ format, ++ n_formats) < 0) { ++ weston_log("failed to create gl renderer output " ++ "state\n"); + gbm_surface_destroy(output->gbm_surface); + return -1; + } +- output->gbm_cursor_bo[i] = +- gbm_bo_create(b->gbm, b->cursor_width, b->cursor_height, +- GBM_FORMAT_ARGB8888, flags); +- } ++ flags = GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE; + - if (output->gbm_cursor_bo[0] == NULL || output->gbm_cursor_bo[1] == NULL) { - weston_log("cursor buffers unavailable, using gl cursors\n"); - b->cursors_are_broken = 1; -+ flags = GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE; -+ + for (i = 0; i < 2; i++) { + if (output->gbm_cursor_bo[i]) + continue; + + output->gbm_cursor_bo[i] = -+ gbm_bo_create(b->gbm, b->cursor_width, b->cursor_height, -+ GBM_FORMAT_ARGB8888, flags); ++ gbm_bo_create(b->gbm, ++ b->cursor_width, ++ b->cursor_height, ++ GBM_FORMAT_ARGB8888, ++ flags); + } + + if (output->gbm_cursor_bo[0] == NULL || output->gbm_cursor_bo[1] == NULL) { @@ -471,20 +476,7 @@ index d1cb21c6b37a..096ca79a3e2b 100644 static int drm_output_init_pixman(struct drm_output *output, 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); -- if (parse_gbm_format(config.gbm_format, b->gbm_format, &output->gbm_format) == -1) -- output->gbm_format = b->gbm_format; -+ if (!b->use_egldevice && parse_gbm_format(config.gbm_format, -+ b->gbm_format, -+ &output->gbm_format) == -1) -+ output->gbm_format = b->gbm_format; - - setup_output_seat_constraint(b, &output->base, - config.seat ? config.seat : ""); -@@ -3003,6 +3115,11 @@ recorder_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, +@@ -3005,6 +3124,11 @@ recorder_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, struct drm_output *output; int width, height; @@ -496,7 +488,7 @@ index d1cb21c6b37a..096ca79a3e2b 100644 output = container_of(b->compositor->output_list.next, struct drm_output, base.link); -@@ -3058,11 +3175,20 @@ switch_to_gl_renderer(struct drm_backend *b) +@@ -3060,11 +3184,20 @@ switch_to_gl_renderer(struct drm_backend *b) weston_log("Switching to GL renderer\n"); @@ -509,20 +501,20 @@ index d1cb21c6b37a..096ca79a3e2b 100644 + b->egldevice = find_egldevice(b->drm.filename); + if (b->egldevice == EGL_NO_DEVICE_EXT) { + weston_log("Failed to create EGL device. " -+ "Aborting renderer switch\n"); ++ "Aborting renderer switch\n"); + return; + } + } else { + b->gbm = create_gbm_device(b->drm.fd); + if (!b->gbm) { + weston_log("Failed to create gbm device. " -+ "Aborting renderer switch\n"); ++ "Aborting renderer switch\n"); + return; + } } wl_list_for_each(output, &b->compositor->output_list, base.link) -@@ -3071,7 +3197,8 @@ switch_to_gl_renderer(struct drm_backend *b) +@@ -3073,7 +3206,8 @@ switch_to_gl_renderer(struct drm_backend *b) b->compositor->renderer->destroy(b->compositor); if (drm_backend_create_gl_renderer(b) < 0) { @@ -532,7 +524,7 @@ index d1cb21c6b37a..096ca79a3e2b 100644 weston_log("Failed to create GL renderer. Quitting.\n"); /* FIXME: we need a function to shutdown cleanly */ assert(0); -@@ -3128,6 +3255,7 @@ drm_backend_create(struct weston_compositor *compositor, +@@ -3130,6 +3264,7 @@ drm_backend_create(struct weston_compositor *compositor, b->sprites_are_broken = 1; b->compositor = compositor; b->use_pixman = config->use_pixman; @@ -541,19 +533,20 @@ index d1cb21c6b37a..096ca79a3e2b 100644 b->use_current_mode = config->use_current_mode; diff --git a/libweston/compositor-drm.h b/libweston/compositor-drm.h -index 1266031f09f1..feb423d8f49c 100644 +index 1266031f09f1..01223c173988 100644 --- a/libweston/compositor-drm.h +++ b/libweston/compositor-drm.h -@@ -89,6 +89,9 @@ struct weston_drm_backend_config { +@@ -89,6 +89,10 @@ struct weston_drm_backend_config { /** Whether to use the pixman renderer instead of the OpenGL ES renderer. */ bool use_pixman; -+ /** Whether to use EGLDevice rather than GBM. */ ++ /** Whether to use the GL composition based off EGLDevice & friends instead ++ * of GBM. */ + bool use_egldevice; + /** The seat to be used for input and output. * * If NULL the default "seat0" will be used. The backend will -- -2.10.0 +2.10.2 diff --git a/0012-Add-nvidia-release-notes-file.patch b/0012-Add-nvidia-release-notes-file.patch new file mode 100644 index 000000000000..adfa82884c73 --- /dev/null +++ b/0012-Add-nvidia-release-notes-file.patch @@ -0,0 +1,37 @@ +From 93f1500533d30ebea97c8055ea62f9e252027e21 Mon Sep 17 00:00:00 2001 +From: "Miguel A. Vico" <mvicomoya@nvidia.com> +Date: Fri, 11 Nov 2016 20:07:19 +0100 +Subject: [PATCH 12/12] Add nvidia-release-notes file +X-NVConfidentiality: public + +Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> +--- + nvidia-release-notes | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + create mode 100644 nvidia-release-notes + +diff --git a/nvidia-release-notes b/nvidia-release-notes +new file mode 100644 +index 000000000000..182251df0008 +--- /dev/null ++++ b/nvidia-release-notes +@@ -0,0 +1,16 @@ ++NVIDIA EGLStream-based Weston version 1.12 ++------------------------------------------ ++ ++This branch includes NVIDIA EGLStream patches on top of ++Weston 1.12. ++ ++* Known issues: ++ ++ - Bad interactions with XDG Shell v6 preventing ++ clients that implement the new interface from ++ starting ++ ++* Contact: ++ ++ Miguel A. Vico (mvicomoya AT nvidia.com) ++ +-- +2.10.2 + @@ -4,7 +4,7 @@ pkgname=weston-eglstream pkgver=1.12.0 -pkgrel=1 +pkgrel=2 pkgdesc='Reference implementation of a Wayland compositor with EGLStream support' arch=('i686' 'x86_64') url='http://wayland.freedesktop.org' @@ -24,19 +24,21 @@ source=("http://wayland.freedesktop.org/releases/weston-$pkgver.tar.xz" '0008-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch' '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') + '0011-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch' + '0012-Add-nvidia-release-notes-file.patch') sha256sums=('ac7ac2a32e3b9f50131fccded5d2326bd36b2226712d90b61999118a09af5033' - 'f8186d1d5229e838ca77b655792a3b0b4d9c329859df1d900d501f5ef4aec1af' - 'f600db2a8e71697a229b4f7f8052992b5ad41a99e273adf7119cb9e428de59a9' - 'bb807ce209fbf0381bc2fb61ad3251ecf0f266dfb20f90a54cc3c2517b6ba1b8' - '09fcb3685832ac3c891004029cc2863ea999b18af2ce3f9806bc208a8da368b5' - '02e232526a7c4ad3b543645135eddd5f945a8531e1436bfccebccf07b193fd87' - 'c789174b8f44f5c8835ad125f9f3a3b3637e2ca47c8ec1424202dc0b96cfb266' - '4a3ed4667158da25511f113df87e93bb73dd053a7593fb754486f3a44495f617' - 'c3a4dbe92e5e16fc486a389dc5e09e55ff064c4e7ac96cdf2bc7edc4f7bd0387' - 'f3bab7e342e8267b8f60a33a3fdd839fb3461869945b55783e2a726119394aab' - '995691ee0dbdd21b864d806281c832ea6ed42623315176d9774a0a078999029a' - 'd12b9820df5331dd0bb7e99a28a862009e0def600166d735dda330ea41e8b15e') + 'dc51d39b460385eff7694f11aa3096896a58246f0d0ffdcd77ac9d07bf4781d7' + 'e9088f7fa816d8c04bfa0abfcbb0c33b436cea157efce03663202131bcf8a053' + '2abc0c12a7c3465c2289e6940f538cf6cb46f4f9c57eff1884b15134a460ef2e' + '9e9cb4ee001d62c09753994225d944b3eb90788d29b69b1d3ffead38c09c8934' + '7492e7d6b3d4d8a95433cbc845117746e48047794422c28b37c16fe60078a6f8' + 'd7ae91ed894a17d578371be877ebd0ab2204522f5f17388ea3ef0714afe85bba' + '1a703d7743b55ccbe934389b1c4430f4f4535f4864439b86097b80d1b42e7e2c' + 'd5a8fddd8ddae650a283915478e8d41669a1dcc953df4317b5d178e14221fa4a' + 'fb759e98bffb406904366b735f7f50f2726a2a1c6700a9cf544d4c763f46bbfa' + '8b6ef50772bf02adb951266ad5d973a701dd147fc168d8d6fa7cbafe0900dbda' + '7838e7de7ac5b7fe4e98392235907333d4977939a487ff4cf2a2bd8756fc49cb' + 'f916ded74db76cfe3566654b5dc5a90b214a1572ffd7c15aa5e577ceabc22ab4') prepare() { cd weston-$pkgver @@ -52,6 +54,7 @@ prepare() { patch -Np1 -i "${srcdir}/0009-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch" patch -Np1 -i "${srcdir}/0010-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch" patch -Np1 -i "${srcdir}/0011-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch" + patch -Np1 -i "${srcdir}/0012-Add-nvidia-release-notes-file.patch" } build() { |