[kwin] [Bug 385372] Crash when changing compositing backend

2017-10-09 Thread Martin Flöser
https://bugs.kde.org/show_bug.cgi?id=385372

Martin Flöser  changed:

   What|Removed |Added

  Latest Commit||https://commits.kde.org/kwi
   ||n/47343fb8f75909f6491c05340
   ||04df56ee1e53737
   Version Fixed In||5.11.0
 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #1 from Martin Flöser  ---
Git commit 47343fb8f75909f6491c0534004df56ee1e53737 by Martin Flöser.
Committed on 05/10/2017 at 19:32.
Pushed by graesslin into branch 'Plasma/5.11'.

[platforms/drm] Use a shared pointer for gbm_surface

Summary:
The gbm_surface is owned by the EglGbmBackend, but it's not the only one
using it. The DrmSurfaceBuffer is also using it and needs it to destroy
the gbm_bo. Now this can become a problem in the following situation:

* a page flip is still pending
* the EglGbmBackend destroys the gbm_surface

-> when the page flip happens the DrmSurfaceBuffer will try to destroy
the gbm_bo and crash as the gbm_surface is no longer valid. This
situation can happen when switching screens or when switching compositing
backend (OpenGL 2 -> OpenGL 3).

To address this problem a class GbmSurface is added which wrapps the
gbm_surface pointer. The EglGbmBackend creates and holds a shared pointer
to the GbmSurface and passes that one to the DrmSurfaceBuffer. So when
cleaning up the gbm_surface only the shared pointer is reset and in case
the DrmSurfaceBuffer still needs it, it can access it without problems.
FIXED-IN: 5.11.0

Test Plan: Not yet

Reviewers: #kwin, #plasma, subdiff

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8152

M  +7-0autotests/CMakeLists.txt
A  +119  -0autotests/test_gbm_surface.cpp [License: GPL (v2)]
M  +1-1plugins/platforms/drm/CMakeLists.txt
M  +1-1plugins/platforms/drm/drm_backend.cpp
M  +4-1plugins/platforms/drm/drm_backend.h
M  +5-6plugins/platforms/drm/drm_buffer_gbm.cpp
M  +5-3plugins/platforms/drm/drm_buffer_gbm.h
M  +5-6plugins/platforms/drm/egl_gbm_backend.cpp
M  +4-1plugins/platforms/drm/egl_gbm_backend.h
C  +24   -30   plugins/platforms/drm/gbm_surface.cpp [from:
plugins/platforms/drm/drm_buffer_gbm.h - 052% similarity]
C  +17   -23   plugins/platforms/drm/gbm_surface.h [from:
plugins/platforms/drm/drm_buffer_gbm.h - 056% similarity]

https://commits.kde.org/kwin/47343fb8f75909f6491c0534004df56ee1e53737

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 385372] Crash when changing compositing backend

2017-10-05 Thread Martin Flöser
https://bugs.kde.org/show_bug.cgi?id=385372

Martin Flöser  changed:

   What|Removed |Added

  Flags||ReviewRequest+
URL||https://phabricator.kde.org
   ||/D8152

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 385372] Crash when changing compositing backend

2017-10-04 Thread Martin Flöser
https://bugs.kde.org/show_bug.cgi?id=385372

Martin Flöser  changed:

   What|Removed |Added

 CC||subd...@gmail.com
  Flags||Wayland+, X11-
   Severity|normal  |crash

-- 
You are receiving this mail because:
You are watching all bug changes.