Commit graph

8 commits

Author SHA1 Message Date
Vlad Zahorodnii
7ecdbad4f1 wayland: Sync DmaBufAttributes 2022-06-13 10:22:29 +00:00
Xaver Hugl
4874066423 port many Qt shared pointers to standard smart pointers
There are a few benefits to using smart pointers from the standard library:
- std::unique_ptr has move semantics. With move semantics, transfer of ownership
can be properly expressed
- std::shared_ptr is more efficient than QSharedPointer
- more developers are used to them, making contributions for newcomers easier

We're also already using a mix of both; because Qt shared pointers provide
no benefits, porting to standard smart pointers improves consistency in
the code base. Because of that, this commit ports most of the uses of QSharedPointer
to std::shared_ptr, and some uses of QScopedPointer to std::unique_ptr
2022-06-04 16:57:29 +00:00
Aleix Pol
9db4fd1a17 DmaBufTexture: The modifier is a global dmabuf attribute
We don't get one per plane, but one per allocation.
2022-06-02 03:42:13 +02:00
Vlad Zahorodnii
d7ec51998b backends/drm: Import gbm bos using dmabuf
It appears that importing gbm_bo's using eglCreateImageKHR() doesn't
work on nvidia.

Another issue is that Platform::createDmaBufTexture() uses
gbm_bo_create(). The nvidia driver doesn't like that, it's preferred to
use gbm_bo_create_with_modifiers().

In order to address those issues, this change refactors how gbm_bo
objects are imported and how gbm_bo's are allocated for dmabuf textures,
so the same code can be reused in EglGbmBackend::textureForOutput()
and Platform::createDmaBufTexture().
2022-05-13 15:55:05 +00:00
Vlad Zahorodnii
992753c24a Rename GLRenderTarget to GLFramebuffer
GLRenderTarget doesn't provide a generic abstraction for framebuffer
objects, so let's call GLRenderTarget what it is - a framebuffer.

Renaming the GLRenderTarget class allows us to use the term "render
target" which abstracts fbos or shm images without creating confusion.
2022-04-12 13:41:19 +03:00
Vlad Zahorodnii
7096e3ead8 Run clang-format
The .clang-format file is based on the one in ECM except the following
style options:

 - AlwaysBreakBeforeMultilineStrings
 - BinPackArguments
 - BinPackParameters
 - ColumnLimit
 - BreakBeforeBraces
 - KeepEmptyLinesAtTheStartOfBlocks
2022-03-25 13:25:15 +02:00
Vlad Zahorodnii
c3c87ed8fa plugins/screencast: Introduce base ScreenCastSource type
Currently, when screencasting a window, kwin may render a window into a
temporary offscreen texture, copy that offscreen texture to the dma-buf
render target, and discard the offscreen texture.

Allocating and deallocating offscreen textures is inefficient. Another
issue is that the screencast plugin uses Scene::Window::windowTexture().
It's a blocker for killing scene windows.

This change introduces a base ScreenCastSource type. It allows us to
move away from Scene::Window::windowTexture() and make the dma-buf code
path efficient with applications such as Firefox that utilize
sub-surfaces.

With the ScreenCastSource, kwin can also provide screen cast frames with
arbitrary device pixel ratio.
2021-11-16 07:24:03 +00:00
Vlad Zahorodnii
93e0265e4e Move source code to src/ directory
Once in a while, we receive complaints from other fellow KDE developers
about the file organization of kwin. This change addresses some of those
complaints by moving all of source code in a separate directory, src/,
thus making the project structure more traditional. Things such as tests
are kept in their own toplevel directories.

This change may wreak havoc on merge requests that add new files to kwin,
but if a patch modifies an already existing file, git should be smart
enough to figure out that the file has been relocated.

We may potentially split the src/ directory further to make navigating
the source code easier, but hopefully this is good enough already.
2021-02-10 15:31:43 +00:00
Renamed from dmabuftexture.h (Browse further)