Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
A530FXXU3BRI1
Browse files Browse the repository at this point in the history
Signed-off-by: BlackMesa123 <[email protected]>
  • Loading branch information
BlackMesa123 committed Oct 23, 2018
1 parent fd6adb3 commit bdb4a62
Show file tree
Hide file tree
Showing 47 changed files with 859 additions and 525 deletions.
6 changes: 3 additions & 3 deletions arch/arm64/configs/exynos7885-jackpot2lte_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4938,7 +4938,7 @@ CONFIG_CRYPTO_ABLK_HELPER=y
# Authenticated Encryption with Associated Data
#
# CONFIG_CRYPTO_CCM is not set
# CONFIG_CRYPTO_GCM is not set
CONFIG_CRYPTO_GCM=y
# CONFIG_CRYPTO_CHACHA20POLY1305 is not set
CONFIG_CRYPTO_SEQIV=y
CONFIG_CRYPTO_ECHAINIV=y
Expand Down Expand Up @@ -4969,7 +4969,7 @@ CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_CRC32C=y
# CONFIG_CRYPTO_CRC32 is not set
# CONFIG_CRYPTO_CRCT10DIF is not set
# CONFIG_CRYPTO_GHASH is not set
CONFIG_CRYPTO_GHASH=y
# CONFIG_CRYPTO_POLY1305 is not set
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
Expand All @@ -4980,7 +4980,7 @@ CONFIG_CRYPTO_MD5=y
# CONFIG_CRYPTO_RMD320 is not set
CONFIG_CRYPTO_SHA1=y
CONFIG_CRYPTO_SHA256=y
# CONFIG_CRYPTO_SHA512 is not set
CONFIG_CRYPTO_SHA512=y
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_WP512 is not set

Expand Down
6 changes: 3 additions & 3 deletions arch/arm64/configs/exynos7885-jackpotlte_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4938,7 +4938,7 @@ CONFIG_CRYPTO_ABLK_HELPER=y
# Authenticated Encryption with Associated Data
#
# CONFIG_CRYPTO_CCM is not set
# CONFIG_CRYPTO_GCM is not set
CONFIG_CRYPTO_GCM=y
# CONFIG_CRYPTO_CHACHA20POLY1305 is not set
CONFIG_CRYPTO_SEQIV=y
CONFIG_CRYPTO_ECHAINIV=y
Expand Down Expand Up @@ -4969,7 +4969,7 @@ CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_CRC32C=y
# CONFIG_CRYPTO_CRC32 is not set
# CONFIG_CRYPTO_CRCT10DIF is not set
# CONFIG_CRYPTO_GHASH is not set
CONFIG_CRYPTO_GHASH=y
# CONFIG_CRYPTO_POLY1305 is not set
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
Expand All @@ -4980,7 +4980,7 @@ CONFIG_CRYPTO_MD5=y
# CONFIG_CRYPTO_RMD320 is not set
CONFIG_CRYPTO_SHA1=y
CONFIG_CRYPTO_SHA256=y
# CONFIG_CRYPTO_SHA512 is not set
CONFIG_CRYPTO_SHA512=y
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_WP512 is not set

Expand Down
6 changes: 3 additions & 3 deletions arch/arm64/configs/exynos7885-jackpotltecan_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4938,7 +4938,7 @@ CONFIG_CRYPTO_ABLK_HELPER=y
# Authenticated Encryption with Associated Data
#
# CONFIG_CRYPTO_CCM is not set
# CONFIG_CRYPTO_GCM is not set
CONFIG_CRYPTO_GCM=y
# CONFIG_CRYPTO_CHACHA20POLY1305 is not set
CONFIG_CRYPTO_SEQIV=y
CONFIG_CRYPTO_ECHAINIV=y
Expand Down Expand Up @@ -4969,7 +4969,7 @@ CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_CRC32C=y
# CONFIG_CRYPTO_CRC32 is not set
# CONFIG_CRYPTO_CRCT10DIF is not set
# CONFIG_CRYPTO_GHASH is not set
CONFIG_CRYPTO_GHASH=y
# CONFIG_CRYPTO_POLY1305 is not set
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
Expand All @@ -4980,7 +4980,7 @@ CONFIG_CRYPTO_MD5=y
# CONFIG_CRYPTO_RMD320 is not set
CONFIG_CRYPTO_SHA1=y
CONFIG_CRYPTO_SHA256=y
# CONFIG_CRYPTO_SHA512 is not set
CONFIG_CRYPTO_SHA512=y
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_WP512 is not set

Expand Down
6 changes: 3 additions & 3 deletions arch/arm64/configs/exynos7885-jackpotltekor_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4955,7 +4955,7 @@ CONFIG_CRYPTO_ABLK_HELPER=y
# Authenticated Encryption with Associated Data
#
# CONFIG_CRYPTO_CCM is not set
# CONFIG_CRYPTO_GCM is not set
CONFIG_CRYPTO_GCM=y
# CONFIG_CRYPTO_CHACHA20POLY1305 is not set
CONFIG_CRYPTO_SEQIV=y
CONFIG_CRYPTO_ECHAINIV=y
Expand Down Expand Up @@ -4986,7 +4986,7 @@ CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_CRC32C=y
# CONFIG_CRYPTO_CRC32 is not set
# CONFIG_CRYPTO_CRCT10DIF is not set
# CONFIG_CRYPTO_GHASH is not set
CONFIG_CRYPTO_GHASH=y
# CONFIG_CRYPTO_POLY1305 is not set
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
Expand All @@ -4997,7 +4997,7 @@ CONFIG_CRYPTO_MD5=y
# CONFIG_CRYPTO_RMD320 is not set
CONFIG_CRYPTO_SHA1=y
CONFIG_CRYPTO_SHA256=y
# CONFIG_CRYPTO_SHA512 is not set
CONFIG_CRYPTO_SHA512=y
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_WP512 is not set

Expand Down
41 changes: 41 additions & 0 deletions drivers/ccic/ccic_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,46 @@ static ssize_t ccic_send_role_swap_message(struct device *dev,
}
static DEVICE_ATTR(role_swap, 0220, NULL, ccic_send_role_swap_message);
#endif
static ssize_t ccic_acc_device_version_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
#ifdef CONFIG_CCIC_S2MM005
struct s2mm005_data *usbpd_data = dev_get_drvdata(dev);

if (!usbpd_data) {
pr_err("%s usbpd_data is null!!\n", __func__);
return -ENODEV;
}
pr_info("%s 0x%04x\n", __func__, usbpd_data->Device_Version);

return sprintf(buf, "%04x\n", usbpd_data->Device_Version);
#else
struct s2mu004_usbpd_data *pdic_data = dev_get_drvdata(dev);
struct usbpd_data *pd_data;
struct usbpd_manager_data *manager;

if (!pdic_data) {
pr_err("%s s2mu004_data is null!!\n", __func__);
return -ENODEV;
}

pd_data = dev_get_drvdata(pdic_data->dev);
if (!pd_data) {
pr_err("%s usbpd_data is null!!\n", __func__);
return -ENODEV;
}

manager = &pd_data->manager;
if (!manager) {
pr_err("%s manager_data is null!!\n", __func__);
return -ENODEV;
}
pr_info("%s 0x%04x\n", __func__, manager->Device_Version);

return sprintf(buf, "%04x\n", manager->Device_Version);
#endif
}
static DEVICE_ATTR(acc_device_version, 0444, ccic_acc_device_version_show,NULL);

static ssize_t ccic_usbpd_ids_show(struct device *dev,
struct device_attribute *attr, char *buf)
Expand Down Expand Up @@ -635,6 +675,7 @@ static struct attribute *ccic_attributes[] = {
&dev_attr_attention.attr,
&dev_attr_role_swap.attr,
#endif
&dev_attr_acc_device_version.attr,
&dev_attr_usbpd_ids.attr,
&dev_attr_usbpd_type.attr,
&dev_attr_water.attr,
Expand Down
14 changes: 14 additions & 0 deletions drivers/gpu/arm/tMIx/r9p0/mali_base_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,27 @@ struct base_mem_aliasing_info {
* @id: Unique ID provided by the caller, this is used
* to pair allocation and free requests.
* Zero is not a valid value.
* @bin_id: The JIT allocation bin, used in conjunction with
* @max_allocations to limit the number of each
* type of JIT allocation.
* @max_allocations: The maximum number of allocations allowed within
* the bin specified by @bin_id. Should be the same
* for all JIT allocations within the same bin.
* @padding: Expansion space - should be initialised to zero
* @usage_id: A hint about which allocation should be reused.
* The kernel should attempt to use a previous
* allocation with the same usage_id
*/
struct base_jit_alloc_info {
u64 gpu_alloc_addr;
u64 va_pages;
u64 commit_pages;
u64 extent;
u8 id;
u8 bin_id;
u8 max_allocations;
u8 padding[3];
u16 usage_id;
};

/**
Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/arm/tMIx/r9p0/mali_kbase_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ kbase_create_context(struct kbase_device *kbdev, bool is_compat)
setup_timer(&kctx->soft_job_timeout,
kbasep_soft_job_timeout_worker,
(uintptr_t)kctx);

get_task_struct(current);
kctx->task = current;

/* MALI_SEC_INTEGRATION */
if (kbdev->vendor_callbacks->create_context)
kbdev->vendor_callbacks->create_context(kctx);
Expand Down Expand Up @@ -353,6 +357,8 @@ void kbase_destroy_context(struct kbase_context *kctx)
kbase_mem_pool_term(&kctx->lp_mem_pool);
WARN_ON(atomic_read(&kctx->nonmapped_pages) != 0);

put_task_struct(kctx->task);

/* MALI_SEC_INTEGRATION */
if (kbdev->vendor_callbacks->destroy_context)
kbdev->vendor_callbacks->destroy_context(kctx);
Expand Down
36 changes: 34 additions & 2 deletions drivers/gpu/arm/tMIx/r9p0/mali_kbase_core_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ static int kbase_open(struct inode *inode, struct file *filp)
}

debugfs_create_file("infinite_cache", 0644, kctx->kctx_dentry,
kctx, &kbase_infinite_cache_fops);
kctx, &kbase_infinite_cache_fops);

mutex_init(&kctx->mem_profile_lock);

Expand Down Expand Up @@ -677,10 +677,37 @@ static int kbase_api_get_ddk_version(struct kbase_context *kctx,
return len;
}

/* Defaults for legacy JIT init ioctl */
#define DEFAULT_MAX_JIT_ALLOCATIONS 255
#define JIT_LEGACY_TRIM_LEVEL (0) /* No trimming */

static int kbase_api_mem_jit_init_old(struct kbase_context *kctx,
struct kbase_ioctl_mem_jit_init_old *jit_init)
{
kctx->jit_version = 1;

return kbase_region_tracker_init_jit(kctx, jit_init->va_pages,
DEFAULT_MAX_JIT_ALLOCATIONS,
JIT_LEGACY_TRIM_LEVEL);
}

static int kbase_api_mem_jit_init(struct kbase_context *kctx,
struct kbase_ioctl_mem_jit_init *jit_init)
{
return kbase_region_tracker_init_jit(kctx, jit_init->va_pages);
int i;

kctx->jit_version = 2;

for (i = 0; i < sizeof(jit_init->padding); i++) {
/* Ensure all padding bytes are 0 for potential future
* extension
*/
if (jit_init->padding[i])
return -EINVAL;
}

return kbase_region_tracker_init_jit(kctx, jit_init->va_pages,
jit_init->max_allocations, jit_init->trim_level);
}

static int kbase_api_mem_sync(struct kbase_context *kctx,
Expand Down Expand Up @@ -1046,6 +1073,11 @@ static long kbase_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
kbase_api_get_ddk_version,
struct kbase_ioctl_get_ddk_version);
break;
case KBASE_IOCTL_MEM_JIT_INIT_OLD:
KBASE_HANDLE_IOCTL_IN(KBASE_IOCTL_MEM_JIT_INIT_OLD,
kbase_api_mem_jit_init_old,
struct kbase_ioctl_mem_jit_init_old);
break;
case KBASE_IOCTL_MEM_JIT_INIT:
KBASE_HANDLE_IOCTL_IN(KBASE_IOCTL_MEM_JIT_INIT,
kbase_api_mem_jit_init,
Expand Down
15 changes: 15 additions & 0 deletions drivers/gpu/arm/tMIx/r9p0/mali_kbase_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1431,6 +1431,7 @@ struct kbase_sub_alloc {

struct kbase_context {
struct file *filp;
struct task_struct *task;
struct kbase_device *kbdev;
u32 id; /* System wide unique id */
unsigned long api_version;
Expand Down Expand Up @@ -1597,6 +1598,17 @@ struct kbase_context {

/* JIT allocation management */
struct kbase_va_region *jit_alloc[256];
/* Maximum number of JIT allocations allowed at once */
u8 jit_max_allocations;
/* Current number of in-flight JIT allocations */
u8 jit_current_allocations;
/* Current number of in-flight JIT allocations per bin */
u8 jit_current_allocations_per_bin[256];
/* JIT version number:
* 1: client used KBASE_IOCTL_MEM_JIT_INIT_OLD
* 2: client used KBASE_IOCTL_MEM_JIT_INIT
*/
u8 jit_version;
struct list_head jit_active_head;
struct list_head jit_pool_head;
struct list_head jit_destroy_head;
Expand All @@ -1620,6 +1632,9 @@ struct kbase_context {

/* Current age count, used to determine age for newly submitted atoms */
u32 age_count;

/* Level of JIT allocation trimming to perform on free (0 - 100%) */
u8 trim_level;
};

/**
Expand Down
29 changes: 28 additions & 1 deletion drivers/gpu/arm/tMIx/r9p0/mali_kbase_ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ extern "C" {

#define KBASE_IOCTL_TYPE 0x80

/* 11.1 introduced a new jit ioctl giving control over the maximum number of
* JIT allocations and trim level to be applied on free.
*/
#define BASE_UK_VERSION_MAJOR 11
#define BASE_UK_VERSION_MINOR 0
#define BASE_UK_VERSION_MINOR 1

#ifdef ANDROID
/* Android's definition of ioctl is incorrect, specifying the type argument as
Expand Down Expand Up @@ -270,16 +273,40 @@ struct kbase_ioctl_get_ddk_version {
#define KBASE_IOCTL_GET_DDK_VERSION \
_IOW(KBASE_IOCTL_TYPE, 13, struct kbase_ioctl_get_ddk_version)

/**
* struct kbase_ioctl_mem_jit_init_old - Initialise the JIT memory allocator
*
* @va_pages: Number of VA pages to reserve for JIT
*
* Note that depending on the VA size of the application and GPU, the value
* specified in @va_pages may be ignored.
*
* New code should use KBASE_IOCTL_MEM_JIT_INIT instead, this is kept for
* backwards compatibility.
*/
struct kbase_ioctl_mem_jit_init_old {
__u64 va_pages;
};

#define KBASE_IOCTL_MEM_JIT_INIT_OLD \
_IOW(KBASE_IOCTL_TYPE, 14, struct kbase_ioctl_mem_jit_init_old)

/**
* struct kbase_ioctl_mem_jit_init - Initialise the JIT memory allocator
*
* @va_pages: Number of VA pages to reserve for JIT
* @max_allocations: Maximum number of concurrent allocations
* @trim_level: Level of JIT allocation trimming to perform on free (0 - 100%)
* @padding: Currently unused, must be zero
*
* Note that depending on the VA size of the application and GPU, the value
* specified in @va_pages may be ignored.
*/
struct kbase_ioctl_mem_jit_init {
__u64 va_pages;
__u8 max_allocations;
__u8 trim_level;
__u8 padding[6];
};

#define KBASE_IOCTL_MEM_JIT_INIT \
Expand Down
Loading

0 comments on commit bdb4a62

Please sign in to comment.