From patchwork Tue Jul 30 23:27:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 20720 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 354CEC323E for ; Tue, 30 Jul 2024 23:27:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0647E63375; Wed, 31 Jul 2024 01:27:31 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="f/or+m6O"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4E34B61984 for ; Wed, 31 Jul 2024 01:27:29 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A9AAF6EF for ; Wed, 31 Jul 2024 01:26:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1722382001; bh=guVUmKlP9waYteMyxpHsCWc5/Eo6+HaXPM2ix5p+OMw=; h=From:To:Subject:Date:From; b=f/or+m6OGRrIUR6E8O00g0yLn0bhHFPDKdC6w3I70hXQPydB1sZhk0in42VAAHKkw wwLhFuS0L4yFPgwxrTfXBl2F6yHpyZ8rP/hWfHXqEt2fdx9FXgYIqSrgoN5Sdt/nKQ UxhhlXqSfBy5Ust6XXSRc7rwnI2JIae8dH5+Raw0= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH 0/3] libcamera: Address soft ISP file seal TODO item Date: Wed, 31 Jul 2024 02:27:05 +0300 Message-ID: <20240730232708.17399-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 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" Hello, This small series addresses one TODO item of the soft ISP, namely shrink and grow sealing of the memfd underlying SharedMem objects. Patch 1/3 starts by sharing the memfd handling code between the DmaBufAllocator and SharedMem classes by moving it to a new MemFd helper class. Patch 2/3 then addresses the TODO item, and patch 3/3 drops it from the TODO file. In case the value of sealing the memfd is dubious, given that shrinking it would be shooting ourselves in the foot, we could drop patch 2/3. I think patch 1/3 is still useful as it reduces the amount of code duplication. Patch 3/3 should then get an updated commit message to explain why the TODO item is dropped without being addressed. Laurent Pinchart (3): libcamera: base: Add MemFd helper class libcamera: shared_mem_object: Prevent memfd from shrinking or growing libcamera: software_isp: Remove file seal TODO item include/libcamera/base/memfd.h | 34 +++++++++ include/libcamera/base/meson.build | 1 + src/libcamera/base/memfd.cpp | 112 ++++++++++++++++++++++++++++ src/libcamera/base/meson.build | 1 + src/libcamera/dma_buf_allocator.cpp | 46 +----------- src/libcamera/shared_mem_object.cpp | 22 ++---- src/libcamera/software_isp/TODO | 19 ----- 7 files changed, 158 insertions(+), 77 deletions(-) create mode 100644 include/libcamera/base/memfd.h create mode 100644 src/libcamera/base/memfd.cpp base-commit: 7f33dfc100b2da0f158494534138a2d8b4f95100 prerequisite-patch-id: a6b8d233e4722c8092fc8a9bf64221ab23dc465f