[PATCH 02/16] drm: Break out ioctl permission check to a separate function v2