media/gpu/v4l2vea: allocate as many buffers as possible in DMABUF mode
If we are operating in DMABUF mode, then we will try to keep the same frame assigned to the same V4L2 buffer. However we don't know in advance how many different frames the encoder will use, only that it is probably larger than the default 2 we are currently allocating. If we undershoot then we will spend a lot of time in-kernel unmapping/remapping DMABUFs. Try to prevent this by allocating as many buffers as allowed by the V4L2 API (32) when operating in DMABUF mode. Since these buffers won't have backing memory unless we attach a DMABUF to them, they are virtually free if unused. BUG=b:159688625 BUG=b:167412992 TEST=video.EncodeAccel.h264_360p_i420 passes on Kukui. Change-Id: Ia24a6bd8574f5d3894237ca0e563ea4cbff3a631 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2415911 Commit-Queue: Alexandre Courbot <acourbot@chromium.org> Reviewed-by:Fritz Koenig <frkoenig@chromium.org> Cr-Commit-Position: refs/heads/master@{#813545}
Showing
Please register or sign in to comment