mali_kbase_device_internal.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. *
  3. * (C) COPYRIGHT 2014 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. * Backend-specific HW access device APIs
  17. */
  18. #ifndef _KBASE_DEVICE_INTERNAL_H_
  19. #define _KBASE_DEVICE_INTERNAL_H_
  20. /**
  21. * kbase_reg_write - write to GPU register
  22. * @kbdev: Kbase device pointer
  23. * @offset: Offset of register
  24. * @value: Value to write
  25. * @kctx: Kbase context pointer. May be NULL
  26. *
  27. * Caller must ensure the GPU is powered (@kbdev->pm.gpu_powered != false). If
  28. * @kctx is not NULL then the caller must ensure it is scheduled (@kctx->as_nr
  29. * != KBASEP_AS_NR_INVALID).
  30. */
  31. void kbase_reg_write(struct kbase_device *kbdev, u16 offset, u32 value,
  32. struct kbase_context *kctx);
  33. /**
  34. * kbase_reg_read - read from GPU register
  35. * @kbdev: Kbase device pointer
  36. * @offset: Offset of register
  37. * @kctx: Kbase context pointer. May be NULL
  38. *
  39. * Caller must ensure the GPU is powered (@kbdev->pm.gpu_powered != false). If
  40. * @kctx is not NULL then the caller must ensure it is scheduled (@kctx->as_nr
  41. * != KBASEP_AS_NR_INVALID).
  42. *
  43. * Return: Value in desired register
  44. */
  45. u32 kbase_reg_read(struct kbase_device *kbdev, u16 offset,
  46. struct kbase_context *kctx);
  47. /**
  48. * kbase_gpu_interrupt - GPU interrupt handler
  49. * @kbdev: Kbase device pointer
  50. * @val: The value of the GPU IRQ status register which triggered the call
  51. *
  52. * This function is called from the interrupt handler when a GPU irq is to be
  53. * handled.
  54. */
  55. void kbase_gpu_interrupt(struct kbase_device *kbdev, u32 val);
  56. #endif // ifndef _KBASE_DEVICE_INTERNAL_H_