From nobody Sun May 5 23:07:23 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1556622692; cv=none; d=zoho.com; s=zohoarc; b=SMP6ZiPWf7GlXyxPn6eWDg2Zlrd2D/Z3CAssx92Mu2fsVxgtJcMzfdtgHrbeISDDu2U09d5WbqMqqU2eyUS4uX+t4MgRHWoC3ZPhcqZyU/dHxI9tQPC0XCLkGpE9ubFtJtLVGTUbU4O7ahq0m4LX3s8TBAhIeVEO3ku+VRBoyeA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556622692; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=4iAW2IScFnJDfTDHSxIBTqLdopjDnLA1Xpb09Xz/knU=; b=XW9Z7AaexXasg7RkzhhN1Ebt2uz5dxkLjvW0lpGMrjGfbH8SYH5FMzHwy8tTYIaVvid4lzy6pF7GSQsLwErRiBeUNi+GR9CTOiWg7EDvgnv+S/hNaQ7P9GsR6Mkgm+sxYVSgoY7mXb+WNywRkPlgHPyAANBKnoATxmdyXKDQvzs= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1556622692653104.55004495355695; Tue, 30 Apr 2019 04:11:32 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hLQeH-00079Y-PN; Tue, 30 Apr 2019 11:10:09 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hLQeG-00079T-N2 for xen-devel@lists.xenproject.org; Tue, 30 Apr 2019 11:10:08 +0000 Received: from mail-wr1-x444.google.com (unknown [2a00:1450:4864:20::444]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 8207a2ae-6b38-11e9-843c-bc764e045a96; Tue, 30 Apr 2019 11:10:06 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id c5so20488828wrs.11 for ; Tue, 30 Apr 2019 04:10:06 -0700 (PDT) Received: from abel.fritz.box ([2a02:908:1252:fb60:b40a:677f:72fa:b9f5]) by smtp.gmail.com with ESMTPSA id o6sm69900182wre.60.2019.04.30.04.10.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2019 04:10:03 -0700 (PDT) X-Inumbo-ID: 8207a2ae-6b38-11e9-843c-bc764e045a96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=y5E07ktx+efLbvKumCSiATFdG/oguBNyyr/c6YqsUm4=; b=H3cwQiS7R8tTn5g1BZMWHEDPNM9bNWbntC4ZvoAvID01wIvqI9bmUOOFUv15v91scb C1qpbqahmiRQuJC8Aq5n6xtgghIKF1RYqKzur6ohFahwy6Cdfz9P3FAtI3pdiYVLYnD6 DT/LkuXa+dLWeK8qnAhpdl8YHrvSqbDQ4fNbXJ2nmmcMyvTg+gMq3KXZ43xoUruVL9+V GbatAPnbwBIh4x9nE9P9hvQZTdFz1g357wwG74Ob7SFF32JS8Wl6s3x5ok6S16Aybse2 BkZQBqc0XCZI2NCf8++VOa+Eth0PBtDKQGZKox/X3KRxrYLYvGVIh7FaHlrFCsgTs88s OE+g== 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:mime-version :content-transfer-encoding; bh=y5E07ktx+efLbvKumCSiATFdG/oguBNyyr/c6YqsUm4=; b=tOz+JG4lQLhqVsWGQWKQ4dPoIfxgCqSKGax+3Em8/VOrbDEs8IgdonqJx3GkTqs4EJ APeRj5bFuVR+H57i7nh28WbaBG3mDOLFOftkUpizeJvNHDellM4tuxN0Gl2iUnex0L27 YqBLVJi8lZZv4DVNDuI3GzkuTJHFifIhOTYU+5nys8j2Z9Z0fOPmTKxagp0FB90TU8SK s/kySLlPDAg5RSOAEiUYNIYnokmsBACF14vBdkoSRw621d+yWsj+eJYSTTSd+481uy9V /VoQ2hSb/0DbSqavWWq0gf0/MVYK1hTQFHMqRIXiGY7GLi/8L3BWkeirkgEMJFsQlalz cydQ== X-Gm-Message-State: APjAAAXzvWWrQwDTPgiN/6nRLryJAsJdMKSEBKfQB/obAnI0BzLaldde zvSLWFQ7gfUMw1x5copw2c68ROo74d4= X-Google-Smtp-Source: APXvYqw5NjFWgrzkTp4ICzt9MaEfnm+UdHYperSOCojD9VbG3ZptOkkp0G4PjTwuTp0ClIkR3IeVGw== X-Received: by 2002:a05:6000:104:: with SMTP id o4mr3851621wrx.106.1556622604773; Tue, 30 Apr 2019 04:10:04 -0700 (PDT) From: "=?UTF-8?q?Christian=20K=C3=B6nig?=" X-Google-Original-From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: xen-devel@lists.xenproject.org, devel@driverdev.osuosl.org, linux-tegra@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, sstabellini@kernel.org, jgross@suse.com, boris.ostrovsky@oracle.com, digetx@gmail.com, gregkh@linuxfoundation.org, arnd@arndb.de, mchehab@kernel.org, kyungmin.park@samsung.com, m.szyprowski@samsung.com, pawel@osciak.com, jonathanh@nvidia.com, thierry.reding@gmail.com, tomi.valkeinen@ti.com, rodrigo.vivi@intel.com, joonas.lahtinen@linux.intel.com, jani.nikula@linux.intel.com, sean@poorly.run, maxime.ripard@bootlin.com, maarten.lankhorst@linux.intel.com, linux@armlinux.org.uk, sumit.semwal@linaro.org Date: Tue, 30 Apr 2019 13:10:02 +0200 Message-Id: <20190430111002.106168-1-christian.koenig@amd.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] dma-buf: add struct dma_buf_attach_info v2 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Add a structure for the parameters of dma_buf_attach, this makes it much ea= sier to add new parameters later on. v2: rebase cleanup and fix all new implementations as well Signed-off-by: Christian K=C3=B6nig Reported-by: kbuild test robot --- drivers/dma-buf/dma-buf.c | 13 +++++++------ drivers/gpu/drm/armada/armada_gem.c | 6 +++++- drivers/gpu/drm/drm_prime.c | 6 +++++- drivers/gpu/drm/i915/i915_gem_dmabuf.c | 6 +++++- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 6 +++++- drivers/gpu/drm/tegra/gem.c | 6 +++++- drivers/gpu/drm/udl/udl_dmabuf.c | 6 +++++- .../common/videobuf2/videobuf2-dma-contig.c | 6 +++++- .../media/common/videobuf2/videobuf2-dma-sg.c | 6 +++++- drivers/misc/fastrpc.c | 6 +++++- drivers/staging/media/tegra-vde/tegra-vde.c | 6 +++++- drivers/xen/gntdev-dmabuf.c | 4 ++++ include/linux/dma-buf.h | 17 +++++++++++++++-- 13 files changed, 76 insertions(+), 18 deletions(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 3ae6c0c2cc02..e295e76a8c57 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -535,8 +535,9 @@ EXPORT_SYMBOL_GPL(dma_buf_put); /** * dma_buf_attach - Add the device to dma_buf's attachments list; optional= ly, * calls attach() of dma_buf_ops to allow device-specific attach functiona= lity - * @dmabuf: [in] buffer to attach device to. - * @dev: [in] device to be attached. + * @info: [in] holds all the attach related information provided + * by the importer. see &struct dma_buf_attach_info + * for further details. * * Returns struct dma_buf_attachment pointer for this attachment. Attachme= nts * must be cleaned up by calling dma_buf_detach(). @@ -550,20 +551,20 @@ EXPORT_SYMBOL_GPL(dma_buf_put); * accessible to @dev, and cannot be moved to a more suitable place. This = is * indicated with the error code -EBUSY. */ -struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, - struct device *dev) +struct dma_buf_attachment *dma_buf_attach(const struct dma_buf_attach_info= *info) { + struct dma_buf *dmabuf =3D info->dmabuf; struct dma_buf_attachment *attach; int ret; =20 - if (WARN_ON(!dmabuf || !dev)) + if (WARN_ON(!dmabuf || !info->dev)) return ERR_PTR(-EINVAL); =20 attach =3D kzalloc(sizeof(*attach), GFP_KERNEL); if (!attach) return ERR_PTR(-ENOMEM); =20 - attach->dev =3D dev; + attach->dev =3D info->dev; attach->dmabuf =3D dmabuf; =20 mutex_lock(&dmabuf->lock); diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/a= rmada_gem.c index 642d0e70d0f8..19c47821032f 100644 --- a/drivers/gpu/drm/armada/armada_gem.c +++ b/drivers/gpu/drm/armada/armada_gem.c @@ -501,6 +501,10 @@ armada_gem_prime_export(struct drm_device *dev, struct= drm_gem_object *obj, struct drm_gem_object * armada_gem_prime_import(struct drm_device *dev, struct dma_buf *buf) { + struct dma_buf_attach_info attach_info =3D { + .dev =3D dev->dev, + .dmabuf =3D buf + }; struct dma_buf_attachment *attach; struct armada_gem_object *dobj; =20 @@ -516,7 +520,7 @@ armada_gem_prime_import(struct drm_device *dev, struct = dma_buf *buf) } } =20 - attach =3D dma_buf_attach(buf, dev->dev); + attach =3D dma_buf_attach(&attach_info); if (IS_ERR(attach)) return ERR_CAST(attach); =20 diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index dc079efb3b0f..1dd70fc095ee 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -710,6 +710,10 @@ struct drm_gem_object *drm_gem_prime_import_dev(struct= drm_device *dev, struct dma_buf *dma_buf, struct device *attach_dev) { + struct dma_buf_attach_info attach_info =3D { + .dev =3D attach_dev, + .dmabuf =3D dma_buf + }; struct dma_buf_attachment *attach; struct sg_table *sgt; struct drm_gem_object *obj; @@ -730,7 +734,7 @@ struct drm_gem_object *drm_gem_prime_import_dev(struct = drm_device *dev, if (!dev->driver->gem_prime_import_sg_table) return ERR_PTR(-EINVAL); =20 - attach =3D dma_buf_attach(dma_buf, attach_dev); + attach =3D dma_buf_attach(&attach_info); if (IS_ERR(attach)) return ERR_CAST(attach); =20 diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/= i915_gem_dmabuf.c index 5a101a9462d8..978054157c64 100644 --- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c +++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.c @@ -277,6 +277,10 @@ static const struct drm_i915_gem_object_ops i915_gem_o= bject_dmabuf_ops =3D { struct drm_gem_object *i915_gem_prime_import(struct drm_device *dev, struct dma_buf *dma_buf) { + struct dma_buf_attach_info attach_info =3D { + .dev =3D dev->dev, + .dmabuf =3D dma_buf + }; struct dma_buf_attachment *attach; struct drm_i915_gem_object *obj; int ret; @@ -295,7 +299,7 @@ struct drm_gem_object *i915_gem_prime_import(struct drm= _device *dev, } =20 /* need to attach */ - attach =3D dma_buf_attach(dma_buf, dev->dev); + attach =3D dma_buf_attach(&attach_info); if (IS_ERR(attach)) return ERR_CAST(attach); =20 diff --git a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c b/drivers/gpu/drm/om= apdrm/omap_gem_dmabuf.c index 0f8b597ccd10..38d06574b251 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c +++ b/drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c @@ -156,6 +156,10 @@ struct dma_buf *omap_gem_prime_export(struct drm_devic= e *dev, struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev, struct dma_buf *dma_buf) { + struct dma_buf_attach_info attach_info =3D { + .dev =3D dev->dev, + .dmabuf =3D dma_buf + }; struct dma_buf_attachment *attach; struct drm_gem_object *obj; struct sg_table *sgt; @@ -173,7 +177,7 @@ struct drm_gem_object *omap_gem_prime_import(struct drm= _device *dev, } } =20 - attach =3D dma_buf_attach(dma_buf, dev->dev); + attach =3D dma_buf_attach(&attach_info); if (IS_ERR(attach)) return ERR_CAST(attach); =20 diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index 4f80100ff5f3..8e6b6c879add 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c @@ -332,6 +332,10 @@ struct tegra_bo *tegra_bo_create_with_handle(struct dr= m_file *file, static struct tegra_bo *tegra_bo_import(struct drm_device *drm, struct dma_buf *buf) { + struct dma_buf_attach_info attach_info =3D { + .dev =3D drm->dev, + .dmabuf =3D buf + }; struct tegra_drm *tegra =3D drm->dev_private; struct dma_buf_attachment *attach; struct tegra_bo *bo; @@ -341,7 +345,7 @@ static struct tegra_bo *tegra_bo_import(struct drm_devi= ce *drm, if (IS_ERR(bo)) return bo; =20 - attach =3D dma_buf_attach(buf, drm->dev); + attach =3D dma_buf_attach(&attach_info); if (IS_ERR(attach)) { err =3D PTR_ERR(attach); goto free; diff --git a/drivers/gpu/drm/udl/udl_dmabuf.c b/drivers/gpu/drm/udl/udl_dma= buf.c index 556f62662aa9..86b928f9742f 100644 --- a/drivers/gpu/drm/udl/udl_dmabuf.c +++ b/drivers/gpu/drm/udl/udl_dmabuf.c @@ -226,6 +226,10 @@ static int udl_prime_create(struct drm_device *dev, struct drm_gem_object *udl_gem_prime_import(struct drm_device *dev, struct dma_buf *dma_buf) { + struct dma_buf_attach_info attach_info =3D { + .dev =3D dev->dev, + .dmabuf =3D dma_buf + }; struct dma_buf_attachment *attach; struct sg_table *sg; struct udl_gem_object *uobj; @@ -233,7 +237,7 @@ struct drm_gem_object *udl_gem_prime_import(struct drm_= device *dev, =20 /* need to attach */ get_device(dev->dev); - attach =3D dma_buf_attach(dma_buf, dev->dev); + attach =3D dma_buf_attach(&attach_info); if (IS_ERR(attach)) { put_device(dev->dev); return ERR_CAST(attach); diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/driver= s/media/common/videobuf2/videobuf2-dma-contig.c index 82389aead6ed..b2d844d45ea6 100644 --- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c +++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c @@ -653,6 +653,10 @@ static void vb2_dc_detach_dmabuf(void *mem_priv) static void *vb2_dc_attach_dmabuf(struct device *dev, struct dma_buf *dbuf, unsigned long size, enum dma_data_direction dma_dir) { + struct dma_buf_attach_info attach_info =3D { + .dev =3D dev, + .dmabuf =3D dbuf + }; struct vb2_dc_buf *buf; struct dma_buf_attachment *dba; =20 @@ -668,7 +672,7 @@ static void *vb2_dc_attach_dmabuf(struct device *dev, s= truct dma_buf *dbuf, =20 buf->dev =3D dev; /* create attachment for the dmabuf with the user device */ - dba =3D dma_buf_attach(dbuf, buf->dev); + dba =3D dma_buf_attach(&attach_info); if (IS_ERR(dba)) { pr_err("failed to attach dmabuf\n"); kfree(buf); diff --git a/drivers/media/common/videobuf2/videobuf2-dma-sg.c b/drivers/me= dia/common/videobuf2/videobuf2-dma-sg.c index 270c3162fdcb..ddd5f36a8ec7 100644 --- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c +++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c @@ -608,6 +608,10 @@ static void vb2_dma_sg_detach_dmabuf(void *mem_priv) static void *vb2_dma_sg_attach_dmabuf(struct device *dev, struct dma_buf *= dbuf, unsigned long size, enum dma_data_direction dma_dir) { + struct dma_buf_attach_info attach_info =3D { + .dev =3D dev, + .dmabuf =3D dbuf + }; struct vb2_dma_sg_buf *buf; struct dma_buf_attachment *dba; =20 @@ -623,7 +627,7 @@ static void *vb2_dma_sg_attach_dmabuf(struct device *de= v, struct dma_buf *dbuf, =20 buf->dev =3D dev; /* create attachment for the dmabuf with the user device */ - dba =3D dma_buf_attach(dbuf, buf->dev); + dba =3D dma_buf_attach(&attach_info); if (IS_ERR(dba)) { pr_err("failed to attach dmabuf\n"); kfree(buf); diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 39f832d27288..93d0aac05715 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -482,6 +482,7 @@ static int fastrpc_map_create(struct fastrpc_user *fl, = int fd, u64 len, struct fastrpc_map **ppmap) { struct fastrpc_session_ctx *sess =3D fl->sctx; + struct dma_buf_attach_info attach_info; struct fastrpc_map *map =3D NULL; int err =3D 0; =20 @@ -501,7 +502,10 @@ static int fastrpc_map_create(struct fastrpc_user *fl,= int fd, goto get_err; } =20 - map->attach =3D dma_buf_attach(map->buf, sess->dev); + memset(&attach_info, 0, sizeof(attach_info)); + attach_info.dev =3D sess->dev; + attach_info.dmabuf =3D map->buf; + map->attach =3D dma_buf_attach(&attach_info); if (IS_ERR(map->attach)) { dev_err(sess->dev, "Failed to attach dmabuf\n"); err =3D PTR_ERR(map->attach); diff --git a/drivers/staging/media/tegra-vde/tegra-vde.c b/drivers/staging/= media/tegra-vde/tegra-vde.c index aa6c6bba961e..5a10c1facc27 100644 --- a/drivers/staging/media/tegra-vde/tegra-vde.c +++ b/drivers/staging/media/tegra-vde/tegra-vde.c @@ -568,6 +568,10 @@ static int tegra_vde_attach_dmabuf(struct device *dev, size_t *size, enum dma_data_direction dma_dir) { + struct dma_buf_attach_info attach_info =3D { + .dev =3D dev, + .dmabuf =3D dmabuf + }; struct dma_buf_attachment *attachment; struct dma_buf *dmabuf; struct sg_table *sgt; @@ -591,7 +595,7 @@ static int tegra_vde_attach_dmabuf(struct device *dev, return -EINVAL; } =20 - attachment =3D dma_buf_attach(dmabuf, dev); + attachment =3D dma_buf_attach(&attach_info); if (IS_ERR(attachment)) { dev_err(dev, "Failed to attach dmabuf\n"); err =3D PTR_ERR(attachment); diff --git a/drivers/xen/gntdev-dmabuf.c b/drivers/xen/gntdev-dmabuf.c index 2c4f324f8626..cacca830b482 100644 --- a/drivers/xen/gntdev-dmabuf.c +++ b/drivers/xen/gntdev-dmabuf.c @@ -608,6 +608,7 @@ dmabuf_imp_to_refs(struct gntdev_dmabuf_priv *priv, str= uct device *dev, int fd, int count, int domid) { struct gntdev_dmabuf *gntdev_dmabuf, *ret; + struct dma_buf_attach_info attach_info; struct dma_buf *dma_buf; struct dma_buf_attachment *attach; struct sg_table *sgt; @@ -627,6 +628,9 @@ dmabuf_imp_to_refs(struct gntdev_dmabuf_priv *priv, str= uct device *dev, gntdev_dmabuf->priv =3D priv; gntdev_dmabuf->fd =3D fd; =20 + memset(&attach_info, 0, sizeof(attach_info)); + attach_info.dev =3D dev; + attach_info.dmabuf =3D dma_buf; attach =3D dma_buf_attach(dma_buf, dev); if (IS_ERR(attach)) { ret =3D ERR_CAST(attach); diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h index a0bd071466fc..b5b0f5e3f186 100644 --- a/include/linux/dma-buf.h +++ b/include/linux/dma-buf.h @@ -375,6 +375,19 @@ struct dma_buf_export_info { struct dma_buf_export_info name =3D { .exp_name =3D KBUILD_MODNAME, \ .owner =3D THIS_MODULE } =20 +/** + * struct dma_buf_attach_info - holds information needed to attach to a dm= a_buf + * @dmabuf: the exported dma_buf + * @dev: the device which wants to import the attachment + * + * This structure holds the information required to attach to a buffer. Us= ed + * with dma_buf_attach() only. + */ +struct dma_buf_attach_info { + struct dma_buf *dmabuf; + struct device *dev; +}; + /** * get_dma_buf - convenience wrapper for get_file. * @dmabuf: [in] pointer to dma_buf @@ -389,8 +402,8 @@ static inline void get_dma_buf(struct dma_buf *dmabuf) get_file(dmabuf->file); } =20 -struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, - struct device *dev); +struct dma_buf_attachment * +dma_buf_attach(const struct dma_buf_attach_info *info); void dma_buf_detach(struct dma_buf *dmabuf, struct dma_buf_attachment *dmabuf_attach); =20 --=20 2.17.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel