MALI: rockchip: modify to build in kernel 4.4.
authorchenzhen <chenzhen@rock-chips.com>
Fri, 4 Mar 2016 13:49:35 +0000 (21:49 +0800)
committerchenzhen <chenzhen@rock-chips.com>
Tue, 8 Mar 2016 09:52:12 +0000 (17:52 +0800)
Change-Id: Ib462c42337e655607b2e222d7d97064dfc1c76c4
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
drivers/gpu/arm/midgard/Kconfig
drivers/gpu/arm/midgard/mali_kbase_config.h
drivers/gpu/arm/midgard/mali_kbase_core_linux.c
drivers/gpu/arm/midgard/mali_kbase_defs.h
drivers/gpu/arm/midgard/mali_kbase_gpu_memory_debugfs.c
drivers/gpu/arm/midgard/mali_kbase_mem_profile_debugfs.c

index a6780dc83beef4be321ff0648e9691e48d4fff19..b45420da828259cac271a3b6060dde1af7dd7d19 100644 (file)
@@ -66,7 +66,7 @@ config MALI_MIDGARD_DVFS
 config MALI_MIDGARD_RT_PM
        bool "Enable Runtime power management"
        depends on MALI_MIDGARD
-       depends on PM_RUNTIME
+       depends on PM
        default y
        help
          Choose this option to enable runtime power management in the Mali Midgard DDK.
index 41c885691a65b29f2c86930b672c93b39b6c6d70..816e45c4d02d53dbd1779538a39aaee6d936e612 100644 (file)
@@ -66,20 +66,18 @@ struct kbase_device;
  */
 struct kbase_platform_funcs_conf {
        /**
-        * platform_init_func 
-         *      - platform specific init function pointer
+        * platform_init_func - platform specific init function pointer
         * @kbdev - kbase_device pointer
         *
-        * Returns 0 on success,
-         * negative error code otherwise.
+        * Returns 0 on success, negative error code otherwise.
         *
         * Function pointer for platform specific initialization or NULL if no
         * initialization function is required. At the point this the GPU is
         * not active and its power and clocks are in unknown (platform specific
         * state) as kbase doesn't yet have control of power and clocks.
         *
-        * The platform specific private pointer kbase_device::platform_context 
-         * can be accessed (and possibly initialized) in here.
+        * The platform specific private pointer kbase_device::platform_context
+        * can be accessed (and possibly initialized) in here.
         */
        int (*platform_init_func)(struct kbase_device *kbdev);
        /**
index 09688219d5f3712a167493ffb67ac715e093f5cd..426947fd76a202d37e1f880077fbd2adca77b6d5 100644 (file)
@@ -14,7 +14,8 @@
  *
  */
 
-
+#define ENABLE_DEBUG_LOG
+#include "platform/rk/custom_log.h"
 
 #include <mali_kbase.h>
 #include <mali_kbase_hwaccess_gpuprops.h>
@@ -48,6 +49,7 @@
 #include <linux/syscalls.h>
 #endif /* CONFIG_KDS */
 
+#include <linux/pm_runtime.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/poll.h>
@@ -1293,7 +1295,7 @@ static int kbase_open(struct inode *inode, struct file *filp)
          */
 #else
        debugfs_create_bool("infinite_cache", 0644, kctx->kctx_dentry,
-                       &kctx->infinite_cache_active);
+                       (bool*)&(kctx->infinite_cache_active));
 #endif /* CONFIG_MALI_COH_USER */
 
        mutex_init(&kctx->mem_profile_lock);
@@ -3158,7 +3160,7 @@ static int kbase_device_debugfs_init(struct kbase_device *kbdev)
 #ifndef CONFIG_MALI_COH_USER
        debugfs_create_bool("infinite_cache", 0644,
                        debugfs_ctx_defaults_directory,
-                       &kbdev->infinite_cache_active_default);
+                       (bool*)&(kbdev->infinite_cache_active_default));
 #endif /* CONFIG_MALI_COH_USER */
 
        debugfs_create_size_t("mem_pool_max_size", 0644,
@@ -3533,12 +3535,6 @@ static int kbase_platform_device_probe(struct platform_device *pdev)
        int err = 0;
        int i;
 
-       printk(KERN_INFO "arm_release_ver of this mali_ko is '%s', rk_ko_ver is '%d', built at '%s', on '%s'.",
-           MALI_RELEASE_NAME,
-           ROCKCHIP_VERSION,
-           __TIME__,
-           __DATE__);
-
 #ifdef CONFIG_OF
        err = kbase_platform_early_init();
        if (err) {
@@ -3648,7 +3644,7 @@ static int kbase_platform_device_probe(struct platform_device *pdev)
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)) && defined(CONFIG_OF) \
                        && defined(CONFIG_PM_OPP)
        /* Register the OPPs if they are available in device tree */
-       if (of_init_opp_table(kbdev->dev) < 0)
+       if (dev_pm_opp_of_add_table(kbdev->dev) < 0)
                dev_dbg(kbdev->dev, "OPP table not found\n");
 #endif
 
@@ -3688,7 +3684,7 @@ out_sysfs:
        kbase_common_device_remove(kbdev);
 out_common_init:
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
-       of_free_opp_table(kbdev->dev);
+       dev_pm_opp_of_remove_table(kbdev->dev);
 #endif
        clk_disable_unprepare(kbdev->clock);
 out_clock_prepare:
index b4e5809a3d545fd4c8b50c887c75498d42422bc0..7d8590af031e1f2dfa9bdd5f698c69da9fdd3e75 100644 (file)
@@ -64,8 +64,7 @@
 #include <linux/clk.h>
 #include <linux/regulator/consumer.h>
 
-#if defined(CONFIG_PM_RUNTIME) || \
-       (defined(CONFIG_PM) && LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
+#if defined(CONFIG_PM)
 #define KBASE_PM_RUNTIME 1
 #endif
 
index ca264049653c40b87e2cf2ff865a3e44174bd325..5aff522e594ae4d61ee1a51e72c5ac51ee6cd11f 100644 (file)
@@ -43,14 +43,14 @@ static int kbasep_gpu_memory_seq_show(struct seq_file *sfile, void *data)
 
                kbdev = list_entry(entry, struct kbase_device, entry);
                /* output the total memory usage and cap for this device */
-               ret = seq_printf(sfile, "%-16s  %10u\n",
+               seq_printf(sfile, "%-16s  %10u\n",
                                kbdev->devname,
                                atomic_read(&(kbdev->memdev.used_pages)));
                mutex_lock(&kbdev->kctx_list_lock);
                list_for_each_entry(element, &kbdev->kctx_list, link) {
                        /* output the memory usage and cap for each kctx
                        * opened on this device */
-                       ret = seq_printf(sfile, "  %s-0x%p %10u\n",
+                       seq_printf(sfile, "  %s-0x%p %10u\n",
                                "kctx",
                                element->kctx,
                                atomic_read(&(element->kctx->used_pages)));
index a443d002a1aca09b00fe9cf732a7bdf7f59812e5..bfa0bbeaa1866ada82fa526ccf92f5be47304849 100644 (file)
@@ -39,7 +39,7 @@ static int kbasep_mem_profile_seq_show(struct seq_file *sfile, void *data)
        err = seq_write(sfile, kctx->mem_profile_data, kctx->mem_profile_size);
 
        if (!err)
-               err = seq_putc(sfile, '\n');
+               seq_putc(sfile, '\n');
 
        mutex_unlock(&kctx->mem_profile_lock);