From d5b8a8a44ceb4250adc1847e02c2d7af7c8cbbc5 Mon Sep 17 00:00:00 2001 From: Mark Yao Date: Fri, 4 Nov 2016 16:27:14 +0800 Subject: [PATCH] drm: support ignore drm ioctl permission Change-Id: I269766a9f3f844933bd294ce681466f5a97b1d43 Signed-off-by: Mark Yao --- drivers/gpu/drm/Kconfig | 5 +++++ drivers/gpu/drm/drm_ioctl.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 52d6e890bf85..e2181ac57107 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -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 diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index 081ba3587ee6..92f079556b98 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -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; } -- 2.34.1