OSDN Git Service

HACK: drm: disable GPU authentication
authorChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 5 Sep 2014 13:07:38 +0000 (21:07 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Sat, 13 Dec 2014 18:37:24 +0000 (02:37 +0800)
Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
drivers/gpu/drm/Kconfig
drivers/gpu/drm/drm_ioctl.c

index e3b4b0f..e2c9b61 100644 (file)
@@ -25,6 +25,13 @@ config DRM_MIPI_DSI
        bool
        depends on DRM
 
+config NO_GPU_AUTHENTICATION
+       bool "Disable GPU authentication"
+       depends on DRM
+       default n
+       help
+         Choose this option if you want to disable GPU authentication.
+
 config DRM_KMS_HELPER
        tristate
        depends on DRM
index 00587a1..fa8b0fd 100644 (file)
@@ -482,6 +482,7 @@ static int drm_version(struct drm_device *dev, void *data,
  */
 static int drm_ioctl_permit(u32 flags, struct drm_file *file_priv)
 {
+#ifndef CONFIG_NO_GPU_AUTHENTICATION
        /* ROOT_ONLY is only for CAP_SYS_ADMIN */
        if (unlikely((flags & DRM_ROOT_ONLY) && !capable(CAP_SYS_ADMIN)))
                return -EACCES;
@@ -505,6 +506,7 @@ static int drm_ioctl_permit(u32 flags, struct drm_file *file_priv)
        if (unlikely(!(flags & DRM_RENDER_ALLOW) &&
                     drm_is_render_client(file_priv)))
                return -EACCES;
+#endif
 
        return 0;
 }