summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/panfrost/panfrost_drv.c
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@collabora.com>2019-06-18 10:16:46 +0200
committerRob Herring <robh@kernel.org>2019-06-18 09:23:23 -0600
commit92f0ad0b1dc63cc27362cd8e466976a7ccde2da3 (patch)
tree876c32d62c9b5411f52e52763b9e46e51b205a2c /drivers/gpu/drm/panfrost/panfrost_drv.c
parentdd082cef99b6e7fd14b17d8a05ac32347a579a41 (diff)
drm/panfrost: Add a module parameter to expose unstable ioctls
We plan to expose performance counters through 2 driver specific ioctls until there's a solution to expose them in a generic way. In order to be able to deprecate those ioctls when this new infrastructure is in place we add an unsafe module parameter that will keep those ioctls hidden unless it's set to true (which also has the effect of tainting the kernel). All unstable ioctl handlers should use panfrost_unstable_ioctl_check() to check whether they're supposed to handle the request or reject it with ENOSYS. Suggested-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Signed-off-by: Rob Herring <robh@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20190618081648.17297-3-boris.brezillon@collabora.com
Diffstat (limited to 'drivers/gpu/drm/panfrost/panfrost_drv.c')
-rw-r--r--drivers/gpu/drm/panfrost/panfrost_drv.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index d11e2281dde6..754881ece8d7 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -20,6 +20,9 @@
#include "panfrost_job.h"
#include "panfrost_gpu.h"
+static bool unstable_ioctls;
+module_param_unsafe(unstable_ioctls, bool, 0600);
+
static int panfrost_ioctl_get_param(struct drm_device *ddev, void *data, struct drm_file *file)
{
struct drm_panfrost_get_param *param = data;
@@ -297,6 +300,14 @@ static int panfrost_ioctl_get_bo_offset(struct drm_device *dev, void *data,
return 0;
}
+int panfrost_unstable_ioctl_check(void)
+{
+ if (!unstable_ioctls)
+ return -ENOSYS;
+
+ return 0;
+}
+
static int
panfrost_open(struct drm_device *dev, struct drm_file *file)
{