Merge "msm: kgsl: Add a property to find if secure context is supported"

This commit is contained in:
Linux Build Service Account 2018-10-09 09:43:37 -07:00 committed by Gerrit - the friendly Code Review server
commit 543676bc40
2 changed files with 41 additions and 0 deletions

View file

@ -1403,6 +1403,45 @@ long kgsl_ioctl_device_getproperty(struct kgsl_device_private *dev_priv,
kgsl_context_put(context);
break;
}
case KGSL_PROP_SECURE_BUFFER_ALIGNMENT:
{
unsigned int align;
if (param->sizebytes != sizeof(unsigned int)) {
result = -EINVAL;
break;
}
/*
* XPUv2 impose the constraint of 1MB memory alignment,
* on the other hand Hypervisor does not have such
* constraints. So driver should fulfill such
* requirements when allocating secure memory.
*/
align = MMU_FEATURE(&dev_priv->device->mmu,
KGSL_MMU_HYP_SECURE_ALLOC) ? PAGE_SIZE : SZ_1M;
if (copy_to_user(param->value, &align, sizeof(align)))
result = -EFAULT;
break;
}
case KGSL_PROP_SECURE_CTXT_SUPPORT:
{
unsigned int secure_ctxt;
if (param->sizebytes != sizeof(unsigned int)) {
result = -EINVAL;
break;
}
secure_ctxt = dev_priv->device->mmu.secured ? 1 : 0;
if (copy_to_user(param->value, &secure_ctxt,
sizeof(secure_ctxt)))
result = -EFAULT;
break;
}
default:
if (is_compat_task())
result = dev_priv->device->ftbl->getproperty_compat(

View file

@ -322,6 +322,8 @@ enum kgsl_timestamp_type {
#define KGSL_PROP_DEVICE_QDSS_STM 0x19
#define KGSL_PROP_DEVICE_QTIMER 0x20
#define KGSL_PROP_IB_TIMEOUT 0x21
#define KGSL_PROP_SECURE_BUFFER_ALIGNMENT 0x23
#define KGSL_PROP_SECURE_CTXT_SUPPORT 0x24
struct kgsl_shadowprop {
unsigned long gpuaddr;