1. 21 Sep, 2020 2 commits
    • Vlad Zahorodnii's avatar
      Keep unreferenced buffers around · 2b197075
      Vlad Zahorodnii authored
      One problem with delaying destruction of buffer objects is that the
      compositor may create a shadow that references defunct buffers.
      
      One way to fix that issue is to immediately destroy buffers. However,
      there is other way to address the issue - keep released buffers alive.
      
      If a buffer is kept alive by the client, then it will most likely be
      used again. It also simplifies buffer management.
      
      BUG: 425233
      
      
      (cherry picked from commit fcfdab06)
      2b197075
    • Vlad Zahorodnii's avatar
      Untangle SurfaceInterface and BufferInterface · e52842af
      Vlad Zahorodnii authored
      A wl_buffer object can be bound to multiple surfaces or none at all. So
      the BufferInterface::surface() property makes very little sense.
      
      
      (cherry picked from commit 9f814c49)
      e52842af
  2. 15 Jul, 2020 1 commit
  3. 01 Jun, 2020 1 commit
  4. 29 Apr, 2020 1 commit
  5. 30 Mar, 2020 1 commit
    • Aleix Pol Gonzalez's avatar
      Fix warnings · 3a7f50d5
      Aleix Pol Gonzalez authored
      Summary:
      Remove unused variables and members.
      We were often storing the q of classes without ever needing them. I'd
      just do it when it's useful. We do it in the private class so it can
      always be added, removes boilerplate code.
      
      Don't use std::move when returning temporary QImage. The compiler is
      smart enough to know to do it but produces the warning "moving a
      temporary object prevents copy elision".
      
      Remove unused lambda captured variables.
      
      Test Plan: Getting much cleaner build logs
      
      Reviewers: #frameworks, #kwin, zzag
      
      Reviewed By: #kwin, zzag
      
      Subscribers: zzag, kde-frameworks-devel
      
      Tags: #frameworks
      
      Differential Revision: https://phabricator.kde.org/D28442
      3a7f50d5
  6. 16 Mar, 2020 1 commit
  7. 06 Aug, 2019 1 commit
    • Roman Gilg's avatar
      Implement zwp_linux_dmabuf_v1 · 1dd57d90
      Roman Gilg authored
      Summary: This interface provides a way for clients to create generic dmabuf-based wl_buffers.
      
      Test Plan: Works with weston-simple-dmabuf-drm and weston-simple-dmabuf-egl in KWin.
      
      Reviewers: #kwin, #plasma, graesslin, davidedmundson, mart, fredrik
      
      Subscribers: zzag, kde-frameworks-devel, romangg, plasma-devel
      
      Tags: #frameworks, #plasma_on_wayland
      
      Maniphest Tasks: T8067
      
      Differential Revision: https://phabricator.kde.org/D10747
      1dd57d90
  8. 20 Nov, 2018 1 commit
  9. 30 Aug, 2017 1 commit
    • David Edmundson's avatar
      Treat input RGB buffers as premultiplied · dc7e367e
      David Edmundson authored
      Summary:
      Currently the server treats incoming buffers as not premultiplied.
      
      KWayland::Client sends data that is ARGB32 and ARGB32_Premultiplied as
      the same
      WL_SHM_FORMAT_ARGB8888.
      
      According to a post on wayland-devel by Fredrik Höglund, all RGB data
      should be treated as premultiplied, which matches what Qt is doing.
      
      Client now performs a conversion rather than sending
      mismatched data,
      
      Note: This commit will still breaks a bunch of tests in
      kwin as it compares the server output to a fixed
      QImage with a format.
      
      Test Plan:
      Existing tests pass
      
      Modified surface test to check the pixel data relative to the output
      QImage format
      not the input format (i.e both input from ARGB32 and
      ARGB32_Premultiplied) should
      both end up in a QImage with format Premultiplied with premultiplied
      values.
      
      The existing test was confirming that data was corrupted, checking that
      even though
      the output format was not pre-multiplied, the data was.
      
      Reviewers: #plasma, graesslin
      
      Reviewed By: #plasma, graesslin
      
      Subscribers: plasma-devel, #frameworks
      
      Tags: #plasma_on_wayland, #frameworks
      
      Differential Revision: https://phabricator.kde.org/D7460
      dc7e367e
  10. 14 Jun, 2016 1 commit
    • Martin Flöser's avatar
      [server] Don't assert when destroying a still referenced BufferInterface · c369a33d
      Martin Flöser authored
      Summary:
      The fact that the buffer is still referenced - that is used - when the
      BufferInterface gets destroyed is an error, but it is not fatal.
      
      Unfortunately KWin/Wayland is still hitting this assert from time to
      time and the assert is not helping to find the cause as a backtrace
      does not show where a reference is still hold.
      
      This change removes the hard assert by a soft warning. The advantage
      of the warning is that the compositor is not killed and that we can
      observe the reason and find a usage pattern which triggers the condition.
      
      With that we will hopefully be able to find the case where the buffer
      is still referenced when being destroyed and fix that.
      
      Reviewers: #plasma_on_wayland
      
      Differential Revision: https://phabricator.kde.org/D1783
      c369a33d
  11. 01 Jun, 2015 1 commit
  12. 31 May, 2015 1 commit
  13. 21 Apr, 2015 3 commits
  14. 02 Apr, 2015 1 commit
  15. 04 Mar, 2015 1 commit
    • Martin Flöser's avatar
      [server] Don't set a parent on BufferInterface · ee7992f6
      Martin Flöser authored
      BufferInterface used to have a SurfaceInterface as parent. This could
      result in easily hitting the abort condition that the BufferInterface
      was still referenced when it gets deleted by just having one other
      user referencing the BufferInterface.
      
      There is no need to have the BufferInterface deleted when the
      SurfaceInterface to which it belongs gets deleted. The BufferInterface
      will get deleted once it's completely unreferenced and also has a
      destroy listener.
      ee7992f6
  16. 03 Mar, 2015 1 commit
    • Martin Flöser's avatar
      [server] BufferInterface can resolve size through egl extension · 6196e945
      Martin Flöser authored
      Uses eglQueryWaylandBufferWL (if available) to determine the size of the
      buffer. In order to do so, the server library links against egl (1) and
      one needs to register the EGLDisplay in Server::Display by the user of
      the library. For this a new method Display::setEglDisplay is added.
      
      1: not using epoxy as it doesn't wrap the Wayland interfaces yet.
      6196e945
  17. 02 Mar, 2015 1 commit
  18. 24 Feb, 2015 1 commit
  19. 13 Nov, 2014 1 commit
    • Martin Flöser's avatar
      Fix shared memory access in BufferInterface · 9600aaa7
      Martin Flöser authored
      The BufferInterface used nested calls of wl_shm_buffer_begin_access
      and allowed multiple different BufferInterfaces to be in a block
      between wl_shm_buffer_begin_access and wl_shm_buffer_end_access.
      But this is not allowed: nesting is only possible if it accesses
      the same buffer!
      
      This resulted in an abort when we accessed two BufferInterfaces
      at the same time. The added test case aborts in the previous
      version.
      
      The fix now changes the semantic of the method. The BufferInterface
      doesn't hold the QImage any more, but creates a new one every time
      ::data is invoked. The QImage is created with a custom cleanup
      function which calls to wl_shm_buffer_end_access. It ensures that
      we don't call into wl_shm_buffer_begin_access as long as there is
      a valid QImage for any other BufferInterface still around and
      instead returns a null QImage.
      
      Thus a user of a BufferInterface::data should destroy the returned
      QImage as soon as it's no longer needed or create a deep copy if
      it needs to be kept around.
      9600aaa7
  20. 07 Nov, 2014 2 commits
  21. 19 Sep, 2014 1 commit
    • Martin Flöser's avatar
      Add d-pointer to Server::SurfaceInterface · a0d28800
      Martin Flöser authored
      It also adds a
      static SurfaceInterface *get(wl_resource*)
      to SurfaceInterface which can find the SurfaceInterface for the
      given wl_resource. This is needed for ShellSurfaceInterface which
      can no longer just cast the wayland user data.
      a0d28800
  22. 18 Sep, 2014 1 commit
  23. 17 Sep, 2014 3 commits
  24. 02 Sep, 2014 1 commit
    • Martin Flöser's avatar
      [kwin_wayland] Add support for shm buffers in server module · 73ecd6a7
      Martin Flöser authored
      The Display provides a method to create the shm pool and a
      BufferInterface class is added to the server module. It is created
      from the SurfaceInterface when a buffer gets attached to the surface.
      The BufferInterface can be referenced and once its unreferenced it
      sends a buffer release to the client and destroys itself.
      
      For the case that the buffer is a shm buffer the BufferInterface
      provides a convenience method to turn it into a QImage.
      
      The auto test for Surface is extended by attaching buffers to the
      surface and verifying that the content is correct.
      73ecd6a7