DRMPRIME video acceleration on XU4

Moderators: mdrjr, odroid

DRMPRIME video acceleration on XU4

Unread postby memeka » Wed Jul 11, 2018 11:59 pm

Why? Because it will allow us to play video using less resources!
Is it possible? Yes it is!

But it's a bit more difficult than on other boards, because the MFC hardware decoder and the exynos DRM don't understand each-other (don't use the same pixel format).
Then how to achieve it then?

1. Someone that knows the hardware (samsung/HK) implements the video plane in the exynos DRM. The hardware exists, but the driver is not implementing it. Then the MFC can send the video to the DRM video plane directly! But it's not very likely to happen :(

2. Use DRMPRIME+EGL! MFC sends DRMPRIME to the GPU, the GPU imports the dma buffer, converts and displays the video. This could work very nicely, but unfortunately the current mali drivers don't have dmabuf import for DRM/GBM (or it does not work). HK can investigate how to fix dmabuf import in the mali gbm driver. Or maybe release newer mali driver where dmabuf import works...

3. Do a workaround! A custom FFMPEG will use MFC decoder to make dma buffer, then send this to the GScaler hardware converter, which will then send also using dma buffer DRMPRIME to the DRM!

Since I am sure HK is busy now doing the N2, I had to go for option #3. My ffmpeg version is not very optimized yet, but it can already play 1080p video using 30% CPU. This is 2x better than before... kodi requires 60-80% CPU to play 1080p video. With a more optimized version, it can go close to 15% CPU!

Let's see: video on one DRM plane, and OSD on another DRM plane:

NEXT => integrate with Kodi.

But before that, it seems there are more issues with the exynos DRM, because sometimes the kernel crashes from DRMPRIME. So this needs to be fixed first :(
I would appreciate help as well in developing this. I have my ffmpeg version here: https://github.com/mihailescu2m/ffmpeg/tree/v4l2-drmprime and I'm using kodi and mpv mainline, or this little program to test: https://github.com/BayLibre/ffmpeg-drm.
User avatar
Posts: 3953
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: DRMPRIME video acceleration on XU4

Unread postby AreaScout » Thu Jul 12, 2018 12:16 am

+1 on this ! memeka i was about to discuss this with you on IRC, but after saturday my desktop computer makes lot of problems with user profile and possible data loss, i am still troubleshooting because i have very unique configuration that would take me weeks to configure this, so i had limited access to internet and things and still do now.
User avatar
Posts: 563
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Return to Ubuntu

Who is online

Users browsing this forum: crazyquark, Google [Bot] and 1 guest