MALI: rockchip: upgrade utgard DDK to r6p0-01rel0
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / arm / mali400 / mali / common / mali_pp_job.h
index e9e4783717f309066649df201b76bfd7bff9e617..7b9d2efa3019cd4a0f1bfa3fed0962382c025d35 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2014 ARM Limited. All rights reserved.
+ * Copyright (C) 2011-2015 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.
 #include "linux/mali_memory_dma_buf.h"
 #endif
 
+typedef enum pp_job_status {
+       MALI_NO_SWAP_IN,
+       MALI_SWAP_IN_FAIL,
+       MALI_SWAP_IN_SUCC,
+} pp_job_status;
+
 /**
  * This structure represents a PP job, including all sub jobs.
  *
@@ -55,6 +61,10 @@ struct mali_pp_job {
        u32 perf_counter_per_sub_job_src1[_MALI_PP_MAX_SUB_JOBS]; /**< Per sub job counters src1 */
        u32 sub_jobs_num;                                  /**< Number of subjobs; set to 1 for Mali-450 if DLBU is used, otherwise equals number of PP cores */
 
+       pp_job_status swap_status;                         /**< Used to track each PP job swap status, if fail, we need to drop them in scheduler part */
+       mali_bool user_notification;                       /**< When we deferred delete PP job, we need to judge if we need to send job finish notification to user space */
+       u32 num_pp_cores_in_virtual;                       /**< How many PP cores we have when job finished */
+
        /*
         * These members are used by both scheduler and executor.
         * They are "protected" by atomic operations.
@@ -68,9 +78,6 @@ struct mali_pp_job {
         * No lock is thus needed for these.
         */
        u32 *memory_cookies;                               /**< Memory cookies attached to job */
-#if defined(CONFIG_DMA_SHARED_BUFFER) && !defined(CONFIG_MALI_DMA_BUF_MAP_ON_ATTACH)
-       struct mali_dma_buf_attachment **dma_bufs;         /**< Array of DMA-bufs used by job */
-#endif
 
        /*
         * These members are used by the scheduler,
@@ -172,7 +179,7 @@ MALI_STATIC_INLINE u32 *mali_pp_job_get_dlbu_registers(struct mali_pp_job *job)
 
 MALI_STATIC_INLINE mali_bool mali_pp_job_is_virtual(struct mali_pp_job *job)
 {
-#if defined(CONFIG_MALI450)
+#if (defined(CONFIG_MALI450) || defined(CONFIG_MALI470))
        MALI_DEBUG_ASSERT_POINTER(job);
        return (0 == job->uargs.num_cores) ? MALI_TRUE : MALI_FALSE;
 #else
@@ -419,32 +426,6 @@ MALI_STATIC_INLINE mali_bool mali_pp_job_needs_dma_buf_mapping(struct mali_pp_jo
        return MALI_FALSE;
 }
 
-#if defined(CONFIG_DMA_SHARED_BUFFER) && !defined(CONFIG_MALI_DMA_BUF_MAP_ON_ATTACH)
-MALI_STATIC_INLINE u32 mali_pp_job_num_dma_bufs(struct mali_pp_job *job)
-{
-       MALI_DEBUG_ASSERT_POINTER(job);
-       return job->uargs.num_memory_cookies;
-}
-
-MALI_STATIC_INLINE struct mali_dma_buf_attachment *mali_pp_job_get_dma_buf(
-       struct mali_pp_job *job, u32 index)
-{
-       MALI_DEBUG_ASSERT_POINTER(job);
-       MALI_DEBUG_ASSERT(index < job->uargs.num_memory_cookies);
-       MALI_DEBUG_ASSERT_POINTER(job->dma_bufs);
-       return job->dma_bufs[index];
-}
-
-MALI_STATIC_INLINE void mali_pp_job_set_dma_buf(struct mali_pp_job *job,
-               u32 index, struct mali_dma_buf_attachment *mem)
-{
-       MALI_DEBUG_ASSERT_POINTER(job);
-       MALI_DEBUG_ASSERT(index < job->uargs.num_memory_cookies);
-       MALI_DEBUG_ASSERT_POINTER(job->dma_bufs);
-       job->dma_bufs[index] = mem;
-}
-#endif
-
 MALI_STATIC_INLINE void mali_pp_job_mark_sub_job_started(struct mali_pp_job *job, u32 sub_job)
 {
        MALI_DEBUG_ASSERT_POINTER(job);