+Daniel and David

On Wed, May 29, 2019 at 3:52 AM Boris Brezillon
<boris.brezil...@collabora.com> wrote:
>
> 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.veli...@collabora.com>
> Signed-off-by: Boris Brezillon <boris.brezil...@collabora.com>

Daniel, David, Any issues with this approach for an unstable interface?

> ---
> Chnages in v3:
> * New patch
> ---
>  drivers/gpu/drm/panfrost/panfrost_device.h |  2 ++
>  drivers/gpu/drm/panfrost/panfrost_drv.c    | 11 +++++++++++
>  2 files changed, 13 insertions(+)
>
> diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h 
> b/drivers/gpu/drm/panfrost/panfrost_device.h
> index 8074f221034b..031168f83bd2 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_device.h
> +++ b/drivers/gpu/drm/panfrost/panfrost_device.h
> @@ -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);
>
> 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)
>  {
> --
> 2.20.1
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to