drm/tegra: Support render node
authorThierry Reding <treding@nvidia.com>
Tue, 15 Aug 2017 13:42:39 +0000 (15:42 +0200)
committerThierry Reding <treding@nvidia.com>
Thu, 17 Aug 2017 15:57:17 +0000 (17:57 +0200)
None of the driver-specific IOCTLs are privileged, so mark them as such
and advertise that the driver supports render nodes.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/drm.c

index 86b3e1ce0b659eef3c123f9c6fbbaee32fe4f631..0251bb1cb545b9d1717b4b831dfa11cc1adb84bb 100644 (file)
@@ -953,20 +953,34 @@ static int tegra_gem_get_flags(struct drm_device *drm, void *data,
 
 static const struct drm_ioctl_desc tegra_drm_ioctls[] = {
 #ifdef CONFIG_DRM_TEGRA_STAGING
-       DRM_IOCTL_DEF_DRV(TEGRA_GEM_CREATE, tegra_gem_create, 0),
-       DRM_IOCTL_DEF_DRV(TEGRA_GEM_MMAP, tegra_gem_mmap, 0),
-       DRM_IOCTL_DEF_DRV(TEGRA_SYNCPT_READ, tegra_syncpt_read, 0),
-       DRM_IOCTL_DEF_DRV(TEGRA_SYNCPT_INCR, tegra_syncpt_incr, 0),
-       DRM_IOCTL_DEF_DRV(TEGRA_SYNCPT_WAIT, tegra_syncpt_wait, 0),
-       DRM_IOCTL_DEF_DRV(TEGRA_OPEN_CHANNEL, tegra_open_channel, 0),
-       DRM_IOCTL_DEF_DRV(TEGRA_CLOSE_CHANNEL, tegra_close_channel, 0),
-       DRM_IOCTL_DEF_DRV(TEGRA_GET_SYNCPT, tegra_get_syncpt, 0),
-       DRM_IOCTL_DEF_DRV(TEGRA_SUBMIT, tegra_submit, 0),
-       DRM_IOCTL_DEF_DRV(TEGRA_GET_SYNCPT_BASE, tegra_get_syncpt_base, 0),
-       DRM_IOCTL_DEF_DRV(TEGRA_GEM_SET_TILING, tegra_gem_set_tiling, 0),
-       DRM_IOCTL_DEF_DRV(TEGRA_GEM_GET_TILING, tegra_gem_get_tiling, 0),
-       DRM_IOCTL_DEF_DRV(TEGRA_GEM_SET_FLAGS, tegra_gem_set_flags, 0),
-       DRM_IOCTL_DEF_DRV(TEGRA_GEM_GET_FLAGS, tegra_gem_get_flags, 0),
+       DRM_IOCTL_DEF_DRV(TEGRA_GEM_CREATE, tegra_gem_create,
+                         DRM_UNLOCKED | DRM_RENDER_ALLOW),
+       DRM_IOCTL_DEF_DRV(TEGRA_GEM_MMAP, tegra_gem_mmap,
+                         DRM_UNLOCKED | DRM_RENDER_ALLOW),
+       DRM_IOCTL_DEF_DRV(TEGRA_SYNCPT_READ, tegra_syncpt_read,
+                         DRM_UNLOCKED | DRM_RENDER_ALLOW),
+       DRM_IOCTL_DEF_DRV(TEGRA_SYNCPT_INCR, tegra_syncpt_incr,
+                         DRM_UNLOCKED | DRM_RENDER_ALLOW),
+       DRM_IOCTL_DEF_DRV(TEGRA_SYNCPT_WAIT, tegra_syncpt_wait,
+                         DRM_UNLOCKED | DRM_RENDER_ALLOW),
+       DRM_IOCTL_DEF_DRV(TEGRA_OPEN_CHANNEL, tegra_open_channel,
+                         DRM_UNLOCKED | DRM_RENDER_ALLOW),
+       DRM_IOCTL_DEF_DRV(TEGRA_CLOSE_CHANNEL, tegra_close_channel,
+                         DRM_UNLOCKED | DRM_RENDER_ALLOW),
+       DRM_IOCTL_DEF_DRV(TEGRA_GET_SYNCPT, tegra_get_syncpt,
+                         DRM_UNLOCKED | DRM_RENDER_ALLOW),
+       DRM_IOCTL_DEF_DRV(TEGRA_SUBMIT, tegra_submit,
+                         DRM_UNLOCKED | DRM_RENDER_ALLOW),
+       DRM_IOCTL_DEF_DRV(TEGRA_GET_SYNCPT_BASE, tegra_get_syncpt_base,
+                         DRM_UNLOCKED | DRM_RENDER_ALLOW),
+       DRM_IOCTL_DEF_DRV(TEGRA_GEM_SET_TILING, tegra_gem_set_tiling,
+                         DRM_UNLOCKED | DRM_RENDER_ALLOW),
+       DRM_IOCTL_DEF_DRV(TEGRA_GEM_GET_TILING, tegra_gem_get_tiling,
+                         DRM_UNLOCKED | DRM_RENDER_ALLOW),
+       DRM_IOCTL_DEF_DRV(TEGRA_GEM_SET_FLAGS, tegra_gem_set_flags,
+                         DRM_UNLOCKED | DRM_RENDER_ALLOW),
+       DRM_IOCTL_DEF_DRV(TEGRA_GEM_GET_FLAGS, tegra_gem_get_flags,
+                         DRM_UNLOCKED | DRM_RENDER_ALLOW),
 #endif
 };
 
@@ -1057,7 +1071,7 @@ static int tegra_debugfs_init(struct drm_minor *minor)
 
 static struct drm_driver tegra_drm_driver = {
        .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
-                          DRIVER_ATOMIC,
+                          DRIVER_ATOMIC | DRIVER_RENDER,
        .load = tegra_drm_load,
        .unload = tegra_drm_unload,
        .open = tegra_drm_open,