mali_kbase_jm_rb.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. *
  3. * (C) COPYRIGHT 2014-2015 ARM Limited. All rights reserved.
  4. *
  5. * This program is free software and is provided to you under the terms of the
  6. * GNU General Public License version 2 as published by the Free Software
  7. * Foundation, and any use by you of this program is subject to the terms
  8. * of such GNU licence.
  9. *
  10. * A copy of the licence is included with the program, and can also be obtained
  11. * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  12. * Boston, MA 02110-1301, USA.
  13. *
  14. */
  15. /*
  16. * Register-based HW access backend specific APIs
  17. */
  18. #ifndef _KBASE_HWACCESS_GPU_H_
  19. #define _KBASE_HWACCESS_GPU_H_
  20. #include <backend/gpu/mali_kbase_pm_internal.h>
  21. /**
  22. * kbase_gpu_irq_evict - Evict an atom from a NEXT slot
  23. *
  24. * @kbdev: Device pointer
  25. * @js: Job slot to evict from
  26. *
  27. * Evict the atom in the NEXT slot for the specified job slot. This function is
  28. * called from the job complete IRQ handler when the previous job has failed.
  29. *
  30. * Return: true if job evicted from NEXT registers, false otherwise
  31. */
  32. bool kbase_gpu_irq_evict(struct kbase_device *kbdev, int js);
  33. /**
  34. * kbase_gpu_complete_hw - Complete an atom on job slot js
  35. *
  36. * @kbdev: Device pointer
  37. * @js: Job slot that has completed
  38. * @completion_code: Event code from job that has completed
  39. * @job_tail: The tail address from the hardware if the job has partially
  40. * completed
  41. * @end_timestamp: Time of completion
  42. */
  43. void kbase_gpu_complete_hw(struct kbase_device *kbdev, int js,
  44. u32 completion_code,
  45. u64 job_tail,
  46. ktime_t *end_timestamp);
  47. /**
  48. * kbase_gpu_inspect - Inspect the contents of the HW access ringbuffer
  49. *
  50. * @kbdev: Device pointer
  51. * @js: Job slot to inspect
  52. * @idx: Index into ringbuffer. 0 is the job currently running on
  53. * the slot, 1 is the job waiting, all other values are invalid.
  54. * Return: The atom at that position in the ringbuffer
  55. * or NULL if no atom present
  56. */
  57. struct kbase_jd_atom *kbase_gpu_inspect(struct kbase_device *kbdev, int js,
  58. int idx);
  59. /**
  60. * kbase_gpu_slot_update - Update state based on slot ringbuffers
  61. *
  62. * @kbdev: Device pointer
  63. *
  64. * Inspect the jobs in the slot ringbuffers and update state.
  65. *
  66. * This will cause jobs to be submitted to hardware if they are unblocked
  67. */
  68. void kbase_gpu_slot_update(struct kbase_device *kbdev);
  69. /**
  70. * kbase_gpu_dump_slots - Print the contents of the slot ringbuffers
  71. *
  72. * @kbdev: Device pointer
  73. */
  74. void kbase_gpu_dump_slots(struct kbase_device *kbdev);
  75. #endif // ifndef _KBASE_HWACCESS_GPU_H_