From patchwork Sun Mar 25 10:59:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 10306603 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 337DA600CC for ; Sun, 25 Mar 2018 11:00:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 252FD29042 for ; Sun, 25 Mar 2018 11:00:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19F9B29332; Sun, 25 Mar 2018 11:00:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A13FC29042 for ; Sun, 25 Mar 2018 11:00:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753197AbeCYLAQ (ORCPT ); Sun, 25 Mar 2018 07:00:16 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:38169 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752496AbeCYLAG (ORCPT ); Sun, 25 Mar 2018 07:00:06 -0400 Received: by mail-wm0-f68.google.com with SMTP id l16so10534768wmh.3; Sun, 25 Mar 2018 04:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=CLGekN5G7K7GwMTrmF0ZiyHtGADCNmtAXO6TQyJFUwc=; b=IQPq9VwLHWyqvgDa/9Jg1ladv2rqNHs8+2RU6DgwJQlm5I2Ic32cA6r+ubykgTX9Gm bZ7074dZzC7qgBtgR66Zjtt70TYQjC4SfRx81yC4RR7EWRJXubejLCRCQtcP2yy5hHWc jBq3GSjcvl/G/FO/44b8Qz8BVp7wLjIIWn+jY9CQ7+/Q6TbBeM6qePUaooan+xIIe2pP saperASPt22IsuFH5TS1Mf/EgXUnas0CN9P2D7eUIW8tSyxsjXilpGMi1M7Us1TaZmBY MPGPsuBTvQfjvoNeq6NcY2vYRM4V6H9Yl9eg5zJaAmNT81U4Ff+cmMvfx+G0xwx/ezzd a8CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CLGekN5G7K7GwMTrmF0ZiyHtGADCNmtAXO6TQyJFUwc=; b=jmzgequeGPxVkVHNeRWIpwL4lngIZOFgq3sYyeMlTecR3j6kG9HJ4gqQkTJjbj+YuP Jtr+T68bKimWGlnDOtjEqQB6+/SeXU8jhmQqXkBbL3Jr9oWLY8PePuOvWcdWg9AT0xow G7UPc0VNeRRERxAi8sBmUhcUunzikX9/WhB1J+NRpHLzAw80dp8GBWnZxJOVuEayOvFv Rz5120Rb2JBXIo5HngnS+/GDzwGDrQANwarp26eeBhgPQXizcBf1oE/cPfZlYXXFvLaN njHv+PHy2K6Wk2l3jjDchHdHU94a3xov6C3zlaj5w/oYTGxtPrRlquz5tSauR+5irHMS UhAg== X-Gm-Message-State: AElRT7E7TU9U/VNAiZ+KMYy1iG3OzWKivOEa0q2FMuoA3+vOAwlKtQ2z 7StxBK5XdiDzMPhj0TuZIlT0Sw== X-Google-Smtp-Source: AIpwx4+1NhG8pBgcMlh8eQgpIXRUayADYya3w//sUelH1FOBqShcTv8ht0e/Tgu92THl2i93sOPhfg== X-Received: by 10.28.153.12 with SMTP id b12mr524203wme.104.1521975604923; Sun, 25 Mar 2018 04:00:04 -0700 (PDT) Received: from baker.fritz.box ([2a02:908:1257:4460:80f2:8bcd:4355:2edc]) by smtp.gmail.com with ESMTPSA id z3sm20492230wme.3.2018.03.25.04.00.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Mar 2018 04:00:04 -0700 (PDT) From: "=?UTF-8?q?Christian=20K=C3=B6nig?=" X-Google-Original-From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/8] dma-buf: add peer2peer flag Date: Sun, 25 Mar 2018 12:59:56 +0200 Message-Id: <20180325110000.2238-4-christian.koenig@amd.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180325110000.2238-1-christian.koenig@amd.com> References: <20180325110000.2238-1-christian.koenig@amd.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a peer2peer flag noting that the importer can deal with device resources which are not backed by pages. Signed-off-by: Christian König --- drivers/dma-buf/dma-buf.c | 1 + include/linux/dma-buf.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index ffaa2f9a9c2c..f420225f93c6 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -565,6 +565,7 @@ struct dma_buf_attachment *dma_buf_attach(const struct dma_buf_attach_info *info attach->dev = info->dev; attach->dmabuf = dmabuf; + attach->peer2peer = info->peer2peer; attach->priv = info->priv; attach->invalidate = info->invalidate; diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h index 15dd8598bff1..1ef50bd9bc5b 100644 --- a/include/linux/dma-buf.h +++ b/include/linux/dma-buf.h @@ -313,6 +313,7 @@ struct dma_buf { * @dmabuf: buffer for this attachment. * @dev: device attached to the buffer. * @node: list of dma_buf_attachment. + * @peer2peer: true if the importer can handle peer resources without pages. * @priv: exporter specific attachment data. * * This structure holds the attachment information between the dma_buf buffer @@ -328,6 +329,7 @@ struct dma_buf_attachment { struct dma_buf *dmabuf; struct device *dev; struct list_head node; + bool peer2peer; void *priv; /** @@ -392,6 +394,7 @@ struct dma_buf_export_info { * @dmabuf: the exported dma_buf * @dev: the device which wants to import the attachment * @priv: private data of importer to this attachment + * @peer2peer: true if the importer can handle peer resources without pages * @invalidate: callback to use for invalidating mappings * * This structure holds the information required to attach to a buffer. Used @@ -401,6 +404,7 @@ struct dma_buf_attach_info { struct dma_buf *dmabuf; struct device *dev; void *priv; + bool peer2peer; void (*invalidate)(struct dma_buf_attachment *attach); };