libv4l-rockchip_v2: Adjust height for I420 to fit DMA alignment

Chromium sometimes uses USERPTR buffers to pass raw frames to the
encoder. USERPTR requires the size of the buffer fit cache alignment
for reliable DMA, which on ARM64 happens to be 128.

Normally we would adjust sizeimage to fit the alignment, but Chromium
currently ignores sizeimage passed back by V4L2, and only uses width
and height to compute a buffer size. To work around this, have the
libv4l plugin round up the height of the output format before it is
passed to the kernel, such that it fits the DMA alignment.

BUG=b:250800750
BUG=chromium:1362996
TEST=Screen share on Kevin should use hardware encoder

Change-Id: I3e4c63bb45b7bc9d50216371b0f7dcaf384c04a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/libv4lplugins/+/3933923
Reviewed-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Tested-by: Hirokazu Honda <hiroh@chromium.org>
Commit-Queue: Chen-Yu Tsai <wenst@chromium.org>
1 file changed
tree: 785dc2a0149c113045f6b8ecbbb42cccb050ee17
  1. libv4l-rockchip/
  2. libv4l-rockchip_v2/
  3. OWNERS
  4. PRESUBMIT.cfg