Skip to content

Commit 9bc519c

Browse files
committed
media: Mali-400 and UMP version r3p2
1 parent 88de0a1 commit 9bc519c

File tree

157 files changed

+31595
-4
lines changed

Some content is hidden

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

157 files changed

+31595
-4
lines changed

drivers/media/video/samsung/Kconfig

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ if CPU_EXYNOS4210 || CPU_EXYNOS4212 || CPU_EXYNOS4412
1717
source "drivers/media/video/samsung/fimc/Kconfig"
1818
source "drivers/media/video/samsung/tvout/Kconfig"
1919
source "drivers/media/video/samsung/mfc5x/Kconfig"
20-
source "drivers/media/video/samsung/ump/Kconfig"
21-
source "drivers/media/video/samsung/mali/Kconfig"
20+
2221
endif
2322

2423
config VIDEO_FIMG2D
@@ -96,3 +95,26 @@ config VIDEO_SAMSUNG_MEMSIZE_JPEG
9695
default "40960"
9796
endif
9897

98+
config VIDEO_MALI_R2P4
99+
bool "Use Mali r2p4 version"
100+
depends on VIDEO_SAMSUNG
101+
default n
102+
help
103+
Use Mali r2p4 version
104+
105+
config VIDEO_MALI_R3P2
106+
bool "Use Mali r3p2 version"
107+
depends on VIDEO_SAMSUNG
108+
default n
109+
help
110+
Use Mali r3p2 version
111+
112+
if VIDEO_MALI_R2P4
113+
source "drivers/media/video/samsung/ump/Kconfig"
114+
source "drivers/media/video/samsung/mali/Kconfig"
115+
endif
116+
117+
if VIDEO_MALI_R3P2
118+
source "drivers/media/video/samsung/ump_r3p2/Kconfig"
119+
source "drivers/media/video/samsung/mali_r3p2/Kconfig"
120+
endif

drivers/media/video/samsung/Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@ obj-$(CONFIG_VIDEO_TVOUT) += tvout/
55
obj-$(CONFIG_VIDEO_MFC5X) += mfc5x/
66
obj-$(CONFIG_VIDEO_FIMG2D3X) += fimg2d3x/
77
obj-$(CONFIG_VIDEO_FIMG2D4X) += fimg2d4x/
8-
obj-$(CONFIG_VIDEO_UMP) += ump/
9-
obj-$(CONFIG_VIDEO_MALI400MP) += mali/
8+
9+
ifeq ($(CONFIG_VIDEO_MALI_R2P4),y)
10+
obj-$(CONFIG_VIDEO_UMP) += ump/
11+
obj-$(CONFIG_VIDEO_MALI400MP) += mali/
12+
endif
13+
14+
ifeq ($(CONFIG_VIDEO_MALI_R3P2),y)
15+
obj-$(CONFIG_UMP) += ump_r3p2/
16+
obj-$(CONFIG_MALI400) += mali_r3p2/
17+
endif
1018

1119
EXTRA_CFLAGS += -Idrivers/media/video
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
#
2+
# Copyright (C) 2010-2011 ARM Limited. All rights reserved.
3+
#
4+
# This program is free software and is provided to you under the terms of the GNU General Public License version 2
5+
# as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
6+
#
7+
# A copy of the licence is included with the program, and can also be obtained from Free Software
8+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
9+
#
10+
11+
# This file is called by the Linux build system.
12+
13+
# set up defaults if not defined by the user
14+
TIMESTAMP ?= default
15+
OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB ?= 16
16+
USING_GPU_UTILIZATION ?= 0
17+
PROFILING_SKIP_PP_JOBS ?= 0
18+
PROFILING_SKIP_PP_AND_GP_JOBS ?= 0
19+
MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP ?= 1
20+
MALI_PP_SCHEDULER_KEEP_SUB_JOB_STARTS_ALIGNED ?= 1
21+
MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP_BETWEEN_APPS ?= 1
22+
MALI_UPPER_HALF_SCHEDULING ?= 1
23+
24+
# For customer releases the Linux Device Drivers will be provided as ARM proprietary and GPL releases:
25+
# The ARM proprietary product will only include the license/proprietary directory
26+
# The GPL product will only include the license/gpl directory
27+
ifeq ($(wildcard $(src)/linux/license/gpl/*),)
28+
ccflags-y += -I$(src)/linux/license/proprietary
29+
ifeq ($(CONFIG_MALI400_PROFILING),y)
30+
$(error Profiling is incompatible with non-GPL license)
31+
endif
32+
ifeq ($(CONFIG_PM_RUNTIME),y)
33+
$(error Runtime PM is incompatible with non-GPL license)
34+
endif
35+
ifeq ($(CONFIG_DMA_SHARED_BUFFER),y)
36+
$(error DMA-BUF is incompatible with non-GPL license)
37+
endif
38+
$(error Linux Device integration is incompatible with non-GPL license)
39+
else
40+
ccflags-y += -I$(src)/linux/license/gpl
41+
endif
42+
43+
mali-y += \
44+
linux/mali_osk_atomics.o \
45+
linux/mali_osk_irq.o \
46+
linux/mali_osk_wq.o \
47+
linux/mali_osk_locks.o \
48+
linux/mali_osk_wait_queue.o \
49+
linux/mali_osk_low_level_mem.o \
50+
linux/mali_osk_math.o \
51+
linux/mali_osk_memory.o \
52+
linux/mali_osk_misc.o \
53+
linux/mali_osk_mali.o \
54+
linux/mali_osk_notification.o \
55+
linux/mali_osk_time.o \
56+
linux/mali_osk_timers.o
57+
58+
mali-y += \
59+
linux/mali_ukk_mem.o \
60+
linux/mali_ukk_gp.o \
61+
linux/mali_ukk_pp.o \
62+
linux/mali_ukk_core.o
63+
64+
# Source files which always are included in a build
65+
mali-y += \
66+
common/mali_kernel_core.o \
67+
linux/mali_kernel_linux.o \
68+
common/mali_kernel_descriptor_mapping.o \
69+
common/mali_session.o \
70+
common/mali_device_pause_resume.o \
71+
common/mali_kernel_vsync.o \
72+
linux/mali_ukk_vsync.o \
73+
linux/mali_kernel_sysfs.o \
74+
common/mali_mmu.o \
75+
common/mali_mmu_page_directory.o \
76+
common/mali_memory.o \
77+
common/mali_kernel_memory_engine.o \
78+
common/mali_block_allocator.o \
79+
common/mali_kernel_mem_os.o \
80+
common/mali_mem_validation.o \
81+
common/mali_hw_core.o \
82+
common/mali_gp.o \
83+
common/mali_pp.o \
84+
common/mali_pp_job.o \
85+
common/mali_gp_job.o \
86+
common/mali_scheduler.o \
87+
common/mali_gp_scheduler.o \
88+
common/mali_pp_scheduler.o \
89+
common/mali_group.o \
90+
common/mali_dlbu.o \
91+
common/mali_broadcast.o \
92+
common/mali_pm.o \
93+
common/mali_pmu.o \
94+
common/mali_user_settings_db.o \
95+
common/mali_kernel_utilization.o \
96+
common/mali_l2_cache.o \
97+
linux/mali_osk_pm.o \
98+
linux/mali_pmu_power_up_down.o \
99+
platform/arm/arm.o \
100+
__malidrv_build_info.o
101+
102+
mali-$(CONFIG_MALI400_PROFILING) += linux/mali_ukk_profiling.o
103+
mali-$(CONFIG_MALI400_PROFILING) += linux/mali_osk_profiling.o
104+
105+
mali-$(CONFIG_MALI400_INTERNAL_PROFILING) += linux/mali_profiling_internal.o timestamp-$(TIMESTAMP)/mali_timestamp.o
106+
ccflags-$(CONFIG_MALI400_INTERNAL_PROFILING) += -I$(src)/timestamp-$(TIMESTAMP)
107+
108+
mali-$(CONFIG_DMA_SHARED_BUFFER) += linux/mali_dma_buf.o
109+
mali-$(CONFIG_SYNC) += linux/mali_sync.o linux/mali_sync_user.o
110+
111+
# Tell the Linux build system from which .o file to create the kernel module
112+
obj-$(CONFIG_MALI400) := mali.o
113+
114+
#ifdef CONFIG_PM
115+
#ifdef CONFIG_PM_RUNTIME
116+
# KERNEL_RUNTIME_PM_ENABLED = 1
117+
#endif
118+
#endif
119+
#export EXTRA_DEFINES += -DMALI_PMM_RUNTIME_JOB_CONTROL_ON=$(KERNEL_RUNTIME_PM_ENABLED)
120+
121+
export EXTRA_DEFINES += -DMALI_FAKE_PLATFORM_DEVICE=1
122+
export EXTRA_DEFINES += -DCONFIG_MALI400_UMP=1
123+
export EXTRA_DEFINES += -DMALI_PMM_RUNTIME_JOB_CONTROL_ON=0
124+
export EXTRA_DEFINES += -D_MALI_OSK_SPECIFIC_INDIRECT_MMAP
125+
export EXTRA_DEFINES += -DMALI_DVFS_ENABLED=0
126+
export EXTRA_DEFINES += -DMALI_VOLTAGE_LOCK=0
127+
export EXTRA_DEFINES += -DMALI_TIMELINE_PROFILING_ENABLED=0
128+
export EXTRA_DEFINES += -DMALI_POWER_MGMT_TEST_SUITE=0
129+
export EXTRA_DEFINES += -DUSING_MALI_PMM=0
130+
export EXTRA_DEFINES += -DDEBUG=1
131+
ccflags-y += $(EXTRA_DEFINES)
132+
133+
# Set up our defines, which will be passed to gcc
134+
ccflags-y += -DPROFILING_SKIP_PP_JOBS=$(PROFILING_SKIP_PP_JOBS)
135+
ccflags-y += -DPROFILING_SKIP_PP_AND_GP_JOBS=$(PROFILING_SKIP_PP_AND_GP_JOBS)
136+
ccflags-y += -DUSING_MALI400=1
137+
ccflags-y += -DMALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP=1
138+
ccflags-y += -DMALI_PP_SCHEDULER_KEEP_SUB_JOB_STARTS_ALIGNED=1
139+
ccflags-y += -DMALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP_BETWEEN_APPS=1
140+
ccflags-y += -DMALI_STATE_TRACKING=0
141+
ccflags-y += -DMALI_OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=256
142+
ccflags-y += -DUSING_GPU_UTILIZATION=0
143+
ccflags-y += -DMALI_LICENSE_IS_GPL=1
144+
145+
ifeq ($(MALI_UPPER_HALF_SCHEDULING),1)
146+
ccflags-y += -DMALI_UPPER_HALF_SCHEDULING
147+
endif
148+
149+
ccflags-$(CONFIG_MALI400_UMP) += -I$(src)/../../ump_r3p2/include/ump
150+
ccflags-$(CONFIG_MALI400_DEBUG) += -DDEBUG
151+
152+
# Use our defines when compiling
153+
ccflags-y += -I$(src) -I$(src)/include -I$(src)/common -I$(src)/linux -I$(src)/platform
154+
155+
# Get subversion revision number, fall back to only ${MALI_RELEASE_NAME} if no svn info is available
156+
MALI_RELEASE_NAME=$(shell cat $(src)/.version 2> /dev/null)
157+
158+
SVN_INFO = (cd $(src); (svn info || git svn info || \
159+
echo -e "\nURL: $(MALI_RELEASE_NAME)\n" \
160+
"Last Changed Rev: $(MALI_RELEASE_NAME)\n" \
161+
"Last Changed Date: $(MALI_RELEASE_NAME)") 2>/dev/null)
162+
163+
SVN_REV := $(shell (cd $(src); echo "$(SVN_INFO)" | grep '^Revision: '| sed -e 's/^Revision: //' ) 2>/dev/null )
164+
ifeq ($(SVN_REV),)
165+
SVN_REV := $(MALI_RELEASE_NAME)
166+
else
167+
SVN_REV := $(MALI_RELEASE_NAME)-r$(SVN_REV)
168+
endif
169+
170+
ccflags-y += -DSVN_REV_STRING=\"$(SVN_REV)\"
171+
172+
VERSION_STRINGS :=
173+
VERSION_STRINGS += API_VERSION=$(shell cd $(src); grep "\#define _MALI_API_VERSION" $(FILES_PREFIX)include/linux/mali/mali_utgard_uk_types.h | cut -d' ' -f 3 )
174+
VERSION_STRINGS += REPO_URL=$(shell $(SVN_INFO) | grep '^URL: ' | cut -d: -f2- | cut -b2-)
175+
VERSION_STRINGS += REVISION=$(SVN_REV)
176+
VERSION_STRINGS += CHANGED_REVISION=$(shell $(SVN_INFO) | grep '^Last Changed Rev: ' | cut -d: -f2- | cut -b2-)
177+
VERSION_STRINGS += CHANGE_DATE=$(shell $(SVN_INFO) | grep '^Last Changed Date: ' | cut -d: -f2- | cut -b2-)
178+
VERSION_STRINGS += BUILD_DATE=$(shell date)
179+
ifdef CONFIG_MALI400_DEBUG
180+
VERSION_STRINGS += BUILD=debug
181+
else
182+
VERSION_STRINGS += BUILD=release
183+
endif
184+
VERSION_STRINGS += TARGET_PLATFORM=$(TARGET_PLATFORM)
185+
VERSION_STRINGS += MALI_PLATFORM=$(MALI_PLATFORM)
186+
VERSION_STRINGS += KDIR=$(KDIR)
187+
VERSION_STRINGS += OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=$(OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB)
188+
VERSION_STRINGS += USING_UMP=$(CONFIG_MALI400_UMP)
189+
VERSION_STRINGS += USING_PROFILING=$(CONFIG_MALI400_PROFILING)
190+
VERSION_STRINGS += USING_INTERNAL_PROFILING=$(CONFIG_MALI400_INTERNAL_PROFILING)
191+
VERSION_STRINGS += USING_GPU_UTILIZATION=$(USING_GPU_UTILIZATION)
192+
VERSION_STRINGS += MALI_UPPER_HALF_SCHEDULING=$(MALI_UPPER_HALF_SCHEDULING)
193+
194+
# Create file with Mali driver configuration
195+
$(src)/__malidrv_build_info.c:
196+
@echo 'const char *__malidrv_build_info(void) { return "malidrv: $(VERSION_STRINGS)";}' > $(src)/__malidrv_build_info.c
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
config MALI400
2+
tristate "Mali-300/400/450 support"
3+
depends on ARM
4+
select DMA_SHARED_BUFFER
5+
---help---
6+
This enables support for the ARM Mali-300, Mali-400, and Mali-450
7+
GPUs.
8+
9+
To compile this driver as a module, choose M here: the module will be
10+
called mali.
11+
12+
config MALI400_DEBUG
13+
bool "Enable debug in Mali driver"
14+
depends on MALI400
15+
---help---
16+
This enabled extra debug checks and messages in the Mali driver.
17+
18+
config MALI400_PROFILING
19+
bool "Enable Mali profiling"
20+
depends on MALI400
21+
select TRACEPOINTS
22+
default y
23+
---help---
24+
This enables gator profiling of Mali GPU events.
25+
26+
config MALI400_INTERNAL_PROFILING
27+
bool "Enable internal Mali profiling API"
28+
depends on MALI400_PROFILING
29+
default n
30+
---help---
31+
This enables the internal legacy Mali profiling API.
32+
33+
config MALI400_UMP
34+
bool "Enable UMP support"
35+
depends on MALI400
36+
---help---
37+
This enables support for the UMP memory sharing API in the Mali driver.
38+
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
#
2+
# Copyright (C) 2010-2012 ARM Limited. All rights reserved.
3+
#
4+
# This program is free software and is provided to you under the terms of the GNU General Public License version 2
5+
# as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
6+
#
7+
# A copy of the licence is included with the program, and can also be obtained from Free Software
8+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
9+
#
10+
11+
USE_UMPV2=0
12+
USING_PROFILING ?= 0
13+
USING_INTERNAL_PROFILING ?= 0
14+
15+
# The Makefile sets up "arch" based on the CONFIG, creates the version info
16+
# string and the __malidrv_build_info.c file, and then call the Linux build
17+
# system to actually build the driver. After that point the Kbuild file takes
18+
# over.
19+
20+
# set up defaults if not defined by the user
21+
ARCH ?= arm
22+
23+
OSKOS=linux
24+
FILES_PREFIX=
25+
26+
check_cc2 = \
27+
$(shell if $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
28+
then \
29+
echo "$(2)"; \
30+
else \
31+
echo "$(3)"; \
32+
fi ;)
33+
34+
# This conditional makefile exports the global definition ARM_INTERNAL_BUILD. Customer releases will not include arm_internal.mak
35+
-include ../../../arm_internal.mak
36+
37+
# Give warning of old config parameters are used
38+
ifneq ($(CONFIG),)
39+
$(warning "You have specified the CONFIG variable which is no longer in used. Use TARGET_PLATFORM instead.")
40+
endif
41+
42+
ifneq ($(CPU),)
43+
$(warning "You have specified the CPU variable which is no longer in used. Use TARGET_PLATFORM instead.")
44+
endif
45+
46+
# Include the mapping between TARGET_PLATFORM and KDIR + MALI_PLATFORM
47+
-include MALI_CONFIGURATION
48+
#export KDIR ?= $(KDIR-$(TARGET_PLATFORM))
49+
#export MALI_PLATFORM ?= $(MALI_PLATFORM-$(TARGET_PLATFORM))
50+
51+
52+
53+
# validate lookup result
54+
ifeq ($(KDIR),)
55+
$(error No KDIR found for platform $(TARGET_PLATFORM))
56+
endif
57+
58+
59+
ifeq ($(USING_UMP),1)
60+
export CONFIG_MALI400_UMP=y
61+
export EXTRA_DEFINES += -DCONFIG_MALI400_UMP=1
62+
ifeq ($(USE_UMPV2),1)
63+
UMP_SYMVERS_FILE ?= ../umpv2/Module.symvers
64+
else
65+
UMP_SYMVERS_FILE ?= ../ump_r3p2/Module.symvers
66+
endif
67+
KBUILD_EXTRA_SYMBOLS = $(realpath $(UMP_SYMVERS_FILE))
68+
$(warning $(KBUILD_EXTRA_SYMBOLS))
69+
endif
70+
71+
# Define host system directory
72+
KDIR-$(shell uname -m):=/lib/modules/$(shell uname -r)/build
73+
74+
include $(KDIR)/.config
75+
76+
# Set up build config
77+
export EXTRA_DEFINES += -DMALI_FAKE_PLATFORM_DEVICE=1
78+
export MALI_PLATFORM_FILES = $(wildcard platform/arm/*.c)
79+
80+
ifeq ($(USING_PROFILING),1)
81+
ifeq ($(CONFIG_TRACEPOINTS),)
82+
$(warning CONFIG_TRACEPOINTS reqired for profiling)
83+
else
84+
export CONFIG_MALI400_PROFILING=y
85+
export EXTRA_DEFINES += -DCONFIG_MALI400_PROFILING=1
86+
ifeq ($(USING_INTERNAL_PROFILING),1)
87+
export CONFIG_MALI400_INTERNAL_PROFILING=y
88+
export EXTRA_DEFINES += -DCONFIG_MALI400_INTERNAL_PROFILING=1
89+
endif
90+
endif
91+
endif
92+
93+
ifneq ($(BUILD),release)
94+
export CONFIG_MALI400_DEBUG=y
95+
endif
96+
97+
all: $(UMP_SYMVERS_FILE)
98+
$(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) modules
99+
@rm $(FILES_PREFIX)__malidrv_build_info.c $(FILES_PREFIX)__malidrv_build_info.o
100+
101+
clean:
102+
$(MAKE) ARCH=$(ARCH) -C $(KDIR) M=$(CURDIR) clean
103+
104+
kernelrelease:
105+
$(MAKE) ARCH=$(ARCH) -C $(KDIR) kernelrelease
106+
107+
export CONFIG KBUILD_EXTRA_SYMBOLS

0 commit comments

Comments
 (0)