From patchwork Thu Jun 18 12:22:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 26960 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 6C2BFC3333 for ; Thu, 18 Jun 2026 12:23:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E5F66656DB; Thu, 18 Jun 2026 14:23:39 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="a2jRMA3N"; dkim-atps=neutral Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DB27D656B8 for ; Thu, 18 Jun 2026 14:23:17 +0200 (CEST) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-461edb387ddso993048f8f.3 for ; Thu, 18 Jun 2026 05:23:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1781785397; x=1782390197; 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=MkNjYBeWEiuiQCIa3/fw0IZi4AbXB6fTVkVhV6295v0=; b=a2jRMA3N5Y/gQCdg2tXgBMVOhI4qsZWZb2FvBhWVlveU693hDydWIAHfDP/wNUwfRo gG87ab2VRr+8M1cE/onIpTKEjDTtU/LIe80Q4rlCiXIImzBsPRnpZ0pXro2wkTbh6zVY YlRi0eT/Lj1jgRUhASxi7jO7yHRBF3+8gIeckppORkqo8DjDVgggS91dEa1/ws3b0j4Y F/LVzovqHSL/XLepy/pFJbV+oPpuJgwokpyCAZ82L2IiLYClhtFUSJv5HQb0fqepPARa 3/YFufP0tnHzicKnhROgytq6qPh9g6/22qQ+DI4qtgzpvIMahDwiXF+5+aZX73WaPOl1 2GVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781785397; x=1782390197; 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=MkNjYBeWEiuiQCIa3/fw0IZi4AbXB6fTVkVhV6295v0=; b=oRQAPyOMEqCMymc+sNIEDI0WOuZtzIVdVJv1S2GYfa32739g7MZAKQUrEKRuR6IDy5 X/AfrhXZ3f4qr5JV/uGfngc1fLHttSuF90DLmS/+brLnde1r0B0Z2UksFIS/M/cMDy7L i4uLRoV0e5Mef6YkoWSHGb5huiVuthzL2RpEgaeM1Gyvh5Rd6uBtNWl5sOMXVxIE6nK7 VbfFTvk07jKWi9YTWNx6HTBH8NbUk6xUa5Q4L5IPXHuaLA22+X3yaqTJLD5+N4pEn8zL yIL2ApNFGg/pJchvn+I5cunvKNJ+gsEGCfAAWhsZnhbcItQ8GVXPsABjMatuIjIYkJ0L gTrg== X-Gm-Message-State: AOJu0YyXLMwqrpFn0VrdfLEGUqgX9KD/XRufeaY2uOCy5CYNwpwl8c9L G4BBcZ+pMe2OgJbV5z+iDsqzYrpdXUjtMNYhRfNHOsy856Ly973t0d0oug9kXC3QIW2+sqnS385 7a+6as2M= X-Gm-Gg: AfdE7cnfqgNE5sKiMBnljNgzA8XS2KRKFtUEri6Hc2B5NaGE7dP3vnPKXqeGG1xjK26 aml8/shmES4GvzPi4JprJw++A8FNhF4BMrpLPqi7zKpw2wzQ47q5V76wZrF3jV7DCFqegOT6wdp govt4rjG1XEOjzc0qrjF8lvoz/kEX02AQL9/sPUsSk/SRZOl3nQlENWJPw5K0ylhXYSa8exFU/u bNlCRz+fMBk/1bystsGo8C9UHv651gWc+EWN8J0KilX3GhoeK/pu0ZXBq8LLG5ieTezhVom9Qbn zJXYJELAKYeuSBUbbMz8FAxCplWncjnnQixJua/3m22JvXOPp2jDimW/i9buMo2cGjMHRbRCAY8 zvCwtpLk+Anyj5dzXI/51TmP3wdzt+kJOJmxs2QedwEGzx1Fj+dwcAN+7RwlVPzdsTFuAV3ebET 59fzmdlBMaam7VVa/Y4CODyn30BUQU X-Received: by 2002:a05:600c:1f83:b0:492:25a0:1730 with SMTP id 5b1f17b1804b1-4923c4adebfmr16858385e9.32.1781785397397; Thu, 18 Jun 2026 05:23:17 -0700 (PDT) Received: from inspiron14p-linux ([109.76.144.236]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4922fa3a4easm275198015e9.3.2026.06.18.05.23.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2026 05:23:17 -0700 (PDT) From: Bryan O'Donoghue To: libcamera-devel@lists.libcamera.org Cc: bryan.odonoghue@linaro.org, pavel@ucw.cz Subject: [PATCH 26/30] libcamera: software_isp: gpu: Do a synchronous BenchMark print after syncOutput Date: Thu, 18 Jun 2026 13:22:39 +0100 Message-ID: <20260618122245.946138-27-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260618122245.946138-1-bryan.odonoghue@linaro.org> References: <20260618122245.946138-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" 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 --- .../software_isp/software_isp_pipeline_gpu.cpp | 15 +++++++++++++++ .../software_isp/software_isp_pipeline_gpu.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/src/libcamera/software_isp/software_isp_pipeline_gpu.cpp b/src/libcamera/software_isp/software_isp_pipeline_gpu.cpp index 14f6d2b8c..d7bed8837 100644 --- a/src/libcamera/software_isp/software_isp_pipeline_gpu.cpp +++ b/src/libcamera/software_isp/software_isp_pipeline_gpu.cpp @@ -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> &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(gpuIspShaderPassBlcNormalise_.glFormat_, inputConfig_.stride / gpuIspShaderPassBlcNormalise_.getBytesPerPixel(), height_, inputConfig_.stride, GL_TEXTURE0, 0); diff --git a/src/libcamera/software_isp/software_isp_pipeline_gpu.h b/src/libcamera/software_isp/software_isp_pipeline_gpu.h index 8a922f658..b32d4cad3 100644 --- a/src/libcamera/software_isp/software_isp_pipeline_gpu.h +++ b/src/libcamera/software_isp/software_isp_pipeline_gpu.h @@ -63,6 +63,8 @@ private: int getShaderVariableLocations(); void setShaderVariableValues(const DebayerParams ¶ms); int processGPU(FrameBuffer *input, FrameBuffer *output, const DebayerParams ¶ms, std::optional *mappedInputBuffer, std::optional *inputBufferDmaSyncer); + void initShaderBenchMarks(void); + void printShaderBenchMarks(void); /* Pointer to object representing input texture */ std::unique_ptr eglImageBayerIn_;