From patchwork Mon Feb 24 19:35:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 2874 Return-Path: Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 911B96042F for ; Mon, 24 Feb 2020 20:36:24 +0100 (CET) X-Halon-ID: e5941d26-573c-11ea-9f40-0050569116f7 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p4fca2392.dip0.t-ipconnect.de [79.202.35.146]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id e5941d26-573c-11ea-9f40-0050569116f7; Mon, 24 Feb 2020 20:36:18 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Mon, 24 Feb 2020 20:35:57 +0100 Message-Id: <20200224193601.1040770-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/4] libcamera: V4L2BufferCache: Improve cache eviction strategy X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2020 19:36:24 -0000 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