1. 30 Oct, 2020 1 commit
  2. 19 Oct, 2020 1 commit
    • Vlad Zahorodnii's avatar
      screencast: Use fences to avoid stalling the graphics pipeline · 9c20df50
      Vlad Zahorodnii authored
      Currently, we use glFinish() to ensure that stream consumers don't see
      corrupted or rather incomplete buffers. This is a serious issue because
      glFinish() not only prevents the gpu from processing new GL commands,
      but it also blocks the compositor.
      
      This change addresses the blocking issue by using native fences. With
      the proposed change, after finishing recording a frame, a fence is
      inserted in the command stream. When the native fence is signaled, the
      pending pipewire buffer will be enqueued.
      
      If the EGL_ANDROID_native_fence_sync extension is not supported, we'll
      fall back to using glFinish().
      9c20df50
  3. 13 Oct, 2020 1 commit
  4. 19 Aug, 2020 1 commit
    • Aleix Pol Gonzalez's avatar
      Implement EGL_KHR_partial_update and EGL_EXT_swap_buffers_with_damage · eeeac049
      Aleix Pol Gonzalez authored
      Summary:
      Notify the driver about the parts of the screen that will be repainted.
      In some cases this can be benefitial. This is especially useful on lima
      and panfrost devices (e.g. pinephone, pinebook, pinebook pro).
      
      Test Plan:
      Tested on a pinebook pro with a late mesa version.
      Basically I implemented it, then it didn't work and I fixed it.
      Maybe next step we want to look into our damage algorithm.
      eeeac049
  5. 07 Aug, 2020 2 commits
    • Vlad Zahorodnii's avatar
      Prettify license headers · 4ce853e8
      Vlad Zahorodnii authored
      4ce853e8
    • Vlad Zahorodnii's avatar
      Switch to SPDX license markers · 1fb9f6f1
      Vlad Zahorodnii authored
      The main advantage of SPDX license identifiers over the traditional
      license headers is that it's more difficult to overlook inappropriate
      licenses for kwin, for example GPL 3. We also don't have to copy a
      lot of boilerplate text.
      
      In order to create this change, I ran licensedigger -r -c from the
      toplevel source directory.
      1fb9f6f1
  6. 23 Jul, 2020 1 commit
  7. 16 Jan, 2020 4 commits
  8. 12 Dec, 2019 1 commit
    • Roman Gilg's avatar
      Add hasSwapEvent getter · a55dee3b
      Roman Gilg authored
      Summary:
      Add a small getter to query information internally if the backend supports
      swap events. Defaults to true as it is the default in the GBM Wayland backend.
      
      Test Plan: i915
      
      Reviewers: #kwin
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Maniphest Tasks: T11071
      
      Differential Revision: https://phabricator.kde.org/D25298
      a55dee3b
  9. 14 Nov, 2019 3 commits
    • Roman Gilg's avatar
      [platforms/x11] Never block on retrace, always present after paint · 8d137290
      Roman Gilg authored
      Summary:
      Compositing in X11 was done time shifted, meaning that we paint first, then
      wait one vblank interval length and present on prepareRenderingFrame the
      previous paint result. This is supposed to make sure we don't miss the vblank
      and in case of block till retrace be able to continue issuing commands and
      only shortly before next vblank present.
      
      This is counter-intuitiv, not how we do it on Wayland or even on MESA with X.
      The reason seems to be that the GLX backend was in the beginning written
      against Nvidia proprietary driver which needed this but nowadays even this
      driver defaults to non-blocking behavior on buffer swap.
      
      Therefore remove this legacy anomaly fully and directly present after paint.
      We then wait one refresh cycle and in the future can optimize this by delaying
      the paint and present till shortly before vsync.
      
      Test Plan: kwin_x11 tested on i915 and Nvidia proprietary driver.
      
      Reviewers: #kwin
      
      Subscribers: zzag, alexeymin, kwin
      
      Tags: #kwin
      
      Maniphest Tasks: T11071
      
      Differential Revision: https://phabricator.kde.org/D23514
      8d137290
    • Roman Gilg's avatar
      Remove vsync detection and configurability · b3a19f9e
      Roman Gilg authored
      Summary:
      Selecting not to vsync does not make sense for an X11 compositor. In the end
      we want clients to be able to present async if they want to but the compositor
      is supposed to send swaps with vsync to the XServer in order to not generate
      tearing artifacts.
      
      There was also a detection logic which did some questionable things in case
      vsync was not available. I don't think this is necessary at all since we can
      just always run a timer to present with or without vsync.
      
      Test Plan: kwin_x11 tested on i915.
      
      Reviewers: #kwin, zzag
      
      Subscribers: zzag, kwin
      
      Tags: #kwin
      
      Maniphest Tasks: T11071
      
      Differential Revision: https://phabricator.kde.org/D23511
      b3a19f9e
    • Roman Gilg's avatar
      [platforms/x11] Remove triple buffering detection · ad892ce3
      Roman Gilg authored
      Summary:
      It is not clear what the advantage of triple buffering is for KWin. An X11
      compositor is meant to swap buffers once every monitor cycle. For that triple
      buffering is not necessary.
      
      The functionality is not maintained, does not reliably work as displayed by
      the existence of an environment variable to force some behavior, pollutes
      our code and every compositing-related problem that might be mitigated with
      triple buffering should find a simpler and more fitting solution with other
      means.
      
      There is one caveat which is if we shall block for retrace. We set it
      currently according to the result of the swap profiler and in the most common
      case with double buffering it is set to true. But on Nvidia systems this might
      be actual the wrong behavior. Instead of trying to work around this ignore
      the issue for now and move the overall architecture to something less complex
      by presenting after paint how we do it in the Wayland DRM backend and with
      double buffering on GLX (although this is at the moment also borken because
      we actually present then twice).
      
      Test Plan: kwin_x11 tested on i915.
      
      Reviewers: #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: zzag, fredrik, kwin
      
      Tags: #kwin
      
      Maniphest Tasks: T11071
      
      Differential Revision: https://phabricator.kde.org/D23504
      ad892ce3
  10. 07 Aug, 2019 1 commit
    • Roman Gilg's avatar
      Split Compositor class in Wayland and X11 child classes · 1db84a2b
      Roman Gilg authored
      Summary:
      This patch is a first take at splitting up of the Compositor class into
      Wayland and X11 child classes.
      
      In this first patch we mostly deal with setup and teardown procedures.
      A future goal is to further differentiate the compositing part itself too.
      
      Test Plan: Manually X from VT and Wayland nested. Autotests pass.
      
      Reviewers: #kwin
      
      Subscribers: sbergeron, anthonyfieroni, zzag, kwin
      
      Tags: #kwin
      
      Maniphest Tasks: T11071
      
      Differential Revision: https://phabricator.kde.org/D22195
      1db84a2b
  11. 29 Jul, 2019 1 commit
    • Vlad Zahorodnii's avatar
      Use more traditional doxygen style · 684b4b63
      Vlad Zahorodnii authored
      Summary:
      So far we were following a bit unique and rare doxygen comment style:
      
          /**
           * Contents of the comment.
           **/
      
      Doxygen comments with this style look balanced and neat, but many people
      that contribute to KWin don't follow this style. Instead, they prefer
      more traditional doxygen comment style, i.e.
      
          /**
           * Contents of the comment.
           */
      
      Reviewing such changes has been a bit frustrating for me (so selfish!)
      and for other contributors.
      
      This change switches doxygen comment style in KWin to a more traditional
      style. The main reason for doing this is to make code review process easier
      for new contributors as well us.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D22812
      684b4b63
  12. 12 Feb, 2019 1 commit
    • Vlad Zahorodnii's avatar
      Overhaul doxygen comments · 7b20e1f6
      Vlad Zahorodnii authored
      Summary:
      We have a mix of different doxygen comment styles, e.g.
      
          /*!
            Foo bar.
           */
      
          /**
           * Foo bar.
           */
      
          /** Foo bar.
           */
      
          /**
           * Foo bar.
           */
      
          /**
           * Foo bar.
           **/
      
      To make the code more consistent, this change updates the style of all
      doxygen comments to the last one.
      
      Test Plan: Compiles.
      
      Reviewers: #kwin, davidedmundson
      
      Reviewed By: #kwin, davidedmundson
      
      Subscribers: kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D18683
      7b20e1f6
  13. 30 Sep, 2017 1 commit
    • Martin Flöser's avatar
      Move SceneOpenGL into a dedicated plugin · 8ae37c42
      Martin Flöser authored
      Summary:
      Unfortunately a rather large change which required more refactoring than
      initially expected. The main problem was that some parts needed to go
      into platformsupport so that the platform plugins can link them. Due to
      the rather monolithic nature of scene_opengl.h a few changes were
      required:
      * SceneOpenGL::Texture -> SceneOpenGLTexture
      * SceneOpenGL::TexturePrivate -> SceneOpenGLTexturePrivate
      * texture based code into dedicated files
      * SwapProfiler code into dedicated files
      * SwapProfiler only used in x11 variants
      * Safety checks for OpenGL scene moved into the new plugin
      * signal declared in SceneOpenGL moved to Scene, so that we don't need
      to include SceneOpenGL in composite
      
      Test Plan: Nested OpenGL compositor works
      
      Reviewers: #kwin, #plasma
      
      Subscribers: plasma-devel, kwin
      
      Tags: #kwin
      
      Differential Revision: https://phabricator.kde.org/D7740
      8ae37c42