| Message ID | 20251210005354.44726-19-bryan.odonoghue@linaro.org |
|---|---|
| State | Superseded |
| Headers | show |
| Series |
|
| Related | show |
Bryan O'Donoghue <bryan.odonoghue@linaro.org> writes: > 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. Let's try. > 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 | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp > index efe44e393..06f93ee0f 100644 > --- a/src/libcamera/software_isp/software_isp.cpp > +++ b/src/libcamera/software_isp/software_isp.cpp > @@ -123,8 +123,15 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor, > > #if HAVE_DEBAYER_EGL > std::optional<std::string> softISPMode = configuration.envOption("LIBCAMERA_SOFTISP_MODE", { "software_isp", "mode" }); > + if (softISPMode) { > + if (softISPMode != "gpu" && softISPMode != "cpu") { > + LOG(SoftwareIsp, Error) << "LIBCAMERA_SOFISP_MODE " << softISPMode.value() << " invalid. " > + << "must be \"cpu\" or \"gpu\""; I'd either replace the dot after "invalid" with a semicolon, or capitalize "must". Reviewed-by: Milan Zamazal <mzamazal@redhat.com> > + return; > + } > + } > > - if (softISPMode && softISPMode == "gpu") { > + if (!softISPMode || softISPMode == "gpu") { > debayer_ = std::make_unique<DebayerEGL>(std::move(stats), configuration); > if (!debayer_) { > LOG(SoftwareIsp, Error) << "Failed to instantiate GPUISP";
diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp index efe44e393..06f93ee0f 100644 --- a/src/libcamera/software_isp/software_isp.cpp +++ b/src/libcamera/software_isp/software_isp.cpp @@ -123,8 +123,15 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor, #if HAVE_DEBAYER_EGL std::optional<std::string> softISPMode = configuration.envOption("LIBCAMERA_SOFTISP_MODE", { "software_isp", "mode" }); + if (softISPMode) { + if (softISPMode != "gpu" && softISPMode != "cpu") { + LOG(SoftwareIsp, Error) << "LIBCAMERA_SOFISP_MODE " << softISPMode.value() << " invalid. " + << "must be \"cpu\" or \"gpu\""; + return; + } + } - if (softISPMode && softISPMode == "gpu") { + if (!softISPMode || softISPMode == "gpu") { debayer_ = std::make_unique<DebayerEGL>(std::move(stats), configuration); if (!debayer_) { LOG(SoftwareIsp, Error) << "Failed to instantiate GPUISP";
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 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)