From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 920CD1382C5 for ; Tue, 17 Apr 2018 01:35:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A2022E09FB; Tue, 17 Apr 2018 01:35:55 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 65F4BE09FB for ; Tue, 17 Apr 2018 01:35:55 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C5A55335C0A for ; Tue, 17 Apr 2018 01:35:53 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5692B282 for ; Tue, 17 Apr 2018 01:35:52 +0000 (UTC) From: "Matt Turner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Turner" Message-ID: <1523928937.4abddc5e499eef7cdb177e4b8c98219284c376e4.mattst88@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: x11-base/xorg-server/, x11-base/xorg-server/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: x11-base/xorg-server/files/xorg-server-1.19.99.904-modesetting-Move-GBM-code-inside-ifdef-GLAMOR_HAS_GB.patch x11-base/xorg-server/files/xorg-server-1.19.99.904-xwayland-Fix-build-without-glamor.patch x11-base/xorg-server/xorg-server-1.19.99.904.ebuild X-VCS-Directories: x11-base/xorg-server/files/ x11-base/xorg-server/ X-VCS-Committer: mattst88 X-VCS-Committer-Name: Matt Turner X-VCS-Revision: 4abddc5e499eef7cdb177e4b8c98219284c376e4 X-VCS-Branch: master Date: Tue, 17 Apr 2018 01:35:52 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 2f11ce31-3048-436d-a25e-01a43f9c50d2 X-Archives-Hash: 5ed18e5f1743ff1b89020cf31280271b commit: 4abddc5e499eef7cdb177e4b8c98219284c376e4 Author: Matt Turner gentoo org> AuthorDate: Tue Apr 17 01:35:22 2018 +0000 Commit: Matt Turner gentoo org> CommitDate: Tue Apr 17 01:35:37 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4abddc5e x11-base/xorg-server: Cherry-pick two patches from upstream Closes: https://bugs.gentoo.org/653288 Package-Manager: Portage-2.3.24, Repoman-2.3.6 ...-Move-GBM-code-inside-ifdef-GLAMOR_HAS_GB.patch | 48 ++++++ ....99.904-xwayland-Fix-build-without-glamor.patch | 175 +++++++++++++++++++++ .../xorg-server/xorg-server-1.19.99.904.ebuild | 7 +- 3 files changed, 227 insertions(+), 3 deletions(-) diff --git a/x11-base/xorg-server/files/xorg-server-1.19.99.904-modesetting-Move-GBM-code-inside-ifdef-GLAMOR_HAS_GB.patch b/x11-base/xorg-server/files/xorg-server-1.19.99.904-modesetting-Move-GBM-code-inside-ifdef-GLAMOR_HAS_GB.patch new file mode 100644 index 00000000000..f0c4ed58d33 --- /dev/null +++ b/x11-base/xorg-server/files/xorg-server-1.19.99.904-modesetting-Move-GBM-code-inside-ifdef-GLAMOR_HAS_GB.patch @@ -0,0 +1,48 @@ +From a98a95b798a0062783ae6fd2135ad488af5efcfd Mon Sep 17 00:00:00 2001 +From: Matt Turner +Date: Sun, 15 Apr 2018 23:37:45 -0700 +Subject: [PATCH xserver 2/2] modesetting: Move GBM code inside #ifdef + GLAMOR_HAS_GBM + +Fixes a compilation error without Glamor. + +Bugzilla: https://bugs.gentoo.org/653288 +Signed-off-by: Matt Turner +Reviewed-by: Olivier Fourdan +--- + hw/xfree86/drivers/modesetting/drmmode_display.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c +index 322ef050b..79e91f0f8 100644 +--- a/hw/xfree86/drivers/modesetting/drmmode_display.c ++++ b/hw/xfree86/drivers/modesetting/drmmode_display.c +@@ -998,18 +998,18 @@ static Bool + drmmode_create_bo(drmmode_ptr drmmode, drmmode_bo *bo, + unsigned width, unsigned height, unsigned bpp) + { +- uint32_t format; +- +- if (drmmode->scrn->depth == 30) +- format = GBM_FORMAT_ARGB2101010; +- else +- format = GBM_FORMAT_ARGB8888; +- + bo->width = width; + bo->height = height; + + #ifdef GLAMOR_HAS_GBM + if (drmmode->glamor) { ++ uint32_t format; ++ ++ if (drmmode->scrn->depth == 30) ++ format = GBM_FORMAT_ARGB2101010; ++ else ++ format = GBM_FORMAT_ARGB8888; ++ + #ifdef GBM_BO_WITH_MODIFIERS + uint32_t num_modifiers; + uint64_t *modifiers = NULL; +-- +2.16.1 + diff --git a/x11-base/xorg-server/files/xorg-server-1.19.99.904-xwayland-Fix-build-without-glamor.patch b/x11-base/xorg-server/files/xorg-server-1.19.99.904-xwayland-Fix-build-without-glamor.patch new file mode 100644 index 00000000000..312a5e05cdc --- /dev/null +++ b/x11-base/xorg-server/files/xorg-server-1.19.99.904-xwayland-Fix-build-without-glamor.patch @@ -0,0 +1,175 @@ +From c3ae963a7b19e05b8296aae8b6354587756d48fa Mon Sep 17 00:00:00 2001 +From: Olivier Fourdan +Date: Mon, 16 Apr 2018 09:39:09 +0200 +Subject: [PATCH xserver 1/2] xwayland: Fix build without glamor + +Present support in Xwayland relies on glamor, make sure Xwayland can +be built without glamor by moving references to Present code inside +the conditional GLAMOR_HAS_GBM. + +Reported-by: Matt Turner +Signed-off-by: Olivier Fourdan +Reviewed-by: Matt Turner +Reviewed-by: Roman Gilg +--- + hw/xwayland/Makefile.am | 4 ++-- + hw/xwayland/meson.build | 3 +-- + hw/xwayland/xwayland.c | 10 +++++++++- + hw/xwayland/xwayland.h | 7 ++++++- + 4 files changed, 18 insertions(+), 6 deletions(-) + +diff --git a/hw/xwayland/Makefile.am b/hw/xwayland/Makefile.am +index 0291afee7..80d3a1f19 100644 +--- a/hw/xwayland/Makefile.am ++++ b/hw/xwayland/Makefile.am +@@ -11,7 +11,6 @@ Xwayland_CFLAGS = \ + + Xwayland_SOURCES = \ + xwayland.c \ +- xwayland-present.c \ + xwayland-input.c \ + xwayland-cursor.c \ + xwayland-shm.c \ +@@ -35,7 +34,8 @@ Xwayland_built_sources = + + if GLAMOR_EGL + Xwayland_SOURCES += \ +- xwayland-glamor.c ++ xwayland-glamor.c \ ++ xwayland-present.c + if XV + Xwayland_SOURCES += \ + xwayland-glamor-xv.c +diff --git a/hw/xwayland/meson.build b/hw/xwayland/meson.build +index 69a5c819a..8d178825e 100644 +--- a/hw/xwayland/meson.build ++++ b/hw/xwayland/meson.build +@@ -1,6 +1,5 @@ + srcs = [ + 'xwayland.c', +- 'xwayland-present.c', + 'xwayland-input.c', + 'xwayland-cursor.c', + 'xwayland-shm.c', +@@ -53,7 +52,7 @@ srcs += code.process(dmabuf_xml) + + xwayland_glamor = [] + if gbm_dep.found() +- srcs += 'xwayland-glamor.c' ++ srcs += [ 'xwayland-glamor.c', 'xwayland-present.c' ] + if build_xv + srcs += 'xwayland-glamor-xv.c' + endif +diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c +index dd074c341..44bbc3b18 100644 +--- a/hw/xwayland/xwayland.c ++++ b/hw/xwayland/xwayland.c +@@ -525,6 +525,7 @@ xwl_realize_window(WindowPtr window) + wl_region_destroy(region); + } + ++#ifdef GLAMOR_HAS_GBM + if (xwl_screen->present) { + xwl_window->present_crtc_fake = RRCrtcCreate(xwl_screen->screen, xwl_window); + xwl_window->present_msc = 1; +@@ -533,6 +534,7 @@ xwl_realize_window(WindowPtr window) + xorg_list_init(&xwl_window->present_event_list); + xorg_list_init(&xwl_window->present_release_queue); + } ++#endif + + wl_display_flush(xwl_screen->display); + +@@ -599,9 +601,11 @@ xwl_unrealize_window(WindowPtr window) + + compUnredirectWindow(serverClient, window, CompositeRedirectManual); + ++#ifdef GLAMOR_HAS_GBM + if (xwl_screen->present) + /* Always cleanup Present (Present might have been active on child window) */ + xwl_present_cleanup(window); ++#endif + + screen->UnrealizeWindow = xwl_screen->UnrealizeWindow; + ret = (*screen->UnrealizeWindow) (window); +@@ -621,8 +625,10 @@ xwl_unrealize_window(WindowPtr window) + if (xwl_window->frame_callback) + wl_callback_destroy(xwl_window->frame_callback); + ++#ifdef GLAMOR_HAS_GBM + if (xwl_window->present_crtc_fake) + RRCrtcDestroy(xwl_window->present_crtc_fake); ++#endif + + free(xwl_window); + dixSetPrivate(&window->devPrivates, &xwl_window_private_key, NULL); +@@ -709,9 +715,11 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen) + + xorg_list_for_each_entry_safe(xwl_window, next_xwl_window, + &xwl_screen->damage_window_list, link_damage) { ++#ifdef GLAMOR_HAS_GBM + /* Present on the main surface. So don't commit here as well. */ + if (xwl_window->present_window) + continue; ++#endif + /* If we're waiting on a frame callback from the server, + * don't attach a new buffer. */ + if (xwl_window->frame_callback) +@@ -1053,10 +1061,10 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) + ErrorF("Failed to initialize glamor, falling back to sw\n"); + xwl_screen->glamor = 0; + } +-#endif + + if (xwl_screen->glamor && xwl_screen->rootless) + xwl_screen->present = xwl_present_init(pScreen); ++#endif + + if (!xwl_screen->glamor) { + xwl_screen->CreateScreenResources = pScreen->CreateScreenResources; +diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h +index a65559374..cf2551b99 100644 +--- a/hw/xwayland/xwayland.h ++++ b/hw/xwayland/xwayland.h +@@ -127,7 +127,7 @@ struct xwl_window { + struct xorg_list link_damage; + struct wl_callback *frame_callback; + Bool allow_commits; +- ++#ifdef GLAMOR_HAS_GBM + /* present */ + RRCrtcPtr present_crtc_fake; + struct xorg_list present_link; +@@ -143,8 +143,10 @@ struct xwl_window { + + struct xorg_list present_event_list; + struct xorg_list present_release_queue; ++#endif + }; + ++#ifdef GLAMOR_HAS_GBM + struct xwl_present_event { + uint64_t event_id; + uint64_t target_msc; +@@ -159,6 +161,7 @@ struct xwl_present_event { + + struct xorg_list list; + }; ++#endif + + #define MODIFIER_META 0x01 + +@@ -378,8 +381,10 @@ struct wl_buffer *xwl_glamor_pixmap_get_wl_buffer(PixmapPtr pixmap, + unsigned short height, + Bool *created); + ++#ifdef GLAMOR_HAS_GBM + Bool xwl_present_init(ScreenPtr screen); + void xwl_present_cleanup(WindowPtr window); ++#endif + + void xwl_screen_release_tablet_manager(struct xwl_screen *xwl_screen); + +-- +2.16.1 + diff --git a/x11-base/xorg-server/xorg-server-1.19.99.904.ebuild b/x11-base/xorg-server/xorg-server-1.19.99.904.ebuild index 7af80e32dab..805f0077333 100644 --- a/x11-base/xorg-server/xorg-server-1.19.99.904.ebuild +++ b/x11-base/xorg-server/xorg-server-1.19.99.904.ebuild @@ -108,9 +108,10 @@ REQUIRED_USE="!minimal? ( ) xephyr? ( kdrive )" -#UPSTREAMED_PATCHES=( -# "${WORKDIR}/patches/" -#) +UPSTREAMED_PATCHES=( + "${FILESDIR}"/${P}-modesetting-Move-GBM-code-inside-ifdef-GLAMOR_HAS_GB.patch + "${FILESDIR}"/${P}-xwayland-Fix-build-without-glamor.patch +) PATCHES=( "${UPSTREAMED_PATCHES[@]}"