From 0d742002e7db72c2ff9761b8edc3c0bbe741cdbf Mon Sep 17 00:00:00 2001 From: Ward Nakchbandi Date: Sat, 25 Feb 2023 14:21:52 +0300 Subject: [PATCH] whoops... sorry i was using outdated configs --- .github/workflows/release.yml | 40 +++ {xwayland-22.1.3/debian => debian}/changelog | 6 + {xwayland-22.1.3/debian => debian}/control | 0 {xwayland-22.1.3/debian => debian}/copyright | 0 {xwayland-22.1.3/debian => debian}/files | 0 .../debian => debian}/patches/series | 2 +- ...t-gbm_bo_get_fd_for_plane-at-runtime.patch | 0 .../xwayland_wp_tearing_control_v1.diff | 248 ++++++++++++++++++ {xwayland-22.1.3/debian => debian}/rules | 0 .../debian => debian}/source/format | 0 .../upstream/signing-key.asc | 0 {xwayland-22.1.3/debian => debian}/watch | 0 .../debian => debian}/xwayland.install | 1 + main.sh | 22 ++ release.sh | 14 + .../debian/patches/xwayland-vsync.diff | 13 - 16 files changed, 332 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/release.yml rename {xwayland-22.1.3/debian => debian}/changelog (92%) rename {xwayland-22.1.3/debian => debian}/control (100%) rename {xwayland-22.1.3/debian => debian}/copyright (100%) rename {xwayland-22.1.3/debian => debian}/files (100%) rename {xwayland-22.1.3/debian => debian}/patches/series (61%) rename {xwayland-22.1.3/debian => debian}/patches/xwayland-Detect-gbm_bo_get_fd_for_plane-at-runtime.patch (100%) create mode 100644 debian/patches/xwayland_wp_tearing_control_v1.diff rename {xwayland-22.1.3/debian => debian}/rules (100%) rename {xwayland-22.1.3/debian => debian}/source/format (100%) rename {xwayland-22.1.3/debian => debian}/upstream/signing-key.asc (100%) rename {xwayland-22.1.3/debian => debian}/watch (100%) rename {xwayland-22.1.3/debian => debian}/xwayland.install (61%) create mode 100755 main.sh create mode 100755 release.sh delete mode 100644 xwayland-22.1.3/debian/patches/xwayland-vsync.diff diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..46b480c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: PikaOS Package Release + +on: + workflow_dispatch + +jobs: + build: + runs-on: self-hosted + container: + image: ubuntu:22.10 + volumes: + - /proc:/proc + options: --privileged -it + + steps: + - uses: actions/checkout@v3 + + - name: Install needed packages + run: apt update && apt install software-properties-common sudo git bc gpg gpg-agent bison build-essential ccache cpio fakeroot flex git kmod libelf-dev libncurses5-dev libssl-dev lz4 qtbase5-dev rsync schedtool wget zstd tar reprepro dpkg-sig devscripts -y + + - name: Import GPG key + id: import_gpg + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.PASSPHRASE }} + + - name: Install SSH key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.SSH_KEY }} + name: id_rsa + known_hosts: ${{ secrets.KNOWN_HOSTS }} + if_key_exists: replace + + - name: Build Package + run: ./main.sh + + - name: Release Package + run: ./release.sh diff --git a/xwayland-22.1.3/debian/changelog b/debian/changelog similarity index 92% rename from xwayland-22.1.3/debian/changelog rename to debian/changelog index fc0ed5f..f590b60 100644 --- a/xwayland-22.1.3/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xwayland (2:23.0.99.901-99pika2) kinetic; urgency=medium + + * New upstream update + + -- Ward Nakchbandi Thu, 04 Oct 2022 17:50:00 +0300 + xwayland (2:22.1.3-99pika2) kinetic; urgency=medium * Add "Disable Locked FPS Patch" diff --git a/xwayland-22.1.3/debian/control b/debian/control similarity index 100% rename from xwayland-22.1.3/debian/control rename to debian/control diff --git a/xwayland-22.1.3/debian/copyright b/debian/copyright similarity index 100% rename from xwayland-22.1.3/debian/copyright rename to debian/copyright diff --git a/xwayland-22.1.3/debian/files b/debian/files similarity index 100% rename from xwayland-22.1.3/debian/files rename to debian/files diff --git a/xwayland-22.1.3/debian/patches/series b/debian/patches/series similarity index 61% rename from xwayland-22.1.3/debian/patches/series rename to debian/patches/series index 26b58bf..628e854 100644 --- a/xwayland-22.1.3/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,3 @@ xwayland-Detect-gbm_bo_get_fd_for_plane-at-runtime.patch -xwayland-vsync.diff +xwayland_wp_tearing_control_v1.diff diff --git a/xwayland-22.1.3/debian/patches/xwayland-Detect-gbm_bo_get_fd_for_plane-at-runtime.patch b/debian/patches/xwayland-Detect-gbm_bo_get_fd_for_plane-at-runtime.patch similarity index 100% rename from xwayland-22.1.3/debian/patches/xwayland-Detect-gbm_bo_get_fd_for_plane-at-runtime.patch rename to debian/patches/xwayland-Detect-gbm_bo_get_fd_for_plane-at-runtime.patch diff --git a/debian/patches/xwayland_wp_tearing_control_v1.diff b/debian/patches/xwayland_wp_tearing_control_v1.diff new file mode 100644 index 0000000..c8e6b8f --- /dev/null +++ b/debian/patches/xwayland_wp_tearing_control_v1.diff @@ -0,0 +1,248 @@ +diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml +index 22769a047b39f484ad21d77af5b3980442d3a2b0..221952ca5990bf34b2f1c0c2f152ec736360170b 100644 +--- a/.gitlab-ci.yml ++++ b/.gitlab-ci.yml +@@ -19,7 +19,7 @@ variables: + FDO_UPSTREAM_REPO: xorg/xserver + FDO_DISTRIBUTION_VERSION: bullseye-slim + FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/debian-install.sh' +- FDO_DISTRIBUTION_TAG: "2022-11-24-new-wayland-protocols" ++ FDO_DISTRIBUTION_TAG: "2022-12-25" + + include: + - project: 'freedesktop/ci-templates' +diff --git a/.gitlab-ci/debian-install.sh b/.gitlab-ci/debian-install.sh +index 5fca4c625ef98666120cf8b625acc00e4d14780c..a0622af5b3e3d65276ad81937b2caf3362acc330 100644 +--- a/.gitlab-ci/debian-install.sh ++++ b/.gitlab-ci/debian-install.sh +@@ -121,8 +121,8 @@ ninja -C _build -j${FDO_CI_CONCURRENT:-4} install + cd .. + rm -rf libxcvt + +-# xserver requires xorgproto >= 2022.2 for XWAYLAND +-git clone https://gitlab.freedesktop.org/xorg/proto/xorgproto.git --depth 1 --branch=xorgproto-2022.2 ++# xserver requires xorgproto >= 2022.3 for XWAYLAND ++git clone https://gitlab.freedesktop.org/Zamundaaa/xorgproto.git --depth 1 --branch=presentoptionimmediate + pushd xorgproto + ./autogen.sh + make -j${FDO_CI_CONCURRENT:-4} install +@@ -137,8 +137,8 @@ ninja -C _build -j${FDO_CI_CONCURRENT:-4} install + cd .. + rm -rf wayland + +-# Xwayland requires wayland-protocols >= 1.28, but Debian bullseye has 1.20 only +-git clone https://gitlab.freedesktop.org/wayland/wayland-protocols.git --depth 1 --branch=1.28 ++# Xwayland requires wayland-protocols >= 1.30, but Debian bullseye has 1.20 only ++git clone https://gitlab.freedesktop.org/wayland/wayland-protocols.git --depth 1 --branch=1.30 + cd wayland-protocols + meson _build + ninja -C _build -j${FDO_CI_CONCURRENT:-4} install +diff --git a/hw/xwayland/meson.build b/hw/xwayland/meson.build +index 6dddfd63e2b865ed1c51b2a9cf046d04b25b372a..0cf7b502a59519d45515d3ca0718c407aa112594 100644 +--- a/hw/xwayland/meson.build ++++ b/hw/xwayland/meson.build +@@ -48,6 +48,7 @@ xdg_shell_xml = join_paths(protodir, 'stable', 'xdg-shell', 'xdg-shell.xml') + drm_lease_xml = join_paths(protodir, 'staging', 'drm-lease', 'drm-lease-v1.xml') + shortcuts_inhibit_xml = join_paths(protodir, 'unstable', 'keyboard-shortcuts-inhibit', 'keyboard-shortcuts-inhibit-unstable-v1.xml') + xwayland_shell_xml = join_paths(protodir, 'staging', 'xwayland-shell', 'xwayland-shell-v1.xml') ++tearing_xml = join_paths(protodir, 'staging', 'tearing-control', 'tearing-control-v1.xml') + + client_header = generator(scanner, + output : '@BASENAME@-client-protocol.h', +@@ -76,6 +77,7 @@ srcs += client_header.process(xdg_shell_xml) + srcs += client_header.process(drm_lease_xml) + srcs += client_header.process(shortcuts_inhibit_xml) + srcs += client_header.process(xwayland_shell_xml) ++srcs += client_header.process(tearing_xml) + srcs += code.process(relative_xml) + srcs += code.process(pointer_xml) + srcs += code.process(gestures_xml) +@@ -88,6 +90,7 @@ srcs += code.process(xdg_shell_xml) + srcs += code.process(drm_lease_xml) + srcs += code.process(shortcuts_inhibit_xml) + srcs += code.process(xwayland_shell_xml) ++srcs += code.process(tearing_xml) + + xwayland_glamor = [] + eglstream_srcs = [] +diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c +index 2c0e1a05cc765da68f18123b37b0be6ae0a25ede..0a827877de31c5f2b213a92bc7ee819e4e94c949 100644 +--- a/hw/xwayland/xwayland-present.c ++++ b/hw/xwayland/xwayland-present.c +@@ -34,8 +34,9 @@ + #include "xwayland-pixmap.h" + #include "glamor.h" + ++#include "tearing-control-v1-client-protocol.h" + +-#define XWL_PRESENT_CAPS PresentCapabilityAsync ++#define XWL_PRESENT_CAPS PresentCapabilityAsync | PresentCapabilityAsyncMayTear + + + /* +@@ -752,6 +753,16 @@ xwl_present_flip(WindowPtr present_window, + damage_box->x2 - damage_box->x1, + damage_box->y2 - damage_box->y1); + ++ if (xwl_window->tearing_control) { ++ uint32_t hint; ++ if (event->async_may_tear) ++ hint = WP_TEARING_CONTROL_V1_PRESENTATION_HINT_ASYNC; ++ else ++ hint = WP_TEARING_CONTROL_V1_PRESENTATION_HINT_VSYNC; ++ ++ wp_tearing_control_v1_set_presentation_hint(xwl_window->tearing_control, hint); ++ } ++ + wl_surface_commit(xwl_window->surface); + + if (!sync_flip) { +@@ -955,11 +966,15 @@ xwl_present_pixmap(WindowPtr window, + } + + vblank->event_id = (uintptr_t)event; ++ event->async_may_tear = options & PresentOptionAsyncMayTear; + +- /* Xwayland presentations always complete (at least) one frame after they ++ /* Synchronous Xwayland presentations always complete (at least) one frame after they + * are executed + */ +- vblank->exec_msc = vblank->target_msc - 1; ++ if (event->async_may_tear) ++ vblank->exec_msc = vblank->target_msc; ++ else ++ vblank->exec_msc = vblank->target_msc - 1; + + vblank->queued = TRUE; + if (crtc_msc < vblank->exec_msc) { +diff --git a/hw/xwayland/xwayland-present.h b/hw/xwayland/xwayland-present.h +index ab7f04a3b88f17789e19087a9d8cea1a19a76470..f3324b2d1dd09bb5e1893f47fa5c5444e45ca25f 100644 +--- a/hw/xwayland/xwayland-present.h ++++ b/hw/xwayland/xwayland-present.h +@@ -59,6 +59,7 @@ struct xwl_present_event { + present_vblank_rec vblank; + + PixmapPtr pixmap; ++ Bool async_may_tear; + }; + + void xwl_present_reset_timer(struct xwl_present_window *xwl_present_window); +diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c +index a880406c9baa38ca43549a8948792db313370c54..764191b53589bed8efdf8579dbfb24ac36e0b958 100644 +--- a/hw/xwayland/xwayland-screen.c ++++ b/hw/xwayland/xwayland-screen.c +@@ -60,6 +60,7 @@ + #include "viewporter-client-protocol.h" + #include "xdg-shell-client-protocol.h" + #include "xwayland-shell-v1-client-protocol.h" ++#include "tearing-control-v1-client-protocol.h" + + static DevPrivateKeyRec xwl_screen_private_key; + static DevPrivateKeyRec xwl_client_private_key; +@@ -458,6 +459,9 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, + xwl_screen->xwayland_shell = + wl_registry_bind(registry, id, &xwayland_shell_v1_interface, 1); + } ++ else if (strcmp(interface, "wp_tearing_control_manager_v1") == 0) { ++ xwl_screen->tearing_control_manager = wl_registry_bind(registry, id, &wp_tearing_control_manager_v1_interface, 1); ++ } + #ifdef XWL_HAS_GLAMOR + else if (xwl_screen->glamor) { + xwl_glamor_init_wl_registry(xwl_screen, registry, id, interface, +diff --git a/hw/xwayland/xwayland-screen.h b/hw/xwayland/xwayland-screen.h +index fadd0526e2160d04bca180a94dd4da87a029c8fb..da97d7f1d924d53cbfb3cfde8487133f7eb3ed10 100644 +--- a/hw/xwayland/xwayland-screen.h ++++ b/hw/xwayland/xwayland-screen.h +@@ -107,6 +107,7 @@ struct xwl_screen { + struct zxdg_output_manager_v1 *xdg_output_manager; + struct wp_viewporter *viewporter; + struct xwayland_shell_v1 *xwayland_shell; ++ struct wp_tearing_control_manager_v1 *tearing_control_manager; + struct xorg_list drm_lease_devices; + struct xorg_list queued_drm_lease_devices; + struct xorg_list drm_leases; +diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c +index 4363730fdadb11c8ce7ab075572dde6f8ca3fcb4..845a806d5c880b30c4da2fba6d46aceb45921491 100644 +--- a/hw/xwayland/xwayland-window.c ++++ b/hw/xwayland/xwayland-window.c +@@ -46,6 +46,7 @@ + #include "xwayland-shm.h" + + #include "linux-dmabuf-unstable-v1-client-protocol.h" ++#include "tearing-control-v1-client-protocol.h" + #include "viewporter-client-protocol.h" + #include "xdg-shell-client-protocol.h" + #include "xwayland-shell-v1-client-protocol.h" +@@ -884,6 +885,11 @@ ensure_surface_for_window(WindowPtr window) + xwl_window_check_resolution_change_emulation(xwl_window); + } + ++ if (xwl_screen->tearing_control_manager) { ++ xwl_window->tearing_control = wp_tearing_control_manager_v1_get_tearing_control( ++ xwl_screen->tearing_control_manager, xwl_window->surface); ++ } ++ + return TRUE; + + err: +@@ -1100,6 +1106,9 @@ xwl_unrealize_window(WindowPtr window) + } + #endif + ++ if (xwl_window->tearing_control) ++ wp_tearing_control_v1_destroy(xwl_window->tearing_control); ++ + release_wl_surface_for_window(xwl_window); + xorg_list_del(&xwl_window->link_damage); + xorg_list_del(&xwl_window->link_window); +diff --git a/hw/xwayland/xwayland-window.h b/hw/xwayland/xwayland-window.h +index 2e8313f56f8646b212b83d5759164bb3db5b9703..bb8603ff7bf8c120b086d6b6f012dabeab34e374 100644 +--- a/hw/xwayland/xwayland-window.h ++++ b/hw/xwayland/xwayland-window.h +@@ -115,6 +115,7 @@ struct xwl_window { + #endif + struct xwayland_surface_v1 *xwayland_surface; + struct xwl_dmabuf_feedback feedback; ++ struct wp_tearing_control_v1 *tearing_control; + }; + + struct xwl_window *xwl_window_get(WindowPtr window); +diff --git a/meson.build b/meson.build +index 98fcb599255f1ea53dca1c8ec480d6988c76a051..4ea5e4a27db149b7fba13a5ff15e68d3aa4a9398 100644 +--- a/meson.build ++++ b/meson.build +@@ -64,7 +64,7 @@ libdrm_req = '>= 2.4.89' + libselinux_req = '>= 2.0.86' + xext_req = '>= 1.0.99.4' + wayland_req = '>= 1.21.0' +-wayland_protocols_req = '>= 1.28' ++wayland_protocols_req = '>= 1.30' + gbm_req = '>= 10.2' + xf86dgaproto_req = '>= 2.0.99.1' + +diff --git a/present/present.c b/present/present.c +index 271fe32bc8b389498171dc572f17f5cd611ff167..211868341dd18bb7664f03d4a008813cc1d6e18f 100644 +--- a/present/present.c ++++ b/present/present.c +@@ -157,7 +157,7 @@ present_get_target_msc(uint64_t target_msc_arg, + uint64_t remainder, + uint32_t options) + { +- const Bool synced_flip = !(options & PresentOptionAsync); ++ const Bool synced_flip = !(options & PresentAllAsyncOptions); + uint64_t target_msc; + + /* If the specified target-msc lies in the future, then this +diff --git a/present/present_vblank.c b/present/present_vblank.c +index a9f17d4b2be374257b44199959c5ae1beb2d3972..4f94f16e44fbcd5504936b01ca93d2f971d70a03 100644 +--- a/present/present_vblank.c ++++ b/present/present_vblank.c +@@ -115,7 +115,7 @@ present_vblank_init(present_vblank_ptr vblank, + { + vblank->flip = TRUE; + vblank->sync_flip = TRUE; +- } else if ((capabilities & PresentCapabilityAsync) && ++ } else if ((capabilities & PresentAllAsyncCapabilities) && + screen_priv->check_flip (target_crtc, window, pixmap, FALSE, valid, x_off, y_off, &reason)) + { + vblank->flip = TRUE; diff --git a/xwayland-22.1.3/debian/rules b/debian/rules similarity index 100% rename from xwayland-22.1.3/debian/rules rename to debian/rules diff --git a/xwayland-22.1.3/debian/source/format b/debian/source/format similarity index 100% rename from xwayland-22.1.3/debian/source/format rename to debian/source/format diff --git a/xwayland-22.1.3/debian/upstream/signing-key.asc b/debian/upstream/signing-key.asc similarity index 100% rename from xwayland-22.1.3/debian/upstream/signing-key.asc rename to debian/upstream/signing-key.asc diff --git a/xwayland-22.1.3/debian/watch b/debian/watch similarity index 100% rename from xwayland-22.1.3/debian/watch rename to debian/watch diff --git a/xwayland-22.1.3/debian/xwayland.install b/debian/xwayland.install similarity index 61% rename from xwayland-22.1.3/debian/xwayland.install rename to debian/xwayland.install index d62e1d8..8d0f339 100644 --- a/xwayland-22.1.3/debian/xwayland.install +++ b/debian/xwayland.install @@ -1,2 +1,3 @@ usr/bin/Xwayland +usr/lib/pkgconfig/xwayland.pc usr/share/man/man1/Xwayland.1 diff --git a/main.sh b/main.sh new file mode 100755 index 0000000..fd4c01b --- /dev/null +++ b/main.sh @@ -0,0 +1,22 @@ +# Add dependent repositories +wget -q -O - https://ppa.pika-os.com/key.gpg | sudo apt-key add - +add-apt-repository https://ppa.pika-os.com +add-apt-repository ppa:pikaos/pika +add-apt-repository ppa:kubuntu-ppa/backports +# Clone Upstream +git clone https://gitlab.freedesktop.org/xorg/xserver.git -b xwayland-23.0.99.901 +cp -rvf ./debian ./xserver +mv ./xserver ./xwayland +cd ./xwayland + +# Get build deps +apt-get build-dep ./ -y + +# Build package +dh_make --createorig +dpkg-buildpackage + +# Move the debs to output +cd ../ +mkdir -p ./output +mv ./*.deb ./output/ diff --git a/release.sh b/release.sh new file mode 100755 index 0000000..13455bb --- /dev/null +++ b/release.sh @@ -0,0 +1,14 @@ +# Sign the packages +dpkg-sig --sign builder ./output/xwayland*.deb + +# Pull down existing ppa repo db files etc +rsync -azP --exclude '*.deb' ferreo@direct.pika-os.com:/srv/www/pikappa/ ./output/repo + +# Remove our existing package from the repo +reprepro -V --basedir ./output/repo/ removefilter kinetic 'Package (% xwayland*)' + +# Add the new package to the repo +reprepro -V --basedir ./output/repo/ includedeb kinetic ./output/xwayland*.deb + +# Push the updated ppa repo to the server +rsync -azP ./output/repo/ ferreo@direct.pika-os.com:/srv/www/pikappa/ diff --git a/xwayland-22.1.3/debian/patches/xwayland-vsync.diff b/xwayland-22.1.3/debian/patches/xwayland-vsync.diff deleted file mode 100644 index a73a7dd..0000000 --- a/xwayland-22.1.3/debian/patches/xwayland-vsync.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- a/hw/xwayland/xwayland-present.c -+++ b/hw/xwayland/xwayland-present.c -@@ -824,7 +824,8 @@ - dixDestroyPixmap(vblank->pixmap, vblank->pixmap->drawable.id); - vblank->pixmap = NULL; - -- if (xwl_present_queue_vblank(screen, window, vblank->crtc, -+ if (vblank->target_msc > crtc_msc && -+ xwl_present_queue_vblank(screen, window, vblank->crtc, - vblank->event_id, crtc_msc + 1) - == Success) - return; -