Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KWin
Commits
b3445d0b
Commit
b3445d0b
authored
Oct 01, 2022
by
Xaver Hugl
Browse files
backends/drm: use linear buffers for multi gpu where necessary
(cherry picked from commit
ae4dd73e
)
parent
433474c2
Pipeline
#241080
canceled with stage
in 12 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/backends/drm/drm_egl_layer_surface.cpp
View file @
b3445d0b
...
...
@@ -32,6 +32,8 @@
namespace
KWin
{
static
const
QVector
<
uint64_t
>
linearModifier
=
{
DRM_FORMAT_MOD_LINEAR
};
EglGbmLayerSurface
::
EglGbmLayerSurface
(
DrmGpu
*
gpu
,
EglGbmBackend
*
eglBackend
)
:
m_gpu
(
gpu
)
,
m_eglBackend
(
eglBackend
)
...
...
@@ -149,6 +151,7 @@ std::optional<std::tuple<std::shared_ptr<DrmFramebuffer>, QRegion>> EglGbmLayerS
bool
EglGbmLayerSurface
::
checkGbmSurface
(
const
QSize
&
bufferSize
,
const
QMap
<
uint32_t
,
QVector
<
uint64_t
>>
&
formats
,
bool
forceLinear
)
{
forceLinear
|=
m_importMode
==
MultiGpuImportMode
::
DumbBuffer
||
m_importMode
==
MultiGpuImportMode
::
DumbBufferXrgb8888
;
if
(
doesGbmSurfaceFit
(
m_gbmSurface
.
get
(),
bufferSize
,
formats
))
{
m_oldGbmSurface
.
reset
();
}
else
{
...
...
@@ -181,7 +184,7 @@ bool EglGbmLayerSurface::createGbmSurface(const QSize &size, uint32_t format, co
}
if
(
allowModifiers
)
{
const
auto
ret
=
GbmSurface
::
createSurface
(
m_eglBackend
,
size
,
format
,
modifiers
,
config
);
const
auto
ret
=
GbmSurface
::
createSurface
(
m_eglBackend
,
size
,
format
,
forceLinear
?
linearModifier
:
modifiers
,
config
);
if
(
const
auto
surface
=
std
::
get_if
<
std
::
shared_ptr
<
GbmSurface
>>
(
&
ret
))
{
m_oldGbmSurface
=
m_gbmSurface
;
m_gbmSurface
=
*
surface
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment