Merge "msm: kgsl: Disable deprecated ioctls"
This commit is contained in:
commit
b7cf9142ba
2 changed files with 28 additions and 1 deletions
|
@ -3342,11 +3342,15 @@ long kgsl_ioctl_sparse_phys_alloc(struct kgsl_device_private *dev_priv,
|
||||||
unsigned int cmd, void *data)
|
unsigned int cmd, void *data)
|
||||||
{
|
{
|
||||||
struct kgsl_process_private *process = dev_priv->process_priv;
|
struct kgsl_process_private *process = dev_priv->process_priv;
|
||||||
|
struct kgsl_device *device = dev_priv->device;
|
||||||
struct kgsl_sparse_phys_alloc *param = data;
|
struct kgsl_sparse_phys_alloc *param = data;
|
||||||
struct kgsl_mem_entry *entry;
|
struct kgsl_mem_entry *entry;
|
||||||
int ret;
|
int ret;
|
||||||
int id;
|
int id;
|
||||||
|
|
||||||
|
if (!(device->flags & KGSL_FLAG_SPARSE))
|
||||||
|
return -ENOTSUPP;
|
||||||
|
|
||||||
ret = _sparse_alloc_param_sanity_check(param->size, param->pagesize);
|
ret = _sparse_alloc_param_sanity_check(param->size, param->pagesize);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -3425,9 +3429,13 @@ long kgsl_ioctl_sparse_phys_free(struct kgsl_device_private *dev_priv,
|
||||||
unsigned int cmd, void *data)
|
unsigned int cmd, void *data)
|
||||||
{
|
{
|
||||||
struct kgsl_process_private *process = dev_priv->process_priv;
|
struct kgsl_process_private *process = dev_priv->process_priv;
|
||||||
|
struct kgsl_device *device = dev_priv->device;
|
||||||
struct kgsl_sparse_phys_free *param = data;
|
struct kgsl_sparse_phys_free *param = data;
|
||||||
struct kgsl_mem_entry *entry;
|
struct kgsl_mem_entry *entry;
|
||||||
|
|
||||||
|
if (!(device->flags & KGSL_FLAG_SPARSE))
|
||||||
|
return -ENOTSUPP;
|
||||||
|
|
||||||
entry = kgsl_sharedmem_find_id_flags(process, param->id,
|
entry = kgsl_sharedmem_find_id_flags(process, param->id,
|
||||||
KGSL_MEMFLAGS_SPARSE_PHYS);
|
KGSL_MEMFLAGS_SPARSE_PHYS);
|
||||||
if (entry == NULL)
|
if (entry == NULL)
|
||||||
|
@ -3457,10 +3465,14 @@ long kgsl_ioctl_sparse_virt_alloc(struct kgsl_device_private *dev_priv,
|
||||||
unsigned int cmd, void *data)
|
unsigned int cmd, void *data)
|
||||||
{
|
{
|
||||||
struct kgsl_process_private *private = dev_priv->process_priv;
|
struct kgsl_process_private *private = dev_priv->process_priv;
|
||||||
|
struct kgsl_device *device = dev_priv->device;
|
||||||
struct kgsl_sparse_virt_alloc *param = data;
|
struct kgsl_sparse_virt_alloc *param = data;
|
||||||
struct kgsl_mem_entry *entry;
|
struct kgsl_mem_entry *entry;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (!(device->flags & KGSL_FLAG_SPARSE))
|
||||||
|
return -ENOTSUPP;
|
||||||
|
|
||||||
ret = _sparse_alloc_param_sanity_check(param->size, param->pagesize);
|
ret = _sparse_alloc_param_sanity_check(param->size, param->pagesize);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -3500,9 +3512,13 @@ long kgsl_ioctl_sparse_virt_free(struct kgsl_device_private *dev_priv,
|
||||||
unsigned int cmd, void *data)
|
unsigned int cmd, void *data)
|
||||||
{
|
{
|
||||||
struct kgsl_process_private *process = dev_priv->process_priv;
|
struct kgsl_process_private *process = dev_priv->process_priv;
|
||||||
|
struct kgsl_device *device = dev_priv->device;
|
||||||
struct kgsl_sparse_virt_free *param = data;
|
struct kgsl_sparse_virt_free *param = data;
|
||||||
struct kgsl_mem_entry *entry = NULL;
|
struct kgsl_mem_entry *entry = NULL;
|
||||||
|
|
||||||
|
if (!(device->flags & KGSL_FLAG_SPARSE))
|
||||||
|
return -ENOTSUPP;
|
||||||
|
|
||||||
entry = kgsl_sharedmem_find_id_flags(process, param->id,
|
entry = kgsl_sharedmem_find_id_flags(process, param->id,
|
||||||
KGSL_MEMFLAGS_SPARSE_VIRT);
|
KGSL_MEMFLAGS_SPARSE_VIRT);
|
||||||
if (entry == NULL)
|
if (entry == NULL)
|
||||||
|
@ -3849,6 +3865,7 @@ long kgsl_ioctl_sparse_bind(struct kgsl_device_private *dev_priv,
|
||||||
unsigned int cmd, void *data)
|
unsigned int cmd, void *data)
|
||||||
{
|
{
|
||||||
struct kgsl_process_private *private = dev_priv->process_priv;
|
struct kgsl_process_private *private = dev_priv->process_priv;
|
||||||
|
struct kgsl_device *device = dev_priv->device;
|
||||||
struct kgsl_sparse_bind *param = data;
|
struct kgsl_sparse_bind *param = data;
|
||||||
struct kgsl_sparse_binding_object obj;
|
struct kgsl_sparse_binding_object obj;
|
||||||
struct kgsl_mem_entry *virt_entry;
|
struct kgsl_mem_entry *virt_entry;
|
||||||
|
@ -3857,6 +3874,9 @@ long kgsl_ioctl_sparse_bind(struct kgsl_device_private *dev_priv,
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
|
if (!(device->flags & KGSL_FLAG_SPARSE))
|
||||||
|
return -ENOTSUPP;
|
||||||
|
|
||||||
ptr = (void __user *) (uintptr_t) param->list;
|
ptr = (void __user *) (uintptr_t) param->list;
|
||||||
|
|
||||||
if (param->size > sizeof(struct kgsl_sparse_binding_object) ||
|
if (param->size > sizeof(struct kgsl_sparse_binding_object) ||
|
||||||
|
@ -3912,6 +3932,9 @@ long kgsl_ioctl_gpu_sparse_command(struct kgsl_device_private *dev_priv,
|
||||||
long result;
|
long result;
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
|
|
||||||
|
if (!(device->flags & KGSL_FLAG_SPARSE))
|
||||||
|
return -ENOTSUPP;
|
||||||
|
|
||||||
/* Make sure sparse and syncpoint count isn't too big */
|
/* Make sure sparse and syncpoint count isn't too big */
|
||||||
if (param->numsparse > KGSL_MAX_SPARSE ||
|
if (param->numsparse > KGSL_MAX_SPARSE ||
|
||||||
param->numsyncs > KGSL_MAX_SYNCPOINTS)
|
param->numsyncs > KGSL_MAX_SYNCPOINTS)
|
||||||
|
@ -4720,6 +4743,9 @@ int kgsl_device_platform_probe(struct kgsl_device *device)
|
||||||
/* Initialize logging first, so that failures below actually print. */
|
/* Initialize logging first, so that failures below actually print. */
|
||||||
kgsl_device_debugfs_init(device);
|
kgsl_device_debugfs_init(device);
|
||||||
|
|
||||||
|
/* Disable the sparse ioctl invocation as they are not used */
|
||||||
|
device->flags &= ~KGSL_FLAG_SPARSE;
|
||||||
|
|
||||||
status = kgsl_pwrctrl_init(device);
|
status = kgsl_pwrctrl_init(device);
|
||||||
if (status)
|
if (status)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2002,2007-2018, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2002,2007-2019, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 and
|
* it under the terms of the GNU General Public License version 2 and
|
||||||
|
@ -61,6 +61,7 @@ enum kgsl_event_results {
|
||||||
};
|
};
|
||||||
|
|
||||||
#define KGSL_FLAG_WAKE_ON_TOUCH BIT(0)
|
#define KGSL_FLAG_WAKE_ON_TOUCH BIT(0)
|
||||||
|
#define KGSL_FLAG_SPARSE BIT(1)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "list" of event types for ftrace symbolic magic
|
* "list" of event types for ftrace symbolic magic
|
||||||
|
|
Loading…
Add table
Reference in a new issue