From patchwork Mon Jun 3 11:12:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 20188 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 74D2BBD87C for ; Mon, 3 Jun 2024 11:13:12 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1D6DD634D9; Mon, 3 Jun 2024 13:13:12 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="aVQ6v6qg"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DCFA0634B2 for ; Mon, 3 Jun 2024 13:13:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717413188; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cIh4hgynOTgyYs33MsOHTHEAhPF8crQlm7ZcrRZS3Zk=; b=aVQ6v6qgHODqxo6tm/WAXCm52uJYtp1MSndR4WFDxoGndkEQ39XKLEsz3YSame0Mwo+mlu vZRVIYzF4WCCOIy/i9dFLcCnbHvBO19CUfNOzVmU/iBmZs3SwaCBN2BOSWunQAxeULHKid 5uqrc9VAiyY2EPQOrlAnwahcFYea8KE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-125-A-1SSk6kMyCIAwpOK_ys4w-1; Mon, 03 Jun 2024 07:13:05 -0400 X-MC-Unique: A-1SSk6kMyCIAwpOK_ys4w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E72958058D6; Mon, 3 Jun 2024 11:13:04 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.193.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0CC602870; Mon, 3 Jun 2024 11:13:03 +0000 (UTC) From: Hans de Goede To: libcamera-devel@lists.libcamera.org Cc: Maxime Ripard , Milan Zamazal , Hans de Goede , Kieran Bingham , Bryan O'Donoghue , Laurent Pinchart Subject: [PATCH v3 3/3] libcamera: software_isp: Allow using dma-buffers from /dev/udmabuf Date: Mon, 3 Jun 2024 13:12:59 +0200 Message-ID: <20240603111259.54321-4-hdegoede@redhat.com> In-Reply-To: <20240603111259.54321-1-hdegoede@redhat.com> References: <20240603111259.54321-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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" Allow the DmaBufAllocator used by the software ISP to use memfd() + /dev/udmabuf for the software ISP destination buffers. This is useful on Linux distributions where normal users are not allowed to access /dev/dma_heap/* while they are allowed to access /dev/udmabuf. Reviewed-by: Kieran Bingham Tested-by: Bryan O'Donoghue # Lenovo-x13s Reviewed-by: Laurent Pinchart Signed-off-by: Hans de Goede --- src/libcamera/software_isp/software_isp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp index 034727c5..20fb6f48 100644 --- a/src/libcamera/software_isp/software_isp.cpp +++ b/src/libcamera/software_isp/software_isp.cpp @@ -67,7 +67,8 @@ LOG_DEFINE_CATEGORY(SoftwareIsp) */ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor) : dmaHeap_(DmaBufAllocator::DmaBufAllocatorFlag::CmaHeap | - DmaBufAllocator::DmaBufAllocatorFlag::SystemHeap) + DmaBufAllocator::DmaBufAllocatorFlag::SystemHeap | + DmaBufAllocator::DmaBufAllocatorFlag::UDmaBuf) { /* * debayerParams_ must be initialized because the initial value is used for