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