1. 21 Nov, 2019 2 commits
  2. 19 Nov, 2019 2 commits
    • Aaron Plattner's avatar
      os: Don't crash in AttendClient if the client is gone · 4308f5d3
      Aaron Plattner authored
      
      
      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's avatarAaron Plattner <aplattner@nvidia.com>
      4308f5d3
    • Olivier Fourdan's avatar
      xwayland: Do not discard frame callbacks on allow commits · 66da95a1
      Olivier Fourdan authored
      
      
      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: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.com>
      Reviewed-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
      xorg/xserver!333
      66da95a1
  3. 18 Nov, 2019 1 commit
  4. 15 Nov, 2019 1 commit
  5. 13 Nov, 2019 4 commits
  6. 11 Nov, 2019 4 commits
    • Alex Goins's avatar
      modesetting: Implement ms_covering_randr_crtc() for ms_present_get_crtc() · 562c7888
      Alex Goins authored
      
      
      ms_present_get_crtc() returns an RRCrtcPtr, but derives it from a xf86CrtcPtr
      found via ms_dri2_crtc_covering_drawable()=>ms_covering_crtc(). As a result, it
      depends on all associated DIX ScreenRecs having an xf86CrtcConfigPtr DDX
      private.
      
      Some DIX ScreenRecs don't have an xf86CrtcConfigPtr DDX private, but do have an
      rrScrPrivPtr DDX private. Given that we can derive all of the information we
      need from RandR, we can support these screens by avoiding the use of xf86Crtc.
      This change implements an RandR-based path for ms_present_get_crtc(), allowing
      drawables to successfully fall back to syncing to the primary output, even if
      the slave doesn't have an xf86CrtcConfigPtr DDX private.
      
      Without this change, if a slave doesn't have an xf86CrtcConfigPtr DDX private,
      drawables will fall back to 1 FPS if they overlap an output on that slave.
      Signed-off-by: Alex Goins's avatarAlex Goins <agoins@nvidia.com>
      562c7888
    • Alex Goins's avatar
      modesetting: Fix ms_covering_crtc() segfault with non-xf86Crtc slave · 797e7a0c
      Alex Goins authored
      
      
      DIX ScreenRecs don't necessarily have an xf86CrtcConfigPtr DDX private.
      ms_covering_crtc() assumes that they do, which can result in a segfault.
      
      Update ms_covering_crtc() to check the XF86_CRTC_CONFIG_PTR() returned pointer
      before dereferencing it. This will still mean that ms_covering_crtc() can't fall
      back to the primary output when a drawable overlaps a slave output (going to the
      1 FPS default instead), but it won't segfault.
      Signed-off-by: Alex Goins's avatarAlex Goins <agoins@nvidia.com>
      797e7a0c
    • Alex Goins's avatar
      modesetting: Fix ms_covering_crtc() segfault with non-modesetting slave primary · 3ef9029a
      Alex Goins authored
      
      
      ms_covering_crtc() uses RRFirstOutput() to determine a primary output to fall
      back to if a drawable is overlapping a slave output.
      
      If the primary output is a slave output, RRFirstOutput() will return a slave
      output even if passed a master ScreenPtr. ms_covering_crtc() dereferences the
      output's devPrivate, which is invalid for non-modesetting outputs, and can
      crash.
      
      Changing RRFirstOutput() could have unintended side effects for other callers,
      so this change replaces the call to RRFirstOutput() with ms_first_output().
      ms_first_output() ignores the primary output if it doesn't match the given
      ScreenPtr, choosing the first connected output instead.
      Signed-off-by: Alex Goins's avatarAlex Goins <agoins@nvidia.com>
      3ef9029a
    • Alex Goins's avatar
      randr: Fix RRCrtcDetachScanoutPixmap() segfault during server teardown · c82f8143
      Alex Goins authored
      
      
      During server teardown, mrootdraw is NULL, which can cause segfaults if
      master->Stop{,Flipping}PixmapTracking() don't do NULL checking. In this case we
      shouldn't need to do master->Stop{,Flipping}PixmapTracking() anyway, so just
      skip it.
      Signed-off-by: Alex Goins's avatarAlex Goins <agoins@nvidia.com>
      c82f8143
  7. 10 Nov, 2019 1 commit
  8. 08 Nov, 2019 4 commits
  9. 07 Nov, 2019 1 commit
    • Dor Askayo's avatar
      xwayland: clear pixmaps after creation in rootless mode · 0e9a0c20
      Dor Askayo authored
      
      
      When a pixmap is created with a backing FBO, the FBO should be cleared
      to avoid rendering uninitialized memory. This could happen when the
      pixmap is rendered without being filled in its entirety.
      
      One example is when a top-level window without a background is
      resized. The pixmap would be reallocated to prepare for more pixels,
      but uninitialized memory would be rendered in the resize offset until
      the client sends a frame that fills these additional pixels.
      
      Another example is when a new top-level window is created without a
      background. Uninitialized memory would be rendered after the pixmap is
      allocated and before the client sends its first frame.
      
      This issue is only apparent in OpenGL implementations that don't zero
      the VRAM of allocated buffers by default, such as RadeonSI.
      Signed-off-by: Dor Askayo's avatarDor Askayo <dor.askayo@gmail.com>
      Closes: xorg/xserver#636
      
      Reviewed-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
      0e9a0c20
  10. 06 Nov, 2019 1 commit
  11. 05 Nov, 2019 1 commit
  12. 04 Nov, 2019 1 commit
    • Hans de Goede's avatar
      glamor/xwayland: Define EGL_NO_X11 · 741bd734
      Hans de Goede authored
      
      
      Define EGL_NO_X11 everywhere were we also define MESA_EGL_NO_X11_HEADERS,
      EGL_NO_X11 is the MESA_EGL_NO_X11_HEADERS equivalent for the egl headers
      shipped with libglvnd.
      
      This fixes the xserver not building with the libglvnd-1.2.0 headers:
      
      In file included from /usr/include/EGL/eglplatform.h:128,
                       from /usr/include/epoxy/egl_generated.h:11,
                       from /usr/include/epoxy/egl.h:46,
                       from glamor_priv.h:43,
                       from glamor_composite_glyphs.c:25:
      /usr/include/X11/Xlib.h:222:2: error: conflicting types for 'GC'
        222 | *GC;
            |  ^~
      In file included from glamor.h:34,
                       from glamor_priv.h:32,
                       from glamor_composite_glyphs.c:25:
      ../include/gcstruct.h:282:3: note: previous declaration of 'GC' was here
        282 | } GC;
            |   ^~
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      741bd734
  13. 30 Oct, 2019 17 commits