From patchwork Tue Apr 22 21:59:14 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: 23234 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 C36F8C3320 for ; Tue, 22 Apr 2025 22:00:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 17F2968B37; Wed, 23 Apr 2025 00:00:01 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="pUjlyZN3"; dkim-atps=neutral Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0F18068B3B for ; Tue, 22 Apr 2025 23:59:44 +0200 (CEST) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-39c1ef4acf2so3680252f8f.0 for ; Tue, 22 Apr 2025 14:59:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745359183; x=1745963983; 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=dfrf9NfeIzeHZUKoKR6Xey4sb9Odqh4LqL16fz3Aurk=; b=pUjlyZN3wzoXbNf4yeD5wqSUVCD/jaW0n74YNEppTDl42ATDezvfisq63Oj6I+OR8X MhvA7vCtQB/pjxv/QF2NSK7qOMJoyA6jPvMaWiSWnvSP3Nx7PybDSLGGsKsWr2+RjEez gZCneI4spWIMGfSjnOVCCxJoKUffHdZ3+4KyGvlrExu0AO7AOLSJ9czW+EycwJMxw4Kx kbBBIwihvahppeWPFRIuD0jdMuxc/A/D5/owKLqG6pvrgbA6/T/FVzg3G/q5U5ixVXhN 8akgO98igLmvvM0NbHqOXquANcJk+rbk5CxKD0vjlNoM/7GM1RA1fe8coH6lGkW//Kp3 zxXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745359183; x=1745963983; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dfrf9NfeIzeHZUKoKR6Xey4sb9Odqh4LqL16fz3Aurk=; b=sv+unWVtMctRW1On3tF7xT/pYSX5xKCdMAGWI+kbjRrCCbcaCFE4ncZkk5ZClUlE0R QSa2UFqk0JtJdxqFeyLvRWITzC6xuU1HE3WWARSaU3abJ7v+KHUMlUATsqjCUtDhcFkn AenmrITwVhA33Sr0RKERHQvTiWUNvGTT9ATefQAlAsAEf6yZ+Be5UkCL3ad5RX+xNGke PAG8U/+9FJnPeErZ3qmeLd5V7JGehk5Xn4wbOq1fc3wteATuGmmE3SLoXyeN8Mj3jytU FiMLcfzCzzLfihnp1qrdOS0sKOHR0pFOPHn4CtFDk/x0p2iIVKTafY30kqBLZFV3Odjp wEuw== X-Gm-Message-State: AOJu0YybsZoUw0LhK3GQgTHdU3lvmdsH0WdgzLcPOvy7/RTvo2lfOk4E leYN6XwG12p/9ch0dYGFGrsep1ehNuIm0+w27WziFfamHri21wbRDfEoyTGksgRKLT8Za8hfSha tX2Y= X-Gm-Gg: ASbGncuz7wEnTdqxlJfunbC0HiWc0Jw/60XoDojhtM64x3wI5SLm0HvytYNP9ku9ZAN NnVLDeDuWNsAn6vHPldMTNxssR3yzZMChGHGVEFpnD/PYbHuXD22WQhhF7x5DEa2iWboDJLmzwe Yrfv0uJJxXIjX71GU8LSdIii426eylawRaaddoCFFLZfJgunK+IIUrTyElxOGuZn8m4J69ONhl6 XmaEGL6EkgJ3Szd9GRaJLLnmryx85PSrK1JIZe0kHvcXlvZWJAIFiGTvnM0RdBgOz5UDGhEph3z J3/5VC9RWIBBKfS/MZdFAZ+Vwk2cG3HKreZqafVULH3cXlgnGgSBsMEexXuK5eSkmouqw63aPj9 4CJiMgd1ckq5CH1zjtVN6 X-Google-Smtp-Source: AGHT+IFq3iNq33PAXIwtpC5e1ualOsqGlxo7UJzEBasQHsQAg1Dcovnyc4/zHwxboOs+sqziSjHTYA== X-Received: by 2002:a05:6000:40ce:b0:39c:1257:dba8 with SMTP id ffacd0b85a97d-39efbaf201amr12617212f8f.56.1745359183430; Tue, 22 Apr 2025 14:59:43 -0700 (PDT) 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-44092d2eccesm2726615e9.20.2025.04.22.14.59.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Apr 2025 14:59:42 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: hdegoede@redhat.com, mzamazal@redhat.com, bryan.odonoghue@linaro.org, bod.linux@nxsw.ie Subject: [PATCH 21/27] libcamera: software_isp: debayer_egl: Make DebayerEGL the default debayer method Date: Tue, 22 Apr 2025 22:59:14 +0100 Message-ID: <20250422215920.4297-22-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250422215920.4297-1-bryan.odonoghue@linaro.org> References: <20250422215920.4297-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" Try the EGL debayer method, if that fails then try the CPU version before bailing out entirely. Signed-off-by: Bryan O'Donoghue --- src/libcamera/software_isp/software_isp.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp index c3dc21de..e4c7fda1 100644 --- a/src/libcamera/software_isp/software_isp.cpp +++ b/src/libcamera/software_isp/software_isp.cpp @@ -25,6 +25,7 @@ #include "libcamera/internal/software_isp/debayer_params.h" #include "debayer_cpu.h" +#include "debayer_egl.h" /** * \file software_isp.cpp @@ -114,7 +115,17 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor, } stats->statsReady.connect(this, &SoftwareIsp::statsReady); - debayer_ = std::make_unique(std::move(stats)); + //TODO: derive the selection from file/environment variable + debayer_ = std::make_unique(std::move(stats)); + if (!debayer_) { + LOG(SoftwareIsp, Error) << "Failed to create DebayerEGL object"; + debayer_ = std::make_unique(std::move(stats)); + if (!debayer_) { + LOG(SoftwareIsp, Error) << "Failed to create DebayerCPUGL object"; + return; + } + } + debayer_->inputBufferReady.connect(this, &SoftwareIsp::inputReady); debayer_->outputBufferReady.connect(this, &SoftwareIsp::outputReady);