drm: support ignore drm ioctl permission

Change-Id: I269766a9f3f844933bd294ce681466f5a97b1d43
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
This commit is contained in:
Mark Yao
2016-11-04 16:27:14 +08:00
committed by Huang, Tao
parent 6842426ce0
commit d5b8a8a44c
2 changed files with 7 additions and 0 deletions

View File

@@ -21,6 +21,11 @@ menuconfig DRM
details. You should also select and configure AGP
(/dev/agpgart) support if it is available for your platform.
config DRM_IGNORE_IOTCL_PERMIT
bool "Ignore drm ioctl permission"
default y
depends on DRM && ANDROID
config DRM_MIPI_DSI
bool
depends on DRM

View File

@@ -520,6 +520,7 @@ static int drm_version(struct drm_device *dev, void *data,
*/
int drm_ioctl_permit(u32 flags, struct drm_file *file_priv)
{
#ifndef CONFIG_DRM_IGNORE_IOTCL_PERMIT
/* ROOT_ONLY is only for CAP_SYS_ADMIN */
if (unlikely((flags & DRM_ROOT_ONLY) && !capable(CAP_SYS_ADMIN)))
return -EACCES;
@@ -543,6 +544,7 @@ 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;
}