[libcamera-devel] [PATCH v2 0/4] libcamera: V4L2BufferCache: Improve cache eviction strategy

Niklas Söderlund niklas.soderlund at ragnatech.se
Mon Feb 24 20:35:57 CET 2020


Hello,

This small series improves the function of the V4L2BufferCache and how
it selects which cache entries to evict. This solves a real issue where 
if the cache is not pre-allocated the cache can perform suboptimally and 
not utilise all the entries in the cache.

Patch 1/4 fix an error in the test class BufferSource found as code in 
v1 of this series was based on it. 2/4 Extracts the BufferSource from 
the camera buffer import test so it can be used in 3/4 where the test 
for the V4L2BufferCache is added. Patch 3/4 also add tests which breaks 
without the improved cache eviction strategy introduced in 4/4.

Niklas Söderlund (4):
  test: camera: buffer_import: Fix error messages
  test: Extract BufferSource class out of camera tests to libtest
  test: v4l2_videodevice: Add test for V4L2BufferCache
  libcamera: V4L2BufferCache: Improve cache eviction strategy

 src/libcamera/include/v4l2_videodevice.h |   1 +
 src/libcamera/v4l2_videodevice.cpp       |   9 +-
 test/camera/buffer_import.cpp            |  92 +---------
 test/libtest/buffer_source.cpp           |  98 +++++++++++
 test/libtest/buffer_source.h             |  32 ++++
 test/libtest/meson.build                 |  11 +-
 test/v4l2_videodevice/buffer_cache.cpp   | 215 +++++++++++++++++++++++
 test/v4l2_videodevice/meson.build        |   1 +
 8 files changed, 361 insertions(+), 98 deletions(-)
 create mode 100644 test/libtest/buffer_source.cpp
 create mode 100644 test/libtest/buffer_source.h
 create mode 100644 test/v4l2_videodevice/buffer_cache.cpp

-- 
2.25.0



More information about the libcamera-devel mailing list