diff options
author | Miguel A. Vico | 2019-09-27 08:46:54 -0700 |
---|---|---|
committer | Miguel A. Vico | 2019-09-27 08:46:54 -0700 |
commit | f821989f042dbf89593a8344624fe0672fbbddb8 (patch) | |
tree | 62fce0e5c4ecb722adece49dcafb25562acb5661 | |
parent | e734459dd41c81d42ee01a6ce2272107c605bba4 (diff) | |
download | aur-f821989f042dbf89593a8344624fe0672fbbddb8.tar.gz |
Add patches to fix display hotplugging
10 files changed, 136 insertions, 21 deletions
@@ -1,7 +1,7 @@ pkgbase = weston-eglstream pkgdesc = Reference implementation of a Wayland compositor with EGLStream support pkgver = 7.0.0 - pkgrel = 1 + pkgrel = 2 url = https://wayland.freedesktop.org/ arch = x86_64 license = MIT @@ -29,13 +29,17 @@ pkgbase = weston-eglstream source = 0004-backend-drm-Gracefully-handle-vblank-and-flip-invali.patch source = 0005-backend-drm-Add-support-for-EGLDevice-EGLOutput.patch source = 0006-compositor-Process-stream-attach-requests-with-wl_eg.patch + source = 0007-desktop-shell-Avoid-NULL-output-dereference-when-get.patch + source = 0008-compositor-Do-not-trigger-invalid-destructors-when-h.patch sha256sums = a00a6d207b6a45f95f4401c604772a307c3767e5e2beecf3d879110c43909a64 - sha256sums = 6e22c17327701c1252d57219718bc7dc818161e9d5a3835af30b28ac1dd36a54 - sha256sums = 1ae44092510c16149bc2717a7847925e73a838ebcee321413bfed9fc5bf1573d - sha256sums = 6caacbd301301ae7f4bff61d406531ba094199ecb865edeffe610f7d8e32d6bd - sha256sums = f1fd377069025fc7ee904a917bfb5c280c125f2507cf96f755004eb0311176a8 - sha256sums = 3f310a2a6d0529761ed75b269f3f312b8d16679f3ddac41ba06283d37b3199aa - sha256sums = 2d06853eca2d5533213ee46cda60cd3bfebdddbee61ef922af873764b11566a9 + sha256sums = 052d1256d069b5ca23865cd12ba5122e79475780b6fb09bdaa1301a621b32c1f + sha256sums = cf2fda06ab6f3a545f9302b4ced8435df2f03378f4b3f2e25f7c85222c54d38f + sha256sums = 5bd7f6a11341efcffc596ad6808d2dc3c5b5e10e6cdecd3bfdc27eb23fe7ba0f + sha256sums = 46d2975fa6c6397206c9b170639aa79a96b3bddde8957dbe234d2a8206f773aa + sha256sums = 085c23f406366b236b6aa7f1d1158b65fead3adbd907a7c44b8e9407b6f90b9d + sha256sums = c4db17e98afca6b099f5bbc6486430b768a1f71929c433ae403e68626f3e78d8 + sha256sums = 2b7025295ae077cf91d22dc32c255f15e36feb9a61bf686adaf4c6be87750469 + sha256sums = 3c12268e4bae6dfa264411c2a72be4ca7aca4055fe3956136b5a31dbca3e4136 pkgname = weston-eglstream diff --git a/0001-gl-renderer-Add-EGLDevice-enumeration-support.patch b/0001-gl-renderer-Add-EGLDevice-enumeration-support.patch index 5f6a4b9bb88a..e3b830e4be6d 100644 --- a/0001-gl-renderer-Add-EGLDevice-enumeration-support.patch +++ b/0001-gl-renderer-Add-EGLDevice-enumeration-support.patch @@ -1,7 +1,7 @@ From 78f72e9eb8e42b2791099c519cf8c47e89c4143f 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 1/6] 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. diff --git a/0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch b/0002-gl-renderer-Add-support-for-EGLDevice-composited-fra.patch index 54c1434006a8..6e5d2734e8a1 100644 --- a/0002-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 418000cc187e0ae6c9ab076f0e743cae669e053d 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 2/6] gl-renderer: Add support for EGLDevice composited frame +Subject: [PATCH 2/8] gl-renderer: Add support for EGLDevice composited frame presentation X-NVConfidentiality: public diff --git a/0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch b/0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch index 3b385346c138..6ce956b25d73 100644 --- a/0003-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 ef918a27b0134d44d680c2cd034a1b50a87edc3e Mon Sep 17 00:00:00 2001 From: "Miguel A. Vico" <mvicomoya@nvidia.com> Date: Thu, 29 Mar 2018 00:15:49 -0700 -Subject: [PATCH 3/6] gl-renderer: Add EGL client support for EGLStream frame +Subject: [PATCH 3/8] gl-renderer: Add EGL client support for EGLStream frame presentation X-NVConfidentiality: public diff --git a/0004-backend-drm-Gracefully-handle-vblank-and-flip-invali.patch b/0004-backend-drm-Gracefully-handle-vblank-and-flip-invali.patch index 55d848698507..118f9498d4f3 100644 --- a/0004-backend-drm-Gracefully-handle-vblank-and-flip-invali.patch +++ b/0004-backend-drm-Gracefully-handle-vblank-and-flip-invali.patch @@ -1,7 +1,7 @@ From f664250b469b329189aef308ce9a65e06a851242 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 4/6] backend-drm: Gracefully handle vblank and flip invalid +Subject: [PATCH 4/8] backend-drm: Gracefully handle vblank and flip invalid timestamps X-NVConfidentiality: public diff --git a/0005-backend-drm-Add-support-for-EGLDevice-EGLOutput.patch b/0005-backend-drm-Add-support-for-EGLDevice-EGLOutput.patch index a99037445ac5..3e09d739c4df 100644 --- a/0005-backend-drm-Add-support-for-EGLDevice-EGLOutput.patch +++ b/0005-backend-drm-Add-support-for-EGLDevice-EGLOutput.patch @@ -1,7 +1,7 @@ From 3a9b0e9def60f81b6f550df29a0dbe26fc07aa05 Mon Sep 17 00:00:00 2001 From: "Miguel A. Vico" <mvicomoya@nvidia.com> Date: Mon, 26 Aug 2019 09:48:49 -0700 -Subject: [PATCH 5/6] backend-drm: Add support for EGLDevice+EGLOutput +Subject: [PATCH 5/8] backend-drm: Add support for EGLDevice+EGLOutput X-NVConfidentiality: public As previously stated, EGLDevice and EGLOutput will provide means diff --git a/0006-compositor-Process-stream-attach-requests-with-wl_eg.patch b/0006-compositor-Process-stream-attach-requests-with-wl_eg.patch index 8cc01634ee1f..c453f46e84cc 100644 --- a/0006-compositor-Process-stream-attach-requests-with-wl_eg.patch +++ b/0006-compositor-Process-stream-attach-requests-with-wl_eg.patch @@ -1,7 +1,7 @@ From 7b4d70dc7f5024e80656d9facdb0bc834d91adb9 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 6/6] compositor: Process stream attach requests with +Subject: [PATCH 6/8] compositor: Process stream attach requests with wl_eglstream_controller X-NVConfidentiality: public diff --git a/0007-desktop-shell-Avoid-NULL-output-dereference-when-get.patch b/0007-desktop-shell-Avoid-NULL-output-dereference-when-get.patch new file mode 100644 index 000000000000..c913b0f9d9d3 --- /dev/null +++ b/0007-desktop-shell-Avoid-NULL-output-dereference-when-get.patch @@ -0,0 +1,52 @@ +From f98d9cf40a5dc11a7f87bc674bb6e3333c2321d1 Mon Sep 17 00:00:00 2001 +From: "Miguel A. Vico" <mvicomoya@nvidia.com> +Date: Wed, 25 Sep 2019 11:23:13 -0700 +Subject: [PATCH 7/8] desktop-shell: Avoid NULL output dereference when getting + surface label +X-NVConfidentiality: public + +When hotunplugging a display, the compositor will tear down the +corresponding output object. + +Avoid NULL output dereferences by all surface label getters in +desktop-shell when hotunplugging happens. + +Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> +--- + desktop-shell/shell.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c +index f94a4ca2..00ee1079 100644 +--- a/desktop-shell/shell.c ++++ b/desktop-shell/shell.c +@@ -521,7 +521,7 @@ static int + focus_surface_get_label(struct weston_surface *surface, char *buf, size_t len) + { + return snprintf(buf, len, "focus highlight effect for output %s", +- surface->output->name); ++ (surface->output ? surface->output->name : "NULL")); + } + + /* no-op func for checking focus surface */ +@@ -2985,7 +2985,7 @@ static int + background_get_label(struct weston_surface *surface, char *buf, size_t len) + { + return snprintf(buf, len, "background for output %s", +- surface->output->name); ++ (surface->output ? surface->output->name : "NULL")); + } + + static void +@@ -3065,7 +3065,7 @@ static int + panel_get_label(struct weston_surface *surface, char *buf, size_t len) + { + return snprintf(buf, len, "panel for output %s", +- surface->output->name); ++ (surface->output ? surface->output->name : "NULL")); + } + + static void +-- +2.21.0 + diff --git a/0008-compositor-Do-not-trigger-invalid-destructors-when-h.patch b/0008-compositor-Do-not-trigger-invalid-destructors-when-h.patch new file mode 100644 index 000000000000..424dab6971b7 --- /dev/null +++ b/0008-compositor-Do-not-trigger-invalid-destructors-when-h.patch @@ -0,0 +1,53 @@ +From 760828c01641d6900e2a63125a558df3b54b01b4 Mon Sep 17 00:00:00 2001 +From: "Miguel A. Vico" <mvicomoya@nvidia.com> +Date: Wed, 25 Sep 2019 11:28:13 -0700 +Subject: [PATCH 8/8] compositor: Do not trigger invalid destructors when + hotunplugging +X-NVConfidentiality: public + +When hotunplugging a display, the compositor will tear the top-level +wet_output object down, freeing its memory. + +However, destruction of the backend output might be delayed in certain +situations (e.g. destroying DRM output while in the middle of a page +flip). + +When the backend output is finally destroyed, it will trigger a +destruction callback previously added by the compositor, which point to +data belonging to the top-level wet_output object. + +In order to avoid access to invalid data when the backend output is +destroyed after the top-level wet_output object, remove the destruction +callback from the corresponding list before freeing the object. + +Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com> +--- + compositor/main.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/compositor/main.c b/compositor/main.c +index bb6bd84b..2f253f40 100644 +--- a/compositor/main.c ++++ b/compositor/main.c +@@ -1860,8 +1860,16 @@ wet_output_from_weston_output(struct weston_output *base) + static void + wet_output_destroy(struct wet_output *output) + { +- if (output->output) +- weston_output_destroy(output->output); ++ if (output->output) { ++ /* output->output destruction may be deferred in some cases (see ++ * drm_output_destroy()), so we need to forcibly trigger the ++ * destruction callback now, or otherwise would later access ++ * data that we are about to free ++ */ ++ struct weston_output *save = output->output; ++ wet_output_handle_destroy(&output->output_destroy_listener, save); ++ weston_output_destroy(save); ++ } + + wl_list_remove(&output->link); + free(output); +-- +2.21.0 + @@ -7,7 +7,7 @@ pkgname=weston-eglstream pkgver=7.0.0 -pkgrel=1 +pkgrel=2 pkgdesc='Reference implementation of a Wayland compositor with EGLStream support' arch=('x86_64') url='https://wayland.freedesktop.org/' @@ -24,14 +24,18 @@ source=("https://wayland.freedesktop.org/releases/weston-$pkgver.tar.xz" '0003-gl-renderer-Add-EGL-client-support-for-EGLStream-fra.patch' '0004-backend-drm-Gracefully-handle-vblank-and-flip-invali.patch' '0005-backend-drm-Add-support-for-EGLDevice-EGLOutput.patch' - '0006-compositor-Process-stream-attach-requests-with-wl_eg.patch') + '0006-compositor-Process-stream-attach-requests-with-wl_eg.patch' + '0007-desktop-shell-Avoid-NULL-output-dereference-when-get.patch' + '0008-compositor-Do-not-trigger-invalid-destructors-when-h.patch') sha256sums=('a00a6d207b6a45f95f4401c604772a307c3767e5e2beecf3d879110c43909a64' - '6e22c17327701c1252d57219718bc7dc818161e9d5a3835af30b28ac1dd36a54' - '1ae44092510c16149bc2717a7847925e73a838ebcee321413bfed9fc5bf1573d' - '6caacbd301301ae7f4bff61d406531ba094199ecb865edeffe610f7d8e32d6bd' - 'f1fd377069025fc7ee904a917bfb5c280c125f2507cf96f755004eb0311176a8' - '3f310a2a6d0529761ed75b269f3f312b8d16679f3ddac41ba06283d37b3199aa' - '2d06853eca2d5533213ee46cda60cd3bfebdddbee61ef922af873764b11566a9') + '052d1256d069b5ca23865cd12ba5122e79475780b6fb09bdaa1301a621b32c1f' + 'cf2fda06ab6f3a545f9302b4ced8435df2f03378f4b3f2e25f7c85222c54d38f' + '5bd7f6a11341efcffc596ad6808d2dc3c5b5e10e6cdecd3bfdc27eb23fe7ba0f' + '46d2975fa6c6397206c9b170639aa79a96b3bddde8957dbe234d2a8206f773aa' + '085c23f406366b236b6aa7f1d1158b65fead3adbd907a7c44b8e9407b6f90b9d' + 'c4db17e98afca6b099f5bbc6486430b768a1f71929c433ae403e68626f3e78d8' + '2b7025295ae077cf91d22dc32c255f15e36feb9a61bf686adaf4c6be87750469' + '3c12268e4bae6dfa264411c2a72be4ca7aca4055fe3956136b5a31dbca3e4136') prepare() { cd weston-$pkgver @@ -41,6 +45,8 @@ prepare() { patch -Np1 -i "${srcdir}/0004-backend-drm-Gracefully-handle-vblank-and-flip-invali.patch" patch -Np1 -i "${srcdir}/0005-backend-drm-Add-support-for-EGLDevice-EGLOutput.patch" patch -Np1 -i "${srcdir}/0006-compositor-Process-stream-attach-requests-with-wl_eg.patch" + patch -Np1 -i "${srcdir}/0007-desktop-shell-Avoid-NULL-output-dereference-when-get.patch" + patch -Np1 -i "${srcdir}/0008-compositor-Do-not-trigger-invalid-destructors-when-h.patch" } build() { |