From patchwork Mon Nov 1 18:08:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Larumbe X-Patchwork-Id: 12596957 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDFDBC433FE for ; Mon, 1 Nov 2021 18:32:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F65C60F24 for ; Mon, 1 Nov 2021 18:32:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9F65C60F24 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=alumnos.upm.es Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Mnq5CRmiTILtVX5vlSyQI8DTyAFCqRwHg6BJnAUlQDQ=; b=vrttgNolh6CT28 eivLIP2t/3obtQhCfgwRxUmkW6lA2Qf+gfhCrgxD78mJ5JjOWw+Am0mv24M0xUsNLHJcBbLP5NUa4 b9EiUzcDQW+A0i6agXGx2k0FwYKlcN++IUgYCxVW8U6AQ7kasxFNkSosseBTJpHI92zg5BwB1wPCM ifyoLh+S3LPTuvLdJV3Q2L56jx/ct8X8/0oz3DsP/HtU83buMe27RiCeQ4rIuS59krwluD52wHE1f ES7bkFYFNZ1pjraVnn7EUmpYjBUT5JCNGJD5C6VlJG28pnsR5lWtiaRrJYqf60T4TCSn9PwY7nvKb NGs1vF4vEyENyUxgagew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhc5V-00H0xz-7T; Mon, 01 Nov 2021 18:31:17 +0000 Received: from neon-v2.ccupm.upm.es ([138.100.198.70]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mhc5R-00H0xN-2t for linux-arm-kernel@lists.infradead.org; Mon, 01 Nov 2021 18:31:14 +0000 Received: from localhost.localdomain (62-3-70-206.dsl.in-addr.zen.co.uk [62.3.70.206] (may be forged)) (user=adrianml@alumnos.upm.es mech=LOGIN bits=0) by neon-v2.ccupm.upm.es (8.15.2/8.15.2/neon-v2-001) with ESMTPSA id 1A1I8fSO016585 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 1 Nov 2021 18:08:53 GMT From: Adrian Larumbe To: vkoul@kernel.org, dmaengine@vger.kernel.org Cc: michal.simek@xilinx.com, linux-arm-kernel@lists.infradead.org, Adrian Larumbe Subject: [PATCH 1/3] dmaengine: Add documentation for new memcpy scatter-gather function Date: Mon, 1 Nov 2021 18:08:23 +0000 Message-Id: <20211101180825.241048-2-adrianml@alumnos.upm.es> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211101180825.241048-1-adrianml@alumnos.upm.es> References: <20210706234338.7696-1-adrian.martinezlarumbe@imgtec.com> <20211101180825.241048-1-adrianml@alumnos.upm.es> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211101_113113_420078_7F19C4B0 X-CRM114-Status: GOOD ( 14.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Documentation describes semantics, limitations and a typical use case scenario. Signed-off-by: Adrian Larumbe --- .../driver-api/dmaengine/provider.rst | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Documentation/driver-api/dmaengine/provider.rst b/Documentation/driver-api/dmaengine/provider.rst index ddb0a81a796c..0072c9c7efd3 100644 --- a/Documentation/driver-api/dmaengine/provider.rst +++ b/Documentation/driver-api/dmaengine/provider.rst @@ -162,6 +162,29 @@ Currently, the types available are: - The device is able to do memory to memory copies +- - DMA_MEMCPY_SG + + - The device supports memory to memory scatter-gather transfers. + + - Even though a plain memcpy can look like a particular case of a + scatter-gather transfer, with a single chunk to copy, it's a distinct + transaction type in the mem2mem transfer case. This is because some very + simple devices might be able to do contiguous single-chunk memory copies, + but have no support for more complex SG transfers. + + - No matter what the overall size of the combined chunks for source and + destination is, only as many bytes as the smallest of the two will be + transmitted. That means the number and size of the scatter-gather buffers in + both lists need not be the same, and that the operation functionally is + equivalent to a ``strncpy`` where the ``count`` argument equals the smallest + total size of the two scatter-gather list buffers. + + - It's usually used for copying pixel data between host memory and + memory-mapped GPU device memory, such as found on modern PCI video graphics + cards. The most immediate example is the OpenGL API function + ``glReadPielx()``, which might require a verbatim copy of a huge framebuffer + from local device memory onto host memory. + - DMA_XOR - The device is able to perform XOR operations on memory areas