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
[RFC] add video backend for Exynos based boards #4986
Conversation
This is inspired by the drm_common helper, but uses the more recent atomic KMS API. This helper will be used by the Exynos vo backend.
Returns some information about a given struct mp_image_params. We kinda need this info for the Exynos vo backend.
This is a DRM/KMS style render which uses the G2D and IPP infrastructure of the Exynos SoC to accelerate colorspace conversion and scaling.
Integrate the new vo with the build system and add a bit of documentation.
Shouldn't modern DRM support color conversion etc. by itself? Why is there still vendor-specific code (all those exynos_ functions) in this? There are some plans of adding atomic KMS support with DRM YUV overlay support, which would benefit RockChip. |
No, core DRM doesn't handle CSC at all. You can query which hardware plane supports which color formats, but you're limited to using these or performing CSC in software to get an adequate format for presentation. In fact, the IPP rewrite was first intended to be much broader, in the sense that it should've served as a general API in DRM space to allow for abstraction of CSC, scaling and maybe bitblit operation. That was quickly aborted by the DRM maintainers. In short: There is never going to be a core DRM API that does CSC. It's always going to be vendor-specific. |
For reference, here is the original approach by Marek: As you can see, this was quickly NAKed by most DRM folks. |
This doesn't fit into our architecture. We're not going to have N vendor specific VOs. Enough is enough. The hope was that DRM would get rid of those vendor-specific Linux video API pieces of shit. (Including mmal.) |
OK, so what would need to happen to have a chance of getting this upstream? |
That really sounds like they're shooting themselves into their own feet. (Or whatever that idiom is.) On the other hand, there's stuff like v4l2 M2M, which is rather inappropriate in the kernel (according to some people's opinion), and all kinds of shoehorned into it. Were other proposals into that direction shot down too, or is it just an issue with details about concrete API proposals? I don't know what's the problem with having such an API. Video filters aren't exactly a new concept, and they've roughly stayed the same in concept for decades. In any case, DRM does support color space conversion, by nv12 surface scanout. Rockchip and apparently vaapi support this. It requires making all the messy video conversion details (colorspaces etc.) part of the DRM API.
I definitely don't want more special VOs. But if it could be modulerized in a nice way, it would be acceptable. For example look at existing desktop API stuff in mpv. I can list the following examples of somewhat successful modularization:
Now I'm not saying that exynos(whatever fit into any of this. But I could imagine that there could be an "overlay" VO, or maybe vo_drm (or vo_drm_atomic) with multiple backends for specific hardware. That kind of stuff. The idea is to reduce vendor specific "garbage" to as little code as possible, and keeping the glue code (and what can be shared) as common code. |
Closing this for now. I got enough feedback on IRC. Going to be back once I have come up with a better design. |
Hi,
at the moment it's difficult to get well performing video playback on Exynos based development boards, without the help of the GPU. Since most (or all?) available SoCs have some Mali GPU, it's impossible to get decent video playback when using an upstream kernel.
Recently some rewrite of the IPP kernel API was published:
https://www.spinics.net/lists/linux-samsung-soc/msg60657.html
This API exposes blocks on the SoC to userspace, which are capable of video format CSC and scaling. On Exynos4 SoCs this would be the FIMC, on Exynos5 some other, but similar, block is available.
This RFC introduces a new vo which uses this IPPv2 API, together with the atomic KMS API.
The necessary libdrm bits can be found here:
https://github.com/tobiasjakobi/libdrm/tree/ippv2
The vo is still very much incomplete:
I have, inspired by drm_common, tried to put all Exynos agnostic code into a new atomic KMS module.
Looking forward to some feedback. Again, this is an RFC. The aforementioned kernel patches haven't landed yet, and the userspace API in libdrm is preliminary.
I have tested the backend with my ODROID-X2, which is Exynos4412 based, with the Sintel and the Big Buck Bunny movie so far (H264, 1080p, 30fps).
A lot of Hardkernel boards should be able to benefit from this vo, in particular the X, X2, U2 and U3 from the ODROID series. But as I said, the IPPv2 API is also designed to work on Exynos5, so some of the Chromebooks as well.