MALI: rockchip: upgrade midgard DDK to r14p0-01rel0
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / arm / midgard / backend / gpu / mali_kbase_js_affinity.h
index 541e554983ef179951c39f947e3b656593656e0f..35d9781ae092c60c9bae4d8a4320e883ded0ea8a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *
- * (C) COPYRIGHT 2011-2015 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 2011-2016 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
 
 
 
-/**
- * @file mali_kbase_js_affinity.h
+/*
  * Affinity Manager internal APIs.
  */
 
 #ifndef _KBASE_JS_AFFINITY_H_
 #define _KBASE_JS_AFFINITY_H_
 
-#ifdef CONFIG_MALI_DEBUG_SHADER_SPLIT_FS
-/* Import the external affinity mask variables */
-extern u64 mali_js0_affinity_mask;
-extern u64 mali_js1_affinity_mask;
-extern u64 mali_js2_affinity_mask;
-#endif /* CONFIG_MALI_DEBUG_SHADER_SPLIT_FS */
-
-
-/**
- * @addtogroup base_api
- * @{
- */
-
-/**
- * @addtogroup base_kbase_api
- * @{
- */
-
 /**
- * @addtogroup kbase_js_affinity Affinity Manager internal APIs.
- * @{
+ * kbase_js_can_run_job_on_slot_no_lock - Decide whether it is possible to
+ * submit a job to a particular job slot in the current status
  *
- */
-
-/**
- * @brief Decide whether it is possible to submit a job to a particular job slot
- * in the current status
+ * @kbdev: The kbase device structure of the device
+ * @js:    Job slot number to check for allowance
  *
  * Will check if submitting to the given job slot is allowed in the current
  * status.  For example using job slot 2 while in soft-stoppable state and only
@@ -59,28 +37,24 @@ extern u64 mali_js2_affinity_mask;
  * called prior to submitting a job to a slot to make sure policy rules are not
  * violated.
  *
- * The following locking conditions are made on the caller:
- * - it must hold kbasep_js_device_data::runpool_irq::lock
- *
- * @param kbdev The kbase device structure of the device
- * @param js    Job slot number to check for allowance
+ * The following locking conditions are made on the caller
+ * - it must hold hwaccess_lock
  */
-bool kbase_js_can_run_job_on_slot_no_lock(struct kbase_device *kbdev,
-                                                                       int js);
+bool kbase_js_can_run_job_on_slot_no_lock(struct kbase_device *kbdev, int js);
 
 /**
- * @brief Compute affinity for a given job.
+ * kbase_js_choose_affinity - Compute affinity for a given job.
+ *
+ * @affinity: Affinity bitmap computed
+ * @kbdev:    The kbase device structure of the device
+ * @katom:    Job chain of which affinity is going to be found
+ * @js:       Slot the job chain is being submitted
  *
  * Currently assumes an all-on/all-off power management policy.
  * Also assumes there is at least one core with tiler available.
  *
  * Returns true if a valid affinity was chosen, false if
  * no cores were available.
- *
- * @param[out] affinity       Affinity bitmap computed
- * @param kbdev The kbase device structure of the device
- * @param katom Job chain of which affinity is going to be found
- * @param js    Slot the job chain is being submitted
  */
 bool kbase_js_choose_affinity(u64 * const affinity,
                                        struct kbase_device *kbdev,
@@ -88,40 +62,60 @@ bool kbase_js_choose_affinity(u64 * const affinity,
                                        int js);
 
 /**
- * @brief Determine whether a proposed \a affinity on job slot \a js would
- * cause a violation of affinity restrictions.
+ * kbase_js_affinity_would_violate - Determine whether a proposed affinity on
+ * job slot @js would cause a violation of affinity restrictions.
+ *
+ * @kbdev:    Kbase device structure
+ * @js:       The job slot to test
+ * @affinity: The affinity mask to test
+ *
+ * The following locks must be held by the caller
+ * - hwaccess_lock
  *
- * The following locks must be held by the caller:
- * - kbasep_js_device_data::runpool_irq::lock
+ * Return: true if the affinity would violate the restrictions
  */
 bool kbase_js_affinity_would_violate(struct kbase_device *kbdev, int js,
                                                                u64 affinity);
 
 /**
- * @brief Affinity tracking: retain cores used by a slot
+ * kbase_js_affinity_retain_slot_cores - Affinity tracking: retain cores used by
+ *                                       a slot
  *
- * The following locks must be held by the caller:
- * - kbasep_js_device_data::runpool_irq::lock
+ * @kbdev:    Kbase device structure
+ * @js:       The job slot retaining the cores
+ * @affinity: The cores to retain
+ *
+ * The following locks must be held by the caller
+ * - hwaccess_lock
  */
 void kbase_js_affinity_retain_slot_cores(struct kbase_device *kbdev, int js,
                                                                u64 affinity);
 
 /**
- * @brief Affinity tracking: release cores used by a slot
+ * kbase_js_affinity_release_slot_cores - Affinity tracking: release cores used
+ *                                        by a slot
+ *
+ * @kbdev:    Kbase device structure
+ * @js:       Job slot
+ * @affinity: Bit mask of core to be released
  *
- * Cores \b must be released as soon as a job is dequeued from a slot's 'submit
+ * Cores must be released as soon as a job is dequeued from a slot's 'submit
  * slots', and before another job is submitted to those slots. Otherwise, the
  * refcount could exceed the maximum number submittable to a slot,
- * BASE_JM_SUBMIT_SLOTS.
+ * %BASE_JM_SUBMIT_SLOTS.
  *
- * The following locks must be held by the caller:
- * - kbasep_js_device_data::runpool_irq::lock
+ * The following locks must be held by the caller
+ * - hwaccess_lock
  */
 void kbase_js_affinity_release_slot_cores(struct kbase_device *kbdev, int js,
                                                                u64 affinity);
 
 /**
- * @brief Output to the Trace log the current tracked affinities on all slots
+ * kbase_js_debug_log_current_affinities - log the current affinities
+ *
+ * @kbdev:  Kbase device structure
+ *
+ * Output to the Trace log the current tracked affinities on all slots
  */
 #if KBASE_TRACE_ENABLE
 void kbase_js_debug_log_current_affinities(struct kbase_device *kbdev);
@@ -132,9 +126,4 @@ kbase_js_debug_log_current_affinities(struct kbase_device *kbdev)
 }
 #endif                         /*  KBASE_TRACE_ENABLE  */
 
-         /** @} *//* end group kbase_js_affinity */
-         /** @} *//* end group base_kbase_api */
-         /** @} *//* end group base_api */
-
-
 #endif                         /* _KBASE_JS_AFFINITY_H_ */