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
9679beac
Commit
9679beac
authored
Jan 31, 2021
by
Xaver Hugl
Browse files
Actually use a linear buffer format for multi-GPU
BUG: 431968
(cherry picked from commit
f8d9b3bc
)
parent
27e7dba1
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugins/platforms/drm/egl_gbm_backend.cpp
View file @
9679beac
...
...
@@ -155,23 +155,6 @@ bool EglGbmBackend::initRenderingContext()
return
true
;
}
std
::
shared_ptr
<
GbmSurface
>
EglGbmBackend
::
createGbmSurface
(
const
QSize
&
size
,
const
bool
linear
)
const
{
auto
flags
=
GBM_BO_USE_SCANOUT
|
GBM_BO_USE_RENDERING
;
if
(
linear
)
{
flags
|=
GBM_BO_USE_LINEAR
;
}
auto
gbmSurface
=
std
::
make_shared
<
GbmSurface
>
(
m_gpu
->
gbmDevice
(),
size
.
width
(),
size
.
height
(),
GBM_FORMAT_XRGB8888
,
flags
);
if
(
!
gbmSurface
)
{
qCCritical
(
KWIN_DRM
)
<<
"Creating GBM surface failed"
;
return
nullptr
;
}
return
gbmSurface
;
}
EGLSurface
EglGbmBackend
::
createEglSurface
(
std
::
shared_ptr
<
GbmSurface
>
gbmSurface
)
const
{
auto
eglSurface
=
eglCreatePlatformWindowSurfaceEXT
(
eglDisplay
(),
config
(),
...
...
@@ -188,9 +171,18 @@ bool EglGbmBackend::resetOutput(Output &output, DrmOutput *drmOutput)
output
.
output
=
drmOutput
;
const
QSize
size
=
drmOutput
->
hardwareTransforms
()
?
drmOutput
->
pixelSize
()
:
drmOutput
->
modeSize
();
auto
gbmSurface
=
createGbmSurface
(
size
,
output
.
onSecondaryGPU
);
int
flags
=
GBM_BO_USE_RENDERING
;
if
(
drmOutput
->
gpu
()
==
m_gpu
)
{
flags
|=
GBM_BO_USE_SCANOUT
;
}
else
{
flags
|=
GBM_BO_USE_LINEAR
;
}
auto
gbmSurface
=
std
::
make_shared
<
GbmSurface
>
(
m_gpu
->
gbmDevice
(),
size
.
width
(),
size
.
height
(),
GBM_FORMAT_XRGB8888
,
flags
);
if
(
!
gbmSurface
)
{
qCCritical
(
KWIN_DRM
)
<<
"Creating GBM surface failed"
;
return
false
;
}
auto
eglSurface
=
createEglSurface
(
gbmSurface
);
...
...
@@ -335,7 +327,7 @@ bool EglGbmBackend::resetFramebuffer(Output &output)
{
cleanupFramebuffer
(
output
);
if
(
output
.
output
->
hardwareTransforms
()
&&
!
output
.
onSecondaryGPU
)
{
if
(
output
.
output
->
hardwareTransforms
())
{
// No need for an extra render target.
return
true
;
}
...
...
plugins/platforms/drm/egl_gbm_backend.h
View file @
9679beac
...
...
@@ -74,14 +74,12 @@ private:
std
::
shared_ptr
<
GLVertexBuffer
>
vbo
;
}
render
;
bool
onSecondaryGPU
=
false
;
int
dmabufFd
=
0
;
gbm_bo
*
secondaryGbmBo
=
nullptr
;
gbm_bo
*
importedGbmBo
=
nullptr
;
};
bool
resetOutput
(
Output
&
output
,
DrmOutput
*
drmOutput
);
std
::
shared_ptr
<
GbmSurface
>
createGbmSurface
(
const
QSize
&
size
,
const
bool
linear
)
const
;
EGLSurface
createEglSurface
(
std
::
shared_ptr
<
GbmSurface
>
gbmSurface
)
const
;
bool
makeContextCurrent
(
const
Output
&
output
)
const
;
...
...
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