adreno_a6xx_hwsched.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef _ADRENO_A6XX_HWSCHED_H_
  7. #define _ADRENO_A6XX_HWSCHED_H_
  8. #include "adreno_a6xx_hwsched_hfi.h"
  9. /**
  10. * struct a6xx_hwsched_device - Container for the a6xx hwscheduling device
  11. */
  12. struct a6xx_hwsched_device {
  13. /** @a6xx_dev: Container for the a6xx device */
  14. struct a6xx_device a6xx_dev;
  15. /** @hwsched_hfi: Container for hwscheduling specific hfi resources */
  16. struct a6xx_hwsched_hfi hwsched_hfi;
  17. };
  18. /**
  19. * a6xx_hwsched_probe - Target specific probe for hwsched
  20. * @pdev: Pointer to the platform device
  21. * @chipid: Chipid of the target
  22. * @gpucore: Pointer to the gpucore
  23. *
  24. * The target specific probe function for hwsched enabled gmu targets.
  25. *
  26. * Return: 0 on success or negative error on failure
  27. */
  28. int a6xx_hwsched_probe(struct platform_device *pdev,
  29. u32 chipid, const struct adreno_gpu_core *gpucore);
  30. /**
  31. * a6xx_hwsched_reset_replay - Restart the gmu and gpu
  32. * @adreno_dev: Pointer to the adreno device
  33. *
  34. * Restart the GMU and GPU and replay the inflight commands
  35. * Return: 0 on success or negative error on failure
  36. */
  37. int a6xx_hwsched_reset_replay(struct adreno_device *adreno_dev);
  38. /**
  39. * a6xx_hwsched_snapshot - take a6xx hwsched snapshot
  40. * @adreno_dev: Pointer to the adreno device
  41. * @snapshot: Pointer to the snapshot instance
  42. *
  43. * Snapshot the faulty ib and then snapshot rest of a6xx gmu things
  44. */
  45. void a6xx_hwsched_snapshot(struct adreno_device *adreno_dev,
  46. struct kgsl_snapshot *snapshot);
  47. /**
  48. * a6xx_hwsched_handle_watchdog - Handle watchdog interrupt
  49. * @adreno_dev: Pointer to the adreno device
  50. */
  51. void a6xx_hwsched_handle_watchdog(struct adreno_device *adreno_dev);
  52. /**
  53. * a6xx_hwsched_active_count_get - Increment the active count
  54. * @adreno_dev: Pointer to the adreno device
  55. *
  56. * This function increments the active count. If active count
  57. * is 0, this function also powers up the device.
  58. *
  59. * Return: 0 on success or negative error on failure
  60. */
  61. int a6xx_hwsched_active_count_get(struct adreno_device *adreno_dev);
  62. /**
  63. * a6xx_hwsched_active_count_put - Put back the active count
  64. * @adreno_dev: Pointer to the adreno device
  65. *
  66. * This function decrements the active count sets the idle
  67. * timer if active count is zero.
  68. */
  69. void a6xx_hwsched_active_count_put(struct adreno_device *adreno_dev);
  70. /**
  71. * a6xx_hwsched_add_to_minidump - Register hwsched_device with va minidump
  72. * @adreno_dev: Pointer to the adreno device
  73. */
  74. int a6xx_hwsched_add_to_minidump(struct adreno_device *adreno_dev);
  75. /**
  76. * a6xx_hwsched_send_recurring_cmdobj - Dispatch IBs to GMU
  77. * @adreno_dev: Pointer to adreno device structure
  78. * @cmdobj: The command object which needs to be submitted
  79. *
  80. * This function is used to register the context if needed and submit
  81. * recurring IBs to the GMU. Upon receiving ipc interrupt GMU will submit
  82. * recurring IBs to GPU.
  83. * Return: 0 on success and negative error on failure
  84. */
  85. int a6xx_hwsched_send_recurring_cmdobj(struct adreno_device *adreno_dev,
  86. struct kgsl_drawobj_cmd *cmdobj);
  87. #endif