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
27e7dba1
Commit
27e7dba1
authored
Jan 28, 2021
by
Xaver Hugl
Browse files
Only release shared buffers right before the next frame
BUG: 425586
(cherry picked from commit
2c6d19fe
)
parent
ab5d1737
Changes
3
Hide whitespace changes
Inline
Side-by-side
plugins/platforms/drm/abstract_egl_drm_backend.h
View file @
27e7dba1
...
...
@@ -36,9 +36,6 @@ public:
Q_UNUSED
(
stride
)
return
0
;
}
virtual
void
cleanupDmabufForSecondaryGpuOutput
(
AbstractOutput
*
output
)
{
Q_UNUSED
(
output
)
}
virtual
QRegion
beginFrameForSecondaryGpu
(
AbstractOutput
*
output
)
{
Q_UNUSED
(
output
)
return
QRegion
();
...
...
plugins/platforms/drm/egl_gbm_backend.cpp
View file @
27e7dba1
...
...
@@ -271,6 +271,14 @@ int EglGbmBackend::getDmabufForSecondaryGpuOutput(AbstractOutput *output, uint32
if
(
it
==
m_secondaryGpuOutputs
.
end
())
{
return
-
1
;
}
if
(
it
->
dmabufFd
)
{
close
(
it
->
dmabufFd
);
it
->
dmabufFd
=
0
;
}
if
(
it
->
secondaryGbmBo
)
{
it
->
gbmSurface
.
get
()
->
releaseBuffer
(
it
->
secondaryGbmBo
);
it
->
secondaryGbmBo
=
nullptr
;
}
renderFramebufferToSurface
(
*
it
);
auto
error
=
eglSwapBuffers
(
eglDisplay
(),
it
->
eglSurface
);
if
(
error
!=
EGL_TRUE
)
{
...
...
@@ -289,27 +297,6 @@ int EglGbmBackend::getDmabufForSecondaryGpuOutput(AbstractOutput *output, uint32
return
it
->
dmabufFd
;
}
void
EglGbmBackend
::
cleanupDmabufForSecondaryGpuOutput
(
AbstractOutput
*
output
)
{
DrmOutput
*
drmOutput
=
static_cast
<
DrmOutput
*>
(
output
);
auto
it
=
std
::
find_if
(
m_secondaryGpuOutputs
.
begin
(),
m_secondaryGpuOutputs
.
end
(),
[
drmOutput
]
(
const
Output
&
output
)
{
return
output
.
output
==
drmOutput
;
}
);
if
(
it
==
m_secondaryGpuOutputs
.
end
())
{
return
;
}
if
(
it
->
dmabufFd
)
{
close
(
it
->
dmabufFd
);
it
->
dmabufFd
=
0
;
}
if
(
it
->
secondaryGbmBo
)
{
it
->
gbmSurface
.
get
()
->
releaseBuffer
(
it
->
secondaryGbmBo
);
it
->
secondaryGbmBo
=
nullptr
;
}
}
QRegion
EglGbmBackend
::
beginFrameForSecondaryGpu
(
AbstractOutput
*
output
)
{
DrmOutput
*
drmOutput
=
static_cast
<
DrmOutput
*>
(
output
);
...
...
@@ -471,7 +458,6 @@ void EglGbmBackend::renderFramebufferToSurface(Output &output)
output
.
importedGbmBo
=
importedBuffer
;
}
}
renderingBackend
()
->
cleanupDmabufForSecondaryGpuOutput
(
output
.
output
);
}
}
...
...
plugins/platforms/drm/egl_gbm_backend.h
View file @
27e7dba1
...
...
@@ -46,7 +46,6 @@ public:
void
addOutput
(
DrmOutput
*
output
)
override
;
void
removeOutput
(
DrmOutput
*
output
)
override
;
int
getDmabufForSecondaryGpuOutput
(
AbstractOutput
*
output
,
uint32_t
*
format
,
uint32_t
*
stride
)
override
;
void
cleanupDmabufForSecondaryGpuOutput
(
AbstractOutput
*
output
)
override
;
QRegion
beginFrameForSecondaryGpu
(
AbstractOutput
*
output
)
override
;
protected:
...
...
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