Compare commits

...
Sign in to create a new pull request.

103 commits

Author SHA1 Message Date
Olivier Fourdan
e356a592b7 Update to v21.1.21
Resolves: #2417000
2025-11-25 14:06:38 +01:00
Olivier Fourdan
115bb19734 Update to v21.1.20
CVE fix for:
CVE-2025-62229, CVE-2025-62230, CVE-2025-62231

Resolves: #2406803
2025-10-28 18:30:25 +01:00
Fedora Release Engineering
ab69deda47 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-25 21:00:45 +00:00
Peter Hutterer
96c4fa6fb3 Update Xvfb SPDX license identifier 2025-07-09 08:21:37 +10:00
Olivier Fourdan
5d7ed4931e Update to v21.1.18
Contains an additional fix for CVE-2025-49176
2025-06-18 19:10:33 +02:00
Olivier Fourdan
5b50181e4f Update to v21.1.17
CVE fix for:
CVE-2025-49175, CVE-2025-49176, CVE-2025-49177,
CVE-2025-49178, CVE-2025-49179, CVE-2025-49180
2025-06-17 16:44:20 +02:00
Olivier Fourdan
dd5395436b Update to v21.1.16
CVE fix for:
CVE-2025-26594, CVE-2025-26595, CVE-2025-26596, CVE-2025-26597,
CVE-2025-26598, CVE-2025-26599, CVE-2025-26600, CVE-2025-26601

Resolves: #2347558
2025-02-26 09:25:34 +01:00
Olivier Fourdan
572824c028 Fix DRI2 failure
Resolves: #2347345
2025-02-25 10:52:00 +01:00
Fedora Release Engineering
3e4c792ded Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-19 16:10:32 +00:00
Sérgio M. Basto
928204fc39 Remove this unused patch which have characters that flagged by the automatic scanning tools.
This pach is already in upstream code, as this patch have characters that are flagged by
the automatic scanning tools, it was remove from previous commits to
avoid delays. Now that we already rebase xorg-x11-server to 21.x and
shipped in F41, we can complete the cleanup
2024-12-31 17:57:55 +00:00
José Expósito
e3a0a54473 Update to v21.1.15
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2332880
2024-12-20 08:50:05 +01:00
Sérgio M. Basto
cb5f4ca65c Revert commit "Fix error copying Xorg.wrap", debugedit-5.1-2 have the real fix 2024-11-29 00:07:55 +00:00
José Expósito
6b1c1806e3 Restore quirks for Apple silicon
Fixes: 422064e45a ("Update X11-server to 21.1.13 and ABI numbers of videodrv and xinput")
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2152414
2024-11-27 09:56:50 +01:00
José Expósito
28edf326d9 Fix error copying Xorg.wrap
Building the latest Rawhide code fails with this error:

    objcopy: unable to copy file '/builddir/build/BUILD/xorg-x11-server-21.1.14-build/BUILDROOT/usr/libexec/Xorg.wrap';
    reason: Permission denied

Upstream patch 09cd65233e0f ("xfree86: Set appropriate install_mode for
suid_wrapper") changed the permissions of Xorg.wrap at install time,
preventing it from being copied.

Revert the patch to be able to build the X.Org server again.

For reference, after reverting the upstream patch, the permissions of
Xorg.wrap matches the permissions in my system:

    $ rpm -qlvp xorg-x11-server-Xorg-21.1.14-2.fc42.x86_64.rpm
    [...]
    -rwsr-xr-x 1  root root 16256 Nov 18 01:00 /usr/libexec/Xorg.wrap

    $ ll /usr/libexec/Xorg.wrap
    -rwsr-xr-x. 1 root root 15K Oct 29 01:00 /usr/libexec/Xorg.wrap
2024-11-27 09:52:42 +01:00
José Expósito
d53e48508b Update to v21.1.14 2024-10-29 18:18:29 +01:00
Peter Robinson
db932d9182 Obsolete xorg-x11-drv-armsoc 2024-10-16 10:16:17 +01:00
Simone Caronni
083eae6061 Obsolete vesa and fbdev drivers 2024-09-30 09:46:44 +02:00
Simone Caronni
51ae8aa675 Remove all conditionals. Drop int10 everywhere and enable libunwind/dri3 on ELN. 2024-09-28 19:31:32 +02:00
Simone Caronni
0bb198b86b Adjust int10/unwind conditionals 2024-09-27 13:34:16 +02:00
Simone Caronni
b8c1f8e99c Format SPEC file 2024-09-27 10:57:26 +02:00
Simone Caronni
ddd6374980 Add build depdendencies as they are searched by meson 2024-09-27 10:53:34 +02:00
Simone Caronni
73f289de65 Drop Obsoletes/Provides that have been removed in ~2014 2024-09-27 09:56:22 +02:00
Simone Caronni
00592f1f26 Switch to meson for building 2024-09-27 09:40:24 +02:00
Simone Caronni
2cdddcc3e1 Clean up .gitignore 2024-09-26 22:16:51 +02:00
Simone Caronni
fefea377b3 Spec file update
- Drop support for building snapshots.
- Drop custom cflags.
- Trim changelog.
2024-09-26 22:15:38 +02:00
Sérgio M. Basto
72accf2c5a Remove unused patches with fedpkg unused-patches 2024-09-02 18:03:09 +01:00
Sérgio M. Basto
422064e45a Update X11-server to 21.1.13 and ABI numbers of videodrv and xinput
DMX DDX was dropped
0001-Disallow-byte-swapped-clients-by-default.patch is upstremaed
0001-autobind-GPUs-to-the-screen.patch is upstreamed
0001-xf86-dri2-Use-va_gl-as-vdpau_driver-for-Intel-i965-G.patch updated
2024-09-02 17:49:53 +01:00
Fedora Release Engineering
aa17c8dba1 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-20 10:21:44 +00:00
José Expósito
ef7d64c39f Backport fix for invalid Unicode sequence 2024-05-08 10:01:49 +02:00
José Expósito
47092bca4f Fix regression caused by the fix for CVE-2024-31083 2024-04-10 09:56:49 +02:00
José Expósito
0ad871b912 CVE fix for: CVE-2024-31080, CVE-2024-31081, CVE-2024-31082 and CVE-2024-31083 2024-04-03 18:10:41 +02:00
José Expósito
43f6ceeda4 Add util-linux as a dependency of Xvfb
The xvfb-run command uses getopt, provided by util-linux, but the
dependency is not listed.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2267450
2024-03-04 15:39:48 +01:00
Yaakov Selkowitz
c88593e07d Apply all CVE patches to RHEL builds
Patch 3801 is specific to Fedora, but all the other patches, even those
that are newer, should be applied both to Fedora and RHEL (or, possibly
in the future, EPEL) builds.
2024-01-30 19:48:04 -05:00
Fedora Release Engineering
3982aab455 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-27 10:01:05 +00:00
José Expósito
af32bd411c Fix compilation error on i686 2024-01-22 09:25:50 +01:00
José Expósito
9df532a027 Fix use after free related to CVE-2024-21886 2024-01-19 11:22:19 +01:00
José Expósito
57dbbbe6c2 CVE fix for: CVE-2023-6816, CVE-2024-0229, CVE-2024-21885, CVE-2024-21886, CVE-2024-0408 and CVE-2024-0409 2024-01-16 15:19:18 +01:00
Peter Hutterer
d887a5b989 CVE fix for: CVE-2023-6377, CVE-2023-6478 2023-12-13 11:51:29 +10:00
Peter Hutterer
d8ec1545f3 Update with full SPDX license list 2023-11-10 14:31:54 +10:00
Peter Hutterer
54e15127ae CVE fix for: CVE-2023-5367, CVE-2023-5380 2023-10-25 12:01:02 +10:00
José Expósito
28a268e0aa SPDX migration: license is already SPDX compatible 2023-10-20 17:38:41 +02:00
Orion Poplawski
fdd7c4bbd1 Fix xvfb-run --error-file / auth-file options 2023-09-28 21:16:17 -06:00
Fedora Release Engineering
78721b7ea4 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-22 19:11:32 +00:00
Olivier Fourdan
a3932dc93a Backport fix for a deadlock with DRI3
See https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1057
and https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21339

Resolves: #2189434
2023-04-25 10:59:38 +02:00
Florian Weimer
c2b6cc043d Make more functions available in fb.h with !FB_ACCESS_WRAPPER
Related to:

  <https://fedoraproject.org/wiki/Changes/PortingToModernC>
  <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
2023-04-13 15:48:20 +02:00
Olivier Fourdan
21269fd4b7 Fix for CVE-2023-1393 2023-03-29 15:36:30 +02:00
Olivier Fourdan
31ea8b9649 Fix xvfb-run script with --listen-tcp 2023-02-23 09:09:36 +01:00
Iker Pedrosa
7c9187a093 Remove pam_console from service file
pam_console is being removed as it was replaced by ConsoleKit, and later
by systemd-logind. Most probably the migration was already done years
ago as I don't see any specific configuration file for pam_console. This
change only removes pam_console from the service file.

If you are curious about the removal check the Fedora System-Wide Change
proposal linked below.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1822209
Relates: https://fedoraproject.org/wiki/Changes/RemovePamConsole
Relates: https://bugzilla.redhat.com/show_bug.cgi?id=2166692

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2023-02-09 11:32:20 +01:00
Peter Hutterer
996eaa843f CVE-2023-0494: potential use-after-free 2023-02-02 15:32:24 +10:00
Peter Hutterer
50af4f1fc6 Updated conditional fedora statement 2023-02-01 14:27:20 +10:00
Olivier Fourdan
743d53fc69 Use the recommended way to apply conditional patches
https://docs.fedoraproject.org/en-US/packaging-guidelines/SourceURL/#_do_not_conditionalize_sources
2023-01-17 17:20:10 +01:00
Leif Liddy
6c12217df8
resolve Xorg server DCP display issue (#2152414)
Xorg server does not correctly select the DCP for the display without a quirk
2023-01-13 12:08:43 +01:00
Peter Hutterer
e6bf129b81 Disallow byte-swapped clients (#2159489) 2023-01-13 15:46:50 +10:00
Olivier Fourdan
140953a817 Rename value field from bool to boolean
Rename boolean config value field from bool to boolean to fix drivers
build failures due to a conflict with C++ and stdbool.h
2023-01-11 16:41:24 +01:00
Peter Hutterer
fc0c7be4e3 Fix buggy patch to CVE-2022-46340 2022-12-19 10:18:48 +10:00
Peter Hutterer
75e6f92d0f CVE fix for: CVE-2022-4283, CVE-2022-46340, CVE-2022-46341,
CVE-2022-46342, CVE-2022-46343, CVE-2022-46344
2022-12-14 11:53:02 +10:00
Peter Hutterer
4e595ce4fd Drop dependency on xorg-x11-font-utils, it was only there for one
build-time variable that's always the same value anyway (#2145088)
2022-11-23 15:47:09 +10:00
Olivier Fourdan
9fc1d98575 Fix CVE-2022-3550, CVE-2022-3551 2022-11-08 12:03:21 +01:00
Fedora Release Engineering
88dcddb59c Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-23 13:25:55 +00:00
Olivier Fourdan
98518b3d7a Fix XKB vulnerabilities
* CVE-2022-2319/ZDI-CAN-16062
 * CVE-2022-2320/ZDI-CAN-16070
2022-07-12 17:26:05 +02:00
Dominik 'Rathann' Mierzejewski
ba5ead2efb Don't hardcode fps for fake screen (#2054188) 2022-04-13 23:20:25 +02:00
František Zatloukal
672ae9a577 Fix basic graphic mode not working with simpledrm (#2067151) 2022-04-11 11:12:37 +02:00
Olivier Fourdan
4f6b52c6ec Fix build with GCC 12
Resolves: #2047134
2022-01-28 10:54:50 +01:00
Olivier Fourdan
befd31b800 Fix crash with NVIDIA proprietary driver with Present
Resolves: #2046147
2022-01-28 10:50:12 +01:00
Fedora Release Engineering
5125f50551 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-22 05:24:18 +00:00
Olivier Fourdan
f08aeec29a xserver 1.20.14
CVE-2021-4008/ZDI-CAN-14192 (#2026059, #2032941)
CVE-2021-4009/ZDI-CAN-14950 (#2026072, #2032943)
CVE-2021-4010/ZDI-CAN-14951 (#2026073, #2032944)
CVE-2021-4011/ZDI-CAN-14952 (#2026074, #2032945)
2021-12-17 15:25:24 +01:00
Sahana Prasad
a6fbe2c194 Rebuilt with OpenSSL 3.0.0 2021-09-14 19:18:17 +02:00
Fedora Release Engineering
4818e48baf - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-23 21:51:14 +00:00
Olivier Fourdan
03bc044aa3 xserver 1.20.11
Security fix for CVE-2021-3472 / ZDI-CAN-1259
2021-04-14 10:55:42 +02:00
Peter Hutterer
5f0a71dde2 Drop BuildRequires for flex-devel (#1871101) 2021-02-03 15:37:50 +10:00
Olivier Fourdan
b1458e4567 Remove Xwayland from the xserver builds 2021-02-01 12:09:03 +01:00
Fedora Release Engineering
11999b2307 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-28 00:18:09 +00:00
Adam Jackson
29f0985634 fix thinko 2021-01-19 20:11:43 -05:00
Adam Jackson
38a777ceb5 Disable int10 and vbe on RHEL
Disable DRI1
Stop overriding the vendor name
2021-01-19 19:52:41 -05:00
Olivier Fourdan
283d9cdb07 xserver 1.20.10 (CVE-2020-14360, CVE-2020-25712) 2020-12-02 10:11:20 +01:00
Peter Hutterer
16f4e7facb Add BuildRequires for make 2020-11-05 10:35:10 +10:00
Peter Hutterer
79af8e61d7 Drop BuildRequires to git-core only 2020-11-04 10:38:24 +10:00
Olivier Fourdan
eaf4422969 xserver 1.20.9 + all current fixes from upstream
- Update to xserver 1.20.9
 - Add all current fixes from the stable server-1.20-branch upstream
 - Backport latest Xwayland randr resolution change emulation support
   patches.
2020-10-09 09:42:43 +02:00
Adam Jackson
eb8a79641e Enable XC-SECURITY 2020-08-12 15:31:35 -04:00
Adam Jackson
e6480d9628 Fix information disclosure bug in pixmap allocation (CVE-2020-14347) 2020-07-31 11:40:32 -04:00
Fedora Release Engineering
9d32eb45b5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-29 14:59:04 +00:00
Olivier Fourdan
efa2d863b7 xserver 1.20.8
- Update to xserver 1.20.8
 - Backport latest Xwayland randr resolution change emulation support
   patches.
2020-03-30 09:42:38 +02:00
Olivier Fourdan
97b803e415 Fix a crash on closing a window using Present
https://gitlab.freedesktop.org/xorg/xserver/issues/1000
2020-03-18 11:02:32 +01:00
Olivier Fourdan
1e468bc44a xserver 1.20.7
- backport from stable "xserver-1.20-branch" up to commit ad7364d8d
  (for mutter fullscreen unredirect on Wayland)
- Update videodrv minor ABI as 1.20.7 changed the minor ABI version
  (backward compatible, API addition in glamor)
- Rebase Xwayland randr resolution change emulation support patches
2020-03-13 09:54:18 +01:00
Fedora Release Engineering
dafffedcc8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-31 04:47:29 +00:00
Olivier Fourdan
622718ea83 xserver 1.20.6 2019-11-25 09:48:42 +01:00
Hans de Goede
76e2fe61fd Fix building with new libglvnd-1.2.0 (E)GL headers and pkgconfig files 2019-11-04 20:48:51 +01:00
Hans de Goede
f1f3380dc7 Fix building with new libglvnd provided gl.pc 2019-11-04 19:35:08 +01:00
Hans de Goede
3ae2631a52 Backport Xwayland randr resolution change emulation support 2019-11-04 17:59:36 +01:00
Olivier Fourdan
7730e12c9e Pick latest fixes from xserver stable branch upstream
resolves: rhbz#1729925
2019-09-10 15:56:14 +02:00
Fedora Release Engineering
cf7f90e3c6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-27 04:32:10 +00:00
Olivier Fourdan
945c62ac33 Fix build on ARM with glibc
- Do not include <sys/io.h> on ARM with glibc to avoid compilation
  failure.
- Do not force vbe and int10 sdk headers as this enables int10 which
  does not build on ARM without <sys/io.h>
2019-07-08 09:38:54 +02:00
Olivier Fourdan
5160bab94c Fix regression causing screen tearing with xserver 1.20.5
Resolves: rhbz#1726419
2019-07-08 09:24:16 +02:00
Olivier Fourdan
84ed0d0988 Fix downstream regression and backport fixes 2019-06-28 17:02:49 +02:00
Peter Hutterer
9f7e9a83a5 Return AlreadyGrabbed for keycodes > 255 (#1697804) 2019-06-06 09:20:27 +10:00
Adam Jackson
9b1cb6ee15 xserver 1.20.5 2019-05-30 14:41:00 -04:00
Adam Jackson
c0df45f1ac Fix some non-atomic modesetting calls to be atomic 2019-04-23 19:39:25 -04:00
Peter Hutterer
324f637f1e Fix a Qt scrolling bug, don't reset the valuator on slave switch 2019-03-27 14:16:32 +10:00
Adam Jackson
d3c0c12b95 Backport an Xwayland crash fix in the Present code 2019-03-21 10:46:27 -04:00
Adam Jackson
cac57f572a Update sources 2019-02-26 16:15:49 -05:00
Adam Jackson
2a3298614e xserver 1.20.4 2019-02-26 15:05:54 -05:00
Fedora Release Engineering
ad1a5b36a8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-02-03 12:43:37 +00:00
Igor Gnatenko
00ee1ad93f Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:24:56 +01:00
30 changed files with 414 additions and 2288 deletions

35
.gitignore vendored
View file

@ -1,36 +1,3 @@
xorg-server-1.9.1.tar.bz2
/xorg-server-20101125.tar.xz
/xorg-server-20101201.tar.xz
/xorg-server-1.10.0.tar.bz2
/xorg-server-20110418.tar.xz
/xorg-server-20110510.tar.xz
/xorg-server-20110818.tar.xz
/xorg-server-1.11.0.tar.bz2
/xorg-server-1.11.1.tar.bz2
/xorg-server-20111109.tar.xz
/xorg-server-20120103.tar.xz
/xorg-server-20120124.tar.xz
/xorg-server-20120215.tar.xz
/xorg-server-1.12.0.tar.bz2
/xorg-server-1.12.1.tar.bz2
/xorg-server-1.12.2.tar.bz2
/xorg-server-1.12.3.tar.bz2
/xorg-server-20120717.tar.xz
/xorg-server-20120726.tar.xz
/xorg-server-20120808.tar.xz
/xorg-server-20120822.tar.xz
/xorg-server-1.13.0.tar.bz2
/xorg-server-1.13.1.tar.bz2
/xorg-server-20130109.tar.xz
/xorg-server-20130215.tar.xz
/xorg-server-1.14.0.tar.bz2
/xorg-server-1.14.1.tar.bz2
/xorg-server-1.14.1.901.tar.bz2
/xorg-server-1.14.2.tar.bz2
/xorg-server-1.14.3.tar.bz2
/xorg-server-1.14.99.3.tar.bz2
/xorg-server-1.14.99.901.tar.bz2
/xorg-server-1.14.99.902.tar.bz2
*.bz2
*.xz
/xorg-x11-server-1.15.0-1.fc21.src.rpm
*.gz

View file

@ -1,37 +0,0 @@
From e96a83d9b1b5a52a41213c7a4840dc96b4f5b06f Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Wed, 15 Aug 2012 12:35:21 -0400
Subject: [PATCH] Always install vbe and int10 sdk headers
Signed-off-by: Adam Jackson <ajax@redhat.com>
---
hw/xfree86/Makefile.am | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index b876b79..a170b58 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -26,17 +26,9 @@ if VGAHW
VGAHW_SUBDIR = vgahw
endif
-if VBE
-VBE_SUBDIR = vbe
-endif
-
-if INT10MODULE
-INT10_SUBDIR = int10
-endif
-
-SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \
+SUBDIRS = common ddc x86emu int10 os-support parser \
ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) \
- $(DRI2_SUBDIR) . $(VBE_SUBDIR) i2c dixmods xkb \
+ $(DRI2_SUBDIR) . vbe i2c dixmods xkb \
fbdevhw shadowfb exa $(XF86UTILS_SUBDIR) doc man \
$(GLAMOR_EGL_SUBDIR) drivers
--
2.13.6

View file

@ -1,293 +0,0 @@
From 471289fa1dc359555ceed6302f7d9605ab6be3ea Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Mon, 2 Apr 2018 16:49:02 -0400
Subject: [PATCH] autobind GPUs to the screen
This is a modified version of a patch we've been carry-ing in Fedora and
RHEL for years now. This patch automatically adds secondary GPUs to the
master as output sink / offload source making e.g. the use of
slave-outputs just work, with requiring the user to manually run
"xrandr --setprovideroutputsource" before he can hookup an external
monitor to his hybrid graphics laptop.
There is one problem with this patch, which is why it was not upstreamed
before. What to do when a secondary GPU gets detected really is a policy
decission (e.g. one may want to autobind PCI GPUs but not USB ones) and
as such should be under control of the Desktop Environment.
Unconditionally adding autobinding support to the xserver will result
in races between the DE dealing with the hotplug of a secondary GPU
and the server itself dealing with it.
However we've waited for years for any Desktop Environments to actually
start doing some sort of autoconfiguration of secondary GPUs and there
is still not a single DE dealing with this, so I believe that it is
time to upstream this now.
To avoid potential future problems if any DEs get support for doing
secondary GPU configuration themselves, the new autobind functionality
is made optional. Since no DEs currently support doing this themselves it
is enabled by default. When DEs grow support for doing this themselves
they can disable the servers autobinding through the servers cmdline or a
xorg.conf snippet.
Signed-off-by: Dave Airlie <airlied@gmail.com>
[hdegoede@redhat.com: Make configurable, fix with nvidia, submit upstream]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/xfree86/common/xf86Config.c | 19 +++++++++++++++++++
hw/xfree86/common/xf86Globals.c | 2 ++
hw/xfree86/common/xf86Init.c | 20 ++++++++++++++++++++
hw/xfree86/common/xf86Priv.h | 1 +
hw/xfree86/common/xf86Privstr.h | 1 +
hw/xfree86/common/xf86platformBus.c | 4 ++++
hw/xfree86/man/Xorg.man | 7 +++++++
hw/xfree86/man/xorg.conf.man | 6 ++++++
randr/randrstr.h | 3 +++
randr/rrprovider.c | 22 ++++++++++++++++++++++
10 files changed, 85 insertions(+)
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 2c1d335..d7d7c2e 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -643,6 +643,7 @@ typedef enum {
FLAG_DRI2,
FLAG_USE_SIGIO,
FLAG_AUTO_ADD_GPU,
+ FLAG_AUTO_BIND_GPU,
FLAG_MAX_CLIENTS,
FLAG_IGLX,
FLAG_DEBUG,
@@ -699,6 +700,8 @@ static OptionInfoRec FlagOptions[] = {
{0}, FALSE},
{FLAG_AUTO_ADD_GPU, "AutoAddGPU", OPTV_BOOLEAN,
{0}, FALSE},
+ {FLAG_AUTO_BIND_GPU, "AutoBindGPU", OPTV_BOOLEAN,
+ {0}, FALSE},
{FLAG_MAX_CLIENTS, "MaxClients", OPTV_INTEGER,
{0}, FALSE },
{FLAG_IGLX, "IndirectGLX", OPTV_BOOLEAN,
@@ -779,6 +782,22 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
}
xf86Msg(from, "%sutomatically adding GPU devices\n",
xf86Info.autoAddGPU ? "A" : "Not a");
+
+ if (xf86AutoBindGPUDisabled) {
+ xf86Info.autoBindGPU = FALSE;
+ from = X_CMDLINE;
+ }
+ else if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_BIND_GPU)) {
+ xf86GetOptValBool(FlagOptions, FLAG_AUTO_BIND_GPU,
+ &xf86Info.autoBindGPU);
+ from = X_CONFIG;
+ }
+ else {
+ from = X_DEFAULT;
+ }
+ xf86Msg(from, "%sutomatically binding GPU devices\n",
+ xf86Info.autoBindGPU ? "A" : "Not a");
+
/*
* Set things up based on the config file information. Some of these
* settings may be overridden later when the command line options are
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index e890f05..7b27b4c 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -131,6 +131,7 @@ xf86InfoRec xf86Info = {
#else
.autoAddGPU = FALSE,
#endif
+ .autoBindGPU = TRUE,
};
const char *xf86ConfigFile = NULL;
@@ -191,6 +192,7 @@ Bool xf86FlipPixels = FALSE;
Gamma xf86Gamma = { 0.0, 0.0, 0.0 };
Bool xf86AllowMouseOpenFail = FALSE;
+Bool xf86AutoBindGPUDisabled = FALSE;
#ifdef XF86VIDMODE
Bool xf86VidModeDisabled = FALSE;
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index ea42ec9..ec255b6 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -76,6 +76,7 @@
#include "xf86DDC.h"
#include "xf86Xinput.h"
#include "xf86InPriv.h"
+#include "xf86Crtc.h"
#include "picturestr.h"
#include "randrstr.h"
#include "glxvndabi.h"
@@ -237,6 +238,19 @@ xf86PrivsElevated(void)
return PrivsElevated();
}
+static void
+xf86AutoConfigOutputDevices(void)
+{
+ int i;
+
+ if (!xf86Info.autoBindGPU)
+ return;
+
+ for (i = 0; i < xf86NumGPUScreens; i++)
+ RRProviderAutoConfigGpuScreen(xf86ScrnToScreen(xf86GPUScreens[i]),
+ xf86ScrnToScreen(xf86Screens[0]));
+}
+
static void
TrapSignals(void)
{
@@ -770,6 +784,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
for (i = 0; i < xf86NumGPUScreens; i++)
AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
+ xf86AutoConfigOutputDevices();
+
xf86VGAarbiterWrapFunctions();
if (sigio_blocked)
input_unlock();
@@ -1278,6 +1294,10 @@ ddxProcessArgument(int argc, char **argv, int i)
xf86Info.iglxFrom = X_CMDLINE;
return 0;
}
+ if (!strcmp(argv[i], "-noautoBindGPU")) {
+ xf86AutoBindGPUDisabled = TRUE;
+ return 1;
+ }
/* OS-specific processing */
return xf86ProcessArgument(argc, argv, i);
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index 4fe2b5f..6566622 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -46,6 +46,7 @@
extern _X_EXPORT const char *xf86ConfigFile;
extern _X_EXPORT const char *xf86ConfigDir;
extern _X_EXPORT Bool xf86AllowMouseOpenFail;
+extern _X_EXPORT Bool xf86AutoBindGPUDisabled;
#ifdef XF86VIDMODE
extern _X_EXPORT Bool xf86VidModeDisabled;
diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
index 21c2e1f..6c71863 100644
--- a/hw/xfree86/common/xf86Privstr.h
+++ b/hw/xfree86/common/xf86Privstr.h
@@ -98,6 +98,7 @@ typedef struct {
Bool autoAddGPU;
const char *debug;
+ Bool autoBindGPU;
} xf86InfoRec, *xf86InfoPtr;
/* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index cef47da..913a324 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -49,6 +49,7 @@
#include "Pci.h"
#include "xf86platformBus.h"
#include "xf86Config.h"
+#include "xf86Crtc.h"
#include "randrstr.h"
int platformSlotClaimed;
@@ -665,6 +666,9 @@ xf86platformAddDevice(int index)
}
/* attach unbound to 0 protocol screen */
AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);
+ if (xf86Info.autoBindGPU)
+ RRProviderAutoConfigGpuScreen(xf86ScrnToScreen(xf86GPUScreens[i]),
+ xf86ScrnToScreen(xf86Screens[0]));
RRResourcesChanged(xf86Screens[0]->pScreen);
RRTellChanged(xf86Screens[0]->pScreen);
diff --git a/hw/xfree86/man/Xorg.man b/hw/xfree86/man/Xorg.man
index 13a9dc3..745f986 100644
--- a/hw/xfree86/man/Xorg.man
+++ b/hw/xfree86/man/Xorg.man
@@ -283,6 +283,13 @@ is a comma separated list of directories to search for
server modules. This option is only available when the server is run
as root (i.e, with real-uid 0).
.TP 8
+.B \-noautoBindGPU
+Disable automatically setting secondary GPUs up as output sinks and offload
+sources. This is equivalent to setting the
+.B AutoBindGPU
+xorg.conf(__filemansuffix__) file option. To
+.B false.
+.TP 8
.B \-nosilk
Disable Silken Mouse support.
.TP 8
diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man
index 9589262..8d51e06 100644
--- a/hw/xfree86/man/xorg.conf.man
+++ b/hw/xfree86/man/xorg.conf.man
@@ -672,6 +672,12 @@ Enabled by default.
If this option is disabled, then no GPU devices will be added from the udev
backend. Enabled by default. (May need to be disabled to setup Xinerama).
.TP 7
+.BI "Option \*qAutoBindGPU\*q \*q" boolean \*q
+If enabled then secondary GPUs will be automatically set up as output-sinks and
+offload-sources. Making e.g. laptop outputs connected only to the secondary
+GPU directly available for use without needing to run
+"xrandr --setprovideroutputsource". Enabled by default.
+.TP 7
.BI "Option \*qLog\*q \*q" string \*q
This option controls whether the log is flushed and/or synced to disk after
each message.
diff --git a/randr/randrstr.h b/randr/randrstr.h
index f94174b..092d726 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -1039,6 +1039,9 @@ RRProviderLookup(XID id, RRProviderPtr *provider_p);
extern _X_EXPORT void
RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider);
+extern _X_EXPORT void
+RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen);
+
/* rrproviderproperty.c */
extern _X_EXPORT void
diff --git a/randr/rrprovider.c b/randr/rrprovider.c
index e4bc2bf..e04c18f 100644
--- a/randr/rrprovider.c
+++ b/randr/rrprovider.c
@@ -485,3 +485,25 @@ RRDeliverProviderEvent(ClientPtr client, WindowPtr pWin, RRProviderPtr provider)
WriteEventsToClient(client, 1, (xEvent *) &pe);
}
+
+void
+RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen)
+{
+ rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen);
+ rrScrPrivPtr masterPriv = rrGetScrPriv(masterScreen);
+ RRProviderPtr provider = pScrPriv->provider;
+ RRProviderPtr master_provider = masterPriv->provider;
+
+ if (!provider || !master_provider)
+ return;
+
+ if ((provider->capabilities & RR_Capability_SinkOutput) &&
+ (master_provider->capabilities & RR_Capability_SourceOutput)) {
+ pScrPriv->rrProviderSetOutputSource(pScreen, provider, master_provider);
+ RRInitPrimeSyncProps(pScreen);
+ }
+
+ if ((provider->capabilities & RR_Capability_SourceOffload) &&
+ (master_provider->capabilities & RR_Capability_SinkOffload))
+ pScrPriv->rrProviderSetOffloadSink(pScreen, provider, master_provider);
+}
--
2.16.2

View file

@ -1,69 +0,0 @@
From f89518e17f7d507734af212785e0b3e47954f603 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Mon, 22 Oct 2018 11:48:25 +0200
Subject: [PATCH xserver] present/wnmd: Fix use after free on CRTC removal
Xwayland will add and remove CRTCs as Wayland outputs are added or
removed.
If there is a pending flip when this occurs, the
`xwl_present_sync_callback()` will be triggered after the Xwayland
output's RRCtrcPtr has been destroyed, hence causing a crash in Xwayland
while trying to use freed memory:
#1 abort ()
#2 OsAbort () at utils.c:1350
#3 AbortServer () at log.c:877
#4 FatalError () at log.c:1015
#5 OsSigHandler () at osinit.c:156
#6 <signal handler called>
#7 dixGetPrivate () at ../include/privates.h:122
#8 dixLookupPrivate () at ../include/privates.h:166
#9 present_screen_priv () at present_priv.h:198
#10 present_wnmd_flip () at present_wnmd.c:358
#11 present_wnmd_execute () at present_wnmd.c:466
#12 present_wnmd_re_execute () at present_wnmd.c:80
#13 xwl_present_sync_callback () at xwayland-present.c:287
#14 ffi_call_unix64 () from /lib64/libffi.so.6
#15 ffi_call () from /lib64/libffi.so.6
#16 wl_closure_invoke () at src/connection.c:1006
#17 dispatch_event () at src/wayland-client.c:1427
#18 dispatch_queue () at src/wayland-client.c:1573
#19 wl_display_dispatch_queue_pending () at src/wayland-client.c:1815
#20 wl_display_dispatch_pending () at src/wayland-client.c:1878
#21 xwl_read_events () at xwayland.c:814
#22 ospoll_wait () at ospoll.c:651
#23 WaitForSomething () at WaitFor.c:208
#24 Dispatch () at ../include/list.h:220
#25 dix_main () at main.c:276
To avoid the issue, get the `ScreenPtr` from the window instead of the
CRTC that might have been just freed, `xwl_present_flip()` has no use
for the CRTC anyway.
Bugzilla: https://bugs.freedesktop.org/108249
Suggested-by: Michel Daenzer <michel.daenzer@amd.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Daenzer <michel.daenzer@amd.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit b768b7d6cec41b8b320c468ec41aab5a8b49b27b)
---
present/present_wnmd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/present/present_wnmd.c b/present/present_wnmd.c
index 8f3836440..2c6412a72 100644
--- a/present/present_wnmd.c
+++ b/present/present_wnmd.c
@@ -354,7 +354,7 @@ present_wnmd_flip(WindowPtr window,
Bool sync_flip,
RegionPtr damage)
{
- ScreenPtr screen = crtc->pScreen;
+ ScreenPtr screen = window->drawable.pScreen;
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
return (*screen_priv->wnmd_info->flip) (window,
--
2.20.1

View file

@ -52,7 +52,7 @@ index 6619e3aa7..1f8ad14bc 100644
/* For non-PCI devices and drmGetDevice fail, just assume that
* the 3D driver is named the same as the kernel driver. This is
* currently true for vc4 and msm (freedreno).
@@ -1456,12 +1460,14 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info)
@@ -1454,12 +1458,14 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info)
xf86DrvMsg(pScreen->myNum, X_ERROR,
"[DRI2] Couldn't drmGetVersion() on non-PCI device, "
"no driver name found.\n");
@ -70,7 +70,7 @@ index 6619e3aa7..1f8ad14bc 100644
}
for (i = 0; driver_map[i].driver; i++) {
@@ -1469,13 +1475,15 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info)
@@ -1467,13 +1473,15 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info)
continue;
if (driver_map[i].num_chips_ids == -1) {
@ -88,7 +88,7 @@ index 6619e3aa7..1f8ad14bc 100644
goto out;
}
}
@@ -1487,9 +1495,9 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info)
@@ -1485,9 +1493,9 @@ dri2_probe_driver_name(ScreenPtr pScreen, DRI2InfoPtr info)
dev->deviceinfo.pci->vendor_id, dev->deviceinfo.pci->device_id);
out:
drmFreeDevice(&dev);
@ -100,21 +100,21 @@ index 6619e3aa7..1f8ad14bc 100644
#endif
}
@@ -1610,7 +1618,8 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
if (info->driverName) {
ds->driverNames[0] = info->driverName;
@@ -1604,7 +1612,8 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
} else {
/* FIXME dri2_probe_driver_name() returns a strdup-ed string,
* currently this gets leaked */
- ds->driverNames[0] = ds->driverNames[1] = dri2_probe_driver_name(pScreen, info);
+ dri2_probe_driver_name(pScreen, info,
+ &ds->driverNames[0], &ds->driverNames[1]);
if (!ds->driverNames[0])
return FALSE;
}
diff --git a/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h b/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h
index da7ea1c1e..7036d1003 100644
--- a/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h
+++ b/hw/xfree86/dri2/pci_ids/pci_id_driver_map.h
@@ -66,21 +66,22 @@ static const int vmwgfx_chip_ids[] = {
@@ -60,23 +60,24 @@ static const int vmwgfx_chip_ids[] = {
static const struct {
int vendor_id;
const char *driver;
@ -124,8 +124,10 @@ index da7ea1c1e..7036d1003 100644
} driver_map[] = {
- { 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) },
- { 0x8086, "i965", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) },
- { 0x8086, "i965", NULL, -1 },
+ { 0x8086, "i915", "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) },
+ { 0x8086, "i965", "va_gl", i965_chip_ids, ARRAY_SIZE(i965_chip_ids) },
+ { 0x8086, "i965", "va_gl", NULL, -1 },
#ifndef DRIVER_MAP_GALLIUM_ONLY
- { 0x1002, "radeon", r100_chip_ids, ARRAY_SIZE(r100_chip_ids) },
- { 0x1002, "r200", r200_chip_ids, ARRAY_SIZE(r200_chip_ids) },
@ -134,19 +136,18 @@ index da7ea1c1e..7036d1003 100644
#endif
- { 0x1002, "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) },
- { 0x1002, "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) },
- { 0x1002, "radeonsi", radeonsi_chip_ids, ARRAY_SIZE(radeonsi_chip_ids) },
- { 0x1002, "radeonsi", NULL, -1 },
- { 0x10de, "nouveau", NULL, -1 },
- { 0x1af4, "virtio_gpu", virtio_gpu_chip_ids, ARRAY_SIZE(virtio_gpu_chip_ids) },
- { 0x15ad, "vmwgfx", vmwgfx_chip_ids, ARRAY_SIZE(vmwgfx_chip_ids) },
- { 0x0000, NULL, NULL, 0 },
+ { 0x1002, "r300", "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) },
+ { 0x1002, "r600","r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) },
+ { 0x1002, "radeonsi", "radeonsi", radeonsi_chip_ids, ARRAY_SIZE(radeonsi_chip_ids) },
+ { 0x1002, "r600", "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) },
+ { 0x1002, "radeonsi", "radeonsi", NULL, -1 },
+ { 0x10de, "nouveau", "nouveau", NULL, -1 },
+ { 0x1af4, "virtio_gpu", "virtio_gpu", virtio_gpu_chip_ids, ARRAY_SIZE(virtio_gpu_chip_ids) },
+ { 0x15ad, "vmwgfx", "vmwgfx", vmwgfx_chip_ids, ARRAY_SIZE(vmwgfx_chip_ids) },
{ 0x0000, NULL, NULL, 0 },
+ { 0x0000, NULL, NULL, NULL, 0 },
};
--
2.19.0
#endif /* _PCI_ID_DRIVER_MAP_H_ */

View file

@ -24,7 +24,7 @@ index 8158c2b62..78d1c947d 100644
@@ -1190,6 +1191,25 @@ xf86VideoPtrToDriverList(struct pci_device *dev,
int idx = 0;
#ifdef __linux__
#if defined(__linux__) || defined(__NetBSD__)
+ char busid[32];
+ int fd;
+

View file

@ -1,48 +0,0 @@
From 64f5e6ec2d297f90e9b9785a1cb7285d609a1877 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
Date: Fri, 19 Oct 2018 18:27:37 +0200
Subject: [PATCH xserver] xwayland: Plug leaks in xwl_present_sync_callback
xwl_present_window->sync_callback was leaked.
The event memory was leaked if the corresponding buffer had already been
released.
(cherry picked from commit cb0de153bf0c486da7e968ab0f258c9c0c9ed34a)
---
hw/xwayland/xwayland-present.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index 316e04443..fb5c6499e 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -274,6 +274,9 @@ xwl_present_sync_callback(void *data,
struct xwl_present_event *event = data;
struct xwl_present_window *xwl_present_window = event->xwl_present_window;
+ wl_callback_destroy(xwl_present_window->sync_callback);
+ xwl_present_window->sync_callback = NULL;
+
event->pending = FALSE;
if (event->abort) {
@@ -289,12 +292,14 @@ xwl_present_sync_callback(void *data,
xwl_present_window->ust,
xwl_present_window->msc);
- if (event->buffer_released)
+ if (event->buffer_released) {
/* If the buffer was already released, send the event now again */
present_wnmd_event_notify(xwl_present_window->window,
event->event_id,
xwl_present_window->ust,
xwl_present_window->msc);
+ xwl_present_free_event(event);
+ }
}
static const struct wl_callback_listener xwl_present_sync_listener = {
--
2.20.1

View file

@ -1,59 +0,0 @@
From 26eb8a0020ebf0e3a550f98be5f58820db765b2f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
Date: Wed, 24 Oct 2018 11:23:05 +0200
Subject: [PATCH xserver 1/7] xwayland: Use xwl_present_reset_timer in
xwl_present_timer_callback
Apart from simplifying the code, this should also prevent a condition
(which might only be possible with the following fix) reported in
https://gitlab.freedesktop.org/wayland/weston/issues/115#note_52467:
1. xwl_present_timer_callback indirectly calls xwl_present_reset_timer
-> xwl_present_free_timer
2. xwl_present_timer_callback then returns a non-0 value, so DoTimer
calls TimerSet with the old xwl_present_window->frame_timer pointer
which was freed in step 1 => use after free
Calling xwl_present_reset_timer explicitly passes NULL to TimerSet if
step 1 freed xwl_present_window->frame_timer, and it will allocate a new
one.
(cherry picked from commit 5e8b9a3a563047e3998d45e761f7a50e4b0f6cb3)
---
hw/xwayland/xwayland-present.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index 316e04443..7539c1636 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -216,24 +216,15 @@ xwl_present_timer_callback(OsTimerPtr timer,
void *arg)
{
struct xwl_present_window *xwl_present_window = arg;
- WindowPtr present_window = xwl_present_window->window;
- struct xwl_window *xwl_window = xwl_window_from_window(present_window);
xwl_present_window->frame_timer_firing = TRUE;
xwl_present_window->msc++;
xwl_present_window->ust = GetTimeInMicros();
xwl_present_events_notify(xwl_present_window);
+ xwl_present_reset_timer(xwl_present_window);
- if (xwl_present_has_events(xwl_present_window)) {
- /* Still events, restart timer */
- return xwl_present_is_flipping(present_window, xwl_window) ? TIMER_LEN_FLIP :
- TIMER_LEN_COPY;
- } else {
- /* No more events, do not restart timer and delete it instead */
- xwl_present_free_timer(xwl_present_window);
- return 0;
- }
+ return 0;
}
static void
--
2.19.2

View file

@ -1,72 +0,0 @@
From d2af650a280f94d7ddd155cb499110ab45135100 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Fri, 19 Oct 2018 16:04:32 +0200
Subject: [PATCH xserver] xwayland: do not crash if `gbm_bo_create()` fails
The function `xwl_glamor_gbm_create_pixmap()` first creates a buffer
objects and then creates the xwl_pixmap from it.
However, `xwl_glamor_gbm_create_pixmap_for_bo()` is not called if the
buffer object creation fails, and `xwl_glamor_gbm_create_pixmap()`
simply returns `glamor_create_pixmap()`.
The problem with this is that if `xwl_glamor_gbm_create_pixmap_for_bo()`
is not called then neither is `xwl_pixmap_set_private()` and further
calls to `xwl_pixmap_get()` will return NULL and cause a NULL pointer
dereference if the return value is not checked:
#0 xwl_glamor_gbm_get_wl_buffer_for_pixmap ()
at hw/xwayland/xwayland-glamor-gbm.c:248
#1 xwl_window_post_damage () at hw/xwayland/xwayland.c:697
#2 xwl_display_post_damage () at hw/xwayland/xwayland.c:759
#3 block_handler () at hw/xwayland/xwayland.c:890
#4 BlockHandler () at dix/dixutils.c:388
#5 WaitForSomething () at os/WaitFor.c:201
#6 Dispatch () at dix/dispatch.c:421
#7 dix_main () at dix/main.c:276
#8 __libc_start_main () at ../csu/libc-start.c:308
#9 _start ()
(gdb) print xwl_pixmap
$1 = (struct xwl_pixmap *) 0x0
Make sure we check for `xwl_pixmap_get()` returned value where relevant
and fail gracefully if this is the case.
See also: https://gitlab.gnome.org/GNOME/mutter/issues/340
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Marco Trevisan <mail@3v1n0.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 036794bebce72a3fa2f95996d2e537ff568e0ff1)
---
hw/xwayland/xwayland-glamor-gbm.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c
index 6aa1e4641d..5f8a68fd8c 100644
--- a/hw/xwayland/xwayland-glamor-gbm.c
+++ b/hw/xwayland/xwayland-glamor-gbm.c
@@ -244,6 +244,9 @@ xwl_glamor_gbm_get_wl_buffer_for_pixmap(PixmapPtr pixmap,
uint64_t modifier;
int i;
+ if (xwl_pixmap == NULL)
+ return NULL;
+
if (xwl_pixmap->buffer) {
/* Buffer already exists. Return it and inform caller if interested. */
if (created)
@@ -494,6 +497,9 @@ glamor_egl_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds,
xwl_pixmap = xwl_pixmap_get(pixmap);
+ if (xwl_pixmap == NULL)
+ return 0;
+
if (!xwl_pixmap->bo)
return 0;
--
2.19.1

View file

@ -1,62 +0,0 @@
From a352f979545723054b0a74862a56dc53b1be93fb Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofourdan@redhat.com>
Date: Tue, 8 Jan 2019 12:48:53 +0100
Subject: [PATCH xserver] xwayland: handle case without any crtc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Xwayland creates and destroys the CRTC along with the Wayland outputs,
so there is possibly a case where the number of CRTC drops to 0.
However, `xwl_present_get_crtc()` always return `crtcs[0]` which is
invalid when `numCrtcs` is 0.
That leads to crash if a client queries the Present capabilities when
there is no CRTC, the backtrace looks like:
#0 raise() from libc.so
#1 abort() from libc.so
#2 OsAbort() at utils.c:1350
#3 AbortServer() at log.c:879
#4 FatalError() at log.c:1017
#5 OsSigHandler() at osinit.c:156
#6 OsSigHandler() at osinit.c:110
#7 <signal handler called>
#8 main_arena() from libc.so
#9 proc_present_query_capabilities() at present_request.c:236
#10 Dispatch() at dispatch.c:478
#11 dix_main() at main.c:276
To avoid returning an invalid pointer (`crtcs[0]`) in that case, simply
check for `numCrtcs` being 0 and return `NULL` in that case.
Thanks to Michel Dänzer <michel.daenzer@amd.com> for pointing this as a
possible cause of the crash.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Bugzilla: https://bugzilla.redhat.com/1609181
(cherry picked from commit e8295c50209f2963fa2823e8de7e8363a38cd2d1)
---
hw/xwayland/xwayland-present.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index 980034db4..74fe84672 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -323,6 +323,10 @@ xwl_present_get_crtc(WindowPtr present_window)
return NULL;
rr_private = rrGetScrPriv(present_window->drawable.pScreen);
+
+ if (rr_private->numCrtcs == 0)
+ return NULL;
+
return rr_private->crtcs[0];
}
--
2.20.1

View file

@ -1,61 +0,0 @@
From bd4b3eb727b14133929d7bf04fed3829a632fc5b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
Date: Thu, 18 Oct 2018 17:36:24 +0200
Subject: [PATCH xserver 2/7] xwayland: Rename xwl_present_events_notify to
xwl_present_msc_bump
And consolidate more code from xwl_present_timer_callback and
xwl_present_frame_callback in it.
(cherry picked from commit 2bfc46d4147dc0bec4cdbb80431a0f4cc1d3b030)
---
hw/xwayland/xwayland-present.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index 7539c1636..117ce781d 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -192,11 +192,13 @@ static const struct wl_buffer_listener xwl_present_release_listener = {
};
static void
-xwl_present_events_notify(struct xwl_present_window *xwl_present_window)
+xwl_present_msc_bump(struct xwl_present_window *xwl_present_window)
{
- uint64_t msc = xwl_present_window->msc;
+ uint64_t msc = ++xwl_present_window->msc;
struct xwl_present_event *event, *tmp;
+ xwl_present_window->ust = GetTimeInMicros();
+
xorg_list_for_each_entry_safe(event, tmp,
&xwl_present_window->event_list,
list) {
@@ -218,10 +220,8 @@ xwl_present_timer_callback(OsTimerPtr timer,
struct xwl_present_window *xwl_present_window = arg;
xwl_present_window->frame_timer_firing = TRUE;
- xwl_present_window->msc++;
- xwl_present_window->ust = GetTimeInMicros();
- xwl_present_events_notify(xwl_present_window);
+ xwl_present_msc_bump(xwl_present_window);
xwl_present_reset_timer(xwl_present_window);
return 0;
@@ -242,10 +242,7 @@ xwl_present_frame_callback(void *data,
return;
}
- xwl_present_window->msc++;
- xwl_present_window->ust = GetTimeInMicros();
-
- xwl_present_events_notify(xwl_present_window);
+ xwl_present_msc_bump(xwl_present_window);
/* we do not need the timer anymore for this frame,
* reset it for potentially the next one
--
2.19.2

View file

@ -1,139 +0,0 @@
From 908c3b4c291e62e63677a75e125f6fd7706493aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
Date: Thu, 18 Oct 2018 17:42:01 +0200
Subject: [PATCH xserver 3/7] xwayland: Complete "synchronous" Present flips
from xwl_present_msc_bump
Completing them from xwl_present_sync_callback had at least two issues:
* It was before the MSC was incremented in xwl_present_frame_callback,
so the MSC value in the completion event could be lower than the
target specified by the client. This could cause hangs with the Mesa
Vulkan drivers.
* It allowed clients to run at a frame-rate higher than the Wayland
compositor's frame-rate, wasting energy on generating frames which
were never displayed. This isn't expected to happen unless the client
specified PresentOptionAsync (in which case flips are still completed
from xwl_present_sync_callback, allowing higher frame-rates).
v2:
* Make xwl_present_has_events return true when there's a pending
"synchronous" flip, so those complete after at most ~1 second even if
the Wayland server doesn't send a frame event.
Bugzilla: https://bugs.freedesktop.org/106713
(cherry picked from commit ace551d8a2603e37b18237a52f62d627c75d9e2a)
---
hw/xwayland/xwayland-present.c | 51 +++++++++++++++++++++++++++++-----
hw/xwayland/xwayland.h | 1 +
2 files changed, 45 insertions(+), 7 deletions(-)
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index 117ce781d..4f517d46b 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -85,7 +85,8 @@ xwl_present_timer_callback(OsTimerPtr timer,
static inline Bool
xwl_present_has_events(struct xwl_present_window *xwl_present_window)
{
- return !xorg_list_is_empty(&xwl_present_window->event_list) ||
+ return !!xwl_present_window->sync_flip ||
+ !xorg_list_is_empty(&xwl_present_window->event_list) ||
!xorg_list_is_empty(&xwl_present_window->release_queue);
}
@@ -139,6 +140,16 @@ xwl_present_cleanup(WindowPtr window)
}
/* Clear remaining buffer releases and inform Present about free ressources */
+ event = xwl_present_window->sync_flip;
+ xwl_present_window->sync_flip = NULL;
+ if (event) {
+ if (event->buffer_released) {
+ free(event);
+ } else {
+ event->pending = FALSE;
+ event->abort = TRUE;
+ }
+ }
xorg_list_for_each_entry_safe(event, tmp, &xwl_present_window->release_queue, list) {
xorg_list_del(&event->list);
event->abort = TRUE;
@@ -199,6 +210,24 @@ xwl_present_msc_bump(struct xwl_present_window *xwl_present_window)
xwl_present_window->ust = GetTimeInMicros();
+ event = xwl_present_window->sync_flip;
+ xwl_present_window->sync_flip = NULL;
+ if (event) {
+ event->pending = FALSE;
+
+ present_wnmd_event_notify(xwl_present_window->window, event->event_id,
+ xwl_present_window->ust, msc);
+
+ if (event->buffer_released) {
+ /* If the buffer was already released, clean up now */
+ present_wnmd_event_notify(xwl_present_window->window, event->event_id,
+ xwl_present_window->ust, msc);
+ free(event);
+ } else {
+ xorg_list_add(&event->list, &xwl_present_window->release_queue);
+ }
+ }
+
xorg_list_for_each_entry_safe(event, tmp,
&xwl_present_window->event_list,
list) {
@@ -454,12 +483,17 @@ xwl_present_flip(WindowPtr present_window,
event->event_id = event_id;
event->xwl_present_window = xwl_present_window;
event->buffer = buffer;
- event->target_msc = xwl_present_window->msc;
+ event->target_msc = target_msc;
event->pending = TRUE;
event->abort = FALSE;
event->buffer_released = FALSE;
- xorg_list_add(&event->list, &xwl_present_window->release_queue);
+ if (sync_flip) {
+ xorg_list_init(&event->list);
+ xwl_present_window->sync_flip = event;
+ } else {
+ xorg_list_add(&event->list, &xwl_present_window->release_queue);
+ }
if (buffer_created)
wl_buffer_add_listener(buffer, &xwl_present_release_listener, NULL);
@@ -488,10 +522,13 @@ xwl_present_flip(WindowPtr present_window,
wl_surface_commit(xwl_window->surface);
- xwl_present_window->sync_callback = wl_display_sync(xwl_window->xwl_screen->display);
- wl_callback_add_listener(xwl_present_window->sync_callback,
- &xwl_present_sync_listener,
- event);
+ if (!sync_flip) {
+ xwl_present_window->sync_callback =
+ wl_display_sync(xwl_window->xwl_screen->display);
+ wl_callback_add_listener(xwl_present_window->sync_callback,
+ &xwl_present_sync_listener,
+ event);
+ }
wl_display_flush(xwl_window->xwl_screen->display);
return TRUE;
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 67819e178..3f4a601fe 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -188,6 +188,7 @@ struct xwl_window {
#ifdef GLAMOR_HAS_GBM
struct xwl_present_window {
struct xwl_screen *xwl_screen;
+ struct xwl_present_event *sync_flip;
WindowPtr window;
struct xorg_list link;
--
2.19.2

View file

@ -1,213 +0,0 @@
From 5a1cb0989274fd745569a60c28c9a5ca729cabf6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
Date: Thu, 1 Nov 2018 18:44:24 +0100
Subject: [PATCH xserver 4/7] xwayland: Replace xwl_window::present_window with
::present_flipped
There's no need to keep track of the window which last performed a
Present flip. This fixes crashes due to the assertion in
xwl_present_flips_stop failing. Fixes issue #10.
The damage generated by a flip only needs to be ignored once, then
xwl_window::present_flipped can be cleared. This may fix freezing in
the (hypothetical) scenario where Present flips are performed on a
window, followed by other drawing requests using the window as the
destination, but nothing triggering xwl_present_flips_stop. The damage
from the latter drawing requests would continue being ignored.
(cherry picked from commit 6b016d58d23d16eaae9908a92ed90547d1926317)
---
hw/xwayland/xwayland-present.c | 56 ++++++++--------------------------
hw/xwayland/xwayland.c | 17 ++++++++---
hw/xwayland/xwayland.h | 4 ++-
3 files changed, 27 insertions(+), 50 deletions(-)
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index 4f517d46b..e6dca5ed0 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -90,24 +90,19 @@ xwl_present_has_events(struct xwl_present_window *xwl_present_window)
!xorg_list_is_empty(&xwl_present_window->release_queue);
}
-static inline Bool
-xwl_present_is_flipping(WindowPtr window, struct xwl_window *xwl_window)
-{
- return xwl_window && xwl_window->present_window == window;
-}
-
static void
xwl_present_reset_timer(struct xwl_present_window *xwl_present_window)
{
if (xwl_present_has_events(xwl_present_window)) {
- WindowPtr present_window = xwl_present_window->window;
- Bool is_flipping = xwl_present_is_flipping(present_window,
- xwl_window_from_window(present_window));
+ CARD32 timeout;
+
+ if (xwl_present_window->frame_callback)
+ timeout = TIMER_LEN_FLIP;
+ else
+ timeout = TIMER_LEN_COPY;
xwl_present_window->frame_timer = TimerSet(xwl_present_window->frame_timer,
- 0,
- is_flipping ? TIMER_LEN_FLIP :
- TIMER_LEN_COPY,
+ 0, timeout,
&xwl_present_timer_callback,
xwl_present_window);
} else {
@@ -118,16 +113,12 @@ xwl_present_reset_timer(struct xwl_present_window *xwl_present_window)
void
xwl_present_cleanup(WindowPtr window)
{
- struct xwl_window *xwl_window = xwl_window_from_window(window);
struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window);
struct xwl_present_event *event, *tmp;
if (!xwl_present_window)
return;
- if (xwl_window && xwl_window->present_window == window)
- xwl_window->present_window = NULL;
-
if (xwl_present_window->frame_callback) {
wl_callback_destroy(xwl_present_window->frame_callback);
xwl_present_window->frame_callback = NULL;
@@ -361,10 +352,6 @@ xwl_present_queue_vblank(WindowPtr present_window,
if (!xwl_window)
return BadMatch;
- if (xwl_window->present_window &&
- xwl_window->present_window != present_window)
- return BadMatch;
-
event = malloc(sizeof *event);
if (!event)
return BadAlloc;
@@ -433,13 +420,6 @@ xwl_present_check_flip2(RRCrtcPtr crtc,
if (!xwl_window)
return FALSE;
- /*
- * Do not flip if there is already another child window doing flips.
- */
- if (xwl_window->present_window &&
- xwl_window->present_window != present_window)
- return FALSE;
-
/*
* We currently only allow flips of windows, that have the same
* dimensions as their xwl_window parent window. For the case of
@@ -476,8 +456,6 @@ xwl_present_flip(WindowPtr present_window,
if (!event)
return FALSE;
- xwl_window->present_window = present_window;
-
buffer = xwl_glamor_pixmap_get_wl_buffer(pixmap, &buffer_created);
event->event_id = event_id;
@@ -502,13 +480,6 @@ xwl_present_flip(WindowPtr present_window,
/* We can flip directly to the main surface (full screen window without clips) */
wl_surface_attach(xwl_window->surface, buffer, 0, 0);
- if (!xwl_present_window->frame_timer ||
- xwl_present_window->frame_timer_firing) {
- /* Realign timer */
- xwl_present_window->frame_timer_firing = FALSE;
- xwl_present_reset_timer(xwl_present_window);
- }
-
if (!xwl_present_window->frame_callback) {
xwl_present_window->frame_callback = wl_surface_frame(xwl_window->surface);
wl_callback_add_listener(xwl_present_window->frame_callback,
@@ -516,6 +487,10 @@ xwl_present_flip(WindowPtr present_window,
xwl_present_window);
}
+ /* Realign timer */
+ xwl_present_window->frame_timer_firing = FALSE;
+ xwl_present_reset_timer(xwl_present_window);
+
wl_surface_damage(xwl_window->surface, 0, 0,
damage_box->x2 - damage_box->x1,
damage_box->y2 - damage_box->y1);
@@ -531,22 +506,15 @@ xwl_present_flip(WindowPtr present_window,
}
wl_display_flush(xwl_window->xwl_screen->display);
+ xwl_window->present_flipped = TRUE;
return TRUE;
}
static void
xwl_present_flips_stop(WindowPtr window)
{
- struct xwl_window *xwl_window = xwl_window_from_window(window);
struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window);
- if (!xwl_window)
- return;
-
- assert(xwl_window->present_window == window);
-
- xwl_window->present_window = NULL;
-
/* Change back to the fast refresh rate */
xwl_present_reset_timer(xwl_present_window);
}
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 96b4db18c..988b8e17d 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -370,6 +370,18 @@ damage_report(DamagePtr pDamage, RegionPtr pRegion, void *data)
struct xwl_window *xwl_window = data;
struct xwl_screen *xwl_screen = xwl_window->xwl_screen;
+#ifdef GLAMOR_HAS_GBM
+ if (xwl_window->present_flipped) {
+ /* This damage is from a Present flip, which already committed a new
+ * buffer for the surface, so we don't need to do anything in response
+ */
+ RegionEmpty(DamageRegion(pDamage));
+ xorg_list_del(&xwl_window->link_damage);
+ xwl_window->present_flipped = FALSE;
+ return;
+ }
+#endif
+
xorg_list_add(&xwl_window->link_damage, &xwl_screen->damage_window_list);
}
@@ -721,11 +733,6 @@ 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)
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 3f4a601fe..a79f836ad 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -182,7 +182,9 @@ struct xwl_window {
struct xorg_list link_damage;
struct wl_callback *frame_callback;
Bool allow_commits;
- WindowPtr present_window;
+#ifdef GLAMOR_HAS_GBM
+ Bool present_flipped;
+#endif
};
#ifdef GLAMOR_HAS_GBM
--
2.19.2

View file

@ -1,77 +0,0 @@
From cd243d4c858d9193ba0eeab778c488b74505d0e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
Date: Thu, 1 Nov 2018 18:24:28 +0100
Subject: [PATCH xserver 5/7] xwayland: Add xwl_present_unrealize_window
When a window is unrealized, a pending frame callback may never be
called, which could result in repeatedly freezing until the frame timer
fires after a second.
Fixes these symptoms when switching from fullscreen to windowed mode in
sauerbraten.
(cherry picked from commit 8c9538573cb9a342897eb3fb4b0c1e4ed917bd0e)
---
hw/xwayland/xwayland-present.c | 16 ++++++++++++++++
hw/xwayland/xwayland.c | 5 +++++
hw/xwayland/xwayland.h | 1 +
3 files changed, 22 insertions(+)
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index e6dca5ed0..7e49cb366 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -519,6 +519,22 @@ xwl_present_flips_stop(WindowPtr window)
xwl_present_reset_timer(xwl_present_window);
}
+void
+xwl_present_unrealize_window(WindowPtr window)
+{
+ struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window);
+
+ if (!xwl_present_window || !xwl_present_window->frame_callback)
+ return;
+
+ /* The pending frame callback may never be called, so drop it and shorten
+ * the frame timer interval.
+ */
+ wl_callback_destroy(xwl_present_window->frame_callback);
+ xwl_present_window->frame_callback = NULL;
+ xwl_present_reset_timer(xwl_present_window);
+}
+
static present_wnmd_info_rec xwl_present_info = {
.version = PRESENT_SCREEN_INFO_VERSION,
.get_crtc = xwl_present_get_crtc,
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 988b8e17d..7e6e0ab25 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -609,6 +609,11 @@ xwl_unrealize_window(WindowPtr window)
xwl_screen->UnrealizeWindow = screen->UnrealizeWindow;
screen->UnrealizeWindow = xwl_unrealize_window;
+#ifdef GLAMOR_HAS_GBM
+ if (xwl_screen->present)
+ xwl_present_unrealize_window(window);
+#endif
+
xwl_window = xwl_window_get(window);
if (!xwl_window)
return ret;
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index a79f836ad..463622669 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -454,6 +454,7 @@ void xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen);
#ifdef GLAMOR_HAS_GBM
Bool xwl_present_init(ScreenPtr screen);
void xwl_present_cleanup(WindowPtr window);
+void xwl_present_unrealize_window(WindowPtr window);
#endif /* GLAMOR_HAS_GBM */
#ifdef XV
--
2.19.2

View file

@ -1,36 +0,0 @@
From 679aa2a629e09aba00f26c819431e7d3a9113834 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
Date: Fri, 9 Nov 2018 17:18:53 +0100
Subject: [PATCH xserver 6/7] xwayland: Don't need xwl_window anymore in
xwl_present_queue_vblank
Fixes issue #12. Presumably the problem was that Present operations on
unmapped windows were executed immediately instead of only when reaching
the target MSC.
(cherry picked from commit f541615342ce6bfb0e6d4e68deb3a924a87e8ba9)
---
hw/xwayland/xwayland-present.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index 7e49cb366..eea7415f3 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -345,13 +345,9 @@ xwl_present_queue_vblank(WindowPtr present_window,
uint64_t event_id,
uint64_t msc)
{
- struct xwl_window *xwl_window = xwl_window_from_window(present_window);
struct xwl_present_window *xwl_present_window = xwl_present_window_get_priv(present_window);
struct xwl_present_event *event;
- if (!xwl_window)
- return BadMatch;
-
event = malloc(sizeof *event);
if (!event)
return BadAlloc;
--
2.19.2

View file

@ -1,37 +0,0 @@
From 354ed9fa48118026456ec2bc64136993f3c53606 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
Date: Thu, 15 Nov 2018 17:16:59 +0100
Subject: [PATCH xserver 7/7] xwayland: Don't take buffer release queue into
account for frame timer
The buffer release queue has two kinds of entries:
* Pending async flips.
* Completed flips waiting for their buffer to be released by the Wayland
compositor.
xwl_present_timer_callback neither completes async flips nor releases
buffers, so the timer isn't needed for the buffer release queue.
(cherry picked from commit e6cd1c9bdefe83e7d99b703a68d26eebb451f889)
---
hw/xwayland/xwayland-present.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index eea7415f3..594e2e822 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -86,8 +86,7 @@ static inline Bool
xwl_present_has_events(struct xwl_present_window *xwl_present_window)
{
return !!xwl_present_window->sync_flip ||
- !xorg_list_is_empty(&xwl_present_window->event_list) ||
- !xorg_list_is_empty(&xwl_present_window->release_queue);
+ !xorg_list_is_empty(&xwl_present_window->event_list);
}
static void
--
2.19.2

View file

@ -1,38 +0,0 @@
# Collection of quirks and blacklist/whitelists for specific devices.
# Accelerometer device, posts data through ABS_X/ABS_Y, making X unusable
# http://bugs.freedesktop.org/show_bug.cgi?id=22442
Section "InputClass"
Identifier "ThinkPad HDAPS accelerometer blacklist"
MatchProduct "ThinkPad HDAPS accelerometer data"
Option "Ignore" "on"
EndSection
# https://bugzilla.redhat.com/show_bug.cgi?id=523914
# Mouse does not move in PV Xen guest
# Explicitly tell evdev to not ignore the absolute axes.
Section "InputClass"
Identifier "Xen Virtual Pointer axis blacklist"
MatchProduct "Xen Virtual Pointer"
Option "IgnoreAbsoluteAxes" "off"
Option "IgnoreRelativeAxes" "off"
EndSection
# https://bugs.freedesktop.org/show_bug.cgi?id=55867
# Bug 55867 - Doesn't know how to tag XI_TRACKBALL
Section "InputClass"
Identifier "Tag trackballs as XI_TRACKBALL"
MatchProduct "trackball"
MatchDriver "evdev"
Option "TypeName" "TRACKBALL"
EndSection
# https://bugs.freedesktop.org/show_bug.cgi?id=62831
# Bug 62831 - Mionix Naos 5000 mouse detected incorrectly
Section "InputClass"
Identifier "Tag Mionix Naos 5000 mouse XI_MOUSE"
MatchProduct "La-VIEW Technology Naos 5000 Mouse"
MatchDriver "evdev"
Option "TypeName" "MOUSE"
EndSection

View file

@ -1,30 +0,0 @@
# Makefile for source rpm: xorg-x11-server
# $Id$
NAME := xorg-x11-server
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attempt a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)
ifeq ($(MAKECMDGOALS),me a sandwich)
.PHONY :: me a sandwich
me a:
@:
sandwich:
@[ `id -u` -ne 0 ] && echo "What? Make it yourself." || echo Okay.
endif

View file

@ -1 +0,0 @@
d13cb974426f7f1110b0bdb08c4ebb46ff8975f7

306
gitignore
View file

@ -1,306 +0,0 @@
Makefile
Makefile.in
.deps
.libs
.msg
*.lo
*.la
*.a
*.o
*~
.*sw?
*.pbxuser
*.mode1v3
obj*
build*
local
aclocal.m4
autom4te.cache
compile
config.guess
config.log
config.status
config.sub
configure
configure.lineno
depcomp
install-sh
libtool
ltmain.sh
missing
TAGS
tags
ylwrap
xorg-server.pc
stamp-h?
do-not-use-config.h
do-not-use-config.h.in
afb/afbbltC.c
afb/afbbltCI.c
afb/afbbltG.c
afb/afbbltO.c
afb/afbbltX.c
afb/afbseg.c
afb/afbtileC.c
afb/afbtileG.c
cfb/cfb8lineCO.c
cfb/cfb8lineCP.c
cfb/cfb8lineG.c
cfb/cfb8lineX.c
cfb/cfb8segC.c
cfb/cfb8segCS.c
cfb/cfb8segX.c
cfb/cfb8setG.c
cfb/cfbbltC.c
cfb/cfbbltG.c
cfb/cfbbltO.c
cfb/cfbbltX.c
cfb/cfbfillarcC.c
cfb/cfbfillarcG.c
cfb/cfbglrop8.c
cfb/cfbply1rctC.c
cfb/cfbply1rctG.c
cfb/cfbseg.c
cfb/cfbsolidC.c
cfb/cfbsolidG.c
cfb/cfbsolidX.c
cfb/cfbtile32C.c
cfb/cfbtile32G.c
cfb/cfbtileoddC.c
cfb/cfbtileoddG.c
cfb/cfbzerarcC.c
cfb/cfbzerarcG.c
cfb/cfbzerarcX.c
cfb32/cfb8lineCO.c
cfb32/cfb8lineCP.c
cfb32/cfb8lineG.c
cfb32/cfb8lineX.c
cfb32/cfb8segC.c
cfb32/cfb8segCS.c
cfb32/cfb8segX.c
cfb32/cfb8setG.c
cfb32/cfbbltC.c
cfb32/cfbbltG.c
cfb32/cfbbltO.c
cfb32/cfbbltX.c
cfb32/cfbfillarcC.c
cfb32/cfbfillarcG.c
cfb32/cfbply1rctC.c
cfb32/cfbply1rctG.c
cfb32/cfbseg.c
cfb32/cfbsolidC.c
cfb32/cfbsolidG.c
cfb32/cfbsolidX.c
cfb32/cfbtile32C.c
cfb32/cfbtile32G.c
cfb32/cfbtileoddC.c
cfb32/cfbtileoddG.c
cfb32/cfbzerarcC.c
cfb32/cfbzerarcG.c
cfb32/cfbzerarcX.c
doc/Xserver.1x
doc/Xserver.man
hw/dmx/Xdmx
hw/dmx/Xdmx.1x
hw/dmx/config/dmxtodmx
hw/dmx/config/dmxtodmx.1x
hw/dmx/config/parser.c
hw/dmx/config/parser.h
hw/dmx/config/scanner.c
hw/dmx/config/vdltodmx
hw/dmx/config/vdltodmx.1x
hw/dmx/config/xdmxconfig
hw/dmx/config/xdmxconfig.1x
hw/dmx/examples/dmxaddinput
hw/dmx/examples/dmxaddscreen
hw/dmx/examples/dmxreconfig
hw/dmx/examples/dmxresize
hw/dmx/examples/dmxrminput
hw/dmx/examples/dmxrmscreen
hw/dmx/examples/dmxwininfo
hw/dmx/examples/ev
hw/dmx/examples/evi
hw/dmx/examples/res
hw/dmx/examples/xbell
hw/dmx/examples/xdmx
hw/dmx/examples/xinput
hw/dmx/examples/xled
hw/dmx/examples/xtest
hw/kdrive/ati/Xati
hw/kdrive/chips/Xchips
hw/kdrive/ephyr/Xephyr
hw/kdrive/epson/Xepson
hw/kdrive/fake/Xfake
hw/kdrive/fbdev/Xfbdev
hw/kdrive/i810/Xi810
hw/kdrive/mach64/Xmach64
hw/kdrive/mga/Xmga
hw/kdrive/neomagic/Xneomagic
hw/kdrive/nvidia/Xnvidia
hw/kdrive/pm2/Xpm2
hw/kdrive/r128/Xr128
hw/kdrive/sdl/Xsdl
hw/kdrive/sis300/Xsis
hw/kdrive/smi/Xsmi
hw/kdrive/vesa/Xvesa
hw/kdrive/via/Xvia
hw/vfb/Xvfb
hw/vfb/Xvfb.1x
hw/vfb/Xvfb.man
hw/xfree86/Xorg
hw/xfree86/common/xf86Build.h
hw/xfree86/common/xf86DefModeSet.c
hw/xfree86/doc/man/Xorg.1x
hw/xfree86/doc/man/Xorg.man
hw/xfree86/doc/man/xorg.conf.5x
hw/xfree86/doc/man/xorg.conf.man
hw/xfree86/exa/exa.4
hw/xfree86/exa/exa.4x
hw/xfree86/exa/exa.man
hw/xfree86/fbdevhw/fbdevhw.4x
hw/xfree86/fbdevhw/fbdevhw.man
hw/xfree86/getconfig/cfg.man
hw/xfree86/getconfig/getconfig.1x
hw/xfree86/getconfig/getconfig.5x
hw/xfree86/getconfig/getconfig.man
hw/xfree86/os-support/xorgos.c
hw/xfree86/osandcommon.c
hw/xfree86/ramdac/xf86BitOrder.c
hw/xfree86/scanpci/xf86PciData.c
hw/xfree86/scanpci/xf86PciIds.h
hw/xfree86/utils/cvt/cvt
hw/xfree86/utils/cvt/cvt.man
hw/xfree86/utils/gtf/gtf
hw/xfree86/utils/gtf/gtf.1x
hw/xfree86/utils/gtf/gtf.man
hw/xfree86/utils/ioport/inb
hw/xfree86/utils/ioport/inl
hw/xfree86/utils/ioport/inw
hw/xfree86/utils/ioport/ioport
hw/xfree86/utils/ioport/outb
hw/xfree86/utils/ioport/outl
hw/xfree86/utils/ioport/outw
hw/xfree86/utils/pcitweak/pcitweak
hw/xfree86/utils/pcitweak/pcitweak.1x
hw/xfree86/utils/pcitweak/pcitweak.man
hw/xfree86/utils/scanpci/scanpci
hw/xfree86/utils/scanpci/scanpci.1x
hw/xfree86/utils/scanpci/scanpci.man
hw/xfree86/utils/xorgcfg/XOrgCfg
hw/xfree86/utils/xorgcfg/xorgcfg
hw/xfree86/utils/xorgcfg/xorgcfg.1x
hw/xfree86/utils/xorgcfg/xorgcfg.man
hw/xfree86/utils/xorgconfig/xorgconfig
hw/xfree86/utils/xorgconfig/xorgconfig.1x
hw/xfree86/utils/xorgconfig/xorgconfig.man
hw/xfree86/xaa/l-xaaBitmap.c
hw/xfree86/xaa/l-xaaStipple.c
hw/xfree86/xaa/l-xaaTEGlyph.c
hw/xfree86/xaa/l3-xaaBitmap.c
hw/xfree86/xaa/l3-xaaStipple.c
hw/xfree86/xaa/lf-xaaBitmap.c
hw/xfree86/xaa/lf-xaaStipple.c
hw/xfree86/xaa/lf-xaaTEGlyph.c
hw/xfree86/xaa/lf3-xaaBitmap.c
hw/xfree86/xaa/lf3-xaaStipple.c
hw/xfree86/xaa/m-xaaBitmap.c
hw/xfree86/xaa/m-xaaStipple.c
hw/xfree86/xaa/m-xaaTEGlyph.c
hw/xfree86/xaa/m3-xaaBitmap.c
hw/xfree86/xaa/m3-xaaStipple.c
hw/xfree86/xaa/mf-xaaBitmap.c
hw/xfree86/xaa/mf-xaaStipple.c
hw/xfree86/xaa/mf-xaaTEGlyph.c
hw/xfree86/xaa/mf3-xaaBitmap.c
hw/xfree86/xaa/mf3-xaaStipple.c
hw/xfree86/xaa/s-xaaDashLine.c
hw/xfree86/xaa/s-xaaLine.c
hw/xfree86/xf1bpp/maskbits.c
hw/xfree86/xf1bpp/mfbbitblt.c
hw/xfree86/xf1bpp/mfbbltC.c
hw/xfree86/xf1bpp/mfbbltCI.c
hw/xfree86/xf1bpp/mfbbltG.c
hw/xfree86/xf1bpp/mfbbltO.c
hw/xfree86/xf1bpp/mfbbltX.c
hw/xfree86/xf1bpp/mfbbres.c
hw/xfree86/xf1bpp/mfbbresd.c
hw/xfree86/xf1bpp/mfbclip.c
hw/xfree86/xf1bpp/mfbcmap.c
hw/xfree86/xf1bpp/mfbfillarc.c
hw/xfree86/xf1bpp/mfbfillrct.c
hw/xfree86/xf1bpp/mfbfillsp.c
hw/xfree86/xf1bpp/mfbfont.c
hw/xfree86/xf1bpp/mfbgc.c
hw/xfree86/xf1bpp/mfbgetsp.c
hw/xfree86/xf1bpp/mfbigbblak.c
hw/xfree86/xf1bpp/mfbigbwht.c
hw/xfree86/xf1bpp/mfbhrzvert.c
hw/xfree86/xf1bpp/mfbimage.c
hw/xfree86/xf1bpp/mfbline.c
hw/xfree86/xf1bpp/mfbmisc.c
hw/xfree86/xf1bpp/mfbpablack.c
hw/xfree86/xf1bpp/mfbpainv.c
hw/xfree86/xf1bpp/mfbpawhite.c
hw/xfree86/xf1bpp/mfbpgbblak.c
hw/xfree86/xf1bpp/mfbpgbinv.c
hw/xfree86/xf1bpp/mfbpgbwht.c
hw/xfree86/xf1bpp/mfbpixmap.c
hw/xfree86/xf1bpp/mfbplyblack.c
hw/xfree86/xf1bpp/mfbplyinv.c
hw/xfree86/xf1bpp/mfbplywhite.c
hw/xfree86/xf1bpp/mfbpntwin.c
hw/xfree86/xf1bpp/mfbpolypnt.c
hw/xfree86/xf1bpp/mfbpushpxl.c
hw/xfree86/xf1bpp/mfbscrclse.c
hw/xfree86/xf1bpp/mfbscrinit.c
hw/xfree86/xf1bpp/mfbseg.c
hw/xfree86/xf1bpp/mfbsetsp.c
hw/xfree86/xf1bpp/mfbteblack.c
hw/xfree86/xf1bpp/mfbtewhite.c
hw/xfree86/xf1bpp/mfbtileC.c
hw/xfree86/xf1bpp/mfbtileG.c
hw/xfree86/xf1bpp/mfbwindow.c
hw/xfree86/xf1bpp/mfbzerarc.c
hw/xfree86/xf4bpp/mfbseg.c
hw/xfree86/xf8_32bpp/cfbgc32.c
hw/xfree86/xf8_32bpp/cfbgc8.c
hw/xfree86/xorg.c
hw/xfree86/xorg.conf.example
hw/xfree86/xorg.conf.example.pre
hw/xnest/Xnest
hw/xnest/Xnest.1x
hw/xnest/Xnest.man
hw/xprint/Xprt
hw/xprint/config/C/print/Xprinters.ghostscript
hw/xprint/doc/Xprt.1x
hw/xprint/doc/Xprt.man
hw/xprint/dpmsstubs-wrapper.c
hw/xprint/miinitext-wrapper.c
include/dix-config.h
include/kdrive-config.h
include/xgl-config.h
include/xkb-config.h
include/xorg-config.h
include/xorg-server.h
include/xwin-config.h
mfb/mfbbltC.c
mfb/mfbbltCI.c
mfb/mfbbltG.c
mfb/mfbbltO.c
mfb/mfbbltX.c
mfb/mfbigbblak.c
mfb/mfbigbwht.c
mfb/mfbpablack.c
mfb/mfbpainv.c
mfb/mfbpawhite.c
mfb/mfbpgbblak.c
mfb/mfbpgbinv.c
mfb/mfbpgbwht.c
mfb/mfbplyblack.c
mfb/mfbplyinv.c
mfb/mfbplywhite.c
mfb/mfbseg.c
mfb/mfbteblack.c
mfb/mfbtewhite.c
mfb/mfbtileC.c
mfb/mfbtileG.c

View file

@ -1,6 +0,0 @@
xorg-x11-server-1_5_0-1_fc10:HEAD:xorg-x11-server-1.5.0-1.fc10.src.rpm:1220485219
xorg-x11-server-1_5_1-1_fc10:HEAD:xorg-x11-server-1.5.1-1.fc10.src.rpm:1222198557
xorg-x11-server-1_5_2-1_fc10:HEAD:xorg-x11-server-1.5.2-1.fc10.src.rpm:1223667007
xorg-x11-server-1_5_3-1_fc10:HEAD:xorg-x11-server-1.5.3-1.fc10.src.rpm:1225918317
xorg-x11-server-1_6_0-1_fc11:HEAD:xorg-x11-server-1.6.0-1.fc11.src.rpm:1235594175
xorg-x11-server-1_6_1-1_fc11:HEAD:xorg-x11-server-1.6.1-1.fc11.src.rpm:1239742477

View file

@ -1,17 +0,0 @@
#!/bin/sh
DIRNAME=xorg-server-$( date +%Y%m%d )
rm -rf $DIRNAME
git clone git://git.freedesktop.org/git/xorg/xserver $DIRNAME
cd $DIRNAME
if [ -z "$1" ]; then
git log | head -1
else
git checkout $1
fi
git log | head -1 | awk '{ print $2 }' > ../commitid
git repack -a -d
cd ..
tar cf - $DIRNAME | xz -c9 > $DIRNAME.tar.xz
rm -rf $DIRNAME

View file

@ -1 +1 @@
SHA512 (xorg-server-1.20.3.tar.bz2) = ee44554f86df4297f54c5871fe7a18954eeef4338775a25f36d6577b279c4775f61128da71b86cfaeadcc080838d6749dede138d4db178866579da2056543fba
SHA512 (xorg-server-21.1.21.tar.xz) = bb2eb4e6756eb9e38b61bd47c017da44bcf5f45f2b7a906b4bb3a56b3d791cec64abb9bf37b224efe1e4fab9cc296f3672c9b2f8e00e1cdfc54337bef63cd16c

File diff suppressed because it is too large Load diff

View file

@ -1,54 +0,0 @@
From patchwork Wed May 23 09:43:32 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [xserver,
1/2] glamor: Always return 0 from glamor_fds_from_pixmap on error
From: =?utf-8?q?Michel_D=C3=A4nzer?= <michel@daenzer.net>
X-Patchwork-Id: 224909
Message-Id: <20180523094333.11076-1-michel@daenzer.net>
To: =?UTF-8?q?Louis-Francis=20Ratt=C3=A9-Boulianne?= <lfrb@collabora.com>,
Daniel Stone <daniels@collabora.com>
Cc: xorg-devel@lists.x.org
Date: Wed, 23 May 2018 11:43:32 +0200
From: Michel Dänzer <michel.daenzer@amd.com>
This matches what glamor_egl_fds_from_pixmap and dri3_fds_from_pixmap do
and what proc_dri3_buffers_from_pixmap expects.
Fixes: c8c276c9569b "glamor: Implement PixmapFromBuffers and
BuffersFromPixmap"
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
glamor/glamor.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/glamor/glamor.c b/glamor/glamor.c
index d984d20f3..e2c74d17a 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -836,20 +836,20 @@ glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds,
glamor_get_screen_private(pixmap->drawable.pScreen);
if (!glamor_priv->dri3_enabled)
- return -1;
+ return 0;
switch (pixmap_priv->type) {
case GLAMOR_TEXTURE_DRM:
case GLAMOR_TEXTURE_ONLY:
if (!glamor_pixmap_ensure_fbo(pixmap, pixmap->drawable.depth == 30 ?
GL_RGB10_A2 : GL_RGBA, 0))
- return -1;
+ return 0;
return glamor_egl_fds_from_pixmap(screen, pixmap, fds,
strides, offsets,
modifier);
default:
break;
}
- return -1;
+ return 0;
}
_X_EXPORT int

View file

@ -1,58 +0,0 @@
From patchwork Wed May 23 09:43:33 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [xserver, 2/2] glamor: Propagate glamor_fds_from_pixmap error in
glamor_fd_from_pixmap
From: =?utf-8?q?Michel_D=C3=A4nzer?= <michel@daenzer.net>
X-Patchwork-Id: 224910
Message-Id: <20180523094333.11076-2-michel@daenzer.net>
To: =?UTF-8?q?Louis-Francis=20Ratt=C3=A9-Boulianne?= <lfrb@collabora.com>,
Daniel Stone <daniels@collabora.com>
Cc: xorg-devel@lists.x.org
Date: Wed, 23 May 2018 11:43:33 +0200
From: Michel Dänzer <michel.daenzer@amd.com>
glamor_fds_from_pixmap returns 0 on error, but we were treating that as
success, continuing with uninitialized stride and fd values.
Also bail if the offset isn't 0, same as in dri3_fd_from_pixmap.
Fixes: c8c276c9569b "glamor: Implement PixmapFromBuffers and
BuffersFromPixmap"
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
---
glamor/glamor.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/glamor/glamor.c b/glamor/glamor.c
index e2c74d17a..63f0947fa 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -865,17 +865,15 @@ glamor_fd_from_pixmap(ScreenPtr screen,
&modifier);
/* Pixmaps with multi-planes/modifier are not supported in this interface */
- if (ret > 1) {
- while (ret > 0)
- close(fds[--ret]);
- return -1;
+ if (ret == 1 && offsets[0] == 0) {
+ *stride = strides[0];
+ *size = pixmap->drawable.height * *stride;
+ return fds[0];
}
- ret = fds[0];
- *stride = strides[0];
- *size = pixmap->drawable.height * *stride;
-
- return ret;
+ while (ret > 0)
+ close(fds[--ret]);
+ return -1;
}
_X_EXPORT int

View file

@ -1,14 +0,0 @@
#!/bin/sh
#
# The X server provides capabilities of the form:
#
# Provides: xserver-abi(ansic-0) = 4
#
# for an ABI version of 0.4. The major number is encoded into the name so
# that major number changes force upgrades. If we didn't, then
#
# Requires: xserver-abi(ansic) >= 0.4
#
# would also match 1.0, which is wrong since major numbers mean an ABI break.
echo "xserver-abi($1-@MAJOR@) >= @MINOR@"

View file

@ -1,19 +0,0 @@
#!/bin/sh
#
# The X server provides capabilities of the form:
#
# Provides: xserver-abi(ansic-0) = 4
#
# for an ABI version of 0.4. The major number is encoded into the name so
# that major number changes force upgrades. If we didn't, then
#
# Requires: xserver-abi(ansic) >= 0.4
#
# would also match 1.0, which is wrong since major numbers mean an ABI break.
ver=$(pkg-config --variable abi_$1 xorg-server)
major=$(echo $ver | cut -f 1 -d .)
minor=$(echo $ver | cut -f 2 -d .)
echo "xserver-abi($1-$major) >= $minor"

View file

@ -1,5 +1,4 @@
#%PAM-1.0
auth sufficient pam_rootok.so
auth required pam_console.so
account required pam_permit.so
session optional pam_keyinit.so force revoke

View file

@ -101,7 +101,7 @@ find_free_servernum() {
# Parse the command line.
ARGS=$(getopt --options +ade:f:hn:lp:s:w: \
--long auto-servernum,error-file:auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait: \
--long auto-servernum,error-file:,auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait: \
--name "$PROGNAME" -- "$@")
GETOPT_STATUS=$?
@ -120,7 +120,7 @@ while :; do
-f|--auth-file) AUTHFILE="$2"; shift ;;
-h|--help) SHOWHELP="yes" ;;
-n|--server-num) SERVERNUM="$2"; shift ;;
-l|--listen-tcp) LISTENTCP="" ;;
-l|--listen-tcp) LISTENTCP="-listen tcp" ;;
-p|--xauth-protocol) XAUTHPROTO="$2"; shift ;;
-s|--server-args) XVFBARGS="$2"; shift ;;
-w|--wait) STARTWAIT="$2"; shift ;;