1. 25 Feb, 2019 3 commits
  2. 22 Feb, 2019 13 commits
  3. 20 Feb, 2019 18 commits
  4. 09 Jan, 2019 6 commits
    • Olivier Fourdan's avatar
      xwayland: handle case without any crtc · a352f979
      Olivier Fourdan authored
      
      
      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: default avatarOlivier Fourdan <ofourdan@redhat.com>
      Reviewed-by: Michel Dänzer's avatarMichel Dänzer <michel.daenzer@amd.com>
      Bugzilla: https://bugzilla.redhat.com/1609181
      (cherry picked from commit e8295c50)
      a352f979
    • Michel Dänzer's avatar
      xwayland: Don't take buffer release queue into account for frame timer · 210cd529
      Michel Dänzer authored
      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 e6cd1c9b)
      210cd529
    • Michel Dänzer's avatar
      xwayland: Don't need xwl_window anymore in xwl_present_queue_vblank · 7c28b0e3
      Michel Dänzer authored
      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 f5416153)
      7c28b0e3
    • Michel Dänzer's avatar
      xwayland: Add xwl_present_unrealize_window · 46135957
      Michel Dänzer authored
      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 8c953857)
      46135957
    • Michel Dänzer's avatar
      xwayland: Replace xwl_window::present_window with ::present_flipped · 98f41563
      Michel Dänzer authored
      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 6b016d58)
      98f41563
    • Michel Dänzer's avatar
      xwayland: Complete "synchronous" Present flips from xwl_present_msc_bump · f393801d
      Michel Dänzer authored
      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 ace551d8)
      f393801d