adreno_gen8_hwsched.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef _ADRENO_GEN8_HWSCHED_H_
  7. #define _ADRENO_GEN8_HWSCHED_H_
  8. #include "adreno_gen8_hwsched_hfi.h"
  9. /**
  10. * struct gen8_hwsched_device - Container for the gen8 hwscheduling device
  11. */
  12. struct gen8_hwsched_device {
  13. /** @gen8_dev: Container for the gen8 device */
  14. struct gen8_device gen8_dev;
  15. /** @hwsched_hfi: Container for hwscheduling specific hfi resources */
  16. struct gen8_hwsched_hfi hwsched_hfi;
  17. };
  18. /**
  19. * gen8_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 gen8_hwsched_probe(struct platform_device *pdev,
  29. u32 chipid, const struct adreno_gpu_core *gpucore);
  30. /**
  31. * gen8_hwsched_reset_replay - Restart the gmu and gpu and replay inflight cmdbatches
  32. * @adreno_dev: Pointer to the adreno device
  33. *
  34. * Return: 0 on success or negative error on failure
  35. */
  36. int gen8_hwsched_reset_replay(struct adreno_device *adreno_dev);
  37. /**
  38. * gen8_hwsched_snapshot - take gen8 hwsched snapshot
  39. * @adreno_dev: Pointer to the adreno device
  40. * @snapshot: Pointer to the snapshot instance
  41. *
  42. * Snapshot the faulty ib and then snapshot rest of gen8 gmu things
  43. */
  44. void gen8_hwsched_snapshot(struct adreno_device *adreno_dev,
  45. struct kgsl_snapshot *snapshot);
  46. /**
  47. * gen8_hwsched_handle_watchdog - Handle watchdog interrupt
  48. * @adreno_dev: Pointer to the adreno device
  49. */
  50. void gen8_hwsched_handle_watchdog(struct adreno_device *adreno_dev);
  51. /**
  52. * gen8_hwsched_active_count_get - Increment the active count
  53. * @adreno_dev: Pointer to the adreno device
  54. *
  55. * This function increments the active count. If active count
  56. * is 0, this function also powers up the device.
  57. *
  58. * Return: 0 on success or negative error on failure
  59. */
  60. int gen8_hwsched_active_count_get(struct adreno_device *adreno_dev);
  61. /**
  62. * gen8_hwsched_active_count_put - Put back the active count
  63. * @adreno_dev: Pointer to the adreno device
  64. *
  65. * This function decrements the active count sets the idle
  66. * timer if active count is zero.
  67. */
  68. void gen8_hwsched_active_count_put(struct adreno_device *adreno_dev);
  69. /**
  70. * gen8_hwsched_add_to_minidump - Register hwsched_device with va minidump
  71. * @adreno_dev: Pointer to the adreno device
  72. */
  73. int gen8_hwsched_add_to_minidump(struct adreno_device *adreno_dev);
  74. /**
  75. * gen8_hwsched_send_recurring_cmdobj - Dispatch IBs to GMU
  76. * @adreno_dev: Pointer to adreno device structure
  77. * @cmdobj: The command object which needs to be submitted
  78. *
  79. * This function is used to register the context if needed and submit
  80. * recurring IBs to the GMU. Upon receiving ipc interrupt GMU will submit
  81. * recurring IBs to GPU.
  82. * Return: 0 on success and negative error on failure
  83. */
  84. int gen8_hwsched_send_recurring_cmdobj(struct adreno_device *adreno_dev,
  85. struct kgsl_drawobj_cmd *cmdobj);
  86. /**
  87. * gen8_hwsched_fault - Set hwsched fault to request recovery
  88. * @adreno_dev: A handle to adreno device
  89. * @fault: The type of fault
  90. */
  91. void gen8_hwsched_fault(struct adreno_device *adreno_dev, u32 fault);
  92. #endif