From patchwork Tue Dec 2 13:45:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 25325 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 4DB3FC32F4 for ; Tue, 2 Dec 2025 13:46:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5E4B960F4E; Tue, 2 Dec 2025 14:46:24 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="wNw0cItN"; dkim-atps=neutral Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6254A60D2D for ; Tue, 2 Dec 2025 14:46:16 +0100 (CET) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-477b198f4bcso40708765e9.3 for ; Tue, 02 Dec 2025 05:46:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764683176; x=1765287976; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TolVqEkHZsRaLOAV12HngkrzaM70wlhXChPq2Fetlso=; b=wNw0cItNuUCklfEFz/euLUQ21yJPD4ErlX/fgct5PKfyqtdvveYDPsDTIb1xU9S0eH D4eUBGr3pg0z8V7d2hPLot53xoqS2RCRXZ0VaDOad8OEdzZPcLQSKLGuXVlSyyFW5UmT YlnIEhh7IJod2hkbEcgOIKpwyctbOCOtZ6fNzgJpC3ABQZtQEviTJznuYZspZ7/U79Hh bpVIv/sTq4mArTAhFKPhe0hwNQpZ05llxLNcZYBGXkwJaDsXiWwu3lGbvJgCdSDkDZ39 wfPUWkAlNOr2/frbrb3nwNTReu4nKd2HNgxGCIzeKMWdFHzOaC1mC+tByq2zuKOeu7Tt UNfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764683176; x=1765287976; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=TolVqEkHZsRaLOAV12HngkrzaM70wlhXChPq2Fetlso=; b=jjkeLy4GlVwQx74i+W9JHnBQ22p/DDxwnhm0mS0xKt/Wxpyt5lf2ajJcMI0VQAOGFx wCvJ0eIo3APPENhueMAbOZf5fM8LelYgY0+jzfrEXLa9yK0QX09BG4HZj2ADJPNMs5aU cXKwnLLU8dS746YUel9jKDpu8LwghRcgEgUWju73jU/Ed2UnfEvV27fFrlhuNBXCVw5o TyXNRAmmdoBma5t1TArY/sRk1lX/hhDfmLy7fw9j8lC19YaqPSjwkRqcZ8y4jpfHJhxA 3cNQ5hs0Wrba6s5ScXckMluTVUYrAmy67nXB+1vuSkqi4TJUk+BayGlzcsVrObUhIruS rAKQ== X-Gm-Message-State: AOJu0YxP1hGmadQPy/ZoQk0CMP8OmKaRWBAl4cf2z1C0vo/e8WG6bCI8 e7/kdfnmb43GXJ5JJMItT2D1htiyhzkbl7hfHC25Gn13QqeLHEU35He72uEhmlNezXQzsWByslV sZ59y X-Gm-Gg: ASbGncvoDwxGqVOezoGLOEv08EDr1jAYoK/mz1nTevXjDuOks6oemqVRbF4doos2haX 5G2VujCu323tdtuFl2yH5bqgHQn/+97ZIfAYh6gWbJFwoFF5Hynf6ZP5UEwxYgt2C4pmNR8xLVl R2Y+/7ocNOReZDpmfGzS+HkEzX0lrb/NwflBZtmBbuIuCCjnt3shcXSkdSWz8IMta10N78TQsVb FNC6NFDO+wq0QZsdJB+ACivce3qwTF69DJR5tRpny3oGxx18bAC9UHTHQT0YDmOfWXkW719TQee 2rZt9S3Sy+Z5N5miHzPeqQWw6p1Q7c1lUJrgNe1160i2NxTgx9SQG9KOFU/hvBwBoijcxuAsHbh 4Si+l82U73zDa5GrPDA8Oa3hVQiC+zvg+N9uRD+u1yGbqfQiLF1qrYwtkbNwHs21jogAZbe+gYs lw5kpZ+pXhGEQvgRMwNPI0MIoLgkPpPgWi5EvMl1Ova86X2XbE3s8JcWpxaLZQBymM6TOsUYdBE yXGjg== X-Google-Smtp-Source: AGHT+IEzYmiL2FE4oKEpDHtVWmuiqaSNHgfYo1XLBzs9mI8kvpHVFkCO0EyUrpLQX7Mbf/yGGVrT2Q== X-Received: by 2002:a05:600c:840f:b0:477:952d:fc00 with SMTP id 5b1f17b1804b1-477c0176752mr478108635e9.12.1764683175693; Tue, 02 Dec 2025 05:46:15 -0800 (PST) Received: from inspiron14p-linux.ht.home (188-141-3-146.dynamic.upc.ie. [188.141.3.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47926f0ec69sm19383375e9.1.2025.12.02.05.46.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Dec 2025 05:46:15 -0800 (PST) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: pavel@ucw.cz, Bryan O'Donoghue Subject: [PATCH v6 16/24] libcamera: software_isp: debayer_egl: Make gpuisp default softisp mode Date: Tue, 2 Dec 2025 13:45:36 +0000 Message-ID: <20251202134544.662446-17-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251202134544.662446-1-bryan.odonoghue@linaro.org> References: <20251202134544.662446-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 --- src/libcamera/software_isp/software_isp.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp index 125a5dd81..fd68dd0c5 100644 --- a/src/libcamera/software_isp/software_isp.cpp +++ b/src/libcamera/software_isp/software_isp.cpp @@ -121,10 +121,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(std::move(stats), configuration); if (!debayer_) { LOG(SoftwareIsp, Error) << "Failed to instantiate GPUISP";