Received: by 10.213.65.68 with SMTP id h4csp450514imn; Sun, 25 Mar 2018 04:02:07 -0700 (PDT) X-Google-Smtp-Source: AG47ELsaHW8xhp99rcAgQel89bDVOslcgA7j7sXF8z/I6bfSoAaOuFfYWlA3hxypO05o+CzurQCo X-Received: by 10.99.54.73 with SMTP id d70mr14626037pga.86.1521975726966; Sun, 25 Mar 2018 04:02:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521975726; cv=none; d=google.com; s=arc-20160816; b=Nj/5t1Un30N5q9KepCFWPKJv8EWv7DBqUUvh1ZxkFtRfgKIed2o+WcbrVLJEBtkcII tyYXaV+jzYskYBePb08Og36mdut2ehMaCkSitnjjc6tRIFdLQzTmzet95ex3A7Knnmxe rBGq9XLOWTAFeT3vi73h25NrdeI+vAfdknoCg9jnz962suXJRjYTw6MCgAnoIStdawwV fDtBF5pRF1yMklwY1z9wEmDXCtumjZv7xkLV8oGAOz6sNdr+pN7mjLp1MaR06ZzXnHFO IDF6AXFXNOahpT+Kf4JDB/f6kDUjMPsfovd9Jt7PU+HtFE8gj4aY5taFxA1Mp7Fv+K3/ p5yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature:arc-authentication-results; bh=CLGekN5G7K7GwMTrmF0ZiyHtGADCNmtAXO6TQyJFUwc=; b=tHflHzV6Tx/5ollUJu+FkqbBLLzGmPqh7vnzRkrprwG9mW2rG8Fq1OJQcozKSCD6mN 8XZI5GTOP/ZUva4U16X6CqNsgkiCqGr4oL4xHiLZ6BCYjIZhaj71rjaYZ5+Pox8sdGL6 RtsPPtZluN9m1CX8lUuArFDvfXGasEXdPvqO+ssH8peNbhvato0m0kyUtPV3kPKQAAsw zO/y3ouYXa9QeHtnPz13FkphsO52eSVXDixRlGkW3DGnF/wGBs6iqaYt6vOdo3J0swjD hdSOgIELSoHLLnB65NClDSlIYDMkgRyxX1RFpCw2lO7V2Yc7GtXXcKYFduF52oZULN3f xthA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IQPq9VwL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k4-v6si486832pls.8.2018.03.25.04.01.52; Sun, 25 Mar 2018 04:02:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IQPq9VwL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753230AbeCYLAR (ORCPT + 99 others); Sun, 25 Mar 2018 07:00:17 -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-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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); }; -- 2.14.1