From patchwork Wed May 27 08:15:31 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Mader X-Patchwork-Id: 26807 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 E01D8C328C for ; Wed, 27 May 2026 08:16:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 570AF6302D; Wed, 27 May 2026 10:16:18 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=collabora.com header.i=robert.mader@collabora.com header.b="jXeWtG6t"; dkim-atps=neutral Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3C00C63020 for ; Wed, 27 May 2026 10:16:13 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; t=1779869764; cv=none; d=zohomail.com; s=zohoarc; b=HYXsPn5kJAEcQi8ae+PARReoGhFSqsg9m0kx1ZQ8Ha4DjkkXeOPNASyFE0GcWtQzbITgvqvV+dWRzs7OIWtL1J34nTFXm+Ci51FyqaVyAEWS9cMDxeAVSn2r2ajMYpy/YYXGeOdqbMDvg4B71rFZVHVZpW2EZTDEuhyLgXHTIlQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779869764; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=l7RjJAijFsQIL0xNq9BIdDwiEkWp3YMq2V3d/E0NjOg=; b=R+2EyhiJ6pjX/K8134QcDfk0sNoxJKHVttczy7LTcFqcz5AQuWSgHTMeV9Cz90OTYysDrJuwf9AytGJhJI2BsnBwQ8uAzZUpnofO57txNqx5IatCfgoAyBkY91+OnQ7Sv26bumvjKuiapQhgChH4damr//OM216IbMHgPa+LALc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=robert.mader@collabora.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1779869764; s=zohomail; d=collabora.com; i=robert.mader@collabora.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=l7RjJAijFsQIL0xNq9BIdDwiEkWp3YMq2V3d/E0NjOg=; b=jXeWtG6tSQy/aZLespliWmG3TacY3yeyOMv4Hgm24uvt8kFY/fe9h4OFTQr6Gu7R 0eJArRdpggAGtIq0bethVYz16fRj0ApIcxg3k+iqDu/Swu0tEy+WSZbCDGQFtX1GJFB WixwBOytcGcDGio4n3fOiCJpqnThFyWAKeK9aoyk= Received: by mx.zohomail.com with SMTPS id 1779869763224499.1927884765007; Wed, 27 May 2026 01:16:03 -0700 (PDT) From: Robert Mader To: libcamera-devel@lists.libcamera.org Cc: Robert Mader Subject: [PATCH v5 2/5] egl: Remove some parameters from createTexture2D() Date: Wed, 27 May 2026 10:15:31 +0200 Message-ID: <20260527081534.20245-3-robert.mader@collabora.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260527081534.20245-1-robert.mader@collabora.com> References: <20260527081534.20245-1-robert.mader@collabora.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" And use the values set in the constructor instead, bringing the function in line with createInputDMABufTexture2D() and createOutputDMABufTexture2D(). Adopt the value passed into the constructor accordingly, which previously was never used. Signed-off-by: Robert Mader --- include/libcamera/internal/egl.h | 2 +- src/libcamera/egl.cpp | 7 ++----- src/libcamera/software_isp/debayer_egl.cpp | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/include/libcamera/internal/egl.h b/include/libcamera/internal/egl.h index 825240dbb..bcf09b475 100644 --- a/include/libcamera/internal/egl.h +++ b/include/libcamera/internal/egl.h @@ -105,7 +105,7 @@ public: int createInputDMABufTexture2D(eGLImage &eglImage, int fd); int createOutputDMABufTexture2D(eGLImage &eglImage, int fd); - void createTexture2D(eGLImage &eglImage, GLint format, uint32_t width, uint32_t height, void *data); + void createTexture2D(eGLImage &eglImage, void *data); void pushEnv(std::vector &shaderEnv, const char *str); void makeCurrent(); diff --git a/src/libcamera/egl.cpp b/src/libcamera/egl.cpp index 2aabfc2e0..267d22c8b 100644 --- a/src/libcamera/egl.cpp +++ b/src/libcamera/egl.cpp @@ -240,9 +240,6 @@ int eGL::createOutputDMABufTexture2D(eGLImage &eglImage, int fd) /** * \brief Create a 2D texture from a memory buffer * \param[in,out] eglImage EGL image to associate with the texture - * \param[in] format OpenGL internal format (e.g., GL_RGB, GL_RGBA) - * \param[in] width Texture width in pixels - * \param[in] height Texture height in pixels * \param[in] data Pointer to pixel data, or nullptr for uninitialised texture * * Creates a 2D texture from a CPU-accessible memory buffer. The texture @@ -250,7 +247,7 @@ int eGL::createOutputDMABufTexture2D(eGLImage &eglImage, int fd) * is useful for uploading static data like lookup tables or uniform color * matrices to the GPU. */ -void eGL::createTexture2D(eGLImage &eglImage, GLint format, uint32_t width, uint32_t height, void *data) +void eGL::createTexture2D(eGLImage &eglImage, void *data) { ASSERT(tid_ == Thread::currentId()); @@ -258,7 +255,7 @@ void eGL::createTexture2D(eGLImage &eglImage, GLint format, uint32_t width, uint glBindTexture(GL_TEXTURE_2D, eglImage.texture_); // Generate texture, bind, associate image to texture, configure, unbind - glTexImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, format, GL_UNSIGNED_BYTE, data); + glTexImage2D(GL_TEXTURE_2D, 0, eglImage.format_, eglImage.width_, eglImage.height_, 0, eglImage.format_, GL_UNSIGNED_BYTE, data); // Nearest filtering glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp index 8c1f2074d..696498a58 100644 --- a/src/libcamera/software_isp/debayer_egl.cpp +++ b/src/libcamera/software_isp/debayer_egl.cpp @@ -506,7 +506,7 @@ int DebayerEGL::debayerGPU(MappedFrameBuffer &in, int out_fd, const DebayerParam egl_.makeCurrent(); /* Create a standard texture input */ - egl_.createTexture2D(*eglImageBayerIn_, glFormat_, inputConfig_.stride / bytesPerPixel_, height_, in.planes()[0].data()); + egl_.createTexture2D(*eglImageBayerIn_, in.planes()[0].data()); /* Generate the output render framebuffer as render to texture */ egl_.createOutputDMABufTexture2D(*eglImageBayerOut_, out_fd); @@ -587,7 +587,7 @@ int DebayerEGL::start() return -EINVAL; /* Raw bayer input as texture */ - eglImageBayerIn_ = std::make_unique(glFormat_, width_, height_, inputConfig_.stride, GL_TEXTURE0, 0); + eglImageBayerIn_ = std::make_unique(glFormat_, inputConfig_.stride / bytesPerPixel_, height_, inputConfig_.stride, GL_TEXTURE0, 0); /* Texture we will render to */ eglImageBayerOut_ = std::make_unique(GL_RGBA, outputSize_.width, outputSize_.height, outputConfig_.stride, GL_TEXTURE1, 1);