Skip to content

Commit

Permalink
drm/panfrost: Add a module parameter to expose unstable ioctls
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Boris Brezillon authored and Rob Herring committed Jun 18, 2019
1 parent dd082ce commit 92f0ad0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/panfrost/panfrost_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ static inline bool panfrost_model_eq(struct panfrost_device *pfdev, s32 id)
return !panfrost_model_cmp(pfdev, id);
}

int panfrost_unstable_ioctl_check(void);

int panfrost_device_init(struct panfrost_device *pfdev);
void panfrost_device_fini(struct panfrost_device *pfdev);

Expand Down
11 changes: 11 additions & 0 deletions drivers/gpu/drm/panfrost/panfrost_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 92f0ad0

Please sign in to comment.