From patchwork Mon Sep 14 12:38:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 28243 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 DD2B4BDCB7 for ; Mon, 14 Sep 2026 12:38:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6FB6B686A1; Mon, 14 Sep 2026 14:38:41 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="mm6BdD+E"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3CCA06868D for ; Mon, 14 Sep 2026 14:38:37 +0200 (CEST) Received: from killaraus.ideasonboard.com (2001-14ba-70f3-e800--a06.rev.dnainternet.fi [IPv6:2001:14ba:70f3:e800::a06]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2815A9A4; Mon, 14 Sep 2026 14:36:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1789389417; bh=6eXWSyxS2FoISF87xLf/Yq0CYVYcWE+4m8H8qSUc8x0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mm6BdD+EZDICtSIY9OtTBZUqoCFAt7RbMeNOhUbZ2hiNjLekt+8H3sxL0UfKwdLsK fMh3ldHWnrIuQvkYD26OYMz4ciel6prvAX/2vdxQxlmrcf9rhC1otWWO/bR3jrtOiR hdykBeGHtPHASPWQjoGQhEWNzTp9h2A9GXnMox3M= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: Robert Mader Subject: [PATCH v3 2/2] libcamera: software_isp: debayer_egl: Use Matrix::transpose() Date: Mon, 14 Sep 2026 15:38:33 +0300 Message-ID: <20260914123833.2724712-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260914123833.2724712-1-laurent.pinchart@ideasonboard.com> References: <20260914123833.2724712-1-laurent.pinchart@ideasonboard.com> 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" Replace the manual matrix transposition code with a call to Matrix::transpose(). Signed-off-by: Laurent Pinchart Reviewed-by: Barnabás Pőcze --- src/libcamera/software_isp/debayer_egl.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp index 3536b5c51ffa..4477c928342f 100644 --- a/src/libcamera/software_isp/debayer_egl.cpp +++ b/src/libcamera/software_isp/debayer_egl.cpp @@ -460,21 +460,10 @@ void DebayerEGL::setShaderVariableValues(eGLImage &eglImageIn, const DebayerPara << " textureUniformStep_.y " << Step[1] << " textureUniformStrideFactor_ " << Stride << " textureUniformProjMatrix_ " << textureUniformProjMatrix_; - /* - * Pre-transpose matrix for GLES 2.0 - */ - GLfloat ccm[9] = { - params.combinedMatrix[0][0], - params.combinedMatrix[1][0], - params.combinedMatrix[2][0], - params.combinedMatrix[0][1], - params.combinedMatrix[1][1], - params.combinedMatrix[2][1], - params.combinedMatrix[0][2], - params.combinedMatrix[1][2], - params.combinedMatrix[2][2], - }; - glUniformMatrix3fv(ccmUniformDataIn_, 1, GL_FALSE, ccm); + + /* Pre-transpose matrix for GLES 2.0. */ + Matrix ccm = params.combinedMatrix.transpose(); + glUniformMatrix3fv(ccmUniformDataIn_, 1, GL_FALSE, ccm.data().data()); LOG(Debayer, Debug) << " ccmUniformDataIn_ " << ccmUniformDataIn_ << " data " << params.combinedMatrix; /*