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

VideoBufferDRMPRIME: extract video buffer interface #15963

Merged
merged 4 commits into from
May 2, 2019

Conversation

Kwiboo
Copy link
Member

@Kwiboo Kwiboo commented Apr 22, 2019

Description

This PR moves CVideoBufferDRMPRIME code, extracts a new IVideoBufferDRMPRIME interface and adds Map/Unmap callbacks.
ProcessInfoGBM is also registered with GBM GLES to use Deinterlace Half as fallback on arm devices (current fallback used for rpi, amlogic and android).

@lrusak please test this with your onging vaapi work, gem close is needed or v4l2 buffers is never released.

Motivation and Context

Preparations to be able to use direct-to-plane rendering with sw decoded video.

How Has This Been Tested?

Tested on LibreELEC using Rockchip and Allwinner devices.

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will 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

@@ -125,9 +128,11 @@ void CVideoLayerBridgeDRMPRIME::Unmap(CVideoBufferDRMPRIME* buffer)
buffer->m_handles[i] = 0;
}
}

buffer->Unmap();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to move the DRM_IOCTL_GEM_CLOSE into the Unmap() function in CVideoBufferDRMPRIME? It is not needed for VAAPI.

Copy link
Member Author

@Kwiboo Kwiboo May 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I want to move it to Unmap() unless keeping it here actually breaks VAAPI. All code references I can find points to that a drmPrimeFDToHandle handle should be DRM_IOCTL_GEM_CLOSE to release the reference hold.

I need to investigate more on how kernel handles reference count for different dma-buf imports, in case we can do some optimization or fix uneven reference count in decoder or kernel. Hopefully result of such investigation can be sent in a follow up PR in near future.

@lrusak lrusak self-assigned this Apr 29, 2019
@lrusak lrusak added Component: Video rendering Platform: Linux Type: Improvement non-breaking change which improves existing functionality v19 Matrix labels Apr 29, 2019
@lrusak lrusak added this to the M** 19.0-alpha 1 milestone Apr 29, 2019
@lrusak lrusak merged commit f286b8d into xbmc:master May 2, 2019
@Kwiboo Kwiboo deleted the drmprime-buffers branch May 2, 2019 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Video rendering Platform: Linux Type: Improvement non-breaking change which improves existing functionality v19 Matrix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants