Files
external_libcamera/include/libcamera/internal/software_isp/benchmark.h
Hans de Goede 7bcc2168bf software_isp: benchmark: Print what is being benchmarked
With the GPU accelerated softISP 2 separate benchmark results are printed,
1 for the generation of the output images on the GPU and a separate one
for generating the statistics on the CPU.

Add a new name argument to the Benchmark class descriptor and print this
out when printing the benchmark result.

Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2026-02-18 10:48:52 +00:00

42 lines
888 B
C++

/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2024, Red Hat Inc.
*
* Authors:
* Hans de Goede <hdegoede@redhat.com>
*
* Simple builtin benchmark to measure software ISP processing times
*/
#pragma once
#include <stdint.h>
#include <string>
#include <time.h>
#include <libcamera/base/log.h>
#include "libcamera/internal/global_configuration.h"
namespace libcamera {
class Benchmark
{
public:
Benchmark(const GlobalConfiguration &configuration, const std::string &name);
~Benchmark();
void startFrame(void);
void finishFrame(void);
private:
std::string name_;
timespec frameStartTime_;
bool measure_;
/* Skip 30 frames for things to stabilize then measure 30 frames */
unsigned int encounteredFrames_ = 0;
int64_t frameProcessTime_ = 0;
unsigned int skipBeforeMeasure_ = 30;
unsigned int framesToMeasure_ = 30;
};
} /* namespace libcamera */