diff options
author | Miguel A. Vico | 2018-04-11 00:03:29 +0200 |
---|---|---|
committer | Miguel A. Vico | 2018-04-11 00:03:29 +0200 |
commit | 773b4f747c18094bceaecc0c62c87d3f2c030c1b (patch) | |
tree | 139f3da5133546b5a8779948029a8c47ab4aaf55 | |
parent | 4c6dd72d7cdd820cef89a203bc7854d85a217b25 (diff) | |
download | aur-773b4f747c18094bceaecc0c62c87d3f2c030c1b.tar.gz |
Update to weston 4.0.0
-rw-r--r-- | .SRCINFO | 42 | ||||
-rw-r--r-- | 0001-compositor-drm-Release-current-next-fb-when-deactiva.patch | 53 | ||||
-rw-r--r-- | 0001-gl-renderer-Add-EGLDevice-enumeration-support.patch (renamed from 0002-gl-renderer-Add-EGLDevice-enumeration-support.patch) | 12 | ||||
-rw-r--r-- | 0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch (renamed from 0003-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch) | 56 | ||||
-rw-r--r-- | 0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch (renamed from 0004-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch) | 36 | ||||
-rw-r--r-- | 0004-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch (renamed from 0005-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch) | 52 | ||||
-rw-r--r-- | 0005-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch (renamed from 0006-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch) | 133 | ||||
-rw-r--r-- | 0006-simple-egl-Do-not-set-EGL-up-until-XDG-setup-is-comp.patch (renamed from 0007-simple-egl-Do-not-set-EGL-up-until-XDG-setup-is-comp.patch) | 22 | ||||
-rw-r--r-- | 0007-compositor-Process-stream-attach-requests-with-wl_eg.patch (renamed from 0008-compositor-Process-stream-attach-requests-with-wl_eg.patch) | 61 | ||||
-rw-r--r-- | 0008-Add-nvidia-release-notes-file.patch (renamed from 0009-Add-nvidia-release-notes-file.patch) | 22 | ||||
-rw-r--r-- | PKGBUILD | 58 |
11 files changed, 229 insertions, 318 deletions
@@ -1,7 +1,7 @@ pkgbase = weston-eglstream pkgdesc = Reference implementation of a Wayland compositor with EGLStream support - pkgver = 3.0.0 - pkgrel = 2 + pkgver = 4.0.0 + pkgrel = 1 url = https://wayland.freedesktop.org/ arch = i686 arch = x86_64 @@ -35,26 +35,24 @@ pkgbase = weston-eglstream depends = egl-wayland-git provides = weston conflicts = weston - source = https://wayland.freedesktop.org/releases/weston-3.0.0.tar.xz - source = 0001-compositor-drm-Release-current-next-fb-when-deactiva.patch - source = 0002-gl-renderer-Add-EGLDevice-enumeration-support.patch - source = 0003-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch - source = 0004-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch - source = 0005-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch - source = 0006-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch - source = 0007-simple-egl-Do-not-set-EGL-up-until-XDG-setup-is-comp.patch - source = 0008-compositor-Process-stream-attach-requests-with-wl_eg.patch - source = 0009-Add-nvidia-release-notes-file.patch - sha256sums = cde1d55e8dd70c3cbb3d1ec72f60e60000041579caa1d6a262bd9c35e93723a5 - sha256sums = c643d5b305ce91150eb0615836dcee494cc28cd12d7cb60e835b69ee5f8c452a - sha256sums = 689f619cb8691416f67fd052b217658dfe3dd2bdf3cb4ede532c8240546f998d - sha256sums = 058ab62996f7d000c144963148fa2e39a9c99bc4e0cac3e56926426fc100dac0 - sha256sums = 9f96e3a94a02cc7fb91d0c8660a8bf6497c8375ce88c0115a2ee8b6c558bcab4 - sha256sums = 04cab2302462d3680152743289e39766b5e38be7acc5b91a1b5cadec6f98d714 - sha256sums = 93e77066b08e213af1173ef5438b5bdc62cc7e638a43d813fe5b73b437c71250 - sha256sums = 6786b4c9e77dfc60db04f05a0b613a71b968d1d12d38c534a240f63a34059757 - sha256sums = ac8c20a932d7e70f4a93a0121cd476be84bf0498a91e927ffe79de66c03382b6 - sha256sums = c37571d1bea9114a31f360a75a449f10bec067f32aaddd0337e1b95076295f1e + source = https://wayland.freedesktop.org/releases/weston-4.0.0.tar.xz + source = 0001-gl-renderer-Add-EGLDevice-enumeration-support.patch + source = 0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch + source = 0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch + source = 0004-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch + source = 0005-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch + source = 0006-simple-egl-Do-not-set-EGL-up-until-XDG-setup-is-comp.patch + source = 0007-compositor-Process-stream-attach-requests-with-wl_eg.patch + source = 0008-Add-nvidia-release-notes-file.patch + sha256sums = a0fc0ae7ef83dfbed12abfe9b8096a24a7dd00705e86fa0db1e619ded18b4b58 + sha256sums = 41cb791c07e377ce16ccb7ba6a6a84a49e5351c3ed815a98076069fb1386ecec + sha256sums = 0bd297017262bf278e20c05e5d0a46208c77f5462d80db1906286764de867720 + sha256sums = a6a05d101701ff97bee1d5d3974fbbc12abb34c4b483568cc3c3552e328c3b55 + sha256sums = d8f04aef2b38628b38dae92c73f16aab36b74ca83a44d144123439cb68c273a6 + sha256sums = dda90181e2f91c03da8d180d7fbae42d61e2a31122301a2fc08f020b1da19a84 + sha256sums = f893280becdb18583d234d1a26814aa092356402fc8731a1b2da8ef8d6963a6e + sha256sums = 5e56cf8d136a241cb05abcad39537287a97777c1697746697631c10f9ab551f1 + sha256sums = 919923d3a545d1e8420d128cd63d7e60095887ec603d417e23df6d7138ba42da pkgname = weston-eglstream diff --git a/0001-compositor-drm-Release-current-next-fb-when-deactiva.patch b/0001-compositor-drm-Release-current-next-fb-when-deactiva.patch deleted file mode 100644 index c94efc1bc75b..000000000000 --- a/0001-compositor-drm-Release-current-next-fb-when-deactiva.patch +++ /dev/null @@ -1,53 +0,0 @@ -From f2da0e2f686ee16ddd3a4e92e06ef3a55ec80472 Mon Sep 17 00:00:00 2001 -From: "Miguel A. Vico" <mvicomoya@nvidia.com> -Date: Tue, 4 Apr 2017 14:39:47 -0700 -Subject: [PATCH 1/9] compositor-drm: Release current & next fb when - deactivating the session -X-NVConfidentiality: public - -With - - commit 47224cc9312fef05c1a523ea0da0a1aae66f100d - Author: Daniel Stone <daniels@collabora.com> - Date: Sat Nov 5 08:04:07 2016 +0000 - - compositor-drm: Delete drm_backend_set_modes - -we stopped forcing a modeset when restoring the session. The motivation -was that we would use a stale fb, so better to let the next repaint -handle it. - -However, if drm_output::current != NULL, we won't issue a modeset upon -repaint. - -This change releases both drm_output::current and drm_output::next when -deactivating the current session. This ensures the very first repaint -after restoring the session will issue a modeset. - -Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> ---- - libweston/compositor-drm.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c -index 8e1e788f..63153271 100644 ---- a/libweston/compositor-drm.c -+++ b/libweston/compositor-drm.c -@@ -3164,6 +3164,14 @@ session_notify(struct wl_listener *listener, void *data) - wl_list_for_each(output, &compositor->output_list, base.link) { - output->base.repaint_needed = false; - drmModeSetCursor(b->drm.fd, output->crtc_id, 0, 0, 0); -+ if (output->fb_current != NULL) { -+ drm_fb_unref(output->fb_current); -+ output->fb_current = NULL; -+ } -+ if (output->fb_pending != NULL) { -+ drm_fb_unref(output->fb_pending); -+ output->fb_pending = NULL; -+ } - } - - output = container_of(compositor->output_list.next, --- -2.13.3 - diff --git a/0002-gl-renderer-Add-EGLDevice-enumeration-support.patch b/0001-gl-renderer-Add-EGLDevice-enumeration-support.patch index 41e0190755c0..3b451da853e3 100644 --- a/0002-gl-renderer-Add-EGLDevice-enumeration-support.patch +++ b/0001-gl-renderer-Add-EGLDevice-enumeration-support.patch @@ -1,7 +1,7 @@ -From d511b3d61c8c99633c1a012883931c2eeff9fe3f Mon Sep 17 00:00:00 2001 +From 89c953d8bc97cb9d80c344d8dad4e44ed22ee691 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 2/9] gl-renderer: Add EGLDevice enumeration support +Subject: [PATCH 1/8] gl-renderer: Add EGLDevice enumeration support X-NVConfidentiality: public EGLDevice provides means to enumerate native devices. @@ -22,10 +22,10 @@ Reviewed-by: James Jones <jajones@nvidia.com> 2 files changed, 96 insertions(+), 1 deletion(-) diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c -index da29b072..ecb19f13 100644 +index 2c50d2da..b681668b 100644 --- a/libweston/gl-renderer.c +++ b/libweston/gl-renderer.c -@@ -3478,6 +3478,90 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface) +@@ -3775,6 +3775,90 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface) return 0; } @@ -116,7 +116,7 @@ index da29b072..ecb19f13 100644 WL_EXPORT struct gl_renderer_interface gl_renderer_interface = { .opaque_attribs = gl_renderer_opaque_attribs, .alpha_attribs = gl_renderer_alpha_attribs, -@@ -3488,5 +3572,8 @@ WL_EXPORT struct gl_renderer_interface gl_renderer_interface = { +@@ -3785,5 +3869,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, @@ -152,5 +152,5 @@ index b47ea07f..9ff4e21e 100644 }; -- -2.13.3 +2.15.1 diff --git a/0003-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch b/0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch index 3e080b0d8887..febe9db55cb3 100644 --- a/0003-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch +++ b/0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch @@ -1,7 +1,7 @@ -From 77c0daf1c09c7d9a4be2e3f10089157e88c5a338 Mon Sep 17 00:00:00 2001 +From 61c044bfaa84364e6043e19dd8c056e1ccffb749 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 3/9] gl-renderer: Add support for EGLDevice composited frame +Subject: [PATCH 2/8] gl-renderer: Add support for EGLDevice composited frame presentation X-NVConfidentiality: public @@ -48,19 +48,19 @@ Reviewed-by: James Jones <jajones@nvidia.com> 3 files changed, 315 insertions(+), 3 deletions(-) diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c -index ecb19f13..ab2881c6 100644 +index b681668b..27794b60 100644 --- a/libweston/gl-renderer.c +++ b/libweston/gl-renderer.c -@@ -86,6 +86,8 @@ struct gl_output_state { +@@ -103,6 +103,8 @@ struct gl_output_state { struct gl_border_image borders[4]; enum gl_border_status border_status; + EGLStreamKHR egl_stream; + struct weston_matrix output_matrix; - }; -@@ -209,6 +211,28 @@ struct gl_renderer { + /* struct timeline_render_point::link */ +@@ -233,6 +235,28 @@ struct gl_renderer { int has_surfaceless_context; @@ -89,10 +89,11 @@ index ecb19f13..ab2881c6 100644 int has_dmabuf_import; struct wl_list dmabuf_images; -@@ -1200,6 +1224,38 @@ gl_renderer_repaint_output(struct weston_output *output, +@@ -1365,6 +1389,38 @@ gl_renderer_repaint_output(struct weston_output *output, + TIMELINE_RENDER_POINT_TYPE_END); } - static int ++static int +gl_renderer_output_stream_flip(struct weston_output *output, + void *flip_data) +{ @@ -124,11 +125,10 @@ index ecb19f13..ab2881c6 100644 +#endif +} + -+static int + static int gl_renderer_read_pixels(struct weston_output *output, pixman_format_code_t format, void *pixels, - uint32_t x, uint32_t y, -@@ -2805,9 +2861,93 @@ gl_renderer_create_window_surface(struct gl_renderer *gr, +@@ -3011,9 +3067,93 @@ gl_renderer_create_window_surface(struct gl_renderer *gr, return egl_surface; } @@ -223,7 +223,7 @@ index ecb19f13..ab2881c6 100644 { struct gl_output_state *go; int i; -@@ -2817,6 +2957,7 @@ gl_renderer_output_create(struct weston_output *output, +@@ -3023,6 +3163,7 @@ gl_renderer_output_create(struct weston_output *output, return -1; go->egl_surface = surface; @@ -231,7 +231,7 @@ index ecb19f13..ab2881c6 100644 for (i = 0; i < BUFFER_DAMAGE_COUNT; i++) pixman_region32_init(&go->buffer_damage[i]); -@@ -2849,13 +2990,41 @@ gl_renderer_output_window_create(struct weston_output *output, +@@ -3057,13 +3198,41 @@ gl_renderer_output_window_create(struct weston_output *output, return -1; } @@ -274,9 +274,9 @@ index ecb19f13..ab2881c6 100644 static void gl_renderer_output_destroy(struct weston_output *output) { -@@ -2872,6 +3041,9 @@ gl_renderer_output_destroy(struct weston_output *output) - - weston_platform_destroy_egl_surface(gr->egl_display, go->egl_surface); +@@ -3088,6 +3257,9 @@ gl_renderer_output_destroy(struct weston_output *output) + wl_list_for_each_safe(trp, tmp, &go->timeline_render_point_list, link) + timeline_render_point_destroy(trp); + if (go->egl_stream != EGL_NO_STREAM_KHR) + gr->destroy_stream(gr->egl_display, go->egl_stream); @@ -284,7 +284,7 @@ index ecb19f13..ab2881c6 100644 free(go); } -@@ -2968,6 +3140,19 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) +@@ -3184,6 +3356,19 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) (void *) eglGetProcAddress("eglUnbindWaylandDisplayWL"); gr->query_buffer = (void *) eglGetProcAddress("eglQueryWaylandBufferWL"); @@ -304,9 +304,9 @@ index ecb19f13..ab2881c6 100644 extensions = (const char *) eglQueryString(gr->egl_display, EGL_EXTENSIONS); -@@ -3027,6 +3212,30 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) - if (weston_check_egl_extension(extensions, "GL_EXT_texture_rg")) - gr->has_gl_texture_rg = 1; +@@ -3257,6 +3442,30 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) + "missing EGL_ANDROID_native_fence_sync extension\n"); + } + if (weston_check_egl_extension(extensions, "EGL_EXT_output_base")) + gr->has_egl_output_base = 1; @@ -335,7 +335,7 @@ index ecb19f13..ab2881c6 100644 renderer_setup_egl_client_extensions(gr); return 0; -@@ -3052,6 +3261,15 @@ static const EGLint gl_renderer_alpha_attribs[] = { +@@ -3282,6 +3491,15 @@ static const EGLint gl_renderer_alpha_attribs[] = { EGL_NONE }; @@ -351,7 +351,7 @@ index ecb19f13..ab2881c6 100644 /** Checks whether a platform EGL client extension is supported * -@@ -3125,6 +3343,8 @@ platform_to_extension(EGLenum platform) +@@ -3355,6 +3573,8 @@ platform_to_extension(EGLenum platform) return "wayland"; case EGL_PLATFORM_X11_KHR: return "x11"; @@ -360,7 +360,7 @@ index ecb19f13..ab2881c6 100644 default: assert(0 && "bad EGL platform enum"); } -@@ -3261,6 +3481,38 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, +@@ -3491,6 +3711,38 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, if (gl_renderer_setup_egl_extensions(ec) < 0) goto fail_with_error; @@ -399,7 +399,7 @@ index ecb19f13..ab2881c6 100644 wl_list_init(&gr->dmabuf_images); if (gr->has_dmabuf_import) { gr->base.import_dmabuf = gl_renderer_import_dmabuf; -@@ -3565,15 +3817,19 @@ gl_renderer_get_drm_device_file(EGLDeviceEXT device, +@@ -3862,15 +4114,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, @@ -461,11 +461,11 @@ index 9ff4e21e..39ea3b42 100644 }; diff --git a/shared/weston-egl-ext.h b/shared/weston-egl-ext.h -index ffea438b..deb1b1c3 100644 +index 0784ea2d..f39990ed 100644 --- a/shared/weston-egl-ext.h +++ b/shared/weston-egl-ext.h -@@ -176,12 +176,52 @@ typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLD - #define EGL_PLATFORM_X11_KHR 0x31D5 +@@ -204,12 +204,52 @@ typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, + #define EGL_NO_NATIVE_FENCE_FD_ANDROID -1 #endif +#ifndef EGL_PLATFORM_DEVICE_EXT @@ -518,5 +518,5 @@ index ffea438b..deb1b1c3 100644 #endif /* ENABLE_EGL */ -- -2.13.3 +2.15.1 diff --git a/0004-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch b/0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch index 7267df5ad616..1e557c68c3dd 100644 --- a/0004-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch +++ b/0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch @@ -1,7 +1,7 @@ -From 65d79593fb1a4663d4241e31e75f0940662224fb Mon Sep 17 00:00:00 2001 +From b1109f50484634fe66e07e9ef958e870263a0b21 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 4/9] gl-renderer: Add EGL client support for EGLStream frame +Date: Thu, 29 Mar 2018 00:15:49 -0700 +Subject: [PATCH 3/8] gl-renderer: Add EGL client support for EGLStream frame presentation X-NVConfidentiality: public @@ -29,10 +29,10 @@ Reviewed-by: James Jones <jajones@nvidia.com> 2 files changed, 187 insertions(+), 1 deletion(-) diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c -index ab2881c6..a9ed723f 100644 +index 27794b60..39e33350 100644 --- a/libweston/gl-renderer.c +++ b/libweston/gl-renderer.c -@@ -168,6 +168,9 @@ struct gl_surface_state { +@@ -188,6 +188,9 @@ struct gl_surface_state { int hsub[3]; /* horizontal subsampling per plane */ int vsub[3]; /* vertical subsampling per plane */ @@ -42,7 +42,7 @@ index ab2881c6..a9ed723f 100644 struct weston_surface *surface; struct wl_listener surface_destroy_listener; -@@ -219,6 +222,7 @@ struct gl_renderer { +@@ -243,6 +246,7 @@ struct gl_renderer { PFNEGLCREATESTREAMKHRPROC create_stream; PFNEGLDESTROYSTREAMKHRPROC destroy_stream; @@ -50,7 +50,7 @@ index ab2881c6..a9ed723f 100644 int has_egl_stream; PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC create_stream_producer_surface; -@@ -228,11 +232,16 @@ struct gl_renderer { +@@ -252,11 +256,16 @@ struct gl_renderer { int has_egl_stream_consumer_egloutput; #ifdef EGL_NV_stream_attrib @@ -67,7 +67,7 @@ index ab2881c6..a9ed723f 100644 int has_dmabuf_import; struct wl_list dmabuf_images; -@@ -2156,6 +2165,145 @@ gl_renderer_attach_dmabuf(struct weston_surface *surface, +@@ -2362,6 +2371,145 @@ gl_renderer_attach_dmabuf(struct weston_surface *surface, gs->y_inverted = buffer->y_inverted; } @@ -213,7 +213,7 @@ index ab2881c6..a9ed723f 100644 static void gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) { -@@ -2179,6 +2327,12 @@ gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) +@@ -2385,6 +2533,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; @@ -226,7 +226,7 @@ index ab2881c6..a9ed723f 100644 return; } -@@ -2192,7 +2346,7 @@ gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) +@@ -2398,7 +2552,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); @@ -235,7 +235,7 @@ index ab2881c6..a9ed723f 100644 weston_log("unhandled buffer type!\n"); weston_buffer_reference(&gs->buffer_ref, NULL); gs->buffer_type = BUFFER_TYPE_NULL; -@@ -2380,6 +2534,10 @@ surface_state_destroy(struct gl_surface_state *gs, struct gl_renderer *gr) +@@ -2586,6 +2740,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); @@ -246,7 +246,7 @@ index ab2881c6..a9ed723f 100644 free(gs); } -@@ -2430,6 +2588,8 @@ gl_renderer_create_surface(struct weston_surface *surface) +@@ -2636,6 +2794,8 @@ gl_renderer_create_surface(struct weston_surface *surface) gs->surface = surface; @@ -255,7 +255,7 @@ index ab2881c6..a9ed723f 100644 pixman_region32_init(&gs->texture_damage); surface->renderer_state = gs; -@@ -3145,14 +3305,19 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) +@@ -3361,14 +3521,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"); @@ -275,7 +275,7 @@ index ab2881c6..a9ed723f 100644 extensions = (const char *) eglQueryString(gr->egl_display, EGL_EXTENSIONS); -@@ -3236,6 +3401,12 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec) +@@ -3466,6 +3631,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; @@ -288,7 +288,7 @@ index ab2881c6..a9ed723f 100644 renderer_setup_egl_client_extensions(gr); return 0; -@@ -3508,6 +3679,16 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, +@@ -3738,6 +3909,16 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, goto fail_terminate; } @@ -306,10 +306,10 @@ index ab2881c6..a9ed723f 100644 weston_log("warning: EGL page flip event notification " "not supported\n"); diff --git a/shared/weston-egl-ext.h b/shared/weston-egl-ext.h -index deb1b1c3..31096e64 100644 +index f39990ed..96982e2d 100644 --- a/shared/weston-egl-ext.h +++ b/shared/weston-egl-ext.h -@@ -215,6 +215,11 @@ EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireAttribEXT (EGLDisplay dpy, +@@ -243,6 +243,11 @@ EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireAttribEXT (EGLDisplay dpy, #define EGL_DRM_FLIP_EVENT_DATA_NV 0x333E #endif /* EGL_NV_output_drm_flip_event */ @@ -322,5 +322,5 @@ index deb1b1c3..31096e64 100644 /* EGL platform definition are keept to allow compositor-xx.c to build */ -- -2.13.3 +2.15.1 diff --git a/0005-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch b/0004-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch index 33bccb67ad11..0b4a62b47b40 100644 --- a/0005-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch +++ b/0004-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch @@ -1,7 +1,7 @@ -From 7f613474a4d3fe83d297700b56ba06b143b473bc Mon Sep 17 00:00:00 2001 +From e207c4f2bf1e359e329b73974184ac4f8ef3a7f3 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 5/9] compositor-drm: Gracefully handle vblank and flip invalid +Subject: [PATCH 4/8] compositor-drm: Gracefully handle vblank and flip invalid timestamps X-NVConfidentiality: public @@ -22,7 +22,7 @@ Reviewed-by: Andy Ritger <aritger@nvidia.com> 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c -index 63153271..7120b578 100644 +index c09c49bf..24573f48 100644 --- a/libweston/compositor-drm.c +++ b/libweston/compositor-drm.c @@ -1,6 +1,7 @@ @@ -33,7 +33,27 @@ index 63153271..7120b578 100644 * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the -@@ -1013,8 +1014,16 @@ drm_output_start_repaint_loop(struct weston_output *output_base) +@@ -1433,6 +1434,19 @@ drm_output_update_complete(struct drm_output *output, uint32_t flags, + + ts.tv_sec = sec; + ts.tv_nsec = usec * 1000; ++ ++ /* Zero timestamp means failure to get valid timestamp, so ++ * immediately finish frame ++ * ++ * 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); ++ flags = WP_PRESENTATION_FEEDBACK_INVALID; ++ } ++ + weston_output_finish_frame(&output->base, &ts, flags); + + /* We can't call this from frame_notify, because the output's +@@ -2434,8 +2448,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 +72,7 @@ index 63153271..7120b578 100644 ts.tv_sec = vbl.reply.tval_sec; ts.tv_nsec = vbl.reply.tval_usec * 1000; -@@ -1035,7 +1044,7 @@ drm_output_start_repaint_loop(struct weston_output *output_base) +@@ -2456,7 +2478,7 @@ drm_output_start_repaint_loop(struct weston_output *output_base) } } @@ -60,27 +80,7 @@ index 63153271..7120b578 100644 + /* Immediate query succeeded, but didn't provide valid timestamp. * Use pageflip fallback. */ - fb_id = output->fb_current->fb_id; -@@ -1136,6 +1145,19 @@ page_flip_handler(int fd, unsigned int frame, - - ts.tv_sec = sec; - ts.tv_nsec = usec * 1000; -+ -+ /* Zero timestamp means failure to get valid timestamp, so -+ * immediately finish frame -+ * -+ * 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); -+ flags = WP_PRESENTATION_FEEDBACK_INVALID; -+ } -+ - weston_output_finish_frame(&output->base, &ts, flags); - /* We can't call this from frame_notify, because the output's -- -2.13.3 +2.15.1 diff --git a/0006-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch b/0005-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch index 12d9e0121fc5..03d0eb9c6e95 100644 --- a/0006-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch +++ b/0005-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch @@ -1,7 +1,7 @@ -From a151d9d94a819673a4fa2cafef2a91dbedc17be4 Mon Sep 17 00:00:00 2001 +From 951a52e7494aeb38da9804c887dfb285fdb1d600 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 6/9] compositor-drm: Add support for EGLDevice+EGLOutput +Subject: [PATCH 5/8] compositor-drm: Add support for EGLDevice+EGLOutput X-NVConfidentiality: public As previously stated, EGLDevice and EGLOutput will provide means @@ -26,26 +26,26 @@ Reviewed-by: Adam Cheney <acheney@nvidia.com> Reviewed-by: James Jones <jajones@nvidia.com> --- compositor/main.c | 2 + - libweston/compositor-drm.c | 285 ++++++++++++++++++++++++++++++++------------- + libweston/compositor-drm.c | 279 ++++++++++++++++++++++++++++++++------------- libweston/compositor-drm.h | 4 + libweston/gl-renderer.h | 1 + shared/weston-egl-ext.h | 9 ++ - 5 files changed, 220 insertions(+), 81 deletions(-) + 5 files changed, 217 insertions(+), 78 deletions(-) diff --git a/compositor/main.c b/compositor/main.c -index f8a60e97..7abc8d1a 100644 +index 1e827884..af0cb902 100644 --- a/compositor/main.c +++ b/compositor/main.c -@@ -566,6 +566,7 @@ usage(int error_code) - " --seat=SEAT\t\tThe seat that weston should run on\n" +@@ -484,6 +484,7 @@ usage(int error_code) " --tty=TTY\t\tThe tty to use\n" + " --drm-device=CARD\tThe DRM device to use, e.g. \"card0\".\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 -@@ -1227,6 +1228,7 @@ load_drm_backend(struct weston_compositor *c, - { WESTON_OPTION_INTEGER, "tty", 0, &config.tty }, +@@ -1113,6 +1114,7 @@ load_drm_backend(struct weston_compositor *c, + { WESTON_OPTION_STRING, "drm-device", 0, &config.specific_device }, { WESTON_OPTION_BOOLEAN, "current-mode", 0, &wet->drm_use_current_mode }, { WESTON_OPTION_BOOLEAN, "use-pixman", 0, &config.use_pixman }, + { WESTON_OPTION_BOOLEAN, "use-egldevice", 0, &config.use_egldevice }, @@ -53,10 +53,10 @@ index f8a60e97..7abc8d1a 100644 parse_options(options, ARRAY_LENGTH(options), argc, argv); diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c -index 7120b578..1eed58a7 100644 +index 24573f48..572d78f8 100644 --- a/libweston/compositor-drm.c +++ b/libweston/compositor-drm.c -@@ -95,7 +95,10 @@ struct drm_backend { +@@ -232,7 +232,10 @@ struct drm_backend { int fd; char *filename; } drm; @@ -67,15 +67,15 @@ index 7120b578..1eed58a7 100644 struct wl_listener session_listener; uint32_t gbm_format; -@@ -114,6 +117,7 @@ struct drm_backend { - int cursors_are_broken; +@@ -261,6 +264,7 @@ struct drm_backend { + bool atomic_modeset; int use_pixman; + int use_egldevice; struct udev_input input; -@@ -735,19 +739,23 @@ drm_output_render_gl(struct drm_output *output, pixman_region32_t *damage) +@@ -1654,19 +1658,23 @@ drm_output_render_gl(struct drm_output_state *state, pixman_region32_t *damage) output->base.compositor->renderer->repaint_output(&output->base, damage); @@ -110,55 +110,46 @@ index 7120b578..1eed58a7 100644 return ret; } -@@ -898,9 +906,14 @@ drm_output_repaint(struct weston_output *output_base, - output->state_invalid = false; +@@ -1717,7 +1725,9 @@ drm_output_render(struct drm_output_state *state, pixman_region32_t *damage) + if (scanout_state->fb) + return; + +- if (!pixman_region32_not_empty(damage) && ++ /* XXX: Assume full damage when using streams */ ++ if (!b->use_egldevice && ++ !pixman_region32_not_empty(damage) && + scanout_plane->state_cur->fb && + (scanout_plane->state_cur->fb->type == BUFFER_GBM_SURFACE || + scanout_plane->state_cur->fb->type == BUFFER_PIXMAN_DUMB) && +@@ -1893,9 +1903,14 @@ drm_output_apply_state_legacy(struct drm_output_state *state) + } } - if (drmModePageFlip(backend->drm.fd, output->crtc_id, -- output->fb_pending->fb_id, +- scanout_state->fb->fb_id, - DRM_MODE_PAGE_FLIP_EVENT, output) < 0) { + if (backend->use_egldevice) + ret = gl_renderer->output_stream_flip(&output->base, output); + else + ret = drmModePageFlip(backend->drm.fd, output->crtc_id, -+ output->fb_pending->fb_id, ++ scanout_state->fb->fb_id, + DRM_MODE_PAGE_FLIP_EVENT, output); + + if (ret < 0) { weston_log("queueing pageflip failed: %m\n"); - goto err_pageflip; + goto err; } -@@ -985,7 +998,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; -@@ -1047,13 +1059,17 @@ drm_output_start_repaint_loop(struct weston_output *output_base) - /* Immediate query succeeded, but didn't provide valid timestamp. - * Use pageflip fallback. - */ -- fb_id = output->fb_current->fb_id; -- - assert(!output->page_flip_pending); - assert(!output->fb_last); - -- if (drmModePageFlip(backend->drm.fd, output->crtc_id, fb_id, -- DRM_MODE_PAGE_FLIP_EVENT, output) < 0) { -+ if (backend->use_egldevice) -+ ret = gl_renderer->output_stream_flip(&output->base, output); -+ else -+ ret = drmModePageFlip(backend->drm.fd, output->crtc_id, -+ output->fb_current->fb_id, -+ DRM_MODE_PAGE_FLIP_EVENT, output); -+ -+ if (ret < 0) { - weston_log("queueing pageflip failed: %m\n"); - goto finish_frame; - } -@@ -1761,11 +1777,6 @@ create_gbm_device(int fd) +@@ -3329,7 +3344,8 @@ init_kms_caps(struct drm_backend *b) + b->universal_planes ? "supports" : "does not support"); + + #ifdef HAVE_DRM_ATOMIC +- if (b->universal_planes && !getenv("WESTON_DISABLE_ATOMIC")) { ++ /* FIXME: Atomic modeset is not yet fully supported with streams */ ++ if (b->universal_planes && !getenv("WESTON_DISABLE_ATOMIC") && !b->use_egldevice) { + ret = drmGetCap(b->drm.fd, DRM_CAP_CRTC_IN_VBLANK_EVENT, &cap); + if (ret != 0) + cap = 0; +@@ -3348,11 +3364,6 @@ create_gbm_device(int fd) { struct gbm_device *gbm; @@ -170,7 +161,7 @@ index 7120b578..1eed58a7 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 -@@ -1778,6 +1789,40 @@ create_gbm_device(int fd) +@@ -3365,6 +3376,40 @@ create_gbm_device(int fd) return gbm; } @@ -211,7 +202,7 @@ index 7120b578..1eed58a7 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. * -@@ -1804,38 +1849,62 @@ fallback_format_for(uint32_t format) +@@ -3391,38 +3436,62 @@ fallback_format_for(uint32_t format) static int drm_backend_create_gl_renderer(struct drm_backend *b) { @@ -295,7 +286,7 @@ index 7120b578..1eed58a7 100644 return -1; } -@@ -2122,37 +2191,67 @@ err: +@@ -4052,37 +4121,67 @@ err: static int drm_output_init_egl(struct drm_output *output, struct drm_backend *b) { @@ -370,8 +361,7 @@ index 7120b578..1eed58a7 100644 + weston_log("failed to create gbm surface\n"); + return -1; + } - -- drm_output_init_cursor_egl(output, b); ++ + if (format[1]) + n_formats = 2; + if (gl_renderer->output_window_create( @@ -386,15 +376,16 @@ index 7120b578..1eed58a7 100644 + gbm_surface_destroy(output->gbm_surface); + return -1; + } -+ + +- drm_output_init_cursor_egl(output, b); + drm_output_init_cursor_egl(output, b); + } return 0; } -@@ -2161,7 +2260,15 @@ static void - drm_output_fini_egl(struct drm_output *output) - { +@@ -4104,7 +4203,15 @@ drm_output_fini_egl(struct drm_output *output) + } + gl_renderer->output_destroy(&output->base); - gbm_surface_destroy(output->gbm_surface); + @@ -409,7 +400,7 @@ index 7120b578..1eed58a7 100644 drm_output_fini_cursor_egl(output); } -@@ -3438,6 +3545,11 @@ recorder_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, +@@ -5544,6 +5651,11 @@ recorder_binding(struct weston_keyboard *keyboard, const struct timespec *time, struct drm_output *output; int width, height; @@ -421,7 +412,7 @@ index 7120b578..1eed58a7 100644 output = container_of(b->compositor->output_list.next, struct drm_output, base.link); -@@ -3493,11 +3605,20 @@ switch_to_gl_renderer(struct drm_backend *b) +@@ -5599,11 +5711,20 @@ switch_to_gl_renderer(struct drm_backend *b) weston_log("Switching to GL renderer\n"); @@ -447,7 +438,7 @@ index 7120b578..1eed58a7 100644 } wl_list_for_each(output, &b->compositor->output_list, base.link) -@@ -3506,7 +3627,8 @@ switch_to_gl_renderer(struct drm_backend *b) +@@ -5612,7 +5733,8 @@ switch_to_gl_renderer(struct drm_backend *b) b->compositor->renderer->destroy(b->compositor); if (drm_backend_create_gl_renderer(b) < 0) { @@ -457,19 +448,19 @@ index 7120b578..1eed58a7 100644 weston_log("Failed to create GL renderer. Quitting.\n"); /* FIXME: we need a function to shutdown cleanly */ assert(0); -@@ -3572,6 +3694,7 @@ drm_backend_create(struct weston_compositor *compositor, +@@ -5681,6 +5803,7 @@ drm_backend_create(struct weston_compositor *compositor, b->compositor = compositor; b->use_pixman = config->use_pixman; b->pageflip_timeout = config->pageflip_timeout; + b->use_egldevice = config->use_egldevice; - if (parse_gbm_format(config->gbm_format, GBM_FORMAT_XRGB8888, &b->gbm_format) < 0) - goto err_compositor; + compositor->backend = &b->base; + diff --git a/libweston/compositor-drm.h b/libweston/compositor-drm.h -index 08707197..bb4ce8cb 100644 +index 68f93eab..01946a5b 100644 --- a/libweston/compositor-drm.h +++ b/libweston/compositor-drm.h -@@ -110,6 +110,10 @@ struct weston_drm_backend_config { +@@ -104,6 +104,10 @@ struct weston_drm_backend_config { /** Whether to use the pixman renderer instead of the OpenGL ES renderer. */ bool use_pixman; @@ -493,10 +484,10 @@ index 39ea3b42..37252492 100644 #endif /* ENABLE_EGL */ diff --git a/shared/weston-egl-ext.h b/shared/weston-egl-ext.h -index 31096e64..778eae07 100644 +index 96982e2d..e4e10ef9 100644 --- a/shared/weston-egl-ext.h +++ b/shared/weston-egl-ext.h -@@ -180,6 +180,10 @@ typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLD +@@ -208,6 +208,10 @@ typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, #define EGL_PLATFORM_DEVICE_EXT 0x313F #endif @@ -507,7 +498,7 @@ index 31096e64..778eae07 100644 /* * FIXME: Remove both EGL_EXT_stream_acquire_mode and * EGL_NV_output_drm_flip_event definitions below once both extensions -@@ -228,6 +232,11 @@ EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireAttribEXT (EGLDisplay dpy, +@@ -256,6 +260,11 @@ EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireAttribEXT (EGLDisplay dpy, #define EGL_PLATFORM_X11_KHR 0x31D5 #define EGL_PLATFORM_DEVICE_EXT 0x313F @@ -520,5 +511,5 @@ index 31096e64..778eae07 100644 #endif -- -2.13.3 +2.15.1 diff --git a/0007-simple-egl-Do-not-set-EGL-up-until-XDG-setup-is-comp.patch b/0006-simple-egl-Do-not-set-EGL-up-until-XDG-setup-is-comp.patch index 9ac968f5b5ed..437e7a5a1b31 100644 --- a/0007-simple-egl-Do-not-set-EGL-up-until-XDG-setup-is-comp.patch +++ b/0006-simple-egl-Do-not-set-EGL-up-until-XDG-setup-is-comp.patch @@ -1,7 +1,7 @@ -From ce015e27839809ed4d602dd8d977f2df770b0921 Mon Sep 17 00:00:00 2001 +From 6e414ed71b82b92fc21dd2bd05dc66fd1d05de97 Mon Sep 17 00:00:00 2001 From: "Miguel A. Vico" <mvicomoya@nvidia.com> Date: Mon, 27 Feb 2017 15:31:35 -0800 -Subject: [PATCH 7/9] simple-egl: Do not set EGL up until XDG setup is complete +Subject: [PATCH 6/8] simple-egl: Do not set EGL up until XDG setup is complete X-NVConfidentiality: public There is nothing that prohibits the underlying EGL_PLATFORM_WAYLAND @@ -22,7 +22,7 @@ Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/clients/simple-egl.c b/clients/simple-egl.c -index dad0f09b..5398a315 100644 +index a1e57aef..0ca66415 100644 --- a/clients/simple-egl.c +++ b/clients/simple-egl.c @@ -221,11 +221,32 @@ init_egl(struct display *display, struct window *window) @@ -59,7 +59,7 @@ index dad0f09b..5398a315 100644 eglTerminate(display->egl.dpy); eglReleaseThread(); } -@@ -360,7 +381,8 @@ handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface, +@@ -364,7 +385,8 @@ handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface, { struct window *window = data; @@ -69,7 +69,7 @@ index dad0f09b..5398a315 100644 window->geometry.width = width; window->geometry.height = height; -@@ -413,7 +435,6 @@ static void +@@ -417,7 +439,6 @@ static void create_surface(struct window *window) { struct display *display = window->display; @@ -77,7 +77,7 @@ index dad0f09b..5398a315 100644 window->surface = wl_compositor_create_surface(display->compositor); -@@ -421,10 +442,6 @@ create_surface(struct window *window) +@@ -425,10 +446,6 @@ create_surface(struct window *window) wl_egl_window_create(window->surface, window->geometry.width, window->geometry.height); @@ -88,7 +88,7 @@ index dad0f09b..5398a315 100644 if (display->shell) { -@@ -435,13 +452,6 @@ create_surface(struct window *window) +@@ -439,13 +456,6 @@ create_surface(struct window *window) assert(0); } @@ -102,7 +102,7 @@ index dad0f09b..5398a315 100644 if (!display->shell) return; -@@ -452,15 +462,6 @@ create_surface(struct window *window) +@@ -456,15 +466,6 @@ create_surface(struct window *window) static void destroy_surface(struct window *window) { @@ -118,7 +118,7 @@ index dad0f09b..5398a315 100644 if (window->xdg_toplevel) zxdg_toplevel_v6_destroy(window->xdg_toplevel); if (window->xdg_surface) -@@ -902,9 +903,7 @@ main(int argc, char **argv) +@@ -906,9 +907,7 @@ main(int argc, char **argv) wl_display_roundtrip(display.display); @@ -128,7 +128,7 @@ index dad0f09b..5398a315 100644 display.cursor_surface = wl_compositor_create_surface(display.compositor); -@@ -914,23 +913,27 @@ main(int argc, char **argv) +@@ -918,23 +917,27 @@ main(int argc, char **argv) sigint.sa_flags = SA_RESETHAND; sigaction(SIGINT, &sigint, NULL); @@ -164,5 +164,5 @@ index dad0f09b..5398a315 100644 wl_surface_destroy(display.cursor_surface); if (display.cursor_theme) -- -2.13.3 +2.15.1 diff --git a/0008-compositor-Process-stream-attach-requests-with-wl_eg.patch b/0007-compositor-Process-stream-attach-requests-with-wl_eg.patch index c322de760806..0536ecf0ca7f 100644 --- a/0008-compositor-Process-stream-attach-requests-with-wl_eg.patch +++ b/0007-compositor-Process-stream-attach-requests-with-wl_eg.patch @@ -1,7 +1,7 @@ -From a044287897d3646440644555f7ac1d756e39e0d2 Mon Sep 17 00:00:00 2001 +From 81512adf8d6f1ced68ea55513a8428f323d1185f Mon Sep 17 00:00:00 2001 From: "Miguel A. Vico" <mvicomoya@nvidia.com> Date: Thu, 18 May 2017 14:35:36 -0700 -Subject: [PATCH 8/9] compositor: Process stream attach requests with +Subject: [PATCH 7/8] compositor: Process stream attach requests with wl_eglstream_controller X-NVConfidentiality: public @@ -31,20 +31,19 @@ requests. Signed-off-by: Ashutosh Agarwal <asagarwal@nvidia.com> Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> --- - Makefile.am | 5 ++ - Makefile.in | 4 ++++ + Makefile.am | 5 + libweston/compositor.c | 78 ++++++++++++++++ libweston/compositor.h | 4 + - libweston/gl-renderer.c | 145 +++++++++++++++++++----------- + libweston/gl-renderer.c | 147 +++++++++++++++++++----------- protocol/wayland-eglstream-controller.xml | 37 ++++++++ - 6 files changed, 219 insertions(+), 54 deletions(-) + 5 files changed, 217 insertions(+), 54 deletions(-) create mode 100644 protocol/wayland-eglstream-controller.xml diff --git a/Makefile.am b/Makefile.am -index e9679e68..59a8ffbc 100644 +index 69ca6cba..fbfbe8d0 100644 --- a/Makefile.am +++ b/Makefile.am -@@ -185,6 +185,11 @@ nodist_libweston_@LIBWESTON_MAJOR@_la_SOURCES = \ +@@ -172,6 +172,11 @@ nodist_libweston_@LIBWESTON_MAJOR@_la_SOURCES = \ BUILT_SOURCES += $(nodist_libweston_@LIBWESTON_MAJOR@_la_SOURCES) @@ -56,30 +55,8 @@ index e9679e68..59a8ffbc 100644 bin_PROGRAMS += weston weston_LDFLAGS = -export-dynamic -diff --git a/Makefile.in b/Makefile.in -index e24003b3..c8c3df10 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -2135,6 +2135,7 @@ noinst_LTLIBRARIES = libsession-helper.la $(am__append_33) \ - BUILT_SOURCES = \ - $(nodist_libweston_desktop_@LIBWESTON_MAJOR@_la_SOURCES) \ - $(nodist_libweston_@LIBWESTON_MAJOR@_la_SOURCES) \ -+ $(nodist_libweston_eglstreams_@LIBWESTON_MAJOR@_la_SOURCES) \ - $(am__append_30) $(am__append_32) $(am__append_34) \ - protocol/weston-screenshooter-protocol.c \ - protocol/weston-screenshooter-client-protocol.h \ -@@ -2302,6 +2303,9 @@ nodist_libweston_@LIBWESTON_MAJOR@_la_SOURCES = \ - protocol/pointer-constraints-unstable-v1-protocol.c \ - protocol/pointer-constraints-unstable-v1-server-protocol.h - -+nodist_libweston_eglstreams_@LIBWESTON_MAJOR@_la_SOURCES = \ -+ protocol/wayland-eglstream-controller-server-protocol.h -+ - weston_LDFLAGS = -export-dynamic - weston_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON \ - -DMODULEDIR='"$(moduledir)"' \ diff --git a/libweston/compositor.c b/libweston/compositor.c -index 813b6634..bb0cee70 100644 +index 4816f33e..8c144117 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -2,6 +2,7 @@ @@ -98,7 +75,7 @@ index 813b6634..bb0cee70 100644 #define DEFAULT_REPAINT_WINDOW 7 /* milliseconds */ -@@ -5170,6 +5172,80 @@ bind_presentation(struct wl_client *client, +@@ -5243,6 +5245,80 @@ bind_presentation(struct wl_client *client, wp_presentation_send_clock_id(resource, compositor->presentation_clock); } @@ -179,7 +156,7 @@ index 813b6634..bb0cee70 100644 static void compositor_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id) -@@ -5281,6 +5357,8 @@ weston_compositor_create(struct wl_display *display, void *user_data) +@@ -5355,6 +5431,8 @@ weston_compositor_create(struct wl_display *display, void *user_data) ec, bind_presentation)) goto fail; @@ -189,11 +166,11 @@ index 813b6634..bb0cee70 100644 goto fail; diff --git a/libweston/compositor.h b/libweston/compositor.h -index 769203a1..dbd95035 100644 +index 010f1fa8..d43625bc 100644 --- a/libweston/compositor.h +++ b/libweston/compositor.h -@@ -754,6 +754,10 @@ struct weston_renderer { - bool (*query_dmabuf_modifiers)(struct weston_compositor *ec, +@@ -769,6 +769,10 @@ struct weston_renderer { + void (*query_dmabuf_modifiers)(struct weston_compositor *ec, int format, uint64_t **modifiers, int *num_modifiers); + @@ -204,7 +181,7 @@ index 769203a1..dbd95035 100644 enum weston_capability { diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c -index a9ed723f..19f96ae4 100644 +index 39e33350..c89c7965 100644 --- a/libweston/gl-renderer.c +++ b/libweston/gl-renderer.c @@ -1,7 +1,7 @@ @@ -216,7 +193,7 @@ index a9ed723f..19f96ae4 100644 * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the -@@ -2165,18 +2165,9 @@ gl_renderer_attach_dmabuf(struct weston_surface *surface, +@@ -2371,18 +2371,9 @@ gl_renderer_attach_dmabuf(struct weston_surface *surface, gs->y_inverted = buffer->y_inverted; } @@ -238,7 +215,7 @@ index a9ed723f..19f96ae4 100644 { #ifdef EGL_NV_stream_attrib struct weston_compositor *ec = es->compositor; -@@ -2185,65 +2176,109 @@ gl_renderer_attach_stream_texture(struct weston_surface *es, +@@ -2391,65 +2382,111 @@ gl_renderer_attach_stream_texture(struct weston_surface *es, EGLStreamKHR stream = EGL_NO_STREAM_KHR; EGLAttrib stream_attribs[] = { #ifdef EGL_WL_wayland_eglstream @@ -312,6 +289,8 @@ index a9ed723f..19f96ae4 100644 - if (gs->egl_stream != EGL_NO_STREAM_KHR) - gr->destroy_stream(gr->egl_display, gs->egl_stream); + return EGL_SUCCESS; ++#else ++ return EGL_BAD_ACCESS; +#endif +} @@ -389,7 +368,7 @@ index a9ed723f..19f96ae4 100644 } /* At this point we should have a valid stream handle */ -@@ -3601,6 +3636,8 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, +@@ -3831,6 +3868,8 @@ gl_renderer_display_create(struct weston_compositor *ec, EGLenum platform, gr->base.surface_get_content_size = gl_renderer_surface_get_content_size; gr->base.surface_copy_content = gl_renderer_surface_copy_content; @@ -442,5 +421,5 @@ index 00000000..dea072e6 + </interface> +</protocol> -- -2.13.3 +2.15.1 diff --git a/0009-Add-nvidia-release-notes-file.patch b/0008-Add-nvidia-release-notes-file.patch index e6994c3f98e7..39153b07d793 100644 --- a/0009-Add-nvidia-release-notes-file.patch +++ b/0008-Add-nvidia-release-notes-file.patch @@ -1,7 +1,7 @@ -From 394829957069c7ac67c847dbccc38b8089bc788e Mon Sep 17 00:00:00 2001 +From c87642ad69fb5ce256430b85fd3a0b00bd0355d3 Mon Sep 17 00:00:00 2001 From: "Miguel A. Vico" <mvicomoya@nvidia.com> Date: Wed, 9 Aug 2017 16:01:34 -0700 -Subject: [PATCH 9/9] Add nvidia-release-notes file +Subject: [PATCH 8/8] Add nvidia-release-notes file X-NVConfidentiality: public Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> @@ -12,30 +12,30 @@ Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> diff --git a/nvidia-release-notes b/nvidia-release-notes new file mode 100644 -index 00000000..0894c8ff +index 00000000..5da24838 --- /dev/null +++ b/nvidia-release-notes @@ -0,0 +1,27 @@ -+NVIDIA EGLStream-based Weston version 3.0 ++NVIDIA EGLStream-based Weston version 4.0 +----------------------------------------- + +This branch includes NVIDIA EGLStream patches on top of -+Weston 3.0. ++Weston 4.0. + +* Known issues: + + - Bad interactions with XDG Shell v6 preventing + clients that implement the new interface from + starting -+ ++ + Fixed if using wl_eglstream_controller from commit: -+ ++ + a044287897d3646440644555f7ac1d756e39e0d2 compositor: Process stream attach requests with wl_eglstream_controller -+ ++ + (Needs libnvidia-egl-wayland.so >= 1.0.2 - https://github.com/NVIDIA/egl-wayland) -+ ++ + Fixed in 'weston-simple-egl' with commit: -+ ++ + ce015e27839809ed4d602dd8d977f2df770b0921 simple-egl: Do not set EGL up until XDG setup is complete + + @@ -44,5 +44,5 @@ index 00000000..0894c8ff + Miguel A. Vico (mvicomoya AT nvidia.com) + -- -2.13.3 +2.15.1 @@ -4,8 +4,8 @@ # Contributor: Joel Teichroeb <joel@teichroeb.net> pkgname=weston-eglstream -pkgver=3.0.0 -pkgrel=2 +pkgver=4.0.0 +pkgrel=1 pkgdesc='Reference implementation of a Wayland compositor with EGLStream support' arch=('i686' 'x86_64') url='https://wayland.freedesktop.org/' @@ -18,38 +18,34 @@ makedepends=('wayland-protocols') provides=('weston') conflicts=('weston') source=("https://wayland.freedesktop.org/releases/weston-$pkgver.tar.xz" - '0001-compositor-drm-Release-current-next-fb-when-deactiva.patch' - '0002-gl-renderer-Add-EGLDevice-enumeration-support.patch' - '0003-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch' - '0004-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch' - '0005-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch' - '0006-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch' - '0007-simple-egl-Do-not-set-EGL-up-until-XDG-setup-is-comp.patch' - '0008-compositor-Process-stream-attach-requests-with-wl_eg.patch' - '0009-Add-nvidia-release-notes-file.patch') -sha256sums=('cde1d55e8dd70c3cbb3d1ec72f60e60000041579caa1d6a262bd9c35e93723a5' - 'c643d5b305ce91150eb0615836dcee494cc28cd12d7cb60e835b69ee5f8c452a' - '689f619cb8691416f67fd052b217658dfe3dd2bdf3cb4ede532c8240546f998d' - '058ab62996f7d000c144963148fa2e39a9c99bc4e0cac3e56926426fc100dac0' - '9f96e3a94a02cc7fb91d0c8660a8bf6497c8375ce88c0115a2ee8b6c558bcab4' - '04cab2302462d3680152743289e39766b5e38be7acc5b91a1b5cadec6f98d714' - '93e77066b08e213af1173ef5438b5bdc62cc7e638a43d813fe5b73b437c71250' - '6786b4c9e77dfc60db04f05a0b613a71b968d1d12d38c534a240f63a34059757' - 'ac8c20a932d7e70f4a93a0121cd476be84bf0498a91e927ffe79de66c03382b6' - 'c37571d1bea9114a31f360a75a449f10bec067f32aaddd0337e1b95076295f1e') - + '0001-gl-renderer-Add-EGLDevice-enumeration-support.patch' + '0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch' + '0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch' + '0004-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch' + '0005-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch' + '0006-simple-egl-Do-not-set-EGL-up-until-XDG-setup-is-comp.patch' + '0007-compositor-Process-stream-attach-requests-with-wl_eg.patch' + '0008-Add-nvidia-release-notes-file.patch') +sha256sums=('a0fc0ae7ef83dfbed12abfe9b8096a24a7dd00705e86fa0db1e619ded18b4b58' + '41cb791c07e377ce16ccb7ba6a6a84a49e5351c3ed815a98076069fb1386ecec' + '0bd297017262bf278e20c05e5d0a46208c77f5462d80db1906286764de867720' + 'a6a05d101701ff97bee1d5d3974fbbc12abb34c4b483568cc3c3552e328c3b55' + 'd8f04aef2b38628b38dae92c73f16aab36b74ca83a44d144123439cb68c273a6' + 'dda90181e2f91c03da8d180d7fbae42d61e2a31122301a2fc08f020b1da19a84' + 'f893280becdb18583d234d1a26814aa092356402fc8731a1b2da8ef8d6963a6e' + '5e56cf8d136a241cb05abcad39537287a97777c1697746697631c10f9ab551f1' + '919923d3a545d1e8420d128cd63d7e60095887ec603d417e23df6d7138ba42da') prepare() { cd weston-$pkgver - patch -Np1 -i "${srcdir}/0001-compositor-drm-Release-current-next-fb-when-deactiva.patch" - patch -Np1 -i "${srcdir}/0002-gl-renderer-Add-EGLDevice-enumeration-support.patch" - patch -Np1 -i "${srcdir}/0003-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch" - patch -Np1 -i "${srcdir}/0004-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch" - patch -Np1 -i "${srcdir}/0005-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch" - patch -Np1 -i "${srcdir}/0006-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch" - patch -Np1 -i "${srcdir}/0007-simple-egl-Do-not-set-EGL-up-until-XDG-setup-is-comp.patch" - patch -Np1 -i "${srcdir}/0008-compositor-Process-stream-attach-requests-with-wl_eg.patch" - patch -Np1 -i "${srcdir}/0009-Add-nvidia-release-notes-file.patch" + patch -Np1 -i "${srcdir}/0001-gl-renderer-Add-EGLDevice-enumeration-support.patch" + patch -Np1 -i "${srcdir}/0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch" + patch -Np1 -i "${srcdir}/0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch" + patch -Np1 -i "${srcdir}/0004-compositor-drm-Gracefully-handle-vblank-and-flip-inv.patch" + patch -Np1 -i "${srcdir}/0005-compositor-drm-Add-support-for-EGLDevice-EGLOutput.patch" + patch -Np1 -i "${srcdir}/0006-simple-egl-Do-not-set-EGL-up-until-XDG-setup-is-comp.patch" + patch -Np1 -i "${srcdir}/0007-compositor-Process-stream-attach-requests-with-wl_eg.patch" + patch -Np1 -i "${srcdir}/0008-Add-nvidia-release-notes-file.patch" } build() { |