Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3eefbe9

Browse files
committed
Merge pull request #70 from dsd/odroid-3.8.y
Update to Mali r5p0
2 parents badaba1 + 7c87ebf commit 3eefbe9

File tree

154 files changed

+12575
-9885
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+12575
-9885
lines changed

arch/arm/configs/odroidu_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2733,6 +2733,7 @@ CONFIG_MALI400=y
27332733
# CONFIG_MALI400_DEBUG is not set
27342734
# CONFIG_MALI400_PROFILING is not set
27352735
# CONFIG_MALI400_UMP is not set
2736+
# CONFIG_MALI_DVFS is not set
27362737
# CONFIG_MALI400_POWER_PERFORMANCE_POLICY is not set
27372738
CONFIG_MALI_DMA_BUF_MAP_ON_ATTACH=y
27382739
# CONFIG_MALI_SHARED_INTERRUPTS is not set

arch/arm/configs/odroidx2_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2578,6 +2578,7 @@ CONFIG_MALI400=y
25782578
# CONFIG_MALI400_DEBUG is not set
25792579
# CONFIG_MALI400_PROFILING is not set
25802580
# CONFIG_MALI400_UMP is not set
2581+
# CONFIG_MALI_DVFS is not set
25812582
# CONFIG_MALI400_POWER_PERFORMANCE_POLICY is not set
25822583
CONFIG_MALI_DMA_BUF_MAP_ON_ATTACH=y
25832584
# CONFIG_MALI_SHARED_INTERRUPTS is not set

arch/arm/configs/odroidx_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2561,6 +2561,7 @@ CONFIG_MALI400=y
25612561
# CONFIG_MALI400_DEBUG is not set
25622562
# CONFIG_MALI400_PROFILING is not set
25632563
# CONFIG_MALI400_UMP is not set
2564+
# CONFIG_MALI_DVFS is not set
25642565
# CONFIG_MALI400_POWER_PERFORMANCE_POLICY is not set
25652566
CONFIG_MALI_DMA_BUF_MAP_ON_ATTACH=y
25662567
# CONFIG_MALI_SHARED_INTERRUPTS is not set

arch/arm/mach-exynos/include/mach/mali_utgard.h

100644100755
Lines changed: 273 additions & 168 deletions
Large diffs are not rendered by default.

arch/arm/plat-samsung/devs.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,6 @@ struct platform_device s5p_device_jpeg = {
309309
/* FIMD0 */
310310
static struct mali_gpu_device_data mali_gpu_data = {
311311
.shared_mem_size = 256*1024*1024,
312-
.utilization_interval = 1000,
313-
.utilization_handler = mali_gpu_utilization_handler,
314312
};
315313

316314
static struct resource mali_gpu_resource[] = {

drivers/gpu/arm/mali/Kbuild

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# set up defaults if not defined by the user
1414
TIMESTAMP ?= default
1515
OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB ?= 16
16-
USING_GPU_UTILIZATION ?= 1
16+
USING_GPU_UTILIZATION ?= 0
1717
PROFILING_SKIP_PP_JOBS ?= 0
1818
PROFILING_SKIP_PP_AND_GP_JOBS ?= 0
1919
MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP ?= 0
@@ -41,6 +41,12 @@ else
4141
ccflags-y += -I$(src)/linux/license/gpl
4242
endif
4343

44+
ifeq ($(USING_GPU_UTILIZATION), 1)
45+
ifeq ($(USING_DVFS), 1)
46+
$(error USING_GPU_UTILIZATION conflict with USING_DVFS you can read the Integration Guide to choose which one do you need)
47+
endif
48+
endif
49+
4450
mali-y += \
4551
linux/mali_osk_atomics.o \
4652
linux/mali_osk_irq.o \
@@ -88,25 +94,24 @@ mali-y += \
8894
common/mali_gp_job.o \
8995
common/mali_soft_job.o \
9096
common/mali_scheduler.o \
91-
common/mali_gp_scheduler.o \
92-
common/mali_pp_scheduler.o \
97+
common/mali_executor.o \
9398
common/mali_group.o \
9499
common/mali_dlbu.o \
95100
common/mali_broadcast.o \
96101
common/mali_pm.o \
97102
common/mali_pmu.o \
98103
common/mali_user_settings_db.o \
99104
common/mali_kernel_utilization.o \
105+
common/mali_control_timer.o \
100106
common/mali_l2_cache.o \
101-
common/mali_dma.o \
102107
common/mali_timeline.o \
103108
common/mali_timeline_fence_wait.o \
104109
common/mali_timeline_sync_fence.o \
105110
common/mali_spinlock_reentrant.o \
106111
common/mali_pm_domain.o \
107112
linux/mali_osk_pm.o \
108113
linux/mali_pmu_power_up_down.o \
109-
platform/pegasus-m400/mali_platform.o \
114+
platform/odroid.o \
110115
__malidrv_build_info.o
111116

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

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

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

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

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

132138
ccflags-y += $(EXTRA_DEFINES)
133139

134140
# Set up our defines, which will be passed to gcc
135-
ccflags-y += -DPROFILING_SKIP_PP_JOBS=$(PROFILING_SKIP_PP_JOBS)
136-
ccflags-y += -DPROFILING_SKIP_PP_AND_GP_JOBS=$(PROFILING_SKIP_PP_AND_GP_JOBS)
137-
138141
ccflags-y += -DMALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP=$(MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP)
139142
ccflags-y += -DMALI_PP_SCHEDULER_KEEP_SUB_JOB_STARTS_ALIGNED=$(MALI_PP_SCHEDULER_KEEP_SUB_JOB_STARTS_ALIGNED)
140143
ccflags-y += -DMALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP_BETWEEN_APPS=$(MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP_BETWEEN_APPS)
@@ -147,7 +150,7 @@ ifeq ($(MALI_UPPER_HALF_SCHEDULING),1)
147150
ccflags-y += -DMALI_UPPER_HALF_SCHEDULING
148151
endif
149152

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

153156
# Use our defines when compiling
@@ -205,7 +208,7 @@ VERSION_STRINGS += USING_UMP=$(CONFIG_MALI400_UMP)
205208
VERSION_STRINGS += USING_PROFILING=$(CONFIG_MALI400_PROFILING)
206209
VERSION_STRINGS += USING_INTERNAL_PROFILING=$(CONFIG_MALI400_INTERNAL_PROFILING)
207210
VERSION_STRINGS += USING_GPU_UTILIZATION=$(USING_GPU_UTILIZATION)
208-
VERSION_STRINGS += USING_POWER_PERFORMANCE_POLICY=$(CONFIG_POWER_PERFORMANCE_POLICY)
211+
VERSION_STRINGS += USING_DVFS=$(CONFIG_MALI_DVFS)
209212
VERSION_STRINGS += MALI_UPPER_HALF_SCHEDULING=$(MALI_UPPER_HALF_SCHEDULING)
210213

211214
# Create file with Mali driver configuration

drivers/gpu/arm/mali/Kconfig

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ config MALI400_UMP
4242
---help---
4343
This enables support for the UMP memory sharing API in the Mali driver.
4444

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

5252
config MALI_DMA_BUF_MAP_ON_ATTACH
5353
bool "Map dma-buf attachments on attach"
@@ -79,3 +79,22 @@ config MALI_PMU_PARALLEL_POWER_UP
7979
powering up domains one by one, with a slight delay in between. Powering on all power
8080
domains at the same time may cause peak currents higher than what some systems can handle.
8181
These systems must not enable this option.
82+
83+
config MALI_DT
84+
bool "Using device tree to initialize module"
85+
depends on MALI400 && CONFIG_OF
86+
default n
87+
---help---
88+
This enable the Mali driver to choose the device tree path to get platform resoures
89+
and disable the old config method. Mali driver could run on the platform which the
90+
device tree is enabled in kernel and corresponding hardware description is implemented
91+
properly in device DTS file.
92+
93+
config MALI_QUIET
94+
bool "Make Mali driver very quiet"
95+
depends on MALI400 && !MALI400_DEBUG
96+
default n
97+
---help---
98+
This forces the Mali driver to never print any messages.
99+
100+
If unsure, say N.

drivers/gpu/arm/mali/Makefile

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2010-2013 ARM Limited. All rights reserved.
2+
# Copyright (C) 2010-2014 ARM Limited. All rights reserved.
33
#
44
# This program is free software and is provided to you under the terms of the GNU General Public License version 2
55
# as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
@@ -11,10 +11,11 @@
1111
USE_UMPV2=0
1212
USING_PROFILING ?= 1
1313
USING_INTERNAL_PROFILING ?= 0
14-
USING_POWER_PERFORMANCE_POLICY ?= 0
14+
USING_DVFS ?= 1
1515
MALI_HEATMAPS_ENABLED ?= 0
1616
MALI_DMA_BUF_MAP_ON_ATTACH ?= 1
1717
MALI_PMU_PARALLEL_POWER_UP ?= 0
18+
USING_DT ?= 0
1819

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

67+
ifeq ($(USING_GPU_UTILIZATION), 1)
68+
ifeq ($(USING_DVFS), 1)
69+
$(error USING_GPU_UTILIZATION conflict with USING_DVFS you can read the Integration Guide to choose which one do you need)
70+
endif
71+
endif
6672

6773
ifeq ($(USING_UMP),1)
6874
export CONFIG_MALI400_UMP=y
@@ -132,18 +138,36 @@ export CONFIG_MALI_SHARED_INTERRUPTS=y
132138
export EXTRA_DEFINES += -DCONFIG_MALI_SHARED_INTERRUPTS
133139
endif
134140

135-
ifeq ($(USING_POWER_PERFORMANCE_POLICY),1)
136-
export CONFIG_MALI400_POWER_PERFORMANCE_POLICY=y
137-
export EXTRA_DEFINES += -DCONFIG_MALI400_POWER_PERFORMANCE_POLICY
141+
ifeq ($(USING_DVFS),1)
142+
export CONFIG_MALI_DVFS=y
143+
export EXTRA_DEFINES += -DCONFIG_MALI_DVFS
138144
endif
139145

140146
ifeq ($(MALI_PMU_PARALLEL_POWER_UP),1)
141147
export CONFIG_MALI_PMU_PARALLEL_POWER_UP=y
142148
export EXTRA_DEFINES += -DCONFIG_MALI_PMU_PARALLEL_POWER_UP
143149
endif
144150

151+
ifdef CONFIG_OF
152+
ifeq ($(USING_DT),1)
153+
export CONFIG_MALI_DT=y
154+
export EXTRA_DEFINES += -DCONFIG_MALI_DT
155+
endif
156+
endif
157+
145158
ifneq ($(BUILD),release)
159+
# Debug
146160
export CONFIG_MALI400_DEBUG=y
161+
else
162+
# Release
163+
ifeq ($(MALI_QUIET),1)
164+
export CONFIG_MALI_QUIET=y
165+
export EXTRA_DEFINES += -DCONFIG_MALI_QUIET
166+
endif
167+
endif
168+
169+
ifeq ($(MALI_SKIP_JOBS),1)
170+
EXTRA_DEFINES += -DPROFILING_SKIP_PP_JOBS=1 -DPROFILING_SKIP_GP_JOBS=1
147171
endif
148172

149173
all: $(UMP_SYMVERS_FILE)

drivers/gpu/arm/mali/__malidrv_build_info.c

Lines changed: 0 additions & 1 deletion
This file was deleted.

drivers/gpu/arm/mali/common/mali_broadcast.c

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2012-2013 ARM Limited. All rights reserved.
2+
* Copyright (C) 2012-2014 ARM Limited. All rights reserved.
33
*
44
* This program is free software and is provided to you under the terms of the GNU General Public License version 2
55
* as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
@@ -12,9 +12,9 @@
1212
#include "mali_kernel_common.h"
1313
#include "mali_osk.h"
1414

15-
static const int bcast_unit_reg_size = 0x1000;
16-
static const int bcast_unit_addr_broadcast_mask = 0x0;
17-
static const int bcast_unit_addr_irq_override_mask = 0x4;
15+
#define MALI_BROADCAST_REGISTER_SIZE 0x1000
16+
#define MALI_BROADCAST_REG_BROADCAST_MASK 0x0
17+
#define MALI_BROADCAST_REG_INTERRUPT_MASK 0x4
1818

1919
struct mali_bcast_unit {
2020
struct mali_hw_core hw_core;
@@ -26,21 +26,23 @@ struct mali_bcast_unit *mali_bcast_unit_create(const _mali_osk_resource_t *resou
2626
struct mali_bcast_unit *bcast_unit = NULL;
2727

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

3132
bcast_unit = _mali_osk_malloc(sizeof(struct mali_bcast_unit));
3233
if (NULL == bcast_unit) {
33-
MALI_PRINT_ERROR(("Mali Broadcast unit: Failed to allocate memory for Broadcast unit\n"));
34+
MALI_PRINT_ERROR(("Broadcast: Failed to allocate memory for Broadcast unit\n"));
3435
return NULL;
3536
}
3637

37-
if (_MALI_OSK_ERR_OK == mali_hw_core_create(&bcast_unit->hw_core, resource, bcast_unit_reg_size)) {
38+
if (_MALI_OSK_ERR_OK == mali_hw_core_create(&bcast_unit->hw_core,
39+
resource, MALI_BROADCAST_REGISTER_SIZE)) {
3840
bcast_unit->current_mask = 0;
3941
mali_bcast_reset(bcast_unit);
4042

4143
return bcast_unit;
4244
} else {
43-
MALI_PRINT_ERROR(("Mali Broadcast unit: Failed map broadcast unit\n"));
45+
MALI_PRINT_ERROR(("Broadcast: Failed map broadcast unit\n"));
4446
}
4547

4648
_mali_osk_free(bcast_unit);
@@ -51,12 +53,16 @@ struct mali_bcast_unit *mali_bcast_unit_create(const _mali_osk_resource_t *resou
5153
void mali_bcast_unit_delete(struct mali_bcast_unit *bcast_unit)
5254
{
5355
MALI_DEBUG_ASSERT_POINTER(bcast_unit);
54-
5556
mali_hw_core_delete(&bcast_unit->hw_core);
5657
_mali_osk_free(bcast_unit);
5758
}
5859

59-
void mali_bcast_add_group(struct mali_bcast_unit *bcast_unit, struct mali_group *group)
60+
/* Call this function to add the @group's id into bcast mask
61+
* Note: redundant calling this function with same @group
62+
* doesn't make any difference as calling it once
63+
*/
64+
void mali_bcast_add_group(struct mali_bcast_unit *bcast_unit,
65+
struct mali_group *group)
6066
{
6167
u32 bcast_id;
6268
u32 broadcast_mask;
@@ -75,7 +81,12 @@ void mali_bcast_add_group(struct mali_bcast_unit *bcast_unit, struct mali_group
7581
bcast_unit->current_mask = broadcast_mask;
7682
}
7783

78-
void mali_bcast_remove_group(struct mali_bcast_unit *bcast_unit, struct mali_group *group)
84+
/* Call this function to remove @group's id from bcast mask
85+
* Note: redundant calling this function with same @group
86+
* doesn't make any difference as calling it once
87+
*/
88+
void mali_bcast_remove_group(struct mali_bcast_unit *bcast_unit,
89+
struct mali_group *group)
7990
{
8091
u32 bcast_id;
8192
u32 broadcast_mask;
@@ -97,28 +108,35 @@ void mali_bcast_reset(struct mali_bcast_unit *bcast_unit)
97108
{
98109
MALI_DEBUG_ASSERT_POINTER(bcast_unit);
99110

111+
MALI_DEBUG_PRINT(4,
112+
("Broadcast: setting mask 0x%08X + 0x%08X (reset)\n",
113+
bcast_unit->current_mask,
114+
bcast_unit->current_mask & 0xFF));
115+
100116
/* set broadcast mask */
101117
mali_hw_core_register_write(&bcast_unit->hw_core,
102-
bcast_unit_addr_broadcast_mask,
103-
bcast_unit->current_mask);
118+
MALI_BROADCAST_REG_BROADCAST_MASK,
119+
bcast_unit->current_mask);
104120

105121
/* set IRQ override mask */
106122
mali_hw_core_register_write(&bcast_unit->hw_core,
107-
bcast_unit_addr_irq_override_mask,
108-
bcast_unit->current_mask & 0xFF);
123+
MALI_BROADCAST_REG_INTERRUPT_MASK,
124+
bcast_unit->current_mask & 0xFF);
109125
}
110126

111127
void mali_bcast_disable(struct mali_bcast_unit *bcast_unit)
112128
{
113129
MALI_DEBUG_ASSERT_POINTER(bcast_unit);
114130

131+
MALI_DEBUG_PRINT(4, ("Broadcast: setting mask 0x0 + 0x0 (disable)\n"));
132+
115133
/* set broadcast mask */
116134
mali_hw_core_register_write(&bcast_unit->hw_core,
117-
bcast_unit_addr_broadcast_mask,
118-
0x0);
135+
MALI_BROADCAST_REG_BROADCAST_MASK,
136+
0x0);
119137

120138
/* set IRQ override mask */
121139
mali_hw_core_register_write(&bcast_unit->hw_core,
122-
bcast_unit_addr_irq_override_mask,
123-
0x0);
140+
MALI_BROADCAST_REG_INTERRUPT_MASK,
141+
0x0);
124142
}

0 commit comments

Comments
 (0)