Skip to content

Commit

Permalink
buildroot-openlinux-3.14-20161230
Browse files Browse the repository at this point in the history
  • Loading branch information
superna9999 committed Feb 15, 2017
1 parent a4e8303 commit 3c7b8bb
Show file tree
Hide file tree
Showing 101 changed files with 5,342 additions and 2,644 deletions.
Expand Up @@ -566,36 +566,27 @@ static u32 dma_te_buf_fill(struct dma_buf *dma_buf, unsigned int value)
goto no_import;
}

ret = dma_buf_begin_cpu_access(dma_buf,
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
0, dma_buf->size,
#endif
DMA_BIDIRECTIONAL);
if (ret)
goto no_cpu_access;

for_each_sg(sgt->sgl, sg, sgt->nents, count) {
ret = dma_buf_begin_cpu_access(dma_buf, offset, sg_dma_len(sg), DMA_BIDIRECTIONAL);
if (ret)
goto no_cpu_access;
for (i = 0; i < sg_dma_len(sg); i = i + PAGE_SIZE) {
void *addr;

addr = dma_buf_kmap(dma_buf, i >> PAGE_SHIFT);
if (!addr) {
/* dma_buf_kmap is unimplemented in exynos and returns NULL */
dma_buf_end_cpu_access(dma_buf, offset, sg_dma_len(sg), DMA_BIDIRECTIONAL);
ret = -EPERM;
goto no_kmap;
goto no_cpu_access;
}
memset(addr, value, PAGE_SIZE);
dma_buf_kunmap(dma_buf, i >> PAGE_SHIFT, addr);
}
dma_buf_end_cpu_access(dma_buf, offset, sg_dma_len(sg), DMA_BIDIRECTIONAL);
offset += sg_dma_len(sg);
}

no_kmap:
dma_buf_end_cpu_access(dma_buf,
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
0, dma_buf->size,
#endif
DMA_BIDIRECTIONAL);
no_cpu_access:
dma_buf_unmap_attachment(attachment, sgt, DMA_BIDIRECTIONAL);
no_import:
Expand Down
5 changes: 1 addition & 4 deletions driver/product/kernel/drivers/base/sconscript
@@ -1,5 +1,5 @@
#
# (C) COPYRIGHT 2010-2014, 2016 ARM Limited. All rights reserved.
# (C) COPYRIGHT 2010-2014 ARM Limited. All rights reserved.
#
# This program is free software and is provided to you under the terms of the
# GNU General Public License version 2 as published by the Free Software
Expand All @@ -19,9 +19,6 @@ if Glob('bus_logger/sconscript'):
if env['buslog'] == '1':
SConscript('bus_logger/sconscript')

if Glob('mali_fpga_sysctl/sconscript'):
SConscript('mali_fpga_sysctl/sconscript')

if Glob('dma_buf_lock/sconscript'):
SConscript('dma_buf_lock/sconscript')

Expand Down
23 changes: 19 additions & 4 deletions driver/product/kernel/drivers/gpu/arm/midgard/Kbuild
Expand Up @@ -15,7 +15,7 @@


# Driver version string which is returned to userspace via an ioctl
MALI_RELEASE_NAME ?= "r13p0-00rel0"
MALI_RELEASE_NAME ?= "r12p0-04rel0"

# Paths required for build
KBASE_PATH = $(src)
Expand Down Expand Up @@ -88,6 +88,7 @@ SRC := \
mali_kbase_context.c \
mali_kbase_pm.c \
mali_kbase_config.c \
mali_kbase_instr.c \
mali_kbase_vinstr.c \
mali_kbase_softjobs.c \
mali_kbase_10969_workaround.c \
Expand All @@ -103,7 +104,6 @@ SRC := \
mali_kbase_replay.c \
mali_kbase_mem_profile_debugfs.c \
mali_kbase_mmu_mode_lpae.c \
mali_kbase_mmu_mode_aarch64.c \
mali_kbase_disjoint_events.c \
mali_kbase_gator_api.c \
mali_kbase_debug_mem_view.c \
Expand All @@ -112,8 +112,7 @@ SRC := \
mali_kbase_mem_pool.c \
mali_kbase_mem_pool_debugfs.c \
mali_kbase_tlstream.c \
mali_kbase_strings.c \
mali_kbase_as_fault_debugfs.c
mali_kbase_strings.c

ifeq ($(MALI_UNIT_TEST),1)
SRC += mali_kbase_tlstream_test.c
Expand Down Expand Up @@ -195,6 +194,10 @@ obj-$(CONFIG_MALI_MIDGARD) += platform/
endif
endif

ifeq ($(CONFIG_MALI_PLATFORM_DEVICETREE),y)
ccflags-y += -I$(src)/platform/devicetree
endif

# Tell the Linux build system from which .o file to create the kernel module
obj-$(CONFIG_MALI_MIDGARD) += mali_kbase.o

Expand All @@ -203,6 +206,13 @@ mali_kbase-y := $(SRC:.c=.o)

mali_kbase-$(CONFIG_MALI_DMA_FENCE) += mali_kbase_dma_fence.o

ifneq ($(wildcard $(src)/internal/Kbuild),)
ifeq ($(MALI_CUSTOMER_RELEASE),0)
include $(src)/internal/Kbuild
mali_kbase-y += $(INTERNAL:.c=.o)
endif
endif

MALI_BACKEND_PATH ?= backend
CONFIG_MALI_BACKEND ?= gpu
CONFIG_MALI_BACKEND_REAL ?= $(CONFIG_MALI_BACKEND)
Expand All @@ -227,6 +237,11 @@ CONFIG_MALI_PLATFORM_DEVICETREE := y
endif

mali_kbase-$(CONFIG_MALI_PLATFORM_DEVICETREE) += \
platform/devicetree/mali_clock.o \
platform/devicetree/mpgpu.o \
platform/devicetree/meson_main2.o \
platform/devicetree/platform_gx.o \
platform/devicetree/scaling.o \
platform/devicetree/mali_kbase_runtime_pm.o \
platform/devicetree/mali_kbase_config_devicetree.o
ccflags-$(CONFIG_MALI_PLATFORM_DEVICETREE) += -I$(src)/platform/devicetree
42 changes: 9 additions & 33 deletions driver/product/kernel/drivers/gpu/arm/midgard/Kconfig
Expand Up @@ -60,7 +60,7 @@ config MALI_DEVFREQ
available OPPs.

config MALI_DMA_FENCE
bool "DMA_BUF fence support for Mali"
bool "DMA_BUF fence support for Mali (EXPERIMENTAL)"
depends on MALI_MIDGARD && !KDS
default n
help
Expand Down Expand Up @@ -92,6 +92,14 @@ config MALI_PRFCNT_SET_SECONDARY

If unsure, say N.

config MALI_DEBUG_SHADER_SPLIT_FS
bool "Allow mapping of shader cores via sysfs"
depends on MALI_MIDGARD && MALI_EXPERT
default n
help
Select this option to provide a sysfs entry for runtime configuration of shader
core affinity masks.

config MALI_PLATFORM_FAKE
bool "Enable fake platform device support"
depends on MALI_MIDGARD && MALI_EXPERT
Expand Down Expand Up @@ -154,23 +162,6 @@ config MALI_DEBUG
help
Select this option for increased checking and reporting of errors.

config MALI_FENCE_DEBUG
bool "Debug sync fence usage"
depends on MALI_MIDGARD && MALI_EXPERT && SYNC
default y if MALI_DEBUG
help
Select this option to enable additional checking and reporting on the
use of sync fences in the Mali driver.

This will add a 3s timeout to all sync fence waits in the Mali
driver, so that when work for Mali has been waiting on a sync fence
for a long time a debug message will be printed, detailing what fence
is causing the block, and which dependent Mali atoms are blocked as a
result of this.

The timeout can be changed at runtime through the js_soft_timeout
device attribute, where the timeout is specified in milliseconds.

config MALI_NO_MALI
bool "No Mali"
depends on MALI_MIDGARD && MALI_EXPERT
Expand Down Expand Up @@ -207,19 +198,4 @@ config MALI_SYSTEM_TRACE
minimal overhead when not in use. Enable only if you know what
you are doing.

config MALI_GPU_MMU_AARCH64
bool "Use AArch64 page tables"
depends on MALI_MIDGARD && MALI_EXPERT
default n
help
Use AArch64 format page tables for the GPU instead of LPAE-style.
The two formats have the same functionality and performance but a
future GPU may deprecate or remove the legacy LPAE-style format.

The LPAE-style format is supported on all Midgard and current Bifrost
GPUs. Enabling AArch64 format restricts the driver to only supporting
Bifrost GPUs.

If in doubt, say N.

source "drivers/gpu/arm/midgard/platform/Kconfig"
Expand Up @@ -41,6 +41,7 @@ BACKEND += \
ifeq ($(MALI_CUSTOMER_RELEASE),0)
BACKEND += \
backend/gpu/mali_kbase_pm_ca_random.c \
backend/gpu/mali_kbase_pm_ca_demand.c \
backend/gpu/mali_kbase_pm_demand_always_powered.c \
backend/gpu/mali_kbase_pm_fast_start.c
endif
Expand Down
Expand Up @@ -16,6 +16,7 @@


#include "backend/gpu/mali_kbase_cache_policy_backend.h"
#include <backend/gpu/mali_kbase_pm_internal.h>
#include <backend/gpu/mali_kbase_device_internal.h>

void kbase_cache_set_coherency_mode(struct kbase_device *kbdev,
Expand Down
@@ -1,6 +1,6 @@
/*
*
* (C) COPYRIGHT 2014-2016 ARM Limited. All rights reserved.
* (C) COPYRIGHT 2014-2015 ARM Limited. All rights reserved.
*
* This program is free software and is provided to you under the terms of the
* GNU General Public License version 2 as published by the Free Software
Expand Down Expand Up @@ -43,6 +43,110 @@
#define dev_pm_opp_find_freq_ceil opp_find_freq_ceil
#endif /* Linux >= 3.13 */

#if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND)
static struct devfreq_simple_ondemand_data ondemand_data = {
.upthreshold = 90,
.downdifferential = 5,
};

#define DEV_FREQ_GOV_DATA (&ondemand_data)

static ssize_t upthreshold_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
return sprintf(buf, "%d\n", ondemand_data.upthreshold);
}

static ssize_t upthreshold_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
unsigned int t;
int ret;

ret = sscanf(buf, "%u", &t);
if (ret != 1)
return -EINVAL;

if (t >= 100 || t == 0) {
dev_err(dev, "invalid input:%s\n", buf);
return -EINVAL;
}
ondemand_data.upthreshold = t;
return count;

}
static DEVICE_ATTR_RW(upthreshold);

static ssize_t downdifferential_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
return sprintf(buf, "%d\n", ondemand_data.downdifferential);
}

static ssize_t downdifferential_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
unsigned int t;
int ret;

ret = sscanf(buf, "%u", &t);
if (ret != 1)
return -EINVAL;

if (t >= 100 || t == 0) {
dev_err(dev, "invalid input:%s\n", buf);
return -EINVAL;
}
ondemand_data.downdifferential = t;
return count;

}
static DEVICE_ATTR_RW(downdifferential);
#else
#define DEV_FREQ_GOV_DATA (NULL)
#endif /* CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND */

static ssize_t utilisation_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct kbase_device *kbdev = dev_get_drvdata(dev->parent);
unsigned long total_time = 0, busy_time = 0;
unsigned long utilise;

kbase_pm_get_dvfs_utilisation(kbdev, &total_time, &busy_time);

if (total_time == 0) {
utilise = 0;
} else {
/* round up */
utilise = (busy_time * 100 + (total_time >> 1)) / total_time;
}
return sprintf(buf, "%ld\n", utilise);
}
static DEVICE_ATTR_RO(utilisation);

static struct device_attribute *kbase_dev_attr[] = {
#if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND)
&dev_attr_downdifferential,
&dev_attr_upthreshold,
#endif
&dev_attr_utilisation
};

static int kbase_dev_add_attr(struct device *dev)
{
int i, ret;
for (i = 0; i < ARRAY_SIZE(kbase_dev_attr); i++) {
if (!kbase_dev_attr[i])
continue;
ret = device_create_file(dev, kbase_dev_attr[i]);
if (ret)
return ret;
}
return ret;
}

static int
kbase_devfreq_target(struct device *dev, unsigned long *target_freq, u32 flags)
Expand Down Expand Up @@ -133,11 +237,9 @@ kbase_devfreq_status(struct device *dev, struct devfreq_dev_status *stat)
stat->private_data = NULL;

#ifdef CONFIG_DEVFREQ_THERMAL
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
if (kbdev->devfreq_cooling)
memcpy(&kbdev->devfreq_cooling->last_status, stat,
sizeof(*stat));
#endif
#endif

return 0;
Expand Down Expand Up @@ -220,12 +322,13 @@ int kbase_devfreq_init(struct kbase_device *kbdev)
return -EFAULT;

kbdev->devfreq = devfreq_add_device(kbdev->dev, dp,
"simple_ondemand", NULL);
"simple_ondemand", DEV_FREQ_GOV_DATA);
if (IS_ERR(kbdev->devfreq)) {
kbase_devfreq_term_freq_table(kbdev);
return PTR_ERR(kbdev->devfreq);
}

kbase_dev_add_attr(&kbdev->devfreq->dev);
err = devfreq_register_opp_notifier(kbdev->dev, kbdev->devfreq);
if (err) {
dev_err(kbdev->dev,
Expand Down
Expand Up @@ -20,6 +20,7 @@
* Register-based HW access backend APIs
*/
#include <mali_kbase.h>
#include <mali_kbase_hwaccess_jm.h>
#include <mali_kbase_hwaccess_backend.h>
#include <backend/gpu/mali_kbase_irq_internal.h>
#include <backend/gpu/mali_kbase_jm_internal.h>
Expand Down

0 comments on commit 3c7b8bb

Please sign in to comment.