Skip to content
  1. Jul 08, 2020
  2. Jun 26, 2020
    • Roman Gilg's avatar
      xwayland: Present with presentation_time protocol · a9298586
      Roman Gilg authored
      Add support for the presentation_time protocol when presenting Pixmaps. This
      allows us to get precise timing information on when a Pixmap was displayed to
      the user.
      
      The output msc timers are aligned with the vblank time after receiving the
      first presented event. This should allow a well behaving Wayland compositor to
      display frames in an optimal manner.
      
      Wayland compositors not impelmenting the presentation_time protocol can still
      make use of optimized flips without copy like before but the flips won't be
      synchronized with the refresh cycle and clients won't get the real time when
      the Pixmap was displayed.
      a9298586
    • Roman Gilg's avatar
      xwayland: Present by entered outputs maximal refresh rate · d89466eb
      Roman Gilg authored
      This replaces the current approach of presenting XWayland windows by returned
      frame callbacks with an approach to present along the current maximal refresh
      rate of all outputs the surface has entered.
      
      On relevant changes to the outputs all current flips or queued events are
      abandoned by XWayland and Present will take care of finishing up their
      processing. Such changes are relatively rare though such that under normal
      circumstances flips and presentations aligned with output refresh rates should
      be possible. For that the Wayland compositor must make sure that the enter and
      leave events are sent for all XWayland surfaces as Wayland protocol prescribes.
      
      One current downside is that the output timers are not aligned with the actual
      vblank of the hardware such that there might be an one frame deviation.
      Aligning could be done with frame callbacks. But the Wayland compositor must
      make sure in this case to send the callbacks at the same rate as the maximal
      refresh rate of all entered outputs (or for longer periods suspend them).
      
      To play it safe with current compositors ignore this downside for now and
      for optimizing that alignment instead use the presentation-time protocol in the
      future.
      d89466eb
    • Roman Gilg's avatar
      present: In window mode allow DDX to abandon vblanks · 24b9774c
      Roman Gilg authored
      In window mode allow DDX to hand back all currently queued vblanks to
      Present.
      
      This means Present will take  care of processing all remaining currently
      queued vblanks and the DDX must not try to return information for these
      in any form afterwards.
      
      On the other side the DDX may process incoming new vblanks as usual.
      24b9774c
    • Roman Gilg's avatar
      present: Remove legacy ust/msc getter · d6ec69d0
      Roman Gilg authored
      With the reworked window mode previous DDX have become non-functional.
      
      Therefore it became pointless trying to retain backwards compatibility. Remove
      the legacy ust/msc getter in the window mode info struct and reset the window
      mode info version to one.
      d6ec69d0
    • Roman Gilg's avatar
      present: Move presentations list in window mode to DDX · 9b0f8eed
      Roman Gilg authored
      Instead of keeping a list of current presentations in Present these are moved
      to the DDX.
      
      The DDX can then report back individually for each vblank if it was presented or
      skipped, and if the associated Pixmap is ready to be reused again.
      
      To simplify the code additional API functions are introduced specific to these
      actions.
      
      This is an API-breaking change in regards to window mode. DDX written against
      the previous version won't work anymore. It is assumed that there only exists
      the XWayland DDX at the moment using the window mode such that this is not an
      issue for the overall ecosystem.
      9b0f8eed
    • Roman Gilg's avatar
      xwayland: Clear Present events in separate function · 5aeaefe5
      Roman Gilg authored
      Can be used afterwards in other contexts and improves code readability.
      5aeaefe5
    • Roman Gilg's avatar
      xwayland: Rename sync_flip event · 97ce2a86
      Roman Gilg authored
      Make it more clear that the member represents an event. It is synthetical in
      the sense that the hardware synchronization with the display rate comes from
      the in-software msc-bump function.
      97ce2a86
    • Roman Gilg's avatar
      xwayland: Update to Present API version 2 · e7756fba
      Roman Gilg authored
      The new crtc argument is unused for now.
      e7756fba
    • Roman Gilg's avatar
      xwayland: Add helper function to free present events · 205bd4f3
      Roman Gilg authored
      A small helper function is introduced to reduce code duplication.
      205bd4f3
    • Roman Gilg's avatar
      xwayland: Present when realized and keep track of that · dff28a9d
      Roman Gilg authored
      With fake vblanks in Present we can simplify the XWayland code such that
      vblanks are ignored while the window is unrealized.
      
      The xwl_present_window struct holds a pointer back to the xwl_window while the
      window is realized and xwl_window has a list of all presenting child windows.
      This will be used in the future to forward information.
      dff28a9d
    • Roman Gilg's avatar
      xwayland: Set present-window xwl_screen entry · 55c5c000
      Roman Gilg authored
      The entry existed already but was never set. We can set it easily though when
      the struct gets allocated. Do this now so we can make use of it in the future.
      55c5c000
    • Roman Gilg's avatar
      xwayland: Rename present event list link · edaf99ac
      Roman Gilg authored
      The variable name for the list link of events was too generic. Rename it from
      list to event_link such that it can be easily identified and grepped for.
      edaf99ac
    • Roman Gilg's avatar
      xwayland: Rename present event lists · 741cb609
      Roman Gilg authored
      The names release_queue and event_list were ambiguous: in both are event-like
      vblanks. In the release_queue can be flips that are already released but still
      wait for the sync or frame callback. In the event_list are queued events
      waiting for a later msc.
      
      Therefore rename release_queue to presentation_list and event_list to
      queue_list.
      741cb609
    • Roman Gilg's avatar
      xwayland: Rename present window cleanup function · d5f32a5d
      Roman Gilg authored
      Make it more obvious when this function is called by having the destroy part
      in the name. It is called when the window is destroyed.
      d5f32a5d
    • Roman Gilg's avatar
      xwayland: Track surfaces entering outputs · 24199072
      Roman Gilg authored
      On surface enter and leave events add and respectively remove windows to the
      entered output.
      
      This later allows to inform all entered windows about changes to the output.
      24199072
    • Roman Gilg's avatar
      xwayland: Add synthetic frame timers to outputs · 261be2d6
      Roman Gilg authored
      The microsecond precise timer can be used in the future to simulate hardware
      vblank events.
      
      The timer is kept in sync with the output's refresh rate and allows to realign
      it manually with arbitrary points in time.
      261be2d6
    • Roman Gilg's avatar
      present: Add crtc-specific msc getter to window mode API · a9a0a7c3
      Roman Gilg authored
      This enables Present to ask a DDX for ust/msc values specific to a certain
      crtc.
      
      The window argument is kept to allow DDX to select the returned value not only
      dependent on crtc queried but also window and to keep the API flexible in the
      future.
      a9a0a7c3
    • Roman Gilg's avatar
      present: Support fake vblanks in window mode · 69f462b0
      Roman Gilg authored
      Enable usage of fake vblanks in window mode. A fake vblank is created when the
      DDX does not provide a crtc for the window.
      
      Fake vblanks in window mode are displayed at 60Hz for now to allow maximum
      flexibility in its usage. Optimizing battery usage can be done on DDX level.
      69f462b0
    • Roman Gilg's avatar
      os: Provide microsecond precise timers · 157fd1be
      Roman Gilg authored
      Introduce new function TimerSetInMicros to specify timers with microsecond
      precision.
      
      For that to facilitate internally all timers are from now on calculated
      in microseconds. Timers through TimerSet are driven in the same way and their
      results translated back.
      157fd1be
  3. Jun 25, 2020
  4. Jun 24, 2020
    • Martin Weber's avatar
      hw/xfree86: Avoid cursor use after free · 7ae221ad
      Martin Weber authored and Michel Dänzer's avatar Michel Dänzer committed
      
      
      During a VT-Switch a raw pointer to the shared cursor object
      is saved which is then freed (in case of low refcount) by a call to
      xf86CursorSetCursor with argument pCurs = NullCursor.
      This leads to a dangling pointer which can follow in a use after free.
      
      This fix ensures that there is a shared handle saved for the VT-Switch cycle.
      
      Reviewed-by: default avatarMichel Dänzer <mdaenzer@redhat.com>
      7ae221ad
  5. Jun 23, 2020
  6. Jun 19, 2020
  7. Jun 05, 2020
    • Adam Jackson's avatar
      xwayland: Set the vendor name for GLX_EXT_libglvnd · fc4f2485
      Adam Jackson authored
      Without this the client library will flail around looking for a default
      provider, probably one named "indirect", and that defeats the point of
      having the EGL provider for direct context support in the first place.
      
      This assumes that "mesa" will work, of course, and in general it should.
      Mesa drivers will DTRT through the DRI3 setup path, and if our glamor is
      atop something non-Mesa then you should fall back to llvmpipe like 1.20.
      In the future it might be useful to differentiate the vendor here based
      on whether glamor is using gbm or streams.
      
      Fixes: xorg/xserver#1032
      fc4f2485
  8. Jun 03, 2020
  9. May 27, 2020
    • Jan Beich's avatar
      meson: split udev from udev_kms which requires systemd · b5b52979
      Jan Beich authored
      DragonFly and FreeBSD can use xf86-input-libinput with config/udev.
      
      ld: error: undefined symbol: xf86PlatformDeviceProbe
      >>> referenced by xf86platformBus.c
      >>>               xf86platformBus.c.o:(xf86platformProbe) in archive hw/xfree86/common/libxorg_common.a
      
      ld: error: undefined symbol: xf86PlatformDeviceCheckBusID
      >>> referenced by xf86platformBus.c
      >>>               xf86platformBus.c.o:(xf86platformProbeDev) in archive hw/xfree86/common/libxorg_common.a
      
      ld: error: undefined symbol: xf86PlatformReprobeDevice
      >>> referenced by xf86platformBus.c
      >>>               xf86platformBus.c.o:(xf86platformVTProbe) in archive hw/xfree86/common/libxorg_common.a
      
      ld: error: undefined symbol: NewGPUDeviceRequest
      >>> referenced by udev.c
      >>>               udev.c.o:(device_added) in archive config/liblibxserver_config.a
      
      ld: error: undefined symbol: DeleteGPUDeviceRequest
      >>> referenced by udev.c
      >>>               udev.c.o:(device_removed) in archive config/liblibxserver_config.a
      b5b52979
    • Jan Beich's avatar
      glx: unbreak on Unix without /usr/include/drm · be731e0b
      Jan Beich authored
      In file included from ../glx/glxdri2.c:35:
      /usr/local/include/GL/internal/dri_interface.h:43:10: fatal error: 'drm.h' file not found
       #include <drm.h>
                ^~~~~~~
      In file included from ../glx/glxdriswrast.c:39:
      /usr/local/include/GL/internal/dri_interface.h:43:10: fatal error: 'drm.h' file not found
       #include <drm.h>
                ^~~~~~~
      be731e0b
    • Jan Beich's avatar
      os: unbreak xsha1 on FreeBSD · f2cf236d
      Jan Beich authored
      ../os/xsha1.c:36:10: fatal error: 'sha1.h' file not found
       #include <sha1.h>
                ^~~~~~~~
      ../os/xsha1.c:45:5: error: implicit declaration of function 'SHA1Init' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
          SHA1Init(ctx);
          ^
      ../os/xsha1.c:54:5: error: implicit declaration of function 'SHA1Update' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
          SHA1Update(sha1_ctx, data, size);
          ^
      ../os/xsha1.c:63:5: error: implicit declaration of function 'SHA1Final' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
          SHA1Final(result, sha1_ctx);
          ^
      f2cf236d
  10. May 20, 2020
  11. May 18, 2020
  12. May 13, 2020
    • Carlos Garnacho's avatar
      xwayland: Improve checks for confined_to on InputOnly windows · 0777cf46
      Carlos Garnacho authored and Olivier Fourdan's avatar Olivier Fourdan committed
      
      
      In this pretty Wine/Proton specific kludge, we try to handle confining grabs
      on InputOnly windows by trying to find the InputOutput window that the pointer
      would get visually confined to.
      
      The grabbing window and the visible window come from different clients, so
      we used to simply resort to the pointer focus. This is troublesome though, as
      the call may happen very soon at a time that the toplevel wasn't yet mapped by
      the Wayland compositor, so the pointer focus may well be out of date soon.
      
      In these situations, it does seem that even though the confining grab happens
      too early to have the wayland surface mapped, the xserver view of the WindowPtr
      does already reflect the size. Use this to find out the better window to
      assign the confining grab to, one whose geometry fully contains the InputOnly
      window's.
      
      Signed-off-by: default avatarCarlos Garnacho <carlosg@gnome.org>
      Reviewed-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
      0777cf46
  13. May 12, 2020