Skip to content
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

Merged
merged 7 commits into from Aug 17, 2018

Conversation

Kwiboo
Copy link
Member

@Kwiboo Kwiboo commented Jul 26, 2018

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 decoded AVFrame / 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 to CVideoLayerBridgeDRMPRIME.

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

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

@jenkins4kodi jenkins4kodi added the Rebase needed PR that does not apply/merge cleanly to current base branch label Aug 1, 2018
@Rechi Rechi requested a review from lrusak August 3, 2018 18:49
@jenkins4kodi jenkins4kodi removed the Rebase needed PR that does not apply/merge cleanly to current base branch label Aug 3, 2018
@Kwiboo
Copy link
Member Author

Kwiboo commented Aug 3, 2018

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 saveBuffers changes I made to Flush.

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.

@Kwiboo
Copy link
Member Author

Kwiboo commented Aug 3, 2018

Updated once more to fix the build issue and I also reverted the saveBuffers changes, will leave saveBuffers for a future PR

@Kwiboo
Copy link
Member Author

Kwiboo commented Aug 6, 2018

@lrusak I made some small changes: added support for saveBuffers and renderer now signals it need the buffer until it is unmapped.

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.

This comment was marked as spam.

}
}

void CVideoLayerBridgeDRMPRIME::Configure(CVideoBufferDRMPRIME* buffer)

This comment was marked as spam.

This comment was marked as spam.


#pragma once

class CVideoLayerBridge

This comment was marked as spam.

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants