[v3,35/39] libcamera: software_isp: debayer_egl: Make gpuisp default softisp mode
diff mbox series

Message ID 20251015012251.17508-36-bryan.odonoghue@linaro.org
State New
Headers show
Series
  • Add GLES 2.0 GPUISP to libcamera
Related show

Commit Message

Bryan O'Donoghue Oct. 15, 2025, 1:22 a.m. UTC
In some cases the GPU can deliver 15x performance in Debayer with the
CCM on, reference hardware Qualcomm RB5 with IMX512 sensor.

Given this large performance difference it makes sense to make GPUISP
the default for the Software ISP.

If LIBCAMERA_SOFTISP_MODE is omitted gpu will be the default. If
libcamera is compiled without gpuisp support, CPU Debayer will be used.

It is still possible to select CPU mode with LIBCAMERA_SOFISP_MODE=cpu.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 src/libcamera/software_isp/software_isp.cpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp
index 869f7320..1b4a29fd 100644
--- a/src/libcamera/software_isp/software_isp.cpp
+++ b/src/libcamera/software_isp/software_isp.cpp
@@ -120,10 +120,17 @@  SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,
 	}
 	stats->statsReady.connect(this, &SoftwareIsp::statsReady);
 
-#if HAVE_DEBAYER_EGL
 	const char *softISPMode = utils::secure_getenv("LIBCAMERA_SOFTISP_MODE");
+	if (softISPMode) {
+		if (strcmp(softISPMode, "gpu") && strcmp(softISPMode, "cpu")) {
+			LOG(SoftwareIsp, Error) << "LIBCAMERA_SOFISP_MODE " << softISPMode << " invalid. "
+						<< "must be \"cpu\" or \"gpu\"";
+			return;
+		}
+	}
 
-	if (softISPMode && !strcmp(softISPMode, "gpu"))
+#if HAVE_DEBAYER_EGL
+	if (!softISPMode || !strcmp(softISPMode, "gpu"))
 		debayer_ = std::make_unique<DebayerEGL>(std::move(stats), configuration);
 #endif
 	if (!debayer_)