New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RendererDRMPRIME: reference count video buffers presented on screen #14232
Conversation
Code has now been rebased and a fix for use of drm modifiers was added. This needs some more testing, could be that I added a fb/gem leak with the |
buf.videoBuffer = picture.videoBuffer; | ||
buf.videoBuffer->Acquire(); | ||
} | ||
|
||
void CRendererDRMPRIME::Reset() | ||
void CRendererDRMPRIME::Flush(bool saveBuffers) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Updated once more to fix the build issue and I also reverted the |
@lrusak I made some small changes: added support for I will squash and force push after current build completes, it should be ready to merge after that unless you want me to make any changes. |
void Disable() override; | ||
|
||
virtual void Configure(CVideoBufferDRMPRIME* buffer); | ||
virtual void SetVideoPlane(CVideoBufferDRMPRIME* buffer, const CRect& destRect); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
} | ||
} | ||
|
||
void CVideoLayerBridgeDRMPRIME::Configure(CVideoBufferDRMPRIME* buffer) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
#pragma once | ||
|
||
class CVideoLayerBridge |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Description
This PR adds a video layer "bridge" between the drm prime renderer and gbm windowing to handle reference count and map/unmap of video frames that is presented on screen.
CDVDVideoCodecDRMPRIME
Interacts with FFmpeg and creates
CVideoBufferDRMPRIME
objects wrapping decodedAVFrame
/AVDRMFrameDescriptor
.CRendererDRMPRIME
Keeps track of video buffers that should be presented on screen same as any other renderer. Pushes the
CVideoBufferDRMPRIME
that is to be presented on screen toCVideoLayerBridgeDRMPRIME
.CVideoLayerBridgeDRMPRIME
Maps video buffers and adds the frame buffer to the next atomic drm commit, unmap/releases the video buffer once it no longer is presented on screen. Disables the video plane when video playback is stopped before the last video buffer is unmap/released.
CVideoLayerBridgeDRMPRIME
can also configure HDR and HDMI properties when the video layer is activated, an example for Rockchip BSP kernel can be found at Kwiboo/xbmc@drmprime-bridge...Kwiboo:drmprime-bridge-rockchip (mainline kernel do no yet support such properties).Motivation and Context
This fixes a "black-on-stop" issue that can be observed on Rockchip when there is no resolution change at end of video playback, the display pipeline could end up disabled and the TV would show a no-signal message.
How Has This Been Tested?
Tested on my Tinker Board S and Rock64
An earlier version of this patchset has been part of my test images at http://kwiboo.libreelec.tv/test/
Screenshots (if appropriate):
Types of change
Checklist: