mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
drm: support ignore drm ioctl permission
Change-Id: I269766a9f3f844933bd294ce681466f5a97b1d43 Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user