Skip to content

Commit

Permalink
make a new mali_cm and use new mali driver from cm kernel. also rever…
Browse files Browse the repository at this point in the history
…t mali_r3p0_lsi and related files back to original state.
  • Loading branch information
gokhanmoral committed Apr 1, 2013
1 parent cd9c5dd commit 3857d9a
Show file tree
Hide file tree
Showing 160 changed files with 29,219 additions and 759 deletions.
2 changes: 1 addition & 1 deletion drivers/media/video/samsung/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ if CPU_EXYNOS4210 || CPU_EXYNOS4212 || CPU_EXYNOS4412
source "drivers/media/video/samsung/tvout/Kconfig"
source "drivers/media/video/samsung/mfc5x/Kconfig"
source "drivers/media/video/samsung/ump_r3p0_lsi/Kconfig"
source "drivers/media/video/samsung/mali_r3p0_lsi/Kconfig"
endif
if (CPU_EXYNOS4210 || CPU_EXYNOS4212 || CPU_EXYNOS4412) && !SLP
source "drivers/media/video/samsung/mali/Kconfig"
source "drivers/media/video/samsung/mali_cm/Kconfig"
endif
if SLP
source "drivers/media/video/samsung/mali_r3p0/Kconfig"
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/samsung/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ else ifeq ($(CONFIG_MACH_SMDKV310), y)
obj-$(CONFIG_VIDEO_MALI400MP) += mali/
else
obj-$(CONFIG_VIDEO_MALI400MP) += mali/
obj-$(CONFIG_MALI_R3P0_LSI) += mali_r3p0_lsi/
obj-$(CONFIG_VIDEO_MALI400MP) += mali_cm/
endif

obj-$(CONFIG_VIDEO_MALI400MP_R2P3) += mali_r2p3/
Expand Down
295 changes: 295 additions & 0 deletions drivers/media/video/samsung/mali_cm/Kbuild_module
Original file line number Diff line number Diff line change
@@ -0,0 +1,295 @@
#
# Copyright (C) 2010-2011 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.
#
# A copy of the licence is included with the program, and can also be obtained from Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#

# This file is called by the Linux build system.

OSKOS=linux

# set up defaults if not defined by the user
USING_UMP ?= 0
USING_OS_MEMORY ?= 0
USING_MALI_PMM_TESTSUITE ?= 0
OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB ?= 16
USING_PROFILING ?= 1
USING_INTERNAL_PROFILING ?= 0
DISABLE_PP0 ?= 0
DISABLE_PP1 ?= 0
DISABLE_PP2 ?= 0
DISABLE_PP3 ?= 0
PROFILING_SKIP_PP_JOBS ?= 0
PROFILING_SKIP_PP_AND_GP_JOBS ?= 0
PROFILING_PRINT_L2_HITRATE_ON_GP_FINISH ?= 0
TIMESTAMP ?= default
BUILD ?= debug
TARGET_PLATFORM ?= default
KERNEL_RUNTIME_PM_ENABLED ?= 0
CONFIG ?= pb-virtex5-m200
MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP ?= 0
MALI_PP_SCHEDULER_KEEP_SUB_JOB_STARTS_ALIGNED ?= 0
MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP_BETWEEN_APPS ?= 0

DEFINES := $(EXTRA_DEFINES)

# Get path to driver source from Linux build system
DRIVER_DIR=$(src)

# For customer releases the Linux Device Drivers will be provided as ARM proprietary and GPL releases:
# The ARM proprietary product will only include the license/proprietary directory
# The GPL product will only include the license/gpl directory

ifeq ($(wildcard $(DRIVER_DIR)/linux/license/gpl/*),)
ccflags-y += -I$(DRIVER_DIR)/linux/license/proprietary
# Disable profiling for proprietary
override USING_PROFILING := 0
$(warning "USING_PROFILING not supported, disabling.")
else
ccflags-y += -I$(DRIVER_DIR)/linux/license/gpl
endif


ifeq ($(USING_PROFILING),1)
ifeq ($(USING_INTERNAL_PROFILING),0)
ifndef CONFIG_TRACEPOINTS
# Should default to gator profiling, but we dont have the kernel feature required, so disable profiling
override USING_PROFILING = 0
$(warning "CONFIG_TRACEPOINTS required for USING_PROFILING")
endif
endif
endif

ifeq ($(USING_PROFILING),0)
# make sure user hasnt selected incompatible flags
override USING_INTERNAL_PROFILING = 0
endif

MALI_RELEASE_NAME=$(shell cat $(DRIVER_DIR)/.version 2> /dev/null)

# Check if a Mali Core sub module should be enabled, true or false returned
submodule_enabled = $(shell gcc $(DEFINES) -E $1/arch/config.h | grep type | grep -c $(2))

OSKFILES = \
$(OSKOS)/mali_osk_atomics.c \
$(OSKOS)/mali_osk_irq.c \
$(OSKOS)/mali_osk_locks.c \
$(OSKOS)/mali_osk_wait_queue.c \
$(OSKOS)/mali_osk_low_level_mem.c \
$(OSKOS)/mali_osk_math.c \
$(OSKOS)/mali_osk_memory.c \
$(OSKOS)/mali_osk_misc.c \
$(OSKOS)/mali_osk_mali.c \
$(OSKOS)/mali_osk_notification.c \
$(OSKOS)/mali_osk_time.c \
$(OSKOS)/mali_osk_timers.c

UKKFILES = \
$(OSKOS)/mali_ukk_mem.c \
$(OSKOS)/mali_ukk_gp.c \
$(OSKOS)/mali_ukk_pp.c \
$(OSKOS)/mali_ukk_core.c

ifeq ($(USING_PROFILING),1)
UKKFILES += \
$(OSKOS)/mali_ukk_profiling.c
endif

ifeq ($(MALI_PLATFORM_FILE),)
MALI_PLATFORM_FILE = platform/default/mali_platform.c
endif

# Get subversion revision number, fall back to only ${MALI_RELEASE_NAME} if no svn info is available
SVN_REV := $(shell (cd $(DRIVER_DIR); (svnversion | grep -E "^[0-9]+" && svnversion) || git svn info | grep '^Revision: '| sed -e 's/^Revision: //' ) 2>/dev/null )
ifeq ($(SVN_REV),)
SVN_REV := $(MALI_RELEASE_NAME)
else
SVN_REV := $(MALI_RELEASE_NAME)-r$(SVN_REV)
endif

# Validate selected config
ifneq ($(shell [ -d $(DRIVER_DIR)/arch-$(CONFIG) ] && [ -f $(DRIVER_DIR)/arch-$(CONFIG)/config.h ] && echo "OK"), OK)
$(warning Current directory is $(shell pwd))
$(error No configuration found for config $(CONFIG). Check that arch-$(CONFIG)/config.h exists)
else
# Link arch to the selected arch-config directory
$(shell [ -L $(DRIVER_DIR)/arch ] && rm $(DRIVER_DIR)/arch)
$(shell ln -sf arch-$(CONFIG) $(DRIVER_DIR)/arch)
$(shell touch $(DRIVER_DIR)/arch/config.h)
endif

# Set up our defines, which will be passed to gcc
DEFINES += -DUSING_OS_MEMORY=$(USING_OS_MEMORY)
DEFINES += -DUSING_MMU=1
DEFINES += -DUSING_UMP=$(USING_UMP)
DEFINES += -D_MALI_OSK_SPECIFIC_INDIRECT_MMAP
DEFINES += -DMALI_INTERNAL_TIMELINE_PROFILING_ENABLED=$(USING_INTERNAL_PROFILING)
DEFINES += -DDISABLE_PP0=$(DISABLE_PP0)
DEFINES += -DDISABLE_PP1=$(DISABLE_PP1)
DEFINES += -DDISABLE_PP2=$(DISABLE_PP2)
DEFINES += -DDISABLE_PP3=$(DISABLE_PP3)
DEFINES += -DPROFILING_SKIP_PP_JOBS=$(PROFILING_SKIP_PP_JOBS)
DEFINES += -DPROFILING_SKIP_PP_AND_GP_JOBS=$(PROFILING_SKIP_PP_AND_GP_JOBS)
DEFINES += -DPROFILING_PRINT_L2_HITRATE_ON_GP_FINISH=$(PROFILING_PRINT_L2_HITRATE_ON_GP_FINISH)

DEFINES += -DMALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP=$(MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP)
DEFINES += -DMALI_PP_SCHEDULER_KEEP_SUB_JOB_STARTS_ALIGNED=$(MALI_PP_SCHEDULER_KEEP_SUB_JOB_STARTS_ALIGNED)
DEFINES += -DMALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP_BETWEEN_APPS=$(MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP_BETWEEN_APPS)
DEFINES += -DMALI_TIMELINE_PROFILING_ENABLED=$(USING_PROFILING)
DEFINES += -DMALI_POWER_MGMT_TEST_SUITE=$(USING_MALI_PMM_TESTSUITE)
ifeq ($(shell test $(SUBLEVEL) -gt 32 -a $(PATCHLEVEL) = 6 -a $(VERSION) = 2 -o $(VERSION) -gt 2 && echo "OK"),OK)
# MALI_STATE_TRACKING is only supported on Linux kernels from version 2.6.32.
DEFINES += -DMALI_STATE_TRACKING=1
else
DEFINES += -DMALI_STATE_TRACKING=0
endif
DEFINES += -DMALI_OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=$(OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB)

MALI_PLATFORM_FILE = platform/$(TARGET_PLATFORM)/mali_platform.c


ifdef CONFIG_PM
ifdef CONFIG_PM_RUNTIME
KERNEL_RUNTIME_PM_ENABLED = 1
endif
endif

DEFINES += -DMALI_PMM_RUNTIME_JOB_CONTROL_ON=$(KERNEL_RUNTIME_PM_ENABLED)

ifeq ($(BUILD), debug)
DEFINES += -DDEBUG
endif
DEFINES += -DSVN_REV=$(SVN_REV)
DEFINES += -DSVN_REV_STRING=\"$(SVN_REV)\"

# Linux has its own mmap cleanup handlers (see mali_kernel_memory.c)
DEFINES += -DMALI_UKK_HAS_IMPLICIT_MMAP_CLEANUP

ifeq ($(USING_UMP),1)
DEFINES += -DMALI_USE_UNIFIED_MEMORY_PROVIDER=1
ccflags-y += -I$(DRIVER_DIR)/../../ump/include/ump
else
DEFINES += -DMALI_USE_UNIFIED_MEMORY_PROVIDER=0
endif

# Use our defines when compiling
ccflags-y += $(DEFINES) -I$(DRIVER_DIR) -I$(DRIVER_DIR)/include -I$(DRIVER_DIR)/common -I$(DRIVER_DIR)/linux -I$(DRIVER_DIR)/platform

# Source files which always are included in a build
SRC = \
common/mali_kernel_core.c \
linux/mali_kernel_linux.c \
common/mali_kernel_descriptor_mapping.c \
common/mali_session.c \
common/mali_device_pause_resume.c \
common/mali_kernel_vsync.c \
linux/mali_ukk_vsync.c \
linux/mali_kernel_sysfs.c \
common/mali_mmu.c \
common/mali_mmu_page_directory.c \
common/mali_memory.c \
common/mali_kernel_memory_engine.c \
common/mali_block_allocator.c \
common/mali_kernel_mem_os.c \
common/mali_mem_validation.c \
common/mali_hw_core.c \
common/mali_gp.c \
common/mali_pp.c \
common/mali_pp_job.c \
common/mali_gp_job.c \
common/mali_scheduler.c \
common/mali_gp_scheduler.c \
common/mali_pp_scheduler.c \
common/mali_cluster.c \
common/mali_group.c \
common/mali_dlbu.c \
common/mali_pm.c \
common/mali_pmu.c \
common/mali_user_settings_db.c \
$(OSKOS)/mali_osk_pm.c \
linux/mali_kernel_pm.c \
linux/mali_pmu_power_up_down.c \
$(MALI_PLATFORM_FILE) \
$(OSKFILES) \
$(UKKFILES) \
__malidrv_build_info.c

# Selecting files to compile by parsing the config file

ifeq ($(USING_INTERNAL_PROFILING),1)
PROFILING_BACKEND_SOURCES = \
linux/mali_osk_profiling_internal.c \
timestamp-$(TIMESTAMP)/mali_timestamp.c
ccflags-y += -I$(DRIVER_DIR)/timestamp-$(TIMESTAMP)
else
ifeq ($(USING_PROFILING),1)
PROFILING_BACKEND_SOURCES = \
linux/mali_osk_profiling_gator.c
endif
endif

# Add the profiling sources
SRC += $(PROFILING_BACKEND_SOURCES)

ifeq ($(USING_MALI_PMM_TESTSUITE),1)
ccflags-y += -I$(DRIVER_DIR)/platform/mali_pmu_testing
endif

mali-$(CONFIG_MALI400_GPU_UTILIZATION) += common/mali_kernel_utilization.o
mali-$(CONFIG_DMA_SHARED_BUFFER) += linux/mali_dma_buf.o

ifneq ($(call submodule_enabled, $(DRIVER_DIR), MALI400PP),0)
# Mali-400 PP in use
ccflags-y += -DUSING_MALI400
endif

ifneq ($(call submodule_enabled, $(DRIVER_DIR), MALI300PP),0)
# Mali-400 PP in use
ccflags-y += -DUSING_MALI400
endif

ifneq ($(call submodule_enabled, $(DRIVER_DIR), MALI200),0)
# Mali200 in use
ccflags-y += -DUSING_MALI200
endif

# Always build in support for Mali L2 cache
SRC += common/mali_l2_cache.c

# Tell the Linux build system to enable building of our .c files
mali-y += $(SRC:.c=.o)
# Tell the Linux build system from which .o file to create the kernel module
obj-$(CONFIG_MALI400) := mali.o


VERSION_STRINGS :=
VERSION_STRINGS += CONFIG=$(CONFIG)
VERSION_STRINGS += USING_OS_MEMORY=$(USING_OS_MEMORY)
VERSION_STRINGS += API_VERSION=$(shell cd $(DRIVER_DIR); grep "\#define _MALI_API_VERSION" $(FILES_PREFIX)include/linux/mali/mali_utgard_uk_types.h | cut -d' ' -f 3 )
VERSION_STRINGS += REPO_URL=$(shell cd $(DRIVER_DIR); (svn info || git svn info || echo 'URL: $(MALI_RELEASE_NAME)') 2>/dev/null | grep '^URL: ' | cut -d: -f2- | cut -b2-)
VERSION_STRINGS += REVISION=$(SVN_REV)
VERSION_STRINGS += CHANGED_REVISION=$(shell cd $(DRIVER_DIR); (svn info || git svn info || echo 'Last Changed Rev: $(MALI_RELEASE_NAME)') 2>/dev/null | grep '^Last Changed Rev: ' | cut -d: -f2- | cut -b2-)
VERSION_STRINGS += CHANGE_DATE=$(shell cd $(DRIVER_DIR); (svn info || git svn info || echo 'Last Changed Date: $(MALI_RELEASE_NAME)') 2>/dev/null | grep '^Last Changed Date: ' | cut -d: -f2- | cut -b2-)
VERSION_STRINGS += BUILD_DATE=$(shell date)

VERSION_STRINGS += BUILD=$(shell echo $(BUILD) | tr a-z A-Z)
VERSION_STRINGS += CPU=$(CPU)
VERSION_STRINGS += USING_UMP=$(USING_UMP)
VERSION_STRINGS += USING_MALI200=$(call submodule_enabled, $(DRIVER_DIR), MALI200)
VERSION_STRINGS += USING_MALI400=$(call submodule_enabled, $(DRIVER_DIR), MALI400)
VERSION_STRINGS += USING_MALI400_L2_CACHE=$(call submodule_enabled, $(DRIVER_DIR), MALI400L2)
VERSION_STRINGS += USING_GP2=$(call submodule_enabled, $(DRIVER_DIR), MALIGP2)
VERSION_STRINGS += KDIR=$(KDIR)
VERSION_STRINGS += MALI_PLATFORM_FILE=$(MALI_PLATFORM_FILE)
VERSION_STRINGS += OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=$(OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB)
VERSION_STRINGS += USING_PROFILING=$(USING_PROFILING)
VERSION_STRINGS += USING_INTERNAL_PROFILING=$(USING_INTERNAL_PROFILING)
VERSION_STRINGS += USING_GPU_UTILIZATION=$(CONFIG_MALI400_GPU_UTILIZATION)

# Create file with Mali driver configuration
$(DRIVER_DIR)/__malidrv_build_info.c:
@echo 'const char *__malidrv_build_info(void) { return "malidrv: $(VERSION_STRINGS)";}' > $(DRIVER_DIR)/__malidrv_build_info.c
12 changes: 12 additions & 0 deletions drivers/media/video/samsung/mali_cm/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
## S3C Multimedia Mali configuration
##
#
# For Mali
config MALI_CM
bool "Enable MALI_CM integration"
depends on VIDEO_SAMSUNG
default y
---help---
This enables MALI integration in the multimedia device driver

30 changes: 30 additions & 0 deletions drivers/media/video/samsung/mali_cm/Kconfig_module
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
config MALI400
tristate "Mali-300/400/450 support"
depends on ARM
select FB
---help---
This enables support for the Mali-300, Mali-400, and Mali-450 GPUs.

To compile this driver as a module, choose M here: the module will be
called mali.

config MALI400_DEBUG
bool "Enable debug in Mali driver"
depends on MALI400
---help---
This enabled extra debug checks and messages in the Mali-300/400/450
driver.

config MALI400_PROFILING
bool "Enable Mali profiling"
depends on MALI400 && TRACEPOINTS
---help---
This enables gator profiling of Mali GPU events.

config MALI400_GPU_UTILIZATION
bool "Enable Mali GPU utilization tracking"
depends on MALI400
---help---
This enables gathering and processing of the utilization of Mali GPU.
This data can be used as a basis to change GPU operating frequency.

Loading

0 comments on commit 3857d9a

Please sign in to comment.