{"id":26873,"url":"https://patchwork.libcamera.org/api/patches/26873/?format=json","web_url":"https://patchwork.libcamera.org/patch/26873/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260611191513.595489-1-robert.mader@collabora.com>","date":"2026-06-11T19:15:13","name":"[v1] software_isp: debayer_egl: Consider border for scaling","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"5c401c66ef5f0c48941db229bd029ef55815b4ad","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/?format=json","name":"Robert Mader","email":"robert.mader@collabora.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/26873/mbox/","series":[{"id":5988,"url":"https://patchwork.libcamera.org/api/series/5988/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5988","date":"2026-06-11T19:15:13","name":"[v1] software_isp: debayer_egl: Consider border for scaling","version":1,"mbox":"https://patchwork.libcamera.org/series/5988/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/26873/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/26873/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 1EAE0C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 11 Jun 2026 19:15:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 369A7623B4;\n\tThu, 11 Jun 2026 21:15:42 +0200 (CEST)","from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com\n\t[136.143.188.112])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5C41460579\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 11 Jun 2026 21:15:40 +0200 (CEST)","by mx.zohomail.com with SMTPS id 17812053336141022.322603986421;\n\tThu, 11 Jun 2026 12:15:33 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=collabora.com\n\theader.i=robert.mader@collabora.com header.b=\"G9RTB2OG\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1781205336; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=Ji52kz5+O62B6b5CP3YN31z9rk7R1eFUMgjxkpTjACDPyuHLq0tk45icgfwFNU3KL3cjTqKW54rG1w26WR7ZvX64xkkqS/Tor17/uarmY/xdU0TkTOttAqxtQzdmg3kreVL5VrjVIBIjrSh65PkAGHRD/wEasR7DvfDm86eMV2o=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1781205336;\n\th=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To;\n\tbh=pMNVXepSsf9c3pTFTp6Bg/XurYu0/kUHLofjiB/xGFs=; \n\tb=YJZ9ggfKdQ4nYOrTHxP0gaStjaPXDxu8egjH6bulI2hXjZrjIJcZiXqY9Wof1Bb1WevUV0UtlpIn43b3S+yuEZ/r5PrzTu1Q8YNThzvmRdT31gs4oh+q5WRkOli3vV1Jpy0hh4/PF6bfy7OrvT1ecuU3jVRGBDVYlOpHYVRljjo=","ARC-Authentication-Results":"i=1; mx.zohomail.com;\n\tdkim=pass  header.i=collabora.com;\n\tspf=pass  smtp.mailfrom=robert.mader@collabora.com;\n\tdmarc=pass header.from=<robert.mader@collabora.com>","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1781205336;\n\ts=zohomail; d=collabora.com; i=robert.mader@collabora.com;\n\th=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To;\n\tbh=pMNVXepSsf9c3pTFTp6Bg/XurYu0/kUHLofjiB/xGFs=;\n\tb=G9RTB2OG8RZsSIEz2xWSCi/1NXZDsQYG6b8oK483Ic7gQ3Peszja2YDVWtmM/Lh2\n\tU5fUeepGrjDfFrKoX15+ci7TLkq9HSfBRFhFZtLBQBgT80JcyD01EhPZQbicmVTllA+\n\tDlPzHTBKbsQzuvcnyAQrAXn4WeJc77/G968p2nk4=","From":"Robert Mader <robert.mader@collabora.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Robert Mader <robert.mader@collabora.com>","Subject":"[PATCH v1] software_isp: debayer_egl: Consider border for scaling","Date":"Thu, 11 Jun 2026 21:15:13 +0200","Message-ID":"<20260611191513.595489-1-robert.mader@collabora.com>","X-Mailer":"git-send-email 2.54.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The debayer algorithm produces a sligtly smaller output resolution\ncompared to the input one, using a border at the edges depending on the\npattern. This wasn't considered when scaling to the final output buffer\nsize, resulting in garbage pixels at the right - or in case or 90 degree\nrotated sensors - the bottom of the image.\n\nUse the correct algorithm output size instead - the maximum output\nbuffer size.\n\nFixes: f520b29fe (libcamera: software_isp: debayer_egl: Add an eGL Debayer class)\nSigned-off-by: Robert Mader <robert.mader@collabora.com>\n---\n src/libcamera/software_isp/debayer_egl.cpp | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)","diff":"diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp\nindex 8e52b45ae..f857e0271 100644\n--- a/src/libcamera/software_isp/debayer_egl.cpp\n+++ b/src/libcamera/software_isp/debayer_egl.cpp\n@@ -404,8 +404,9 @@ void DebayerEGL::setShaderVariableValues(const DebayerParams &params)\n \t * Scale input to output size, keeping the aspect ratio and preferring\n \t * cropping over black bars.\n \t */\n-\tGLfloat scale = std::max((GLfloat)window_.width / width_,\n-\t\t\t\t (GLfloat)window_.height / height_);\n+\tSize maxInputSize = sizes(inputPixelFormat_, {width_, height_}).max;\n+\tGLfloat scale = std::max((GLfloat)window_.width / maxInputSize.width,\n+\t\t\t\t (GLfloat)window_.height / maxInputSize.height);\n \tGLfloat trans = -(1.0f - scale);\n \tGLfloat projMatrix[] = {\n \t\tscale, 0, 0, 0,\n","prefixes":["v1"]}