Skip to content

Commit

Permalink
Merge pull request #70 from dsd/odroid-3.8.y
Browse files Browse the repository at this point in the history
Update to Mali r5p0
  • Loading branch information
mdrjr committed Feb 20, 2015
2 parents badaba1 + 7c87ebf commit 3eefbe9
Show file tree
Hide file tree
Showing 154 changed files with 12,575 additions and 9,885 deletions.
1 change: 1 addition & 0 deletions arch/arm/configs/odroidu_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2733,6 +2733,7 @@ CONFIG_MALI400=y
# CONFIG_MALI400_DEBUG is not set
# CONFIG_MALI400_PROFILING is not set
# CONFIG_MALI400_UMP is not set
# CONFIG_MALI_DVFS is not set
# CONFIG_MALI400_POWER_PERFORMANCE_POLICY is not set
CONFIG_MALI_DMA_BUF_MAP_ON_ATTACH=y
# CONFIG_MALI_SHARED_INTERRUPTS is not set
Expand Down
1 change: 1 addition & 0 deletions arch/arm/configs/odroidx2_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2578,6 +2578,7 @@ CONFIG_MALI400=y
# CONFIG_MALI400_DEBUG is not set
# CONFIG_MALI400_PROFILING is not set
# CONFIG_MALI400_UMP is not set
# CONFIG_MALI_DVFS is not set
# CONFIG_MALI400_POWER_PERFORMANCE_POLICY is not set
CONFIG_MALI_DMA_BUF_MAP_ON_ATTACH=y
# CONFIG_MALI_SHARED_INTERRUPTS is not set
Expand Down
1 change: 1 addition & 0 deletions arch/arm/configs/odroidx_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2561,6 +2561,7 @@ CONFIG_MALI400=y
# CONFIG_MALI400_DEBUG is not set
# CONFIG_MALI400_PROFILING is not set
# CONFIG_MALI400_UMP is not set
# CONFIG_MALI_DVFS is not set
# CONFIG_MALI400_POWER_PERFORMANCE_POLICY is not set
CONFIG_MALI_DMA_BUF_MAP_ON_ATTACH=y
# CONFIG_MALI_SHARED_INTERRUPTS is not set
Expand Down
441 changes: 273 additions & 168 deletions arch/arm/mach-exynos/include/mach/mali_utgard.h
100644 → 100755

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions arch/arm/plat-samsung/devs.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,6 @@ struct platform_device s5p_device_jpeg = {
/* FIMD0 */
static struct mali_gpu_device_data mali_gpu_data = {
.shared_mem_size = 256*1024*1024,
.utilization_interval = 1000,
.utilization_handler = mali_gpu_utilization_handler,
};

static struct resource mali_gpu_resource[] = {
Expand Down
25 changes: 14 additions & 11 deletions drivers/gpu/arm/mali/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# set up defaults if not defined by the user
TIMESTAMP ?= default
OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB ?= 16
USING_GPU_UTILIZATION ?= 1
USING_GPU_UTILIZATION ?= 0
PROFILING_SKIP_PP_JOBS ?= 0
PROFILING_SKIP_PP_AND_GP_JOBS ?= 0
MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP ?= 0
Expand Down Expand Up @@ -41,6 +41,12 @@ else
ccflags-y += -I$(src)/linux/license/gpl
endif

ifeq ($(USING_GPU_UTILIZATION), 1)
ifeq ($(USING_DVFS), 1)
$(error USING_GPU_UTILIZATION conflict with USING_DVFS you can read the Integration Guide to choose which one do you need)
endif
endif

mali-y += \
linux/mali_osk_atomics.o \
linux/mali_osk_irq.o \
Expand Down Expand Up @@ -88,25 +94,24 @@ mali-y += \
common/mali_gp_job.o \
common/mali_soft_job.o \
common/mali_scheduler.o \
common/mali_gp_scheduler.o \
common/mali_pp_scheduler.o \
common/mali_executor.o \
common/mali_group.o \
common/mali_dlbu.o \
common/mali_broadcast.o \
common/mali_pm.o \
common/mali_pmu.o \
common/mali_user_settings_db.o \
common/mali_kernel_utilization.o \
common/mali_control_timer.o \
common/mali_l2_cache.o \
common/mali_dma.o \
common/mali_timeline.o \
common/mali_timeline_fence_wait.o \
common/mali_timeline_sync_fence.o \
common/mali_spinlock_reentrant.o \
common/mali_pm_domain.o \
linux/mali_osk_pm.o \
linux/mali_pmu_power_up_down.o \
platform/pegasus-m400/mali_platform.o \
platform/odroid.o \
__malidrv_build_info.o

ifneq ($(MALI_PLATFORM_FILES),)
Expand All @@ -121,20 +126,18 @@ ccflags-$(CONFIG_MALI400_INTERNAL_PROFILING) += -I$(src)/timestamp-$(TIMESTAMP)

mali-$(CONFIG_DMA_SHARED_BUFFER) += linux/mali_memory_dma_buf.o
mali-$(CONFIG_SYNC) += linux/mali_sync.o
ccflags-$(CONFIG_SYNC) += -Idrivers/staging/android

mali-$(CONFIG_MALI400_UMP) += linux/mali_memory_ump.o

mali-$(CONFIG_MALI400_POWER_PERFORMANCE_POLICY) += common/mali_power_performance_policy.o
mali-$(CONFIG_MALI_DVFS) += common/mali_dvfs_policy.o

# Tell the Linux build system from which .o file to create the kernel module
obj-$(CONFIG_MALI400) := mali.o

ccflags-y += $(EXTRA_DEFINES)

# Set up our defines, which will be passed to gcc
ccflags-y += -DPROFILING_SKIP_PP_JOBS=$(PROFILING_SKIP_PP_JOBS)
ccflags-y += -DPROFILING_SKIP_PP_AND_GP_JOBS=$(PROFILING_SKIP_PP_AND_GP_JOBS)

ccflags-y += -DMALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP=$(MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP)
ccflags-y += -DMALI_PP_SCHEDULER_KEEP_SUB_JOB_STARTS_ALIGNED=$(MALI_PP_SCHEDULER_KEEP_SUB_JOB_STARTS_ALIGNED)
ccflags-y += -DMALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP_BETWEEN_APPS=$(MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP_BETWEEN_APPS)
Expand All @@ -147,7 +150,7 @@ ifeq ($(MALI_UPPER_HALF_SCHEDULING),1)
ccflags-y += -DMALI_UPPER_HALF_SCHEDULING
endif

ccflags-$(CONFIG_MALI400_UMP) += -I$(src)/../ump/include
ccflags-$(CONFIG_MALI400_UMP) += -I$(src)/../../ump/include/ump
ccflags-$(CONFIG_MALI400_DEBUG) += -DDEBUG

# Use our defines when compiling
Expand Down Expand Up @@ -205,7 +208,7 @@ VERSION_STRINGS += USING_UMP=$(CONFIG_MALI400_UMP)
VERSION_STRINGS += USING_PROFILING=$(CONFIG_MALI400_PROFILING)
VERSION_STRINGS += USING_INTERNAL_PROFILING=$(CONFIG_MALI400_INTERNAL_PROFILING)
VERSION_STRINGS += USING_GPU_UTILIZATION=$(USING_GPU_UTILIZATION)
VERSION_STRINGS += USING_POWER_PERFORMANCE_POLICY=$(CONFIG_POWER_PERFORMANCE_POLICY)
VERSION_STRINGS += USING_DVFS=$(CONFIG_MALI_DVFS)
VERSION_STRINGS += MALI_UPPER_HALF_SCHEDULING=$(MALI_UPPER_HALF_SCHEDULING)

# Create file with Mali driver configuration
Expand Down
29 changes: 24 additions & 5 deletions drivers/gpu/arm/mali/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ config MALI400_UMP
---help---
This enables support for the UMP memory sharing API in the Mali driver.

config MALI400_POWER_PERFORMANCE_POLICY
bool "Enable Mali power performance policy"
depends on ARM
default n
config MALI_DVFS
bool "Enable Mali dynamically frequency change"
depends on MALI400
default y
---help---
This enables support for dynamic performance scaling of Mali with the goal of lowering power consumption.
This enables support for dynamic change frequency of Mali with the goal of lowering power consumption.

config MALI_DMA_BUF_MAP_ON_ATTACH
bool "Map dma-buf attachments on attach"
Expand Down Expand Up @@ -79,3 +79,22 @@ config MALI_PMU_PARALLEL_POWER_UP
powering up domains one by one, with a slight delay in between. Powering on all power
domains at the same time may cause peak currents higher than what some systems can handle.
These systems must not enable this option.

config MALI_DT
bool "Using device tree to initialize module"
depends on MALI400 && CONFIG_OF
default n
---help---
This enable the Mali driver to choose the device tree path to get platform resoures
and disable the old config method. Mali driver could run on the platform which the
device tree is enabled in kernel and corresponding hardware description is implemented
properly in device DTS file.

config MALI_QUIET
bool "Make Mali driver very quiet"
depends on MALI400 && !MALI400_DEBUG
default n
---help---
This forces the Mali driver to never print any messages.

If unsure, say N.
34 changes: 29 additions & 5 deletions drivers/gpu/arm/mali/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2010-2013 ARM Limited. All rights reserved.
# Copyright (C) 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 Foundation, and any use by you of this program is subject to the terms of such GNU licence.
Expand All @@ -11,10 +11,11 @@
USE_UMPV2=0
USING_PROFILING ?= 1
USING_INTERNAL_PROFILING ?= 0
USING_POWER_PERFORMANCE_POLICY ?= 0
USING_DVFS ?= 1
MALI_HEATMAPS_ENABLED ?= 0
MALI_DMA_BUF_MAP_ON_ATTACH ?= 1
MALI_PMU_PARALLEL_POWER_UP ?= 0
USING_DT ?= 0

# The Makefile sets up "arch" based on the CONFIG, creates the version info
# string and the __malidrv_build_info.c file, and then call the Linux build
Expand Down Expand Up @@ -63,6 +64,11 @@ ifeq ($(KDIR),)
$(error No KDIR found for platform $(TARGET_PLATFORM))
endif

ifeq ($(USING_GPU_UTILIZATION), 1)
ifeq ($(USING_DVFS), 1)
$(error USING_GPU_UTILIZATION conflict with USING_DVFS you can read the Integration Guide to choose which one do you need)
endif
endif

ifeq ($(USING_UMP),1)
export CONFIG_MALI400_UMP=y
Expand Down Expand Up @@ -132,18 +138,36 @@ export CONFIG_MALI_SHARED_INTERRUPTS=y
export EXTRA_DEFINES += -DCONFIG_MALI_SHARED_INTERRUPTS
endif

ifeq ($(USING_POWER_PERFORMANCE_POLICY),1)
export CONFIG_MALI400_POWER_PERFORMANCE_POLICY=y
export EXTRA_DEFINES += -DCONFIG_MALI400_POWER_PERFORMANCE_POLICY
ifeq ($(USING_DVFS),1)
export CONFIG_MALI_DVFS=y
export EXTRA_DEFINES += -DCONFIG_MALI_DVFS
endif

ifeq ($(MALI_PMU_PARALLEL_POWER_UP),1)
export CONFIG_MALI_PMU_PARALLEL_POWER_UP=y
export EXTRA_DEFINES += -DCONFIG_MALI_PMU_PARALLEL_POWER_UP
endif

ifdef CONFIG_OF
ifeq ($(USING_DT),1)
export CONFIG_MALI_DT=y
export EXTRA_DEFINES += -DCONFIG_MALI_DT
endif
endif

ifneq ($(BUILD),release)
# Debug
export CONFIG_MALI400_DEBUG=y
else
# Release
ifeq ($(MALI_QUIET),1)
export CONFIG_MALI_QUIET=y
export EXTRA_DEFINES += -DCONFIG_MALI_QUIET
endif
endif

ifeq ($(MALI_SKIP_JOBS),1)
EXTRA_DEFINES += -DPROFILING_SKIP_PP_JOBS=1 -DPROFILING_SKIP_GP_JOBS=1
endif

all: $(UMP_SYMVERS_FILE)
Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/arm/mali/__malidrv_build_info.c

This file was deleted.

56 changes: 37 additions & 19 deletions drivers/gpu/arm/mali/common/mali_broadcast.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2012-2013 ARM Limited. All rights reserved.
* Copyright (C) 2012-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 Foundation, and any use by you of this program is subject to the terms of such GNU licence.
Expand All @@ -12,9 +12,9 @@
#include "mali_kernel_common.h"
#include "mali_osk.h"

static const int bcast_unit_reg_size = 0x1000;
static const int bcast_unit_addr_broadcast_mask = 0x0;
static const int bcast_unit_addr_irq_override_mask = 0x4;
#define MALI_BROADCAST_REGISTER_SIZE 0x1000
#define MALI_BROADCAST_REG_BROADCAST_MASK 0x0
#define MALI_BROADCAST_REG_INTERRUPT_MASK 0x4

struct mali_bcast_unit {
struct mali_hw_core hw_core;
Expand All @@ -26,21 +26,23 @@ struct mali_bcast_unit *mali_bcast_unit_create(const _mali_osk_resource_t *resou
struct mali_bcast_unit *bcast_unit = NULL;

MALI_DEBUG_ASSERT_POINTER(resource);
MALI_DEBUG_PRINT(2, ("Mali Broadcast unit: Creating Mali Broadcast unit: %s\n", resource->description));
MALI_DEBUG_PRINT(2, ("Broadcast: Creating Mali Broadcast unit: %s\n",
resource->description));

bcast_unit = _mali_osk_malloc(sizeof(struct mali_bcast_unit));
if (NULL == bcast_unit) {
MALI_PRINT_ERROR(("Mali Broadcast unit: Failed to allocate memory for Broadcast unit\n"));
MALI_PRINT_ERROR(("Broadcast: Failed to allocate memory for Broadcast unit\n"));
return NULL;
}

if (_MALI_OSK_ERR_OK == mali_hw_core_create(&bcast_unit->hw_core, resource, bcast_unit_reg_size)) {
if (_MALI_OSK_ERR_OK == mali_hw_core_create(&bcast_unit->hw_core,
resource, MALI_BROADCAST_REGISTER_SIZE)) {
bcast_unit->current_mask = 0;
mali_bcast_reset(bcast_unit);

return bcast_unit;
} else {
MALI_PRINT_ERROR(("Mali Broadcast unit: Failed map broadcast unit\n"));
MALI_PRINT_ERROR(("Broadcast: Failed map broadcast unit\n"));
}

_mali_osk_free(bcast_unit);
Expand All @@ -51,12 +53,16 @@ struct mali_bcast_unit *mali_bcast_unit_create(const _mali_osk_resource_t *resou
void mali_bcast_unit_delete(struct mali_bcast_unit *bcast_unit)
{
MALI_DEBUG_ASSERT_POINTER(bcast_unit);

mali_hw_core_delete(&bcast_unit->hw_core);
_mali_osk_free(bcast_unit);
}

void mali_bcast_add_group(struct mali_bcast_unit *bcast_unit, struct mali_group *group)
/* Call this function to add the @group's id into bcast mask
* Note: redundant calling this function with same @group
* doesn't make any difference as calling it once
*/
void mali_bcast_add_group(struct mali_bcast_unit *bcast_unit,
struct mali_group *group)
{
u32 bcast_id;
u32 broadcast_mask;
Expand All @@ -75,7 +81,12 @@ void mali_bcast_add_group(struct mali_bcast_unit *bcast_unit, struct mali_group
bcast_unit->current_mask = broadcast_mask;
}

void mali_bcast_remove_group(struct mali_bcast_unit *bcast_unit, struct mali_group *group)
/* Call this function to remove @group's id from bcast mask
* Note: redundant calling this function with same @group
* doesn't make any difference as calling it once
*/
void mali_bcast_remove_group(struct mali_bcast_unit *bcast_unit,
struct mali_group *group)
{
u32 bcast_id;
u32 broadcast_mask;
Expand All @@ -97,28 +108,35 @@ void mali_bcast_reset(struct mali_bcast_unit *bcast_unit)
{
MALI_DEBUG_ASSERT_POINTER(bcast_unit);

MALI_DEBUG_PRINT(4,
("Broadcast: setting mask 0x%08X + 0x%08X (reset)\n",
bcast_unit->current_mask,
bcast_unit->current_mask & 0xFF));

/* set broadcast mask */
mali_hw_core_register_write(&bcast_unit->hw_core,
bcast_unit_addr_broadcast_mask,
bcast_unit->current_mask);
MALI_BROADCAST_REG_BROADCAST_MASK,
bcast_unit->current_mask);

/* set IRQ override mask */
mali_hw_core_register_write(&bcast_unit->hw_core,
bcast_unit_addr_irq_override_mask,
bcast_unit->current_mask & 0xFF);
MALI_BROADCAST_REG_INTERRUPT_MASK,
bcast_unit->current_mask & 0xFF);
}

void mali_bcast_disable(struct mali_bcast_unit *bcast_unit)
{
MALI_DEBUG_ASSERT_POINTER(bcast_unit);

MALI_DEBUG_PRINT(4, ("Broadcast: setting mask 0x0 + 0x0 (disable)\n"));

/* set broadcast mask */
mali_hw_core_register_write(&bcast_unit->hw_core,
bcast_unit_addr_broadcast_mask,
0x0);
MALI_BROADCAST_REG_BROADCAST_MASK,
0x0);

/* set IRQ override mask */
mali_hw_core_register_write(&bcast_unit->hw_core,
bcast_unit_addr_irq_override_mask,
0x0);
MALI_BROADCAST_REG_INTERRUPT_MASK,
0x0);
}
7 changes: 6 additions & 1 deletion drivers/gpu/arm/mali/common/mali_broadcast.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2012-2013 ARM Limited. All rights reserved.
* Copyright (C) 2012-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 Foundation, and any use by you of this program is subject to the terms of such GNU licence.
Expand All @@ -8,6 +8,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#ifndef __MALI_BROADCAST_H__
#define __MALI_BROADCAST_H__

/*
* Interface for the broadcast unit on Mali-450.
*
Expand Down Expand Up @@ -50,3 +53,5 @@ MALI_STATIC_INLINE void mali_bcast_enable(struct mali_bcast_unit *bcast_unit)
{
mali_bcast_reset(bcast_unit);
}

#endif /* __MALI_BROADCAST_H__ */
Loading

0 comments on commit 3eefbe9

Please sign in to comment.