-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Conversation
@@ -125,9 +128,11 @@ void CVideoLayerBridgeDRMPRIME::Unmap(CVideoBufferDRMPRIME* buffer) | |||
buffer->m_handles[i] = 0; | |||
} | |||
} | |||
|
|||
buffer->Unmap(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Description
This PR moves
CVideoBufferDRMPRIME
code, extracts a newIVideoBufferDRMPRIME
interface and addsMap
/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
Checklist: