Files
mi8-platina-linux/project/camera/libcamera-headless/0003-platina-full-field-gpu-scale.patch
Sukecz 655d0f5b49
Offline project checks / check (push) Canceled after 0s
Release 0.8.1 camera, browser audio and compact controls
2026-10-27 11:45:42 +01:00

48 lines
1.7 KiB
Diff

--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -692,6 +692,10 @@
*/
void SimpleCameraData::tryPipeline(unsigned int code, const Size &size)
{
+ /* Platina: retain the full sensor field of view at every output size. */
+ if (sensor_->model() == "imx363" && size != Size(4032, 3024))
+ return;
+
/*
* Propagate the format through the pipeline, and enumerate the
* corresponding possible V4L2 pixel formats on the video node.
--- a/src/libcamera/software_isp/debayer_egl.cpp
+++ b/src/libcamera/software_isp/debayer_egl.cpp
@@ -326,8 +326,10 @@
~(inputConfig_.patternSize.width - 1);
window_.y = ((inputCfg.size.height - outputCfg.size.height) / 2) &
~(inputConfig_.patternSize.height - 1);
- window_.width = outputCfg.size.width;
- window_.height = outputCfg.size.height;
+ window_.width = inputCfg.size.width;
+ window_.height = inputCfg.size.height;
+ window_.x = 0;
+ window_.y = 0;
/*
* Don't pass x,y from window_ since process() already adjusts for it.
@@ -389,8 +391,7 @@
* Scale input to output size, keeping the aspect ratio and preferring
* cropping over black bars.
*/
- GLfloat scale = std::max((GLfloat)window_.width / width_,
- (GLfloat)window_.height / height_);
+ GLfloat scale = 1.0f;
GLfloat trans = -(1.0f - scale);
GLfloat projMatrix[] = {
scale, 0, 0, 0,
@@ -507,7 +508,7 @@
egl_.createOutputDMABufTexture2D(*eglImageBayerOut_, out_fd);
setShaderVariableValues(params);
- glViewport(0, 0, width_, height_);
+ glViewport(0, 0, outputSize_.width, outputSize_.height);
glClear(GL_COLOR_BUFFER_BIT);
glDrawArrays(GL_TRIANGLE_FAN, 0, DEBAYER_OPENGL_COORDS);