From: Robert Foss <robert.foss@collabora.com>
To: gustavo@padovan.org, maarten.lankhorst@linux.intel.com,
seanpaul@chromium.org, airlied@linux.ie,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Emil Velikov <emil.l.velikov@gmail.com>,
Tomasz Figa <tfiga@chromium.org>, Rob Herring <robh@kernel.org>,
Eric Engestrom <eric.engestrom@intel.com>,
Brian Paul <brianp@vmware.com>
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>,
Nicolas Norvez <norvez@chromium.org>,
Robert Foss <robert.foss@collabora.com>
Subject: [RFC] drm: Allow DRM_IOCTL_MODE_MAP_DUMB for render nodes
Date: Tue, 24 Jul 2018 10:22:13 +0200 [thread overview]
Message-ID: <20180724082213.25677-1-robert.foss@collabora.com> (raw)
From: Tomasz Figa <tfiga@chromium.org>
There is no particular reason to prevent userspace for using this IOCTL,
considering that it already has access to other, platform-specific
IOCTLs. This patch makes is possible to have the same userspace code
work regardless on the underlying platform, which significantly
simplifies the stack.
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Signed-off-by: Nicolas Norvez <norvez@chromium.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
---
I've been looking into enabling a kms_swrast based driver for mesa on
the Android platform[1].
But have come up against the issue of dumb buffer related ioctls below
not being flagged with DRM_RENDER_ALLOW.
DRM_IOCTL_MODE_CREATE_DUMB
DRM_IOCTL_MODE_MAP_DUMB
To be more precise, I've been seeing a failure due to DRM_IOCTL_MODE_MAP_DUMB
not being allowed for /dev/dri/renderD* nodes, and used in mesa
kms_sw_displaytarget_map().
As I understand it the DRM_RENDER_ALLOW flag being unset is a very intentional
restriction placed on dumb buffers in order to minimize its use.
But as far as alternative solutions for software renderers there seems to only
be VGEM and mmap()-ing DMABUFs.
While it would be convenient from the point of view of software renderers if
dumb buffers had more promiscuous permissions, it may be a hard sell upstream.
If dumb buffers aren't the way forward, what is? VGEM? Or are there any other
preferable ways?
[1] https://patchwork.freedesktop.org/series/45966/
drivers/gpu/drm/drm_ioctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 0d4cfb232576..ef716246baf6 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -642,8 +642,8 @@ static const struct drm_ioctl_desc drm_ioctls[] = {
DRM_IOCTL_DEF(DRM_IOCTL_MODE_RMFB, drm_mode_rmfb, DRM_UNLOCKED),
DRM_IOCTL_DEF(DRM_IOCTL_MODE_PAGE_FLIP, drm_mode_page_flip_ioctl, DRM_MASTER|DRM_UNLOCKED),
DRM_IOCTL_DEF(DRM_IOCTL_MODE_DIRTYFB, drm_mode_dirtyfb_ioctl, DRM_MASTER|DRM_UNLOCKED),
- DRM_IOCTL_DEF(DRM_IOCTL_MODE_CREATE_DUMB, drm_mode_create_dumb_ioctl, DRM_UNLOCKED),
- DRM_IOCTL_DEF(DRM_IOCTL_MODE_MAP_DUMB, drm_mode_mmap_dumb_ioctl, DRM_UNLOCKED),
+ DRM_IOCTL_DEF(DRM_IOCTL_MODE_CREATE_DUMB, drm_mode_create_dumb_ioctl, DRM_UNLOCKED|DRM_RENDER_ALLOW),
+ DRM_IOCTL_DEF(DRM_IOCTL_MODE_MAP_DUMB, drm_mode_mmap_dumb_ioctl, DRM_UNLOCKED|DRM_RENDER_ALLOW),
DRM_IOCTL_DEF(DRM_IOCTL_MODE_DESTROY_DUMB, drm_mode_destroy_dumb_ioctl, DRM_UNLOCKED),
DRM_IOCTL_DEF(DRM_IOCTL_MODE_OBJ_GETPROPERTIES, drm_mode_obj_get_properties_ioctl, DRM_UNLOCKED),
DRM_IOCTL_DEF(DRM_IOCTL_MODE_OBJ_SETPROPERTY, drm_mode_obj_set_property_ioctl, DRM_MASTER|DRM_UNLOCKED),
--
2.17.1
next reply other threads:[~2018-07-24 8:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-24 8:22 Robert Foss [this message]
2018-08-01 14:24 ` [RFC] drm: Allow DRM_IOCTL_MODE_MAP_DUMB for render nodes Martin Fuzzey
2018-08-03 12:35 ` Emil Velikov
2018-08-03 15:06 ` Martin Fuzzey
2018-08-03 17:03 ` Emil Velikov
2018-08-03 19:50 ` Sean Paul
2018-08-06 19:05 ` Rob Herring
2018-08-07 9:18 ` Martin Fuzzey
2018-08-07 11:01 ` Emil Velikov
2018-08-07 12:28 ` Daniel Vetter
2018-08-07 13:26 ` Emil Velikov
2018-08-03 12:25 ` Emil Velikov
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=20180724082213.25677-1-robert.foss@collabora.com \
--to=robert.foss@collabora.com \
--cc=airlied@linux.ie \
--cc=brianp@vmware.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=emil.l.velikov@gmail.com \
--cc=eric.engestrom@intel.com \
--cc=gustavo@padovan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=norvez@chromium.org \
--cc=robh@kernel.org \
--cc=seanpaul@chromium.org \
--cc=tfiga@chromium.org \
--cc=tomeu.vizoso@collabora.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;
as well as URLs for NNTP newsgroup(s).