mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
drm: support ignore drm ioctl permission
Change-Id: I269766a9f3f844933bd294ce681466f5a97b1d43 Signed-off-by: Mark Yao <mark.yao@rock-chips.com> Signed-off-by: Sandy Huang <hjc@rock-chips.com>
This commit is contained in:
@@ -31,6 +31,10 @@ config DRM_MIPI_DBI
|
||||
tristate
|
||||
depends on DRM
|
||||
|
||||
config DRM_IGNORE_IOTCL_PERMIT
|
||||
bool "Ignore drm ioctl permission"
|
||||
depends on DRM && ANDROID && NO_GKI
|
||||
|
||||
config DRM_MIPI_DSI
|
||||
bool
|
||||
depends on DRM
|
||||
|
||||
@@ -536,6 +536,7 @@ 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;
|
||||
@@ -554,6 +555,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