From: Dmitry Osipenko <digetx@gmail.com>
To: Mikko Perttunen <cyndis@kapsi.fi>,
Thierry Reding <thierry.reding@gmail.com>,
Jon Hunter <jonathanh@nvidia.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
sumit.semwal@linaro.org, gustavo@padovan.org
Cc: "linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
talho@nvidia.com, bhuntsman@nvidia.com,
dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [RFC] Host1x/TegraDRM UAPI (drm_tegra_channel_map)
Date: Fri, 26 Jun 2020 01:47:46 +0300 [thread overview]
Message-ID: <4f9ddf30-ad8d-3750-20d7-867be17a1006@gmail.com> (raw)
In-Reply-To: <9b06b7ec-f952-2561-7afb-5653514cd5d3@kapsi.fi>
23.06.2020 15:09, Mikko Perttunen пишет:
> ### DRM_TEGRA_CHANNEL_MAP
>
> Make memory accessible by the engine while executing work on the channel.
>
> ```
> #define DRM_TEGRA_CHANNEL_MAP_READWRITE (1<<0)
>
> struct drm_tegra_channel_map {
> /*
> * [in] ID of the channel for which to map memory to.
> */
> __u32 channel_id;
> /*
> * [in] GEM handle of the memory to map.
> */
> __u32 handle;
>
> /*
> * [in] Offset in GEM handle of the memory area to map.
> *
> * Must be aligned by 4K.
> */
> __u64 offset;
Could you please give a use-case example for this partial mapping?
I vaguely recalling that maybe it was me who suggested this in the past..
I kinda see that this could be useful for a case where userspace
allocates a large chunk of memory and then performs sub-allocations in
the userspace driver. But do we have a real-world example for this right
now?
Please see more below.
> /*
> * [in] Length of memory area to map in bytes.
> *
> * Must be aligned by 4K.
> */
> __u64 length;
>
> /*
> * [out] IOVA of mapped memory. Userspace can use this IOVA
> * directly to refer to the memory to skip using relocations.
> * Only available if hardware memory isolation is enabled.
> *
> * Will be set to 0xffff_ffff_ffff_ffff if unavailable.
> */
> __u64 iova;
>
> /*
> * [out] ID corresponding to the mapped memory to be used for
> * relocations or unmapping.
> */
> __u32 mapping_id;
> /*
> * [in] Flags.
> */
> __u32 flags;
>
> __u32 reserved[6];
> };
It looks to me that we actually need a bit different thing here.
This MAP IOCTL maps a portion of a GEM and then returns the mapping_id.
And I think we need something more flexible that will allow us to use
GEM handles for the relocation IDs, which should fit nicely with the
DMA-reservations.
What about an IOCTL that wraps GEM into another GEM? We could wrap a
portion of GEM_A into a GEM_B, and then map the GEM_B using the MAP IOCTL.
It could be something like this:
### DRM_TEGRA_BO_WRAP
struct drm_tegra_wrap_bo {
__u32 bo_handle_wrapped; // out
__u32 bo_handle; // in
__u64 offset;
__u64 length;
};
### DRM_TEGRA_CHANNEL_MAP
struct drm_tegra_channel_map {
__u32 channels_mask;
__u32 mapping_id;
__u32 bo_handle;
__u32 flags;
__u64 iova;
};
===
This allows multiple mapping_ids to have the same backing GEM, so the
mapping_id could be resolved into a BO during of job's submission for
the DMA-reservations handling.
Also:
1. Maybe the WRAP IOCTL could be a generic GEM IOCTL?
2. I guess we could start easy without the WRAP IOCTL and
add it later on once there will be a real-world need.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-06-26 7:36 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-23 12:09 [RFC] Host1x/TegraDRM UAPI Mikko Perttunen
2020-06-24 20:55 ` Dmitry Osipenko
2020-06-25 9:17 ` Mikko Perttunen
2020-06-24 22:33 ` Dmitry Osipenko
2020-06-25 9:27 ` Mikko Perttunen
2020-06-25 22:50 ` [RFC] Host1x/TegraDRM UAPI (drm_tegra_submit_relocation) Dmitry Osipenko
2020-06-26 9:01 ` Mikko Perttunen
2020-06-24 23:11 ` [RFC] Host1x/TegraDRM UAPI Dmitry Osipenko
2020-06-25 9:16 ` Mikko Perttunen
2020-06-25 23:24 ` Dmitry Osipenko
2020-06-26 9:05 ` Mikko Perttunen
2020-06-24 23:18 ` Dmitry Osipenko
2020-06-25 0:59 ` Dmitry Osipenko
2020-06-24 23:23 ` Dmitry Osipenko
2020-06-25 9:19 ` Mikko Perttunen
2020-06-25 0:47 ` Dmitry Osipenko
2020-06-25 9:23 ` Mikko Perttunen
2020-06-25 22:47 ` Dmitry Osipenko [this message]
2020-06-26 7:34 ` [RFC] Host1x/TegraDRM UAPI (drm_tegra_channel_map) Thierry Reding
2020-06-26 16:35 ` Dmitry Osipenko
2020-06-28 11:16 ` Mikko Perttunen
2020-06-28 22:59 ` Dmitry Osipenko
2020-06-30 10:55 ` Mikko Perttunen
2020-06-30 19:48 ` Dmitry Osipenko
2020-06-26 11:06 ` [RFC] Host1x/TegraDRM UAPI Karol Herbst
2020-06-26 11:13 ` Mikko Perttunen
2020-06-26 11:16 ` Karol Herbst
2020-06-26 11:40 ` Thierry Reding
2020-06-26 13:38 ` Daniel Vetter
2020-06-26 13:59 ` Dmitry Osipenko
2020-06-30 9:09 ` Daniel Vetter
2020-06-27 21:47 ` [RFC] Host1x/TegraDRM UAPI (drm_tegra_submit_syncpt_incr) Dmitry Osipenko
2020-06-28 11:10 ` Mikko Perttunen
2020-06-27 22:32 ` [RFC] Host1x/TegraDRM UAPI (drm_tegra_submit_command) Dmitry Osipenko
2020-06-28 10:28 ` Mikko Perttunen
2020-06-29 0:00 ` Dmitry Osipenko
2020-06-30 10:40 ` Mikko Perttunen
2020-06-27 23:27 ` [RFC] Host1x/TegraDRM UAPI (sync points) Dmitry Osipenko
2020-06-28 9:44 ` Mikko Perttunen
2020-06-29 2:36 ` Dmitry Osipenko
2020-06-29 10:27 ` Mikko Perttunen
2020-06-29 19:28 ` Dmitry Osipenko
2020-06-29 19:33 ` Dmitry Osipenko
2020-06-29 19:42 ` Dmitry Osipenko
2020-06-30 10:26 ` Mikko Perttunen
2020-07-01 0:22 ` Dmitry Osipenko
2020-07-02 12:10 ` Mikko Perttunen
2020-07-07 11:06 ` Dmitry Osipenko
2020-07-08 10:06 ` Mikko Perttunen
2020-07-09 9:28 ` Dmitry Osipenko
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=4f9ddf30-ad8d-3750-20d7-867be17a1006@gmail.com \
--to=digetx@gmail.com \
--cc=airlied@linux.ie \
--cc=bhuntsman@nvidia.com \
--cc=cyndis@kapsi.fi \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=gustavo@padovan.org \
--cc=jonathanh@nvidia.com \
--cc=linux-tegra@vger.kernel.org \
--cc=sumit.semwal@linaro.org \
--cc=talho@nvidia.com \
--cc=thierry.reding@gmail.com \
/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