Files
pmaports-rtwo/temp/libcamera/0006-debayer_egl-Use-untransposed-matrix-to-fix-GLES-2.0.patch
T
Robert Mader d9587b2fea temp/libcamera: Add some patches and tuning files
Notably:
1. Add the in-review quad-debayer patch required for the imx371 - the OP6
   front camera.
2. Fix GLES 2.0 devices like the Librem5 and PinePhone
3. Small tuning file adjustments, including CCMS for the imx371 and
   imx800 (FP5 main rear camera).
4. A small patch allowing to set maximum resolutions via config file.

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/9449>
2026-08-29 16:38:11 +00:00

64 lines
2.4 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
From 2e2d412965dc84cc0bdcd770b76674a8da0cf419 Mon Sep 17 00:00:00 2001
From: Robert Mader <robert.mader@collabora.com>
Date: Sat, 29 Aug 2026 01:38:26 +0200
Subject: [PATCH 6/8] debayer_egl: Use untransposed matrix to fix GLES 2.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The softISP curently fails on Mali-400 on Mesa. It turns out that
transposed matrices are not allowed by the spec:
> The UniformMatrix{234}fv commands will load count 2 × 2, 3 × 3, or 4 × 4
> matrices (corresponding to 2, 3, or 4 in the command name) of floating-point values
> into a uniform location defined as a matrix or an array of matrices. The matrix is
> specified in column-major order. transpose must be FALSE.
Thus partially revert the commit mentioned below and manually transpose
the matrix.
Fixes: d780e285b593 ("shaders: bayer: Use native matrix multiplication")
Closes: https://gitlab.freedesktop.org/camera/libcamera/-/work_items/342
Signed-off-by: Robert Mader <robert.mader@collabora.com>
---
Changes in v2:
- Actually transpose the matrix to not re-introduce issues with CCMs
- Add comment about GLES 2.0
- Add "Closes:" link
---
src/libcamera/software_isp/debayer_egl.cpp | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp
index 5c0508239f9c..ae06dc0d2a3d 100644
--- a/src/libcamera/software_isp/debayer_egl.cpp
+++ b/src/libcamera/software_isp/debayer_egl.cpp
@@ -479,8 +479,21 @@ void DebayerEGL::setShaderVariableValues(eGLImage &eglImageIn, const DebayerPara
<< " textureUniformStep_.y " << Step[1]
<< " textureUniformStrideFactor_ " << Stride
<< " textureUniformProjMatrix_ " << textureUniformProjMatrix_;
-
- glUniformMatrix3fv(ccmUniformDataIn_, 1, GL_TRUE, params.combinedMatrix.data().data());
+ /*
+ * 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);
LOG(Debayer, Debug) << " ccmUniformDataIn_ " << ccmUniformDataIn_ << " data " << params.combinedMatrix;
/*
--
2.55.0