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

Do not map linear surface with no cache. #620

Closed
xuguangxin opened this issue May 9, 2019 · 12 comments
Closed

Do not map linear surface with no cache. #620

xuguangxin opened this issue May 9, 2019 · 12 comments
Assignees
Labels
Bug Issue: identify as a bug P3 Low priority no customer usage, no business requirements, not from communities, just from internal verifying PR: fix ready and verifying with build/test VP Video Processing

Comments

@xuguangxin
Copy link
Contributor

The driver always uses mapgtt on the atom. No matter it’s tiled or linear surface. This logic does not exist on i965.
The logic will disable cache for linear surface and slow down the cpu access.
If we have this issue, two important and typical use cases are not possible:

  1. decode output -> scale and csc to i420 surface -> send i420 surface directly to sw encoder.
  2. decode output -> scale and csc to RGB surface -> use RGB surface directly for cpu based post-processing.

Please help fix it.
thanks

@FurongZhang FurongZhang self-assigned this May 9, 2019
@FurongZhang
Copy link
Contributor

I will be OOO ww20. Will follow up this issue ww21.

@FurongZhang FurongZhang added the VP Video Processing label May 9, 2019
@xuguangxin
Copy link
Contributor Author

Thanks, Furong for quick response

@FurongZhang
Copy link
Contributor

Sorry for the late response because of taking annual leave. I will check this issue this week.

@FurongZhang
Copy link
Contributor

@xuguangxin , I filed pull request for this issue. Please help to review that, thanks a lot in advance!
#646

@xuguangxin
Copy link
Contributor Author

thanks @FurongZhang , @fulinjie could you help check it benefits.
decode output -> scale and csc to i420 surface -> send i420 surface directly to x264
or not?
thanks

@fulinjie
Copy link
Contributor

Trid above pipeline but failed with cmdline:
ffmpeg -hwaccel qsv -c:v h264_qsv -i 9-\ 4K-\ Nature-\ H264-\ SDR_60fps.mp4 -vf "scale_qsv=format=yuv420p,hwdownload,format=yuv420p" -c:v libx264 -f h264 /dev/null

And I tried HW decode + CSC to rgb32 pipeline on APL, the performance is similar:
ffmpeg -hwaccel qsv -c:v h264_qsv -i 9-\ 4K-\ Nature-\ H264-\ SDR_60fps.mp4 -vf "scale_qsv=format=rgb32,hwdownload,format=rgb32" -f rawvideo -pix_fmt rgb32 /dev/null

frame= 41 fps=3.9 q=-0.0 Lsize= 1328400kB time=00:00:00.68 bitrate=15909330.9kbits/s speed=0.0652x

With gpu_copy, it can reach up to 30 fps.

@FurongZhang FurongZhang added verifying PR: fix ready and verifying with build/test Bug Issue: identify as a bug labels Jun 17, 2019
@xuguangxin
Copy link
Contributor Author

Hi @FurongZhang ,
I double confirmed @fulinjie 's finding.
The iHD driver uses mos_bo_map map linear surface, but the performance is still not good.

you can use libyami to reproduce the issue. the command is
$yamidecode -i test.264 -m 0

use iHD driver with your patch, we only get about 10fps for a 1080P video.
use i965 driver, it can reach 100+fps.

Is anything we missed here?

thanks

@xuguangxin
Copy link
Contributor Author

@FurongZhang , any feedback on this?
thanks

@FurongZhang
Copy link
Contributor

I will check this function mos_bo_map and why it does not take effect as expected.

@xuguangxin
Copy link
Contributor Author

xuguangxin commented Jun 28, 2019

thanks @FurongZhang , waiting for your feedback

@xuguangxin
Copy link
Contributor Author

@XinfengZhang , any progress on this?

thanks

@XinfengZhang XinfengZhang added the P2 Medium priority label Jan 31, 2021
@FurongZhang FurongZhang added P3 Low priority no customer usage, no business requirements, not from communities, just from internal and removed P2 Medium priority labels Dec 21, 2021
@FurongZhang
Copy link
Contributor

Please use this patch https://github.com/intel/media-driver/pull/646/files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issue: identify as a bug P3 Low priority no customer usage, no business requirements, not from communities, just from internal verifying PR: fix ready and verifying with build/test VP Video Processing
Projects
None yet
Development

No branches or pull requests

4 participants