libcamera: V4L2BufferCache: Check for hot hit first
Check for a hot cache hit before updating which buffer is best to evict in case no hot hit is found. This doesn't change the behaviour, but follows a more logical flow. Suggested-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
@@ -212,15 +212,15 @@ int V4L2BufferCache::get(const FrameBuffer &buffer)
|
||||
if (!entry.free)
|
||||
continue;
|
||||
|
||||
if (use < 0)
|
||||
use = index;
|
||||
|
||||
/* Try to find a cache hit by comparing the planes. */
|
||||
if (entry == buffer) {
|
||||
hit = true;
|
||||
use = index;
|
||||
break;
|
||||
}
|
||||
|
||||
if (use < 0)
|
||||
use = index;
|
||||
}
|
||||
|
||||
if (!hit)
|
||||
|
||||
Reference in New Issue
Block a user