From patchwork Sat Jan 10 22:13:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Mader X-Patchwork-Id: 25713 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 CF8FDBDCBF for ; Sat, 10 Jan 2026 22:14:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7A4D661FC4; Sat, 10 Jan 2026 23:14:11 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=collabora.com header.i=robert.mader@collabora.com header.b="kED5V2FK"; 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 1F3A561A35 for ; Sat, 10 Jan 2026 23:14:08 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; t=1768083244; cv=none; d=zohomail.com; s=zohoarc; b=lxtU/dJx0WuuXTX6B1K09W2MUE5XkU3HPccr4pecEzeTX+k1aDu46x9Lbykc9HsARFJB0yvq8pYpQYGfnmC8KuLwO9cXAuKkFtx1yffr6XEivndpVqtDVLOdwnsgjgZOKbbbiiXbBLLoZZ2EcW25bfhSxNWHOnpavgFPrQ2oxl0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768083244; 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=TCeqJBig0Vxz6BFsgYrsU2iIel+rHXFKLVO7rNnN1VM=; b=PfPCDDA11KN0flYOxts+Ic2vWSgEpswTmUypWJdqGumFxw+xvCWd59oxYRrpbR6fmqwNj9FuTBVGh9ORFOwip6FV+OdTrJZ8nAzCk2XJWtwdohDfquuLHpjgtpGBzQ2F7AJVkxdAzd8MzEXIiuEoQXnk9y+BD5IbYf38pCfQ2a8= 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=1768083244; 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=TCeqJBig0Vxz6BFsgYrsU2iIel+rHXFKLVO7rNnN1VM=; b=kED5V2FKuuo2D6RhbL7Ug+dM1mzh+NqSWdhAO/iN+FWlDOSr8ZNuI7om7BNfvBW1 gvQynYfFQ0oeoVLSb3hbqtM78jyJGJE0EbAlsbn6VZ+H//4Oulowej6KSCARFTG0e5j ya0I0Du+dWCfIXb1a5gHTILutqgPZDbS2QibgmC0= Received: by mx.zohomail.com with SMTPS id 1768083243102915.5716527798162; Sat, 10 Jan 2026 14:14:03 -0800 (PST) From: Robert Mader To: libcamera-devel@lists.libcamera.org Cc: Robert Mader Subject: [PATCH 2/2] Revert "libcamera: software_isp: gbm: Add a GBM helper class for GPU surface access" Date: Sat, 10 Jan 2026 23:13:37 +0100 Message-ID: <20260110221337.145378-2-robert.mader@collabora.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260110221337.145378-1-robert.mader@collabora.com> References: <20260110221337.145378-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" GBM is not used any more - remove the helper class. This reverts commit c60b1ce8193841c2742b655097bb39ccbcb417c2. Signed-off-by: Robert Mader --- include/libcamera/internal/gbm.h | 55 ------------- include/libcamera/internal/meson.build | 1 - src/libcamera/gbm.cpp | 107 ------------------------- src/libcamera/meson.build | 12 +-- 4 files changed, 1 insertion(+), 174 deletions(-) delete mode 100644 include/libcamera/internal/gbm.h delete mode 100644 src/libcamera/gbm.cpp diff --git a/include/libcamera/internal/gbm.h b/include/libcamera/internal/gbm.h deleted file mode 100644 index c10be06c1..000000000 --- a/include/libcamera/internal/gbm.h +++ /dev/null @@ -1,55 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-or-later */ -/* - * Copyright (C) 2024, Linaro Ltd. - * - * Authors: - * Bryan O'Donoghue - * - * Helper class for managing GBM interactions - */ - -#pragma once - -#include - -#include -#include - -#include - -namespace libcamera { - -LOG_DECLARE_CATEGORY(GBM) - -class GBM -{ -public: - GBM(); - ~GBM(); - - int createDevice(); - - /** - * \brief Retrieve the GBM device handle - * - * \return Pointer to the gbm_device structure, or nullptr if the device - * has not been created - */ - struct gbm_device *device() const { return gbmDevice_; } - - /** - * \brief Retrieve the pixel format - * - * \return The PixelFormat used by this GBM instance (ARGB8888) - */ - PixelFormat format() const { return format_; } - -private: - LIBCAMERA_DISABLE_COPY_AND_MOVE(GBM) - - UniqueFD fd_; - struct gbm_device *gbmDevice_ = nullptr; - PixelFormat format_; -}; - -} /* namespace libcamera */ diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build index dc48619e5..4d2a09bd7 100644 --- a/include/libcamera/internal/meson.build +++ b/include/libcamera/internal/meson.build @@ -24,7 +24,6 @@ libcamera_internal_headers = files([ 'formats.h', 'framebuffer.h', 'egl.h', - 'gbm.h', 'global_configuration.h', 'ipa_data_serializer.h', 'ipa_manager.h', diff --git a/src/libcamera/gbm.cpp b/src/libcamera/gbm.cpp deleted file mode 100644 index d37808b0c..000000000 --- a/src/libcamera/gbm.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-or-later */ -/* - * Copyright (C) 2024, Linaro Ltd. - * - * Authors: - * Bryan O'Donoghue - * - * Helper class for managing GBM interactions - */ - -#include "libcamera/internal/gbm.h" - -#include -#include -#include -#include -#include - -#include -#include - -namespace libcamera { - -LOG_DEFINE_CATEGORY(GBM) - -/** - * \class GBM - * \brief Helper class for managing GBM interactions - * - * The GBM class provides a simplified interface for creating and managing - * GBM devices. It handles the initialization and teardown of GBM devices - * used for buffer allocation in graphics and camera pipelines. - * - * This class is responsible for opening a DRI render node, creating a GBM - * device, and providing access to the device and its associated pixel format. - */ - -/** - *\var GBM::fd_ - *\brief file descriptor to DRI device - */ - -/** - *\var GBM::gbmDevice_ - *\brief Pointer to GBM device structure derived from fd_ - */ - -/** - *\var GBM::format_ - *\brief Pixel format the GBM surface was created in - */ - -/** - *\brief GBM constructor. - * - * Creates a GBM instance with uninitialised state. - */ -GBM::GBM() -{ -} - -/** - *\brief GBM destructor - * - * Cleans up the GBM device if it was successfully created, and closes - * the associated file descriptor. - */ -GBM::~GBM() -{ - if (gbmDevice_) - gbm_device_destroy(gbmDevice_); -} - -/** - * \brief Create and initialize a GBM device - * - * \todo Get dri device name from envOption setting - * - * Opens the DRI render node (/dev/dri/renderD128) and creates a GBM - * device using the libgbm library. Sets the default pixel format to - * ARGB8888. - * - * \return 0 on success, or a negative error code on failure - */ -int GBM::createDevice() -{ - const char dri_node[] = "/dev/dri/renderD128"; - - int fd = open(dri_node, O_RDWR | O_CLOEXEC | O_NOCTTY); - if (fd < 0) { - LOG(GBM, Error) << "Open " << dri_node << " fail " << strerror(errno); - return -errno; - } - fd_ = UniqueFD(fd); - - gbmDevice_ = gbm_create_device(fd_.get()); - if (!gbmDevice_) { - LOG(GBM, Error) << "gbm_create_device fail" << strerror(errno); - return -errno; - } - - format_ = libcamera::formats::ARGB8888; - - return 0; -} - -} /* namespace libcamera */ diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 6f952bd98..d15943586 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -70,15 +70,6 @@ libcamera_deps = [] libatomic = cc.find_library('atomic', required : false) libthreads = dependency('threads') -libgbm = dependency('gbm', required : false) -gbm_works = cc.check_header('gbm.h', required: false) - -if libgbm.found() and gbm_works - libcamera_internal_sources += files([ - 'gbm.cpp', - ]) -endif - mesa_works = cc.check_header('EGL/egl.h', required: false) libegl = dependency('egl', required : false) libglesv2 = dependency('glesv2', required : false) @@ -91,7 +82,7 @@ if libglesv2.found() config_h.set('HAVE_GLESV2', 1) endif -if mesa_works and gbm_works +if mesa_works libcamera_internal_sources += files([ 'egl.cpp', ]) @@ -209,7 +200,6 @@ libcamera_deps += [ libcrypto, libdl, libegl, - libgbm, libglesv2, liblttng, libudev,