Commit Graph

17308 Commits

Author SHA1 Message Date
Michel Dänzer
a52122c7f2 gitlab-ci: Use sorted lists of distro packages, one per line
This will make it easier to review changes.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2020-01-06 15:52:31 +01:00
Michel Dänzer
37a64ede3b gitlab-ci: Strip down docker image contents more
Making the image significantly smaller.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2020-01-06 15:52:27 +01:00
Michel Dänzer
23b72d8e4b gitlab-ci: Use -j4 instead of -j$(proc)
The shared GitLab CI runners are configured for jobs making use of up
to 4 CPU cores, attempting to use more may overload them.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2020-01-06 15:52:24 +01:00
Michel Dänzer
9107a610de gitlab-ci: Use host-mapped directory for ccache
Same as done in Mesa.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2020-01-06 15:44:56 +01:00
Aaron Plattner
4226c6d032 modesetting: Check whether RandR was initialized before calling rrGetScrPriv
Calling rrGetScrPriv when RandR isn't initialized causes an assertion
failure that aborts the server:

 Xorg: ../include/privates.h:121: dixGetPrivateAddr: Assertion `key->initialized' failed.

 Thread 1 "Xorg" received signal SIGABRT, Aborted.
 0x00007ffff78a8f25 in raise () from /usr/lib/libc.so.6
 (gdb) bt
 #0  0x00007ffff78a8f25 in raise () from /usr/lib/libc.so.6
 #1  0x00007ffff7892897 in abort () from /usr/lib/libc.so.6
 #2  0x00007ffff7892767 in __assert_fail_base.cold () from /usr/lib/libc.so.6
 #3  0x00007ffff78a1526 in __assert_fail () from /usr/lib/libc.so.6
 #4  0x00007ffff7fb57c1 in dixGetPrivateAddr (privates=0x555555ab1b60, key=0x555555855720 <rrPrivKeyRec>) at ../include/privates.h:121
 #5  0x00007ffff7fb5822 in dixGetPrivate (privates=0x555555ab1b60, key=0x555555855720 <rrPrivKeyRec>) at ../include/privates.h:136
 #6  0x00007ffff7fb586a in dixLookupPrivate (privates=0x555555ab1b60, key=0x555555855720 <rrPrivKeyRec>) at ../include/privates.h:166
 #7  0x00007ffff7fb8445 in CreateScreenResources (pScreen=0x555555ab1790) at ../hw/xfree86/drivers/modesetting/driver.c:1335
 #8  0x000055555576c5e4 in xf86CrtcCreateScreenResources (screen=0x555555ab1790) at ../hw/xfree86/modes/xf86Crtc.c:744
 #9  0x00005555555d8bb6 in dix_main (argc=4, argv=0x7fffffffead8, envp=0x7fffffffeb00) at ../dix/main.c:214
 #10 0x00005555557a4f0b in main (argc=4, argv=0x7fffffffead8, envp=0x7fffffffeb00) at ../dix/stubmain.c:34

This can happen, for example, if the server is configured with Xinerama
and there is more than one X screen:

 Section "ServerLayout"
   Identifier "crash"
   Screen 0 "modesetting"
   Screen 1 "dummy" RightOf "modesetting"
   Option "Xinerama"
 EndSection

 Section "Device"
   Identifier "modesetting"
   Driver "modesetting"
 EndSection

 Section "Screen"
   Identifier "modesetting"
   Device "modesetting"
 EndSection

 Section "Device"
   Identifier "dummy"
   Driver "dummy"
 EndSection

 Section "Screen"
   Identifier "dummy"
   Device "dummy"
 EndSection

The problem does not reproduce if there is only one X screen because of
this code in xf86RandR12Init:

 #ifdef PANORAMIX
     /* XXX disable RandR when using Xinerama */
     if (!noPanoramiXExtension) {
         if (xf86NumScreens == 1)
             noPanoramiXExtension = TRUE;
         else
             return TRUE;
     }
 #endif

Fix the problem by checking dixPrivateKeyRegistered(rrPrivKey) before
calling rrGetScrPriv. This is similar to what the xf86-video-amdgpu
driver does:
fd66f5c0be/src/amdgpu_kms.c (L388)

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2020-01-03 08:39:21 -08:00
Michel Dänzer
b1ee4036bf gitlab-ci: Mark jobs as interruptible
Allowing redundant pipelines to be automatically cancelled.
2019-12-23 22:01:59 +00:00
Michel Dänzer
1e9c63bedd gitlab-ci: Turn .retry YAML anchor into .ci-run-policy template
To match Mesa.
2019-12-23 22:01:59 +00:00
Alex Goins
456dff1bf8 modesetting: Fix msSharePixmapBacking Segfault Regression
Commit cb1b1e184 modified msSharePixmapBacking() to derive modesettingPtr from
the 'screen' argument. Unfortunately, the name of the argument is misleading --
the screen is the slave screen. If the master is modesetting,
and the slave is not modesetting, it will segfault.

To fix the problem, this change derives modesettingPtr from
ppix->drawable.pScreen. This method is already used when calling
ms->glamor.shareable_fd_from_pixmap() later in the function.

To avoid future issues, this change also renames the 'screen' argument to
'slave'.

Signed-off-by: Alex Goins <agoins@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-23 08:56:22 -08:00
Olivier Fourdan
58155baeac xwayland: Cleanup and remove xwayland.h
Now that each source and header should be in order, we can safely cleaup
the last remaining bits from the main `xwayland.h` which is not needed
anymore and can be removed.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-20 16:19:01 +01:00
Olivier Fourdan
c830bd847f xwayland: Remove MODIFIER_META definition
It's nowhere to be used.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-20 16:19:01 +01:00
Olivier Fourdan
4c644fd792 xwayland: Move Xwayland GLX declaration
Move the Xwayland GLX declaration to its own header file.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-20 16:19:01 +01:00
Olivier Fourdan
808a0a038b xwayland: Move Xwayland vidmode declaration
Move the Xwayland vidmode declaration to its own header file.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-20 16:19:01 +01:00
Olivier Fourdan
e8ba8a94e1 xwayland: Move Xwayland CVT declaration
Move the Xwayland CVT declaration to its own header file.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-20 16:19:01 +01:00
Olivier Fourdan
0617c635fa xwayland: Separate Xwayland screen code
Move Xwayland screen related code to a separate source file and header.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-20 16:19:01 +01:00
Olivier Fourdan
211609a938 xwayland: Move Xwayland cursor declarations
Move the Xwayland cursor declarations to their own header file.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-20 16:19:01 +01:00
Olivier Fourdan
aaeeb10b74 xwayland: Move Xwayland output declarations
Move the Xwayland output declarations to their own header file.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-20 16:19:01 +01:00
Olivier Fourdan
091b24f13e xwayland: Move Xwayland input declarations
Move the Xwayland input declarations to their own header file.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-20 16:19:01 +01:00
Olivier Fourdan
e23d2223d8 xwayland: Move Xwayland present declarations
Move the Xwayland Present declarations to their own header file.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-20 16:19:01 +01:00
Olivier Fourdan
d780bdc2fd xwayland: Separate Xwayland pixmap code
Move Xwayland generic pixmap code to a separate source file and header.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-20 16:19:01 +01:00
Olivier Fourdan
89e32d00f6 xwayland: Move Xwayland windows to its own sources
Over time, Xwayland main source file `xwayland.c` has grown in size
which makes it look cluttered and harder to read.

Move the code dealing with Xwayland window to its own source and header
files.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-20 16:19:01 +01:00
Olivier Fourdan
3a59650ba7 xwayland: Move GLAMOR declarations to their own header
Currently, `xwayland.h` contains all the declarations, which is a bit
awkward and hard to follow.

Move the GLAMOR relevant declarations to their own header file.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-20 16:19:01 +01:00
Olivier Fourdan
177c8a2302 xwayland: Move SHM declarations to their own header
Currently, `xwayland.h` contains all the declarations, which is a bit
awkward and hard to follow.

Move the SHM relevant declarations to their own header file.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-20 16:19:01 +01:00
Olivier Fourdan
c20e61fddc xwayland: Move Xwayland structures to their own header
Currently, `xwayland.h` contains all the declarations, which is a bit
awkward and hard to follow.

Move the Xwayland structures declarations to their own header file.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-20 16:19:01 +01:00
Michel Dänzer
5bfca0038e glamor: Only use dual blending with GLSL >= 1.30
It can't be used with older GLSL. Fixes a crash when attempting to
anyway.

Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/97
Fixes: e7308b6c77 "glamor: Add support for CA rendering in a single pass."
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-12-20 12:35:28 +01:00
Michel Dänzer
846e81ecb8 xwayland: Create duplicate TrueColor GLXFBConfigs for Composite
Similar to what is done in Xorg. Not doing this prevented apps from
using GLX with a Composite visual, e.g. Firefox WebRender or Chromium.

v2:
* Fix inverted direct_color test, fixes Chromium as well.
* Drop Composite extension guards, since other Xwayland code calls
  compRedirectWindow/compUnredirectWindow unconditionally anyway.

Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/921
Fixes: 8469241592 "xwayland: Add EGL-backed GLX provider"
Reviewed-by: Adam Jackson <ajax@redhat.com> # v1
2019-12-19 11:35:19 +01:00
Michel Dänzer
02e7a497ce xwayland: Fix duplicate "direct_color" comment to say "double_buffer"
Fixes: 8469241592 "xwayland: Add EGL-backed GLX provider"
Reviewed-by: Adam Jackson <ajax@redhat.com>
2019-12-17 18:43:07 +01:00
Michel Dänzer
9b31358c52 xwayland: Use frame callbacks for Present vblank events
Instead of only the fallback timer.

Fixes https://gitlab.freedesktop.org/xorg/xserver/issues/854

v2:
* Drop unused frame_callback member of struct xwl_present_window
  (Olivier Fourdan)

Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2019-12-17 10:31:22 +01:00
Michel Dänzer
c5067feaee xwayland: Use single frame callback for Present flips and normal updates
Using a list of Present windows that need to be called back.

This prepares for the following change, there should be no change in
observed behaviour.

v2:
* Use xwl_window_create_frame_callback instead of making the
  frame_listener struct non-static (Olivier Fourdan)

Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2019-12-17 10:28:33 +01:00
Michel Dänzer
f80eea0529 xwayland: Add xwl_window_create_frame_callback helper
This will be used by the following changes. No functional change
intended.

Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2019-12-13 18:26:35 +01:00
Olivier Fourdan
46e5236bbe xwayland: Take border width into account
Damage coordinates are relative to the drawable, (0,0) being the top
left corner inside the border.

Therefore, when applying damages or accumulating damages between window
buffers, we need to take the window border width into account as well,
otherwise the updates might be only partial or misplaced.

Related: https://gitlab.freedesktop.org/xorg/xserver/issues/951
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-13 16:11:09 +01:00
Olivier Fourdan
1cb886bc2a xwayland: Recycle window buffers when setting pixmap
Right now, we would recycle the window buffers whenever the window the
window is resized.

This, however, is not sufficient to guarantee that the buffers are up
to date, since changing the window border width for example would not
trigger a `WindowResize` (the border being outside the window).

Make sure we recycle the buffers on `SetWindowPixmap` to ensure that
the buffers will be recycled whenever the pixmap size is changed.

Related: https://gitlab.freedesktop.org/xorg/xserver/issues/951
Suggested-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-12-13 16:11:09 +01:00
dslater38
71c3a97142 XWin: Fix infinite loop in GetShift()
GetShift(int mask) can be called with mask==0, causing
it to go into an infinite loop.

Note: GetShift(mask) will return 0 for a mask of
both 0 and -1. The assumption is that if mask == 0,
then the corresponding bits for which we're calculating
the shift, are also 0.
2019-12-12 04:54:46 +00:00
Peter Hutterer
0c729bb958 gitlab CI: update to the latest version of the ci-templates
Primarily to fix the skopeo copy issue that causes pipelines to fail right
now, see ci-templates commit 0a9bdd33a98f05af67.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-12-12 09:24:46 +10:00
Michel Dänzer
2a2234ad1a xwayland: Do flush GPU work in xwl_present_flush
The Present code sends the idle notification event to the client after
xwl_present_flush returns. If we don't flush our GPU work here, the
client may race to draw another frame to the same buffer, so we may end
up copying (parts of) that new frame instead of the one we meant to.

Fixes https://gitlab.freedesktop.org/xorg/xserver/issues/835

Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2019-12-03 18:24:34 +01:00
Olivier Fourdan
cd999f08c6 xwayland: Use multiple window buffers
Xwayland takes care of not attaching a new buffer if a frame callback is
pending.

Yet, the existing buffer (which was previously attached) may still be
updated from the X11 side, causing unexpected visual glitches to the
buffer.

Add multiple buffering to the xwl_window and alternate between buffers,
to leave the Wayland buffer untouched between frame callbacks and avoid
stuttering or tearing issues.

Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/835
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-11-28 17:32:44 +01:00
Olivier Fourdan
1c6f875f52 xwayland: Add multiple window buffering support
Add a mechanism to create, recycle and destroy window buffers when
needed.

Typically, this adds a new `xwl_window_buffer` structure which
represents a buffer for a given Xwayland window.

Each Xwayland window has two different pools of buffers:

 - The available buffers pool:
   Those are buffers which where created previously and that have either
   not been submitted to the compositor or submitted and released.

 - The unavailable buffers pool:
   Those are typically the buffers which are being used by the
   compositor, awaiting a release.

Initially, an Xwayland window starts with both pools empty. As soon as a
new buffer is needed, it's either created (if there is none available)
or picked from the pool of available buffers.

Once submitted to the compositor, the buffer is moved to the pool of
unavailable buffers. When the corresponding `wl_buffer` is released by
the compositor, it is moved back to pool of available buffers again to
be reused when needed.

To avoid keeping too many buffers around doing nothing, a garbage
collection of older, unused buffers also takes care of disposing the
buffers being unused for some time.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-11-28 17:32:44 +01:00
Olivier Fourdan
7765874186 xwayland: Add buffer release callback
The API `wl_buffer_add_listener` is misleading in the sense that there
can be only one `wl_buffer` release callback, and trying to add a new
listener when once is already in place will lead to a protocol error.

The Xwayland EGL backends may need to set up their own `wl_buffer`
release listener, meaning that there is no way to our own `wl_buffer`
release callback.

To avoid the problem, add our own callback API to be notified when the
`wl_buffer` associated with an `xwl_pixmap` is released, triggered from
the different `xwl_pixmap` implementations.

Also update the Present code to use the new buffer release callback API.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-11-28 17:32:44 +01:00
Kenneth Graunke
8d4be7f6c4 modesetting: Use EGL_MESA_query_driver to select DRI driver if possible
New now ask Glamor to use EGL_MESA_query_driver to obtain the DRI driver
name; if successful, we use that as the DRI driver name.  Following the
existing dri2.c logic, we also use the same name for the VDPAU driver,
except for i965 (and now iris), where we switch to the "va_gl" fallback.

This allows us to bypass the PCI ID lists in xserver and centralize the
driver selection mechanism inside Mesa.  The hope is that we no longer
have to update these lists for any future hardware.
2019-11-26 01:36:10 -08:00
Kenneth Graunke
195c2ef8f9 glamor: Add a function to get the driver name via EGL_MESA_query_driver
This maps to eglGetDisplayDriverName if EGL_MESA_query_render is
supported, otherwise it returns NULL.
2019-11-26 01:13:45 -08:00
Michel Dänzer
60003023fa modesetting: Use glamor_clear_pixmap in drmmode_clear_pixmap
Should be slightly more efficient.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2019-11-25 18:47:37 +01:00
Michel Dänzer
9ba13bac9d modesetting: Clear new screen pixmap storage on RandR resize
Fixes random garbage being visible intermittently.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2019-11-25 18:46:56 +01:00
Michel Dänzer
327df450ff xfree86/modes: Call xf86RotateRedisplay from xf86CrtcRotate
If a new rotate buffer was allocated. This makes sure the new buffer
has valid transformed contents when it starts being displayed.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2019-11-25 18:46:31 +01:00
Michel Dänzer
c66c548eab modesetting: Call glamor_finish from drmmode_crtc_set_mode
This makes sure any pending drawing to a new scanout buffer will be
visible from the start.

This makes the finish call in drmmode_copy_fb superfluous, so remove it.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2019-11-25 18:46:04 +01:00
Michel Dänzer
06ef320e9b modesetting: Add glamor_finish() convenience macro
This will simplify backporting the following fix to the 1.20 branch.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2019-11-25 18:44:57 +01:00
Matt Turner
e6ab7f9f34 xfree86: Test presence of isastream()
isastream() was never more than a stub in glibc, and was removed in
glibc-2.30 by commit a0a0dc83173c ("Remove obsolete, never-implemented
XSI STREAMS declarations").

Bug: https://bugs.gentoo.org/700838
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2019-11-22 15:22:43 -05:00
Dor Askayo
ebf549db2d glamor: make sure the correct FBO is cleared
This also removes an unnecesary call to glDrawBuffer.

Signed-off-by: Dor Askayo <dor.askayo@gmail.com>
Fixes: 0e9a0c20 - "xwayland: clear pixmaps after creation in rootless
                   mode"
Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/933
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-11-22 17:12:03 +01:00
Adam Jackson
cb1b1e1847 Revert "Revert "modesetting: Indirect the glamor API through LoaderSymbol""
Now that we've fixed LoaderSymbolFromModule this should work properly.

This reverts commit 5c7c6d5cff.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-11-21 14:20:57 -05:00
Adam Jackson
ab61c16ef0 loader: Make LoaderSymbolFromModule take a ModuleDescPtr
The thing you get back from xf86LoadSubModule is a ModuleDescPtr, not a
dlsym handle. We don't expose ModuleDescPtr to the drivers, so change
LoaderSymbolFromModule to cast its void * argument to a ModuleDescPtr.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2019-11-21 14:20:50 -05:00
Aaron Plattner
4308f5d3d1 os: Don't crash in AttendClient if the client is gone
If a client is in the process of being closed down, then its client->osPrivate
pointer will be set to NULL by CloseDownConnection. This can cause a crash if
freeing the client's resources results in a call to AttendClient. For example,
if the client has a pending sync fence:

 Thread 1 "X" received signal SIGSEGV, Segmentation fault.
 AttendClient (client=0x5571c4aed9a0) at ../os/connection.c:942
 (gdb) bt
 #0  AttendClient (client=0x5571c4aed9a0) at ../os/connection.c:942
 #1  0x00005571c3dbb865 in SyncAwaitTriggerFired (pTrigger=<optimized out>) at ../Xext/sync.c:694
 #2  0x00005571c3dd5749 in miSyncDestroyFence (pFence=0x5571c5063980) at ../miext/sync/misync.c:120
 #3  0x00005571c3dbbc69 in FreeFence (obj=<optimized out>, id=<optimized out>) at ../Xext/sync.c:1909
 #4  0x00005571c3d7a01d in doFreeResource (res=0x5571c506e3d0, skip=skip@entry=0) at ../dix/resource.c:880
 #5  0x00005571c3d7b1dc in FreeClientResources (client=0x5571c4aed9a0) at ../dix/resource.c:1146
 #6  FreeClientResources (client=0x5571c4aed9a0) at ../dix/resource.c:1109
 #7  0x00005571c3d5525f in CloseDownClient (client=0x5571c4aed9a0) at ../dix/dispatch.c:3473
 #8  0x00005571c3d55eeb in Dispatch () at ../dix/dispatch.c:492
 #9  0x00005571c3d59e96 in dix_main (argc=3, argv=0x7ffe7854bc28, envp=<optimized out>) at ../dix/main.c:276
 #10 0x00007fea4837cb6b in __libc_start_main (main=0x5571c3d1d060 <main>, argc=3, argv=0x7ffe7854bc28, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe7854bc18) at ../csu/libc-start.c:308
 #11 0x00005571c3d1d09a in _start () at ../Xext/sync.c:2378
 (gdb) print client->osPrivate
 $1 = (void *) 0x0

Since the client is about to be freed, its ignore count doesn't matter and
AttendClient can simply be a no-op. Check for client->clientGone in AttendClient
and remove similar checks from two callers that had them.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2019-11-19 10:15:05 -08:00
Olivier Fourdan
66da95a172 xwayland: Do not discard frame callbacks on allow commits
Currently, when a X11 client (usually the X11 window manager from a
Wayland compositor) changes the value of the X11 property
`_XWAYLAND_ALLOW_COMMITS` from `false` to `true`, all pending frame
callbacks on the window are discarded so that the commit occurs
immediately.

Weston uses that mechanism to prevent the content of the window from
showing before it's ready when mapping the window initially, but
discarding the pending frame callbacks has no effect on the initial
mapping of the X11 window since at that point there cannot be any frame
callback on a surface which hasn't been committed yet anyway.

However, discarding pending frame callbacks can be problematic if we
were to use the same `_XWAYLAND_ALLOW_COMMITS` mechanism to prevent
damages to be posted before the X11 toplevel is updated completely
(including the window decorations from the X11 window manager).

Remove the portion of code discarding the pending frame callback,
Xwayland should always wait for a pending frame callback if there's one
before posting new damages.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
https://gitlab.freedesktop.org/xorg/xserver/merge_requests/333
2019-11-19 09:56:10 +00:00