@@ -122,6 +122,12 @@ int SoftwareIspPipelineGpu::initBayerShaders(PixelFormat inputFormat, PixelForma
return ret;
}
+void SoftwareIspPipelineGpu::initShaderBenchMarks(void)
+{
+ gpuIspShaderPassBlcNormalise_.initShaderBenchMark();
+ gpuIspShaderPassDemosiac_.initShaderBenchMark();
+}
+
int SoftwareIspPipelineGpu::configure(const StreamConfiguration &inputCfg,
const std::vector<std::reference_wrapper<const StreamConfiguration>> &outputCfgs,
[[maybe_unused]] bool ccmEnabled)
@@ -283,6 +289,12 @@ int SoftwareIspPipelineGpu::processGPU(FrameBuffer *input, FrameBuffer *output,
return pipelineResult;
}
+void SoftwareIspPipelineGpu::printShaderBenchMarks(void)
+{
+ gpuIspShaderPassBlcNormalise_.printShaderBenchMark();
+ gpuIspShaderPassDemosiac_.printShaderBenchMark();
+}
+
void SoftwareIspPipelineGpu::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output, const DebayerParams ¶ms)
{
bench_.startFrame();
@@ -323,6 +335,7 @@ void SoftwareIspPipelineGpu::process(uint32_t frame, FrameBuffer *input, FrameBu
egl_.syncOutput();
bench_.finishFrame();
+ printShaderBenchMarks();
outputBufferReady.emit(output);
inputBufferReady.emit(input);
@@ -349,6 +362,8 @@ int SoftwareIspPipelineGpu::start()
if (initBayerShaders(inputPixelFormat_, outputPixelFormat_))
return -EINVAL;
+ initShaderBenchMarks();
+
/* Raw bayer input as texture */
eglImageBayerIn_ = std::make_unique<eGLImage>(gpuIspShaderPassBlcNormalise_.glFormat_, inputConfig_.stride / gpuIspShaderPassBlcNormalise_.getBytesPerPixel(), height_, inputConfig_.stride, GL_TEXTURE0, 0);
@@ -63,6 +63,8 @@ private:
int getShaderVariableLocations();
void setShaderVariableValues(const DebayerParams ¶ms);
int processGPU(FrameBuffer *input, FrameBuffer *output, const DebayerParams ¶ms, std::optional<MappedFrameBuffer> *mappedInputBuffer, std::optional<DmaSyncer> *inputBufferDmaSyncer);
+ void initShaderBenchMarks(void);
+ void printShaderBenchMarks(void);
/* Pointer to object representing input texture */
std::unique_ptr<eGLImage> eglImageBayerIn_;
Doing an optional synchronous print after syncOutput. The GPU has finished at this point so we can interrogate how long each shader took to execute. Only really interesting for a debug scenario. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> --- .../software_isp/software_isp_pipeline_gpu.cpp | 15 +++++++++++++++ .../software_isp/software_isp_pipeline_gpu.h | 2 ++ 2 files changed, 17 insertions(+)