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

How to request stride alignment when decoding #507

Open
hbiyik opened this issue Jan 3, 2024 · 6 comments
Open

How to request stride alignment when decoding #507

hbiyik opened this issue Jan 3, 2024 · 6 comments

Comments

@hbiyik
Copy link

hbiyik commented Jan 3, 2024

When drm prime frames are imported with EGL, mesa expects 64 byte aligned frames, if not EGL does not import.

I am working around it by processing the decoded frames with RGA to 64 byte aligned strides but thats kind of non optimal.

Instead, is it possible to request from mpp a custom (ie: 64) byte alignment of strides when decoding?

Reference: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19620

@kyak
Copy link

kyak commented Mar 15, 2024

It would be great to hear from develovers on this issue.

@HermanChen
Copy link
Collaborator

Yes, 64 align is ok for mpp. But for some resolution like 4096 width the hardware performance is lower then expected. So we use 256 odd align to keep the performace.
Need a global option?

1 similar comment
@HermanChen
Copy link
Collaborator

Yes, 64 align is ok for mpp. But for some resolution like 4096 width the hardware performance is lower then expected. So we use 256 odd align to keep the performace.
Need a global option?

@hbiyik
Copy link
Author

hbiyik commented Mar 16, 2024

256 align is also fine, the problem is when it is not 64 aligned, ie 16 or 32. So may be instead of requesting alignment, it is also feasible to bump the minimum alignment to 64.

Just like @nyanmisaka s patch for h264 and av1, but for all decoders.

nyanmisaka/ffmpeg-rockchip#39 (comment)

@hbiyik
Copy link
Author

hbiyik commented Mar 16, 2024

Because not for vallhall but for <v10 mali gpus, 64 is the minium alignment requirement to import to gpu

@nyanmisaka
Copy link
Contributor

nyanmisaka commented Mar 16, 2024

Yes, 64 align is ok for mpp. But for some resolution like 4096 width the hardware performance is lower then expected. So we use 256 odd align to keep the performace. Need a global option?

Yes. We need an option to override the MPP built-in hal_hor_align() func. 256 odd multiple alignment already ensures that it is 64-aligned, so VP9 and HEVC are not affected by this problem. But codecs such as H264, AV1 and MPEG1/2/4 require this.

Not only does Mali GPU require 64-aligned when importing textures through EGL, but also using RGA3 (RK3588) only supports 64-aligned for 10-bit formats such as NV15 and NV20. (decoder/nv15 -> rga3 -> nv12 -> encoder)

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

No branches or pull requests

4 participants