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: 10306575 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 0C0D160385 for ; Sun, 25 Mar 2018 11:00:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F17E529042 for ; Sun, 25 Mar 2018 11:00:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E66FD2935C; Sun, 25 Mar 2018 11:00:14 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9B7DC29042 for ; Sun, 25 Mar 2018 11:00:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 799156E41D; Sun, 25 Mar 2018 11:00:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7BDFF6E412; Sun, 25 Mar 2018 11:00:06 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id f125so10484164wme.4; Sun, 25 Mar 2018 04:00:06 -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=PNWquk8XMs/gtVu8Ow3i4iusT1izjE1x3dvFsc/ngFypaJPpmLTKQkj7XK+stss9sH 2IQ5T3G1SD4s4RSo+qlF2j/FntfWDuskCRT5NE1e1hmd59xR3+R4+XTmm6rVnphAiqsv Hrlkim/axpd9AOG3HqH0e3RdvYtA1k8DGhCOViH0/DxHdoJbvrgUzW0KOZl5w5YLiKdw VN9x1wc0vDuUWDZHthJfFstmvWpxEK6kHbGq5lQURGerOTaSdfUk743ljtIeE2gGO3uK N7aotLsx+hAOaBdrC8jawl0gceZh/SEGOoEMSbBh/lTIWGyj+qYnGdcENWkueNC003fM ZMWg== X-Gm-Message-State: AElRT7HQ44wKY39gfmpA5GckUFmpzK9QWUw6SiZpNYMIpdW5iWfgjFEc J1niwRl2Kg/EP62qTytd7WY= 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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); };