#
# Copyright (C) 2015 MediaTek Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#

$(info mali MTK evironment)

MTK_TOP = $(srctree)/drivers/misc/mediatek/

#build support for a ARM Mali Midgard GPU
CONFIG_MALI_MIDGARD := y

#use mtk platform
CONFIG_MALI_PLATFORM_NAME := $(CONFIG_MTK_PLATFORM)

CONFIG_MALI_DEBUG := y

ccflags-y += -DCONFIG_MALI_MIDGARD_DVFS
ccflags-y += -DCONFIG_DEBUG_FS
ccflags-y += -DCONFIG_PROC_FS
ccflags-y += -DENABLE_MTK_MEMINFO
ccflags-$(CONFIG_MTK_GPU_COMMON_DVFS_SUPPORT) += -DENABLE_COMMON_DVFS

ccflags-y += -I-I$(srctree)/include
ccflags-y += -I$(srctree)/drivers/staging/android
ccflags-y += -I$(srctree)/drivers/misc/mediatek/base/power/$(CONFIG_MTK_PLATFORM)
ccflags-y += -I$(srctree)/drivers/misc/mediatek/gpu/ged/include

#include clock manager for clock use
ccflags-y += -I$(srctree)/drivers/misc/mediatek/mach/$(CONFIG_MTK_PLATFORM)/include

#include path for pmic
ccflags-y += -I$(srctree)/drivers/misc/mediatek/power/$(CONFIG_MTK_PLATFORM)

#Add include path for mtk dvfs
ccflags-y += \
    -I$(srctree)/include/ \
    -I$(MTK_TOP)/include/ \
    -I$(MTK_TOP)/include/mt-plat \
    -I$(MTK_TOP)/include/mt-plat/$(subst ",,$(CONFIG_MTK_PLATFORM))/include \
    -I$(MTK_TOP)/base/power/$(subst ",,$(CONFIG_MTK_PLATFORM))/

#include path for AEE
ccflags-y += -I$(srctree)/drivers/misc/mediatek/include

VER := $(if $(filter y,$(CONFIG_MTK_ENG_BUILD)),eng,user)

ifeq ($(VER),eng)
ccflags-y += -DCONFIG_MALI_DEBUG
else
ccflags-y += -UCONFIG_MALI_DEBUG
endif

ccflags-y += -DMTK_MALI_USE_GED_LOG
