rockchip:midgard:1,update version to r4p1-02dev0 2,disable ve configuration when...
authorxxm <xxm@rock-chips.com>
Thu, 12 Jun 2014 06:44:51 +0000 (14:44 +0800)
committerxxm <xxm@rock-chips.com>
Thu, 12 Jun 2014 08:10:18 +0000 (16:10 +0800)
26 files changed:
drivers/gpu/arm/midgard/Kbuild
drivers/gpu/arm/midgard/mali_base_hwconfig.h
drivers/gpu/arm/midgard/mali_kbase_context.c
drivers/gpu/arm/midgard/mali_kbase_core_linux.c
drivers/gpu/arm/midgard/mali_kbase_debug.h
drivers/gpu/arm/midgard/mali_kbase_defs.h
drivers/gpu/arm/midgard/mali_kbase_hw.c
drivers/gpu/arm/midgard/mali_kbase_jd.c
drivers/gpu/arm/midgard/mali_kbase_jm.c
drivers/gpu/arm/midgard/mali_kbase_js.h
drivers/gpu/arm/midgard/mali_kbase_js_ctx_attr.c
drivers/gpu/arm/midgard/mali_kbase_js_defs.h
drivers/gpu/arm/midgard/mali_kbase_mem_linux.c
drivers/gpu/arm/midgard/mali_kbase_mmu.c
drivers/gpu/arm/midgard/mali_kbase_pm.h
drivers/gpu/arm/midgard/mali_kbase_pm_driver.c
drivers/gpu/arm/midgard/mali_kbase_pm_metrics.c
drivers/gpu/arm/midgard/mali_kbase_softjobs.c
drivers/gpu/arm/midgard/mali_kbase_sync.c
drivers/gpu/arm/midgard/mali_midg_regmap.h
drivers/gpu/arm/midgard/platform/rk/mali_kbase_config_rk.c
drivers/gpu/arm/midgard/platform/rk/mali_kbase_dvfs.c
drivers/gpu/arm/midgard/platform/rk/mali_kbase_dvfs.h
drivers/gpu/arm/midgard/sconscript
drivers/gpu/arm/midgard/tests/customer/sconscript
drivers/gpu/arm/midgard/tests/sconscript

index c516686153bdcf3ace131f7c2b8bc974d73ee2d6..379237198c4c7af629b34b686e01d35ef5949e22 100755 (executable)
@@ -15,7 +15,7 @@
 
 
 # Driver version string which is returned to userspace via an ioctl
-MALI_RELEASE_NAME ?= "r4p1-01dev0"
+MALI_RELEASE_NAME ?= "r4p1-02dev0"
 
 # Paths required for build
 KBASE_PATH = $(src)
@@ -66,9 +66,11 @@ else
 DEFINES +=-DMALI_KBASE_THIRDPARTY_PATH=$(src)/platform/$(CONFIG_MALI_PLATFORM_THIRDPARTY_NAME)
 endif
 
+DEFINES += -I$(srctree)/drivers/staging/android
+
 # Use our defines when compiling
-ccflags-y += $(DEFINES) -I$(KBASE_PATH)   -I$(KBASE_PLATFORM_PATH) -I$(UMP_PATH) -I$(srctree)/drivers/staging/android
-subdir-ccflags-y += $(DEFINES) -I$(KBASE_PATH)   -I$(KBASE_PLATFORM_PATH) -I$(OSK_PATH) -I$(UMP_PATH)
+ccflags-y += $(DEFINES) -I$(KBASE_PATH)   -I$(KBASE_PLATFORM_PATH) -I$(UMP_PATH) -I$(srctree)/include/linux
+subdir-ccflags-y += $(DEFINES) -I$(KBASE_PATH)   -I$(KBASE_PLATFORM_PATH) -I$(OSK_PATH) -I$(UMP_PATH) -I$(srctree)/include/linux
 
 SRC := \
        mali_kbase_device.c \
index 8609fa0a61168705dff4410b9ac4b97c785431bc..f7ee4a7257d1550947269c31ab4d6dea4700094b 100755 (executable)
@@ -235,7 +235,7 @@ typedef enum base_hw_issue {
        /* sometimes HW doesn't invalidate cached VPDs when it has to */
        BASE_HW_ISSUE_10684,
 
-       /* Chicken bit on (t67x_r1p0 and t72x) to work for a HW workaround in compiler */
+       /* Chicken bit on t72x to work for a HW workaround in compiler */
        BASE_HW_ISSUE_10797,
 
        /* Soft-stopping fragment jobs might fail with TILE_RANGE_FAULT */
@@ -281,30 +281,9 @@ typedef enum base_hw_issue {
        /* Partial 16xMSAA support */
        BASE_HW_ISSUE_T76X_26,
 
-       /* Forward pixel kill doesn't work with MRT */
-       BASE_HW_ISSUE_T76X_2121,
-
-       /* CRC not working with MFBD and more than one render target */
-       BASE_HW_ISSUE_T76X_2315,
-
-       /* Some indexed formats not supported for MFBD preload. */
-       BASE_HW_ISSUE_T76X_2686,
-
-       /* Must disable CRC if the tile output size is 8 bytes or less. */
-       BASE_HW_ISSUE_T76X_2712,
-
-       /* DBD clean pixel enable bit is reserved */
-       BASE_HW_ISSUE_T76X_2772,
-
-       /* AFBC is not supported for T76X beta. */
-       BASE_HW_ISSUE_T76X_2906,
-
        /* RTD doesn't specify the row stride for AFBC surfaces. */
        BASE_HW_ISSUE_T76X_3086,
 
-       /* Prevent MMU deadlock for T76X beta. */
-       BASE_HW_ISSUE_T76X_3285,
-
        /* Clear encoder state for a hard stopped fragment job which is AFBC
         * encoded by soft resetting the GPU. Only for T76X r0p0, r0p1 and r0p1_50rel0
         */
@@ -318,9 +297,6 @@ typedef enum base_hw_issue {
        /* T76X cannot disable uses_discard even if depth and stencil are read-only. */
        BASE_HW_ISSUE_T76X_3700,
 
-       /* ST_TILEBUFFER is not supported on T76X-r0p0-beta */
-       BASE_HW_ISSUE_T76X_3759,
-
        /* Preload ignores any size or bounding box restrictions of the output image. */
        BASE_HW_ISSUE_T76X_3793,
 
@@ -515,8 +491,9 @@ static const base_hw_issue base_hw_issues_t62x_r1p0[] = {
        BASE_HW_ISSUE_END
 };
 
-/* Mali T67x r1p0 */
-static const base_hw_issue base_hw_issues_t67x_r1p0[] = {
+/* Mali T62x r1p1 */
+static const base_hw_issue base_hw_issues_t62x_r1p1[] =
+{
        BASE_HW_ISSUE_6402,
        BASE_HW_ISSUE_8803,
        BASE_HW_ISSUE_9435,
@@ -524,41 +501,12 @@ static const base_hw_issue base_hw_issues_t67x_r1p0[] = {
        BASE_HW_ISSUE_10472,
        BASE_HW_ISSUE_10649,
        BASE_HW_ISSUE_10684,
-       BASE_HW_ISSUE_10797,
        BASE_HW_ISSUE_10821,
        BASE_HW_ISSUE_10883,
        BASE_HW_ISSUE_10931,
        BASE_HW_ISSUE_10946,
        BASE_HW_ISSUE_10959,
        BASE_HW_ISSUE_11012,
-       BASE_HW_ISSUE_11020,
-       BASE_HW_ISSUE_11024,
-       /* List of hardware issues must end with BASE_HW_ISSUE_END */
-       BASE_HW_ISSUE_END
-};
-
-/* Mali T76x r0p0 beta */
-static const base_hw_issue base_hw_issues_t76x_r0p0_beta[] = {
-       BASE_HW_ISSUE_8803,
-       BASE_HW_ISSUE_9435,
-       BASE_HW_ISSUE_10649,
-       BASE_HW_ISSUE_10821,
-       BASE_HW_ISSUE_10883,
-       BASE_HW_ISSUE_10946,
-       BASE_HW_ISSUE_10959,
-       BASE_HW_ISSUE_11020,
-       BASE_HW_ISSUE_11024,
-       BASE_HW_ISSUE_T76X_26,
-       BASE_HW_ISSUE_T76X_2121,
-       BASE_HW_ISSUE_T76X_2315,
-       BASE_HW_ISSUE_T76X_2686,
-       BASE_HW_ISSUE_T76X_2712,
-       BASE_HW_ISSUE_T76X_2772,
-       BASE_HW_ISSUE_T76X_2906,
-       BASE_HW_ISSUE_T76X_3285,
-       BASE_HW_ISSUE_T76X_3700,
-       BASE_HW_ISSUE_T76X_3759,
-       BASE_HW_ISSUE_T76X_3793,
        /* List of hardware issues must end with BASE_HW_ISSUE_END */
        BASE_HW_ISSUE_END
 };
@@ -612,6 +560,7 @@ static const base_hw_issue base_hw_issues_t76x_r0p1_50rel0[] = {
        BASE_HW_ISSUE_10883,
        BASE_HW_ISSUE_10946,
        BASE_HW_ISSUE_T76X_26,
+       BASE_HW_ISSUE_T76X_3086,
        BASE_HW_ISSUE_T76X_3542,
        BASE_HW_ISSUE_T76X_3556,
        BASE_HW_ISSUE_T76X_3700,
@@ -649,6 +598,7 @@ static const base_hw_issue base_hw_issues_t76x_r0p3[] = {
        BASE_HW_ISSUE_10883,
        BASE_HW_ISSUE_10946,
        BASE_HW_ISSUE_T76X_26,
+       BASE_HW_ISSUE_T76X_3086,
        BASE_HW_ISSUE_T76X_3542,
        BASE_HW_ISSUE_T76X_3556,
        BASE_HW_ISSUE_T76X_3700,
index 5d004599812ca11fd1378c800c0ee6ce73ee225d..3320e846a55c988dba7d07cf1a198eaaeb5f563d 100755 (executable)
@@ -27,6 +27,7 @@
 
 #define MEMPOOL_PAGES 16384
 
+
 /**
  * @brief Create a kernel base context.
  *
@@ -125,7 +126,7 @@ free_jd:
 free_allocator:
        kbase_mem_allocator_term(&kctx->osalloc);
 free_kctx:
-    vfree(kctx);
+       vfree(kctx);
 out:
        return NULL;
 
index 607c485790767dce0e14b44910d8d7f466f6d735..9cb098ae564b3a31029dae943964c5eb8ff44beb 100755 (executable)
@@ -85,7 +85,7 @@ EXPORT_SYMBOL(shared_kernel_test_data);
 #endif /* MALI_UNIT_TEST */
 
 #define KBASE_DRV_NAME "mali"
-#define ROCKCHIP_VERSION 1
+#define ROCKCHIP_VERSION 2
 static const char kbase_drv_name[] = KBASE_DRV_NAME;
 
 static int kbase_dev_nr;
@@ -3020,11 +3020,6 @@ module_exit(kbase_driver_exit);
 MODULE_LICENSE("GPL");
 MODULE_VERSION(MALI_RELEASE_NAME);
 
-/* Module parameter to control log level */
-int mali_debug_level = 0;
-module_param(mali_debug_level, int, S_IRUSR | S_IWUSR | S_IWGRP | S_IRGRP | S_IROTH); /* rw-rw-r-- */
-MODULE_PARM_DESC(mali_debug_level, "Higher number, more dmesg output");
-
 #ifdef CONFIG_MALI_GATOR_SUPPORT
 /* Create the trace points (otherwise we just get code to call a tracepoint) */
 #define CREATE_TRACE_POINTS
index 54edc4b11790134ef5ebc021309f9be88dafd2b7..8e388ec2c162c0102fccbd4f33744d282fa74d32 100755 (executable)
 
 #include <linux/bug.h>
 
-extern int mali_debug_level;
-/**
- * @def KBASEP_LOG(level, ...)
- * @brief Logs a debug message using dev_dbg().
- *
- * Logs a debug message using dev_dbg if the debug level specified for the
- * message is lower or equal than the current debug level. Use higher
- * numbers to log messages with increasing verbosity.
- *
- * The current debug level is controlled by the module parameter
- * 'mali_debug_level' which is 0 by default.
- * 
- * No special meaning is assigned to debug levels but the recommendation is
- * 0 = driver init/exit messages
- * 1 = function entry/exit messages
- * 2 = function detailed messages
- * 3 = irq/callback messages
- * 4 = register read/write messages
- *
- * @param level debug level for the message    
- * @param ... Arguments you would normally pass to dev_dbg()
- */
-#define KBASE_LOG(level, ...) if ((level) <= mali_debug_level) dev_dbg(__VA_ARGS__)
-
 /** @brief If equals to 0, a trace containing the file, line, and function will be displayed before each message. */
 #define KBASE_DEBUG_SKIP_TRACE 0
 
index 6340cba770a277f49930d9c0f6fb6d338ec5271a..52300d20d51d0d9ff838065861fef607d7b45a9b 100755 (executable)
@@ -42,7 +42,6 @@
 #endif                         /* CONFIG_KDS */
 
 #ifdef CONFIG_SYNC
-//#include <linux/sync.h>
 #include "sync.h"
 #endif                         /* CONFIG_SYNC */
 
index abf1757631c64bd8c65b848b262f2477bb268fa9..872d24bc187c333b5280592708b0f29100e29131 100755 (executable)
@@ -79,13 +79,9 @@ mali_error kbase_hw_set_issues_mask(kbase_device *kbdev)
                case GPU_ID_MAKE(GPU_ID_PI_T62X, 1, 0, 0):
                case GPU_ID_MAKE(GPU_ID_PI_T62X, 1, 0, 1):
                        issues = base_hw_issues_t62x_r1p0;
-                       break;
-               case GPU_ID_MAKE(GPU_ID_PI_T67X, 1, 0, 0):
-               case GPU_ID_MAKE(GPU_ID_PI_T67X, 1, 0, 1):
-                       issues = base_hw_issues_t67x_r1p0;
                        break;
-               case GPU_ID_MAKE(GPU_ID_PI_T76X, 0, 0, 0):
-                       issues = base_hw_issues_t76x_r0p0_beta;
+               case GPU_ID_MAKE(GPU_ID_PI_T62X, 1, 1, 0):
+                       issues = base_hw_issues_t62x_r1p1;
                        break;
                case GPU_ID_MAKE(GPU_ID_PI_T76X, 0, 0, 1):
                        issues = base_hw_issues_t76x_r0p0;
@@ -122,7 +118,6 @@ mali_error kbase_hw_set_issues_mask(kbase_device *kbdev)
                switch (gpu_id >> GPU_ID_VERSION_PRODUCT_ID_SHIFT) {
                case GPU_ID_PI_T60X:
                case GPU_ID_PI_T62X:
-               case GPU_ID_PI_T67X:
                        issues = base_hw_issues_model_t6xx;
                        break;
                case GPU_ID_PI_T72X:
index 02a8471b3b48e7c7956374953c4bc2a1ceade9cd..8d2c0ba2f7f6d6089d68d6fdba81de569d4f2f80 100755 (executable)
@@ -834,6 +834,7 @@ mali_bool jd_submit_atom(kbase_context *kctx,
        katom->nr_extres = user_atom->nr_extres;
        katom->extres = NULL;
        katom->device_nr = user_atom->device_nr;
+
        katom->affinity = 0;
        katom->jc = user_atom->jc;
        katom->coreref_state = KBASE_ATOM_COREREF_STATE_NO_CORES_REQUESTED;
@@ -897,14 +898,22 @@ mali_bool jd_submit_atom(kbase_context *kctx,
        katom->status = KBASE_JD_ATOM_STATE_QUEUED;
 
        /* Reject atoms with job chain = NULL, as these cause issues with soft-stop */
-       if (0 == katom->jc && (katom->core_req & BASEP_JD_REQ_ATOM_TYPE) != BASE_JD_REQ_DEP)
-       {
+       if (0 == katom->jc && (katom->core_req & BASEP_JD_REQ_ATOM_TYPE) != BASE_JD_REQ_DEP) {
                dev_warn(kctx->kbdev->dev, "Rejecting atom with jc = NULL");
                katom->event_code = BASE_JD_EVENT_JOB_INVALID;
                ret = jd_done_nolock(katom);
                goto out;
        }
 
+       /* Reject atoms with an invalid device_nr */
+       if ((katom->core_req & BASE_JD_REQ_SPECIFIC_COHERENT_GROUP) &&
+           (katom->device_nr >= kctx->kbdev->gpu_props.num_core_groups)) {
+               dev_warn(kctx->kbdev->dev, "Rejecting atom with invalid device_nr %d", katom->device_nr);
+               katom->event_code = BASE_JD_EVENT_JOB_INVALID;
+               ret = jd_done_nolock(katom);
+               goto out;
+       }
+
        /*
         * If the priority is increased we need to check the caller has security caps to do this, if
         * priority is decreased then this is ok as the result will have no negative impact on other
index ca7935f64c133789f671bd8e8bf05e8e7d70c7bb..d3c66431e3f3d2c14c6dfedf47fe24a8966d947b 100755 (executable)
@@ -146,11 +146,31 @@ static void kbase_job_hw_submit(kbase_device *kbdev, kbase_jd_atom *katom, int j
 void kbase_job_submit_nolock(kbase_device *kbdev, kbase_jd_atom *katom, int js)
 {
        kbase_jm_slot *jm_slots;
+       base_jd_core_req core_req;
 
        KBASE_DEBUG_ASSERT(kbdev);
+       KBASE_DEBUG_ASSERT(katom);
 
        jm_slots = kbdev->jm_slots;
 
+       core_req = katom->core_req;
+       if (core_req & BASE_JD_REQ_ONLY_COMPUTE) {
+               unsigned long flags;
+               int device_nr = (core_req & BASE_JD_REQ_SPECIFIC_COHERENT_GROUP) ? katom->device_nr : 0;
+               KBASE_DEBUG_ASSERT(device_nr < 2);
+               spin_lock_irqsave(&kbdev->pm.metrics.lock, flags);
+               kbasep_pm_record_job_status(kbdev);
+               kbdev->pm.metrics.active_cl_ctx[device_nr]++;
+               spin_unlock_irqrestore(&kbdev->pm.metrics.lock, flags);
+       } else {
+               unsigned long flags;
+
+               spin_lock_irqsave(&kbdev->pm.metrics.lock, flags);
+               kbasep_pm_record_job_status(kbdev);
+               kbdev->pm.metrics.active_gl_ctx++;
+               spin_unlock_irqrestore(&kbdev->pm.metrics.lock, flags);
+       }
+
        /*
         * We can have:
         * - one job already done (pending interrupt),
index 8c99634dce8faca935773916dae41e505c932a9a..7e325c2a0b28cdbe0a8f8755d434dd3bd59b36eb 100755 (executable)
@@ -752,6 +752,7 @@ static INLINE void kbasep_js_atom_retained_state_copy(kbasep_js_atom_retained_st
        retained_state->event_code = katom->event_code;
        retained_state->core_req = katom->core_req;
        retained_state->retry_submit_on_slot = katom->retry_submit_on_slot;
+       retained_state->device_nr = katom->device_nr;
 }
 
 /**
index 6e051b18a63cdc89d9ad60295bf83b46a51de9cb..4da69020165cc759d6e6250b65569134c798c471 100755 (executable)
@@ -295,10 +295,27 @@ mali_bool kbasep_js_ctx_attr_ctx_release_atom(kbase_device *kbdev, kbase_context
        if (kbasep_js_atom_retained_state_is_valid(katom_retained_state) == MALI_FALSE)
                return MALI_FALSE;
 
-       if (core_req & BASE_JD_REQ_ONLY_COMPUTE)
+       if (core_req & BASE_JD_REQ_ONLY_COMPUTE) {
+               unsigned long flags;
+               int device_nr = (core_req & BASE_JD_REQ_SPECIFIC_COHERENT_GROUP) ? katom_retained_state->device_nr : 0;
+               KBASE_DEBUG_ASSERT(device_nr < 2);
+
+               spin_lock_irqsave(&kbdev->pm.metrics.lock, flags);
+               kbasep_pm_record_job_status(kbdev);
+               kbdev->pm.metrics.active_cl_ctx[device_nr]--;
+               spin_unlock_irqrestore(&kbdev->pm.metrics.lock, flags);
+
                runpool_state_changed |= kbasep_js_ctx_attr_ctx_release_attr(kbdev, kctx, KBASEP_JS_CTX_ATTR_COMPUTE);
-       else
+       } else {
+               unsigned long flags;
+
+               spin_lock_irqsave(&kbdev->pm.metrics.lock, flags);
+               kbasep_pm_record_job_status(kbdev);
+               kbdev->pm.metrics.active_gl_ctx--;
+               spin_unlock_irqrestore(&kbdev->pm.metrics.lock, flags);
+
                runpool_state_changed |= kbasep_js_ctx_attr_ctx_release_attr(kbdev, kctx, KBASEP_JS_CTX_ATTR_NON_COMPUTE);
+       }
 
        if ((core_req & (BASE_JD_REQ_CS | BASE_JD_REQ_ONLY_COMPUTE | BASE_JD_REQ_T)) != 0 && (core_req & (BASE_JD_REQ_COHERENT_GROUP | BASE_JD_REQ_SPECIFIC_COHERENT_GROUP)) == 0) {
                /* Atom that can run on slot1 or slot2, and can use all cores */
index 695bf466c79ec6f928085e41e4e1581ff79ec697..981bb1d1ef12978107815365306fa876f04a7230 100755 (executable)
@@ -448,6 +448,8 @@ typedef struct kbasep_js_atom_retained_state {
        base_jd_core_req core_req;
        /** Job Slot to retry submitting to if submission from IRQ handler failed */
        int retry_submit_on_slot;
+       /* Core group atom was executed on */
+       u32 device_nr;
 
 } kbasep_js_atom_retained_state;
 
index a88fbabb2395588e7fa4ad9efb78a3b7bbf1cfa7..59bafcabf724899eda5e3be6342da7fce31ef123 100755 (executable)
@@ -1404,7 +1404,7 @@ int kbase_mmap(struct file *file, struct vm_area_struct *vma)
                             !(reg->flags & KBASE_REG_CPU_WR))) {
                                /* VM flags inconsistent with region flags */
                                err = -EPERM;
-                               printk(KERN_ERR "%s:%d inconsistent VM flags\n",
+                               dev_err(dev, "%s:%d inconsistent VM flags\n",
                                        __FILE__, __LINE__);
                                goto out_unlock;
                        }
index ff361792d6c6bb2d073dc91c078547a955738d98..27fd4f29b315d2db2567cdcaa8da04b0b3957498 100755 (executable)
@@ -207,10 +207,6 @@ static void page_fault_worker(struct work_struct *data)
                kbase_reg_write(kbdev, MMU_AS_REG(as_no, ASn_LOCKADDR_LO), lock_addr & 0xFFFFFFFFUL, kctx);
                kbase_reg_write(kbdev, MMU_AS_REG(as_no, ASn_LOCKADDR_HI), lock_addr >> 32, kctx);
                kbase_reg_write(kbdev, MMU_AS_REG(as_no, ASn_COMMAND), ASn_COMMAND_LOCK, kctx);
-               if (kbase_hw_has_issue(kbdev, BASE_HW_ISSUE_T76X_3285)) {
-                       kbase_reg_write(kbdev, MMU_REG(MMU_IRQ_CLEAR), (1UL << as_no), NULL);
-                       kbase_reg_write(kbdev, MMU_AS_REG(as_no, ASn_COMMAND), ASn_COMMAND_LOCK, kctx);
-               }
 
                /* set up the new pages */
                err = kbase_mmu_insert_pages(kctx, region->start_pfn + kbase_reg_current_backed_size(region) - new_pages, &kbase_get_phy_pages(region)[kbase_reg_current_backed_size(region) - new_pages], new_pages, region->flags);
index a9baff977dda1e09136c7c36fda585a6894ec0ab..4647dfe9cebb8918b56942e23911ecfd6e8a693e 100755 (executable)
@@ -110,10 +110,16 @@ void kbase_pm_term(struct kbase_device *kbdev);
 typedef struct kbasep_pm_metrics_data {
        int vsync_hit;
        int utilisation;
+       int util_gl_share;
+       int util_cl_share[2]; /* 2 is a max number of core groups we can have */
        ktime_t time_period_start;
        u32 time_busy;
        u32 time_idle;
        mali_bool gpu_active;
+       u32 busy_cl[2];
+       u32 busy_gl;
+       u32 active_cl_ctx[2];
+       u32 active_gl_ctx;
 
        spinlock_t lock;
 
@@ -660,6 +666,16 @@ mali_error kbasep_pm_metrics_init(struct kbase_device *kbdev);
  */
 void kbasep_pm_metrics_term(struct kbase_device *kbdev);
 
+/** Record state of jobs currently active on GPU.
+ *
+ * This function record time spent executing jobs split per GL and CL
+ * contexts, per core group (only CL jobs).
+ *
+ * @param kbdev     The kbase device structure for the device
+ *                  (must be a valid pointer)
+ */
+void kbasep_pm_record_job_status(struct kbase_device *kbdev);
+
 /** Record that the GPU is active.
  *
  * This records that the GPU is now active. The previous GPU state must have been idle, the function will assert if
@@ -839,11 +855,14 @@ void kbase_pm_do_poweroff(struct kbase_device *kbdev, mali_bool is_suspend);
  * Function provided by platform specific code when DVFS is enabled to allow
  * the power management metrics system to report utilisation.
  *
- * @param kbdev        The kbase device structure for the device (must be a valid pointer)
- * @param utilisation  The current calculated utilisation by the metrics system.
- * @return             Returns 0 on failure and non zero on success.
+ * @param kbdev           The kbase device structure for the device (must be a valid pointer)
+ * @param utilisation     The current calculated utilisation by the metrics system.
+ * @param util_gl_share   The current calculated gl share of utilisation.
+ * @param util_cl_share   The current calculated cl share of utilisation per core group.
+ * @return                Returns 0 on failure and non zero on success.
  */
 
-int kbase_platform_dvfs_event(struct kbase_device *kbdev, u32 utilisation);
+int kbase_platform_dvfs_event(struct kbase_device *kbdev, u32 utilisation,
+       u32 util_gl_share, u32 util_cl_share[2]);
 #endif
 #endif                         /* _KBASE_PM_H_ */
index 9fe788b630eb54b4a1631fe6ad1693717b75b798..eb752e0323c3237d40cc0761c50e7660c0d6c6ae 100755 (executable)
@@ -762,10 +762,6 @@ static void kbase_pm_hw_issues(kbase_device *kbdev)
        if (DEFAULT_ALTERNATIVE_HWC)
                value |= SC_ALT_COUNTERS;
 
-       /* Use software control of forward pixel kill when needed. See MIDEUR-174. */
-       if (kbase_hw_has_issue(kbdev, BASE_HW_ISSUE_T76X_2121))
-               value |= SC_OVERRIDE_FWD_PIXEL_KILL;
-
        /* Needed due to MIDBASE-2795. ENABLE_TEXGRD_FLAGS. See PRLAM-10797. */
        if (kbase_hw_has_issue(kbdev, BASE_HW_ISSUE_10797))
                value |= SC_ENABLE_TEXGRD_FLAGS;
index 191fd33d4117adcdfae94002f4693fd045aa9370..c02940c1c07567e81229c5389447c1034f86a68b 100755 (executable)
@@ -69,12 +69,21 @@ mali_error kbasep_pm_metrics_init(kbase_device *kbdev)
        kbdev->pm.metrics.kbdev = kbdev;
        kbdev->pm.metrics.vsync_hit = 0;
        kbdev->pm.metrics.utilisation = 0;
+       kbdev->pm.metrics.util_cl_share[0] = 0;
+       kbdev->pm.metrics.util_cl_share[1] = 0;
+       kbdev->pm.metrics.util_gl_share = 0;
 
        kbdev->pm.metrics.time_period_start = ktime_get();
        kbdev->pm.metrics.time_busy = 0;
        kbdev->pm.metrics.time_idle = 0;
        kbdev->pm.metrics.gpu_active = MALI_TRUE;
        kbdev->pm.metrics.timer_active = MALI_TRUE;
+       kbdev->pm.metrics.active_cl_ctx[0] = 0;
+       kbdev->pm.metrics.active_cl_ctx[1] = 0;
+       kbdev->pm.metrics.active_gl_ctx = 0;
+       kbdev->pm.metrics.busy_cl[0] = 0;
+       kbdev->pm.metrics.busy_cl[1] = 0;
+       kbdev->pm.metrics.busy_gl = 0;
 
        spin_lock_init(&kbdev->pm.metrics.lock);
 
@@ -109,11 +118,31 @@ void kbasep_pm_metrics_term(kbase_device *kbdev)
 
 KBASE_EXPORT_TEST_API(kbasep_pm_metrics_term)
 
-void kbasep_pm_record_gpu_idle(kbase_device *kbdev)
+/*caller needs to hold kbdev->pm.metrics.lock before calling this function*/
+void kbasep_pm_record_job_status(kbase_device *kbdev)
 {
-       unsigned long flags;
        ktime_t now;
        ktime_t diff;
+       u32 ns_time;
+
+       KBASE_DEBUG_ASSERT(kbdev != NULL);
+
+       now = ktime_get();
+       diff = ktime_sub(now, kbdev->pm.metrics.time_period_start);
+
+       ns_time = (u32) (ktime_to_ns(diff) >> KBASE_PM_TIME_SHIFT);
+       kbdev->pm.metrics.time_busy += ns_time;
+       kbdev->pm.metrics.busy_gl += ns_time * kbdev->pm.metrics.active_gl_ctx;
+       kbdev->pm.metrics.busy_cl[0] += ns_time * kbdev->pm.metrics.active_cl_ctx[0];
+       kbdev->pm.metrics.busy_cl[1] += ns_time * kbdev->pm.metrics.active_cl_ctx[1];
+       kbdev->pm.metrics.time_period_start = now;
+}
+
+KBASE_EXPORT_TEST_API(kbasep_pm_record_job_status)
+
+void kbasep_pm_record_gpu_idle(kbase_device *kbdev)
+{
+       unsigned long flags;
 
        KBASE_DEBUG_ASSERT(kbdev != NULL);
 
@@ -123,11 +152,7 @@ void kbasep_pm_record_gpu_idle(kbase_device *kbdev)
 
        kbdev->pm.metrics.gpu_active = MALI_FALSE;
 
-       now = ktime_get();
-       diff = ktime_sub(now, kbdev->pm.metrics.time_period_start);
-
-       kbdev->pm.metrics.time_busy += (u32) (ktime_to_ns(diff) >> KBASE_PM_TIME_SHIFT);
-       kbdev->pm.metrics.time_period_start = now;
+       kbasep_pm_record_job_status(kbdev);
 
        spin_unlock_irqrestore(&kbdev->pm.metrics.lock, flags);
 }
@@ -172,9 +197,10 @@ void kbase_pm_report_vsync(kbase_device *kbdev, int buffer_updated)
 KBASE_EXPORT_TEST_API(kbase_pm_report_vsync)
 
 /*caller needs to hold kbdev->pm.metrics.lock before calling this function*/
-int kbase_pm_get_dvfs_utilisation(kbase_device *kbdev)
+int kbase_pm_get_dvfs_utilisation(kbase_device *kbdev, int *util_gl_share, int util_cl_share[2])
 {
        int utilisation = 0;
+       int busy;
        ktime_t now = ktime_get();
        ktime_t diff;
 
@@ -183,7 +209,11 @@ int kbase_pm_get_dvfs_utilisation(kbase_device *kbdev)
        diff = ktime_sub(now, kbdev->pm.metrics.time_period_start);
 
        if (kbdev->pm.metrics.gpu_active) {
-               kbdev->pm.metrics.time_busy += (u32) (ktime_to_ns(diff) >> KBASE_PM_TIME_SHIFT);
+               u32 ns_time = (u32) (ktime_to_ns(diff) >> KBASE_PM_TIME_SHIFT);
+               kbdev->pm.metrics.time_busy += ns_time;
+               kbdev->pm.metrics.busy_cl[0] += ns_time * kbdev->pm.metrics.active_cl_ctx[0];
+               kbdev->pm.metrics.busy_cl[1] += ns_time * kbdev->pm.metrics.active_cl_ctx[1];
+               kbdev->pm.metrics.busy_gl += ns_time * kbdev->pm.metrics.active_gl_ctx;
                kbdev->pm.metrics.time_period_start = now;
        } else {
                kbdev->pm.metrics.time_idle += (u32) (ktime_to_ns(diff) >> KBASE_PM_TIME_SHIFT);
@@ -193,15 +223,49 @@ int kbase_pm_get_dvfs_utilisation(kbase_device *kbdev)
        if (kbdev->pm.metrics.time_idle + kbdev->pm.metrics.time_busy == 0) {
                /* No data - so we return NOP */
                utilisation = -1;
+               if (util_gl_share)
+                       *util_gl_share = -1;
+               if (util_cl_share) {
+                       util_cl_share[0] = -1;
+                       util_cl_share[1] = -1;
+               }
                goto out;
        }
 
-       utilisation = (100 * kbdev->pm.metrics.time_busy) / (kbdev->pm.metrics.time_idle + kbdev->pm.metrics.time_busy);
+       utilisation = (100 * kbdev->pm.metrics.time_busy) /
+                       (kbdev->pm.metrics.time_idle +
+                        kbdev->pm.metrics.time_busy);
+
+       busy = kbdev->pm.metrics.busy_gl +
+               kbdev->pm.metrics.busy_cl[0] +
+               kbdev->pm.metrics.busy_cl[1];
+
+       if (busy != 0) {
+               if (util_gl_share)
+                       *util_gl_share =
+                               (100 * kbdev->pm.metrics.busy_gl) / busy;
+               if (util_cl_share) {
+                       util_cl_share[0] =
+                               (100 * kbdev->pm.metrics.busy_cl[0]) / busy;
+                       util_cl_share[1] =
+                               (100 * kbdev->pm.metrics.busy_cl[1]) / busy;
+               }
+       } else {
+               if (util_gl_share)
+                       *util_gl_share = -1;
+               if (util_cl_share) {
+                       util_cl_share[0] = -1;
+                       util_cl_share[1] = -1;
+               }
+       }
 
- out:
+out:
 
        kbdev->pm.metrics.time_idle = 0;
        kbdev->pm.metrics.time_busy = 0;
+       kbdev->pm.metrics.busy_cl[0] = 0;
+       kbdev->pm.metrics.busy_cl[1] = 0;
+       kbdev->pm.metrics.busy_gl = 0;
 
        return utilisation;
 }
@@ -209,18 +273,22 @@ int kbase_pm_get_dvfs_utilisation(kbase_device *kbdev)
 kbase_pm_dvfs_action kbase_pm_get_dvfs_action(kbase_device *kbdev)
 {
        unsigned long flags;
-       int utilisation;
+       int utilisation, util_gl_share;
+       int util_cl_share[2];
        kbase_pm_dvfs_action action;
 
        KBASE_DEBUG_ASSERT(kbdev != NULL);
 
        spin_lock_irqsave(&kbdev->pm.metrics.lock, flags);
 
-       utilisation = kbase_pm_get_dvfs_utilisation(kbdev);
+       utilisation = kbase_pm_get_dvfs_utilisation(kbdev, &util_gl_share, util_cl_share);
 
-       if (utilisation < 0) {
+       if (utilisation < 0 || util_gl_share < 0 || util_cl_share < 0) {
                action = KBASE_PM_DVFS_NOP;
                utilisation = 0;
+               util_gl_share = 0;
+               util_cl_share[0] = 0;
+               util_cl_share[1] = 0;
                goto out;
        }
 
@@ -243,12 +311,18 @@ kbase_pm_dvfs_action kbase_pm_get_dvfs_action(kbase_device *kbdev)
        }
 
        kbdev->pm.metrics.utilisation = utilisation;
- out:
+       kbdev->pm.metrics.util_cl_share[0] = util_cl_share[0];
+       kbdev->pm.metrics.util_cl_share[1] = util_cl_share[1];
+       kbdev->pm.metrics.util_gl_share = util_gl_share;
+out:
 #ifdef CONFIG_MALI_MIDGARD_DVFS
-       kbase_platform_dvfs_event(kbdev, utilisation);
+       kbase_platform_dvfs_event(kbdev, utilisation, util_gl_share, util_cl_share);
 #endif                         /*CONFIG_MALI_MIDGARD_DVFS */
        kbdev->pm.metrics.time_idle = 0;
        kbdev->pm.metrics.time_busy = 0;
+       kbdev->pm.metrics.busy_cl[0] = 0;
+       kbdev->pm.metrics.busy_cl[1] = 0;
+       kbdev->pm.metrics.busy_gl = 0;
        spin_unlock_irqrestore(&kbdev->pm.metrics.lock, flags);
 
        return action;
index 92bf0b754b43c3eb85ecba27cc8a654cf590ff77..785ed205a5ba68dba9558d9d21c5f5289cdf1e2e 100755 (executable)
@@ -20,7 +20,6 @@
 #include <mali_kbase.h>
 
 #ifdef CONFIG_SYNC
-//#include <linux/sync.h>
 #include "sync.h"
 #include <linux/syscalls.h>
 #include "mali_kbase_sync.h"
index 57b2d74335004905f007504f05995f63fa5c4b6c..f8db35e31c1f8d983b9bd2b64926cb770c190998 100755 (executable)
@@ -24,7 +24,6 @@
 
 #ifdef CONFIG_SYNC
 
-//#include <linux/sync.h>
 #include "sync.h"
 #include <mali_kbase.h>
 
index c40d74004ec14b1b74d5bca23f5631d598bf7c5d..d3848ad9c5f6042759e5f9c8f09637c73299ee2b 100755 (executable)
 /* Values for GPU_ID_VERSION_PRODUCT_ID bitfield */
 #define GPU_ID_PI_T60X                    0x6956
 #define GPU_ID_PI_T62X                    0x0620
-#define GPU_ID_PI_T67X                    0x0670
 #define GPU_ID_PI_T76X                    0x0750
 #define GPU_ID_PI_T72X                    0x0720
 
index 9d21dbd7b87dbc28701b42b07c517e83c10e5ff1..d845ba4090fe43ef6d521419bd23f6bb0ed0fdc8 100755 (executable)
@@ -312,6 +312,7 @@ static kbase_attribute config_attributes[] = {
 
 #ifdef CONFIG_MALI_DEBUG
 /* Use more aggressive scheduling timeouts in debug builds for testing purposes */
+#if 0
        {
         KBASE_CONFIG_ATTR_JS_SCHEDULING_TICK_NS,
         KBASE_VE_JS_SCHEDULING_TICK_NS_DEBUG},
@@ -335,6 +336,7 @@ static kbase_attribute config_attributes[] = {
        {
         KBASE_CONFIG_ATTR_JS_RESET_TICKS_NSS,
         KBASE_VE_JS_RESET_TICKS_NSS_DEBUG},
+#endif
 #else                          /* CONFIG_MALI_DEBUG */
 /* In release builds same as the defaults but scaled for 5MHz FPGA */
 #if 0
index bf42c68a7072e06374d5ca4dcdbd19afb05ccac6..4a3d5b03b4c01a3dadff3266fd68feaadd6ee332 100755 (executable)
@@ -222,7 +222,7 @@ static void mali_dvfs_event_proc(struct work_struct *w)
 
 static DECLARE_WORK(mali_dvfs_work, mali_dvfs_event_proc);
 
-int kbase_platform_dvfs_event(struct kbase_device *kbdev, u32 utilisation)
+int kbase_platform_dvfs_event(struct kbase_device *kbdev, u32 utilisation,u32 util_gl_share_no_use,u32 util_cl_share_no_use[2])
 {
        unsigned long flags;
        struct rk_context *platform;
index 0fefc1a78a8dba024261be0d226f2732d1e40e3d..c1cb689554bdd100faa32bfe6f85782a7dac6554 100755 (executable)
@@ -48,7 +48,8 @@ int kbase_platform_dvfs_get_level(int freq);
 #ifdef CONFIG_MALI_MIDGARD_DVFS
 int kbase_platform_dvfs_init(struct kbase_device *dev);
 void kbase_platform_dvfs_term(void);
-int kbase_platform_dvfs_event(struct kbase_device *kbdev, u32 utilisation);
+/*int kbase_platform_dvfs_event(struct kbase_device *kbdev, u32 utilisation);*/
+/*int kbase_platform_dvfs_event(struct kbase_device *kbdev, u32 utilisation,u32 util_gl_share, u32 util_cl_share[2]);*/
 int kbase_platform_dvfs_get_enable_status(void);
 int kbase_platform_dvfs_enable(bool enable, int freq);
 int kbase_platform_dvfs_get_utilisation(void);
index 9d463784e6ac0a0b97da80e159f5e51457bc61f9..1923c891b99c80430a9f1de795d46fd9ec18724f 100755 (executable)
@@ -1,5 +1,5 @@
 #
-# (C) COPYRIGHT 2010-2013 ARM Limited. All rights reserved.
+# (C) COPYRIGHT 2010-2014 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
index f793785d265a3c429af6f36dc76c5f949ecda934..508e3724e9baeba5405a1dc517f0fcb4801e4258 100755 (executable)
@@ -1,6 +1,6 @@
 # This confidential and proprietary software may be used only as
 # authorised by a licensing agreement from ARM Limited
-# (C) COPYRIGHT 2010-2011 ARM Limited
+# (C) COPYRIGHT 2010-2011, 2013 ARM Limited
 # ALL RIGHTS RESERVED
 # The entire notice above must be reproduced on all authorised
 # copies and copies may only be made to the extent permitted
index 0203614a7afd4d520236a229320dfb68a04851dc..67040eecd036af46cf0dac2f8c110499140c0096 100755 (executable)
@@ -1,6 +1,6 @@
 # This confidential and proprietary software may be used only as
 # authorised by a licensing agreement from ARM Limited
-# (C) COPYRIGHT 2010-2011 ARM Limited
+# (C) COPYRIGHT 2010-2011, 2013 ARM Limited
 # ALL RIGHTS RESERVED
 # The entire notice above must be reproduced on all authorised
 # copies and copies may only be made to the extent permitted