From: Rob Clark <robdclark@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: freedreno@lists.freedesktop.org,
"Daniel Vetter" <daniel@ffwll.ch>,
"Christian König" <christian.koenig@amd.com>,
"Rob Clark" <robdclark@chromium.org>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@linux.ie>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v2 2/3] drm/prime: Wire up mmap_info support
Date: Mon, 15 Aug 2022 14:15:13 -0700 [thread overview]
Message-ID: <20220815211516.3169470-3-robdclark@gmail.com> (raw)
In-Reply-To: <20220815211516.3169470-1-robdclark@gmail.com>
From: Rob Clark <robdclark@chromium.org>
Just plumbing the thing thru an extra layer.
Signed-off-by: Rob Clark <robdclark@chromium.org>
---
drivers/gpu/drm/drm_prime.c | 3 +++
include/drm/drm_gem.h | 11 +++++++++++
2 files changed, 14 insertions(+)
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index e3f09f18110c..4457fedde1ec 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -888,6 +888,9 @@ struct dma_buf *drm_gem_prime_export(struct drm_gem_object *obj,
.resv = obj->resv,
};
+ if (obj->funcs && obj->funcs->map_info)
+ exp_info.map_info = obj->funcs->map_info(obj);
+
return drm_gem_dmabuf_export(dev, &exp_info);
}
EXPORT_SYMBOL(drm_gem_prime_export);
diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
index f28a48a6f846..a573ebfc529a 100644
--- a/include/drm/drm_gem.h
+++ b/include/drm/drm_gem.h
@@ -172,6 +172,17 @@ struct drm_gem_object_funcs {
* This is optional but necessary for mmap support.
*/
const struct vm_operations_struct *vm_ops;
+
+ /**
+ * @map_info:
+ *
+ * Return dma_buf_map_info indicating the coherency of an exported
+ * dma-buf.
+ *
+ * This callback is optional. If not provided, exported dma-bufs are
+ * assumed to be DMA_BUF_MAP_INCOHERENT.
+ */
+ enum dma_buf_map_info (*map_info)(struct drm_gem_object *obj);
};
/**
--
2.36.1
next prev parent reply other threads:[~2022-08-16 1:25 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-15 21:15 [PATCH v2 0/3] dma-buf: map-info support Rob Clark
2022-08-15 21:15 ` [PATCH v2 1/3] dma-buf: Add ioctl to query mmap coherency/cache info Rob Clark
2022-08-16 8:27 ` Christian König
2022-08-16 14:26 ` Rob Clark
2022-08-16 16:50 ` Christian König
2022-08-16 17:29 ` Rob Clark
2022-08-17 9:57 ` Christian König
2022-08-17 13:44 ` Rob Clark
2022-08-18 11:20 ` Christian König
2022-08-18 14:25 ` Rob Clark
2022-08-18 14:54 ` Christian König
2022-08-18 15:01 ` Rob Clark
2022-09-07 16:55 ` Daniel Vetter
2022-09-08 5:24 ` Rob Clark
2022-09-07 16:43 ` Daniel Vetter
2022-09-08 6:01 ` Christian König
2022-08-15 21:15 ` Rob Clark [this message]
2022-08-15 21:15 ` [PATCH v2 3/3] drm/msm/prime: Add mmap_info support Rob Clark
-- strict thread matches above, loose matches on Subject: below --
2022-08-01 17:04 [PATCH v2 0/3] dma-buf: map-info support Rob Clark
2022-08-01 17:04 ` [PATCH v2 2/3] drm/prime: Wire up mmap_info support Rob Clark
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220815211516.3169470-3-robdclark@gmail.com \
--to=robdclark@gmail.com \
--cc=airlied@linux.ie \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=robdclark@chromium.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox