Skip to content

Commit 028bc40

Browse files
committed
HEADER: MALI: rockchip: upgrade midgard DDK to r9p0-05rel0
Change-Id: Ie46489734268edac2db7508ed6976fc8b72c2f06 Signed-off-by: Jacob Chen <[email protected]>
1 parent f27d1ca commit 028bc40

File tree

98 files changed

+4126
-8988
lines changed

Some content is hidden

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

98 files changed

+4126
-8988
lines changed

drivers/gpu/arm/midgard/Kbuild

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
# Driver version string which is returned to userspace via an ioctl
18-
MALI_RELEASE_NAME ?= "r13p0-00rel0"
18+
MALI_RELEASE_NAME ?= "r9p0-05rel0"
1919

2020
# Paths required for build
2121
KBASE_PATH = $(src)
@@ -88,6 +88,7 @@ SRC := \
8888
mali_kbase_context.c \
8989
mali_kbase_pm.c \
9090
mali_kbase_config.c \
91+
mali_kbase_instr.c \
9192
mali_kbase_vinstr.c \
9293
mali_kbase_softjobs.c \
9394
mali_kbase_10969_workaround.c \
@@ -103,27 +104,25 @@ SRC := \
103104
mali_kbase_replay.c \
104105
mali_kbase_mem_profile_debugfs.c \
105106
mali_kbase_mmu_mode_lpae.c \
106-
mali_kbase_mmu_mode_aarch64.c \
107107
mali_kbase_disjoint_events.c \
108108
mali_kbase_gator_api.c \
109109
mali_kbase_debug_mem_view.c \
110110
mali_kbase_debug_job_fault.c \
111111
mali_kbase_smc.c \
112112
mali_kbase_mem_pool.c \
113-
mali_kbase_mem_pool_debugfs.c \
114-
mali_kbase_tlstream.c \
115-
mali_kbase_strings.c \
116-
mali_kbase_as_fault_debugfs.c
113+
mali_kbase_mem_pool_debugfs.c
117114

118-
ifeq ($(MALI_UNIT_TEST),1)
119-
SRC += mali_kbase_tlstream_test.c
115+
ifeq ($(CONFIG_MALI_MIPE_ENABLED),y)
116+
SRC += mali_kbase_tlstream.c
117+
ifeq ($(MALI_UNIT_TEST),1)
118+
SRC += mali_kbase_tlstream_test.c
119+
endif
120120
endif
121121

122122
ifeq ($(MALI_CUSTOMER_RELEASE),0)
123123
SRC += mali_kbase_regs_dump_debugfs.c
124124
endif
125125

126-
127126
# Job Scheduler Policy: Completely Fair Scheduler
128127
SRC += mali_kbase_js_policy_cfs.c
129128

@@ -201,7 +200,13 @@ obj-$(CONFIG_MALI_MIDGARD) += mali_kbase.o
201200
# Tell the Linux build system to enable building of our .c files
202201
mali_kbase-y := $(SRC:.c=.o)
203202

204-
mali_kbase-$(CONFIG_MALI_DMA_FENCE) += mali_kbase_dma_fence.o
203+
ifneq ($(wildcard $(src)/internal/Kbuild),)
204+
ifeq ($(MALI_CUSTOMER_RELEASE),0)
205+
# This include may set MALI_BACKEND_PATH and CONFIG_MALI_BACKEND_REAL
206+
include $(src)/internal/Kbuild
207+
mali_kbase-y += $(INTERNAL:.c=.o)
208+
endif
209+
endif
205210

206211
MALI_BACKEND_PATH ?= backend
207212
CONFIG_MALI_BACKEND ?= gpu

drivers/gpu/arm/midgard/Kconfig

Lines changed: 35 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,45 @@
1616

1717
menuconfig MALI_MIDGARD
1818
tristate "Mali Midgard series support"
19-
select GPU_TRACEPOINTS if ANDROID
2019
default n
2120
help
2221
Enable this option to build support for a ARM Mali Midgard GPU.
2322

2423
To compile this driver as a module, choose M here:
2524
this will generate a single module, called mali_kbase.
2625

26+
choice
27+
prompt "Streamline support"
28+
depends on MALI_MIDGARD
29+
default MALI_TIMELINE_DISABLED
30+
help
31+
Select streamline support configuration.
32+
33+
config MALI_TIMELINE_DISABLED
34+
bool "Streamline support disabled"
35+
help
36+
Disable support for ARM Streamline Performance Analyzer.
37+
38+
Timeline support will not be included in
39+
kernel code.
40+
Debug stream will not be generated.
41+
2742
config MALI_GATOR_SUPPORT
2843
bool "Streamline support via Gator"
29-
depends on MALI_MIDGARD
30-
default n
3144
help
3245
Adds diagnostic support for use with the ARM Streamline Performance Analyzer.
3346
You will need the Gator device driver already loaded before loading this driver when enabling
3447
Streamline debug support.
35-
This is a legacy interface required by older versions of Streamline.
48+
49+
config MALI_MIPE_ENABLED
50+
bool "Streamline support via MIPE"
51+
help
52+
Adds diagnostic support for use with the ARM Streamline Performance Analyzer.
53+
54+
Stream will be transmitted directly to Mali GPU library.
55+
Compatible version of the library is required to read debug stream generated by kernel.
56+
57+
endchoice
3658

3759
config MALI_MIDGARD_DVFS
3860
bool "Enable legacy DVFS"
@@ -59,15 +81,6 @@ config MALI_DEVFREQ
5981
governor, the frequency of Mali will be dynamically selected from the
6082
available OPPs.
6183

62-
config MALI_DMA_FENCE
63-
bool "DMA_BUF fence support for Mali"
64-
depends on MALI_MIDGARD && !KDS
65-
default n
66-
help
67-
Support DMA_BUF fences for Mali.
68-
69-
This option should only be enabled if KDS is not present and
70-
the Linux Kernel has built in support for DMA_BUF fences.
7184

7285
# MALI_EXPERT configuration options
7386

@@ -79,18 +92,13 @@ menuconfig MALI_EXPERT
7992
Enabling this option and modifying the default settings may produce a driver with performance or
8093
other limitations.
8194

82-
config MALI_PRFCNT_SET_SECONDARY
83-
bool "Use secondary set of performance counters"
95+
config MALI_DEBUG_SHADER_SPLIT_FS
96+
bool "Allow mapping of shader cores via sysfs"
8497
depends on MALI_MIDGARD && MALI_EXPERT
8598
default n
8699
help
87-
Select this option to use secondary set of performance counters. Kernel
88-
features that depend on an access to the primary set of counters may
89-
become unavailable. Enabling this option will prevent power management
90-
from working optimally and may cause instrumentation tools to return
91-
bogus results.
92-
93-
If unsure, say N.
100+
Select this option to provide a sysfs entry for runtime configuration of shader
101+
core affinity masks.
94102

95103
config MALI_PLATFORM_FAKE
96104
bool "Enable fake platform device support"
@@ -154,23 +162,6 @@ config MALI_DEBUG
154162
help
155163
Select this option for increased checking and reporting of errors.
156164

157-
config MALI_FENCE_DEBUG
158-
bool "Debug sync fence usage"
159-
depends on MALI_MIDGARD && MALI_EXPERT && SYNC
160-
default y if MALI_DEBUG
161-
help
162-
Select this option to enable additional checking and reporting on the
163-
use of sync fences in the Mali driver.
164-
165-
This will add a 3s timeout to all sync fence waits in the Mali
166-
driver, so that when work for Mali has been waiting on a sync fence
167-
for a long time a debug message will be printed, detailing what fence
168-
is causing the block, and which dependent Mali atoms are blocked as a
169-
result of this.
170-
171-
The timeout can be changed at runtime through the js_soft_timeout
172-
device attribute, where the timeout is specified in milliseconds.
173-
174165
config MALI_NO_MALI
175166
bool "No Mali"
176167
depends on MALI_MIDGARD && MALI_EXPERT
@@ -207,19 +198,11 @@ config MALI_SYSTEM_TRACE
207198
minimal overhead when not in use. Enable only if you know what
208199
you are doing.
209200

210-
config MALI_GPU_MMU_AARCH64
211-
bool "Use AArch64 page tables"
212-
depends on MALI_MIDGARD && MALI_EXPERT
213-
default n
201+
config MALI_GPU_TRACEPOINTS
202+
bool "Enable GPU tracepoints"
203+
depends on MALI_MIDGARD && ANDROID
204+
select GPU_TRACEPOINTS
214205
help
215-
Use AArch64 format page tables for the GPU instead of LPAE-style.
216-
The two formats have the same functionality and performance but a
217-
future GPU may deprecate or remove the legacy LPAE-style format.
218-
219-
The LPAE-style format is supported on all Midgard and current Bifrost
220-
GPUs. Enabling AArch64 format restricts the driver to only supporting
221-
Bifrost GPUs.
222-
223-
If in doubt, say N.
206+
Enables GPU tracepoints using Android trace event definitions.
224207

225208
source "drivers/gpu/arm/midgard/platform/Kconfig"

drivers/gpu/arm/midgard/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# (C) COPYRIGHT 2010-2016 ARM Limited. All rights reserved.
2+
# (C) COPYRIGHT 2010-2015 ARM Limited. All rights reserved.
33
#
44
# This program is free software and is provided to you under the terms of the
55
# GNU General Public License version 2 as published by the Free Software
@@ -26,6 +26,10 @@ ifeq ($(MALI_UNIT_TEST), 1)
2626
EXTRA_SYMBOLS += $(KBASE_PATH_RELATIVE)/tests/internal/src/kernel_assert_module/linux/Module.symvers
2727
endif
2828

29+
ifneq ($(wildcard $(CURDIR)/internal/Makefile.in),)
30+
include $(CURDIR)/internal/Makefile.in
31+
endif
32+
2933
ifeq ($(MALI_BUS_LOG), 1)
3034
#Add bus logger symbols
3135
EXTRA_SYMBOLS += $(BUSLOG_PATH_RELATIVE)/drivers/base/bus_logger/Module.symvers

drivers/gpu/arm/midgard/backend/gpu/mali_kbase_cache_policy_backend.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* (C) COPYRIGHT 2015-2016 ARM Limited. All rights reserved.
3+
* (C) COPYRIGHT 2015 ARM Limited. All rights reserved.
44
*
55
* This program is free software and is provided to you under the terms of the
66
* GNU General Public License version 2 as published by the Free Software
@@ -16,12 +16,7 @@
1616

1717

1818
#include "backend/gpu/mali_kbase_cache_policy_backend.h"
19+
#include <backend/gpu/mali_kbase_pm_internal.h>
1920
#include <backend/gpu/mali_kbase_device_internal.h>
2021

21-
void kbase_cache_set_coherency_mode(struct kbase_device *kbdev,
22-
u32 mode)
23-
{
24-
if (kbase_hw_has_feature(kbdev, BASE_HW_FEATURE_COHERENCY_REG))
25-
kbase_reg_write(kbdev, COHERENCY_ENABLE, mode, NULL);
26-
}
2722

drivers/gpu/arm/midgard/backend/gpu/mali_kbase_cache_policy_backend.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* (C) COPYRIGHT 2015-2016 ARM Limited. All rights reserved.
3+
* (C) COPYRIGHT 2015 ARM Limited. All rights reserved.
44
*
55
* This program is free software and is provided to you under the terms of the
66
* GNU General Public License version 2 as published by the Free Software
@@ -22,13 +22,5 @@
2222
#include "mali_kbase.h"
2323
#include "mali_base_kernel.h"
2424

25-
/**
26-
* kbase_cache_set_coherency_mode() - Sets the system coherency mode
27-
* in the GPU.
28-
* @kbdev: Device pointer
29-
* @mode: Coherency mode. COHERENCY_ACE/ACE_LITE
30-
*/
31-
void kbase_cache_set_coherency_mode(struct kbase_device *kbdev,
32-
u32 mode);
3325

3426
#endif /* _KBASE_CACHE_POLICY_H_ */

drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* (C) COPYRIGHT 2014-2016 ARM Limited. All rights reserved.
3+
* (C) COPYRIGHT 2014-2015 ARM Limited. All rights reserved.
44
*
55
* This program is free software and is provided to you under the terms of the
66
* GNU General Public License version 2 as published by the Free Software
@@ -135,14 +135,6 @@ kbase_devfreq_status(struct device *dev, struct devfreq_dev_status *stat)
135135

136136
stat->private_data = NULL;
137137

138-
#ifdef CONFIG_DEVFREQ_THERMAL
139-
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
140-
if (kbdev->devfreq_cooling)
141-
memcpy(&kbdev->devfreq_cooling->last_status, stat,
142-
sizeof(*stat));
143-
#endif
144-
#endif
145-
146138
return 0;
147139
}
148140

@@ -213,8 +205,7 @@ int kbase_devfreq_init(struct kbase_device *kbdev)
213205
dp = &kbdev->devfreq_profile;
214206

215207
dp->initial_freq = kbdev->current_freq;
216-
/* .KP : set devfreq_dvfs_interval_in_ms */
217-
dp->polling_ms = 20;
208+
dp->polling_ms = 100;
218209
dp->target = kbase_devfreq_target;
219210
dp->get_dev_status = kbase_devfreq_status;
220211
dp->get_cur_freq = kbase_devfreq_cur_freq;

drivers/gpu/arm/midgard/backend/gpu/mali_kbase_device_hw.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* (C) COPYRIGHT 2014-2016 ARM Limited. All rights reserved.
3+
* (C) COPYRIGHT 2014-2015 ARM Limited. All rights reserved.
44
*
55
* This program is free software and is provided to you under the terms of the
66
* GNU General Public License version 2 as published by the Free Software
@@ -33,9 +33,7 @@ void kbase_reg_write(struct kbase_device *kbdev, u16 offset, u32 value,
3333
KBASE_DEBUG_ASSERT(kctx == NULL || kctx->as_nr != KBASEP_AS_NR_INVALID);
3434
KBASE_DEBUG_ASSERT(kbdev->dev != NULL);
3535
dev_dbg(kbdev->dev, "w: reg %04x val %08x", offset, value);
36-
3736
writel(value, kbdev->reg + offset);
38-
3937
if (kctx && kctx->jctx.tb)
4038
kbase_device_trace_register_access(kctx, REG_WRITE, offset,
4139
value);
@@ -50,9 +48,7 @@ u32 kbase_reg_read(struct kbase_device *kbdev, u16 offset,
5048
KBASE_DEBUG_ASSERT(kbdev->pm.backend.gpu_powered);
5149
KBASE_DEBUG_ASSERT(kctx == NULL || kctx->as_nr != KBASEP_AS_NR_INVALID);
5250
KBASE_DEBUG_ASSERT(kbdev->dev != NULL);
53-
5451
val = readl(kbdev->reg + offset);
55-
5652
dev_dbg(kbdev->dev, "r: reg %04x val %08x", offset, val);
5753
if (kctx && kctx->jctx.tb)
5854
kbase_device_trace_register_access(kctx, REG_READ, offset, val);

drivers/gpu/arm/midgard/backend/gpu/mali_kbase_gpu.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* (C) COPYRIGHT 2014-2016 ARM Limited. All rights reserved.
3+
* (C) COPYRIGHT 2014-2015 ARM Limited. All rights reserved.
44
*
55
* This program is free software and is provided to you under the terms of the
66
* GNU General Public License version 2 as published by the Free Software
@@ -20,6 +20,7 @@
2020
* Register-based HW access backend APIs
2121
*/
2222
#include <mali_kbase.h>
23+
#include <mali_kbase_hwaccess_jm.h>
2324
#include <mali_kbase_hwaccess_backend.h>
2425
#include <backend/gpu/mali_kbase_irq_internal.h>
2526
#include <backend/gpu/mali_kbase_jm_internal.h>
@@ -80,6 +81,7 @@ int kbase_backend_late_init(struct kbase_device *kbdev)
8081
if (err)
8182
goto fail_timer;
8283

84+
/* Currently disabled on the prototype */
8385
#ifdef CONFIG_MALI_DEBUG
8486
#ifndef CONFIG_MALI_NO_MALI
8587
if (kbasep_common_test_interrupt_handlers(kbdev) != 0) {
@@ -99,13 +101,12 @@ int kbase_backend_late_init(struct kbase_device *kbdev)
99101
return 0;
100102

101103
fail_job_slot:
102-
104+
/* Currently disabled on the prototype */
103105
#ifdef CONFIG_MALI_DEBUG
104106
#ifndef CONFIG_MALI_NO_MALI
105107
fail_interrupt_test:
106108
#endif /* !CONFIG_MALI_NO_MALI */
107109
#endif /* CONFIG_MALI_DEBUG */
108-
109110
kbase_backend_timer_term(kbdev);
110111
fail_timer:
111112
kbase_hwaccess_pm_halt(kbdev);

drivers/gpu/arm/midgard/backend/gpu/mali_kbase_gpuprops_backend.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* (C) COPYRIGHT 2014-2016 ARM Limited. All rights reserved.
3+
* (C) COPYRIGHT 2014-2015 ARM Limited. All rights reserved.
44
*
55
* This program is free software and is provided to you under the terms of the
66
* GNU General Public License version 2 as published by the Free Software
@@ -86,20 +86,8 @@ void kbase_backend_gpuprops_get(struct kbase_device *kbdev,
8686
void kbase_backend_gpuprops_get_features(struct kbase_device *kbdev,
8787
struct kbase_gpuprops_regdump *regdump)
8888
{
89-
if (kbase_hw_has_feature(kbdev, BASE_HW_FEATURE_COHERENCY_REG)) {
90-
/* Ensure we can access the GPU registers */
91-
kbase_pm_register_access_enable(kbdev);
92-
93-
regdump->coherency_features = kbase_reg_read(kbdev,
94-
GPU_CONTROL_REG(COHERENCY_FEATURES), NULL);
95-
96-
/* We're done accessing the GPU registers for now. */
97-
kbase_pm_register_access_disable(kbdev);
98-
} else {
99-
/* Pre COHERENCY_FEATURES we only supported ACE_LITE */
10089
regdump->coherency_features =
10190
COHERENCY_FEATURE_BIT(COHERENCY_NONE) |
10291
COHERENCY_FEATURE_BIT(COHERENCY_ACE_LITE);
103-
}
10492
}
10593

0 commit comments

Comments
 (0)