adreno_a3xx.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2013-2016, 2019-2020, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef __A3XX_H
  7. #define __A3XX_H
  8. #include "a3xx_reg.h"
  9. /**
  10. * struct adreno_a3xx_core - a3xx specific GPU core definitions
  11. */
  12. struct adreno_a3xx_core {
  13. /** @base: Container for the generic &struct adreno_gpu_core */
  14. struct adreno_gpu_core base;
  15. /** pm4fw_name: Name of the PM4 microcode file */
  16. const char *pm4fw_name;
  17. /** pfpfw_name: Name of the PFP microcode file */
  18. const char *pfpfw_name;
  19. /** @vbif: List of registers and values to write for VBIF */
  20. const struct kgsl_regmap_list *vbif;
  21. /** @vbif_count: Number of registers in @vbif */
  22. u32 vbif_count;
  23. };
  24. struct adreno_device;
  25. /**
  26. * to_a3xx_core - return the a3xx specific GPU core struct
  27. * @adreno_dev: An Adreno GPU device handle
  28. *
  29. * Returns:
  30. * A pointer to the a3xx specific GPU core struct
  31. */
  32. static inline const struct adreno_a3xx_core *
  33. to_a3xx_core(struct adreno_device *adreno_dev)
  34. {
  35. const struct adreno_gpu_core *core = adreno_dev->gpucore;
  36. return container_of(core, struct adreno_a3xx_core, base);
  37. }
  38. void a3xx_snapshot(struct adreno_device *adreno_dev,
  39. struct kgsl_snapshot *snapshot);
  40. extern const struct adreno_perfcounters adreno_a3xx_perfcounters;
  41. /**
  42. * a3xx_ringbuffer_init - Initialize the ringbuffer
  43. * @adreno_dev: An Adreno GPU handle
  44. *
  45. * Initialize the ringbuffer for a3xx.
  46. * Return: 0 on success or negative on failure
  47. */
  48. int a3xx_ringbuffer_init(struct adreno_device *adreno_dev);
  49. /**
  50. * a3xx_ringbuffer_submitcmd - Submit a user command to the ringbuffer
  51. * @adreno_dev: An Adreno GPU handle
  52. * @cmdobj: Pointer to a user command object
  53. * @flags: Internal submit flags
  54. * @time: Optional pointer to a adreno_submit_time container
  55. *
  56. * Return: 0 on success or negative on failure
  57. */
  58. int a3xx_ringbuffer_submitcmd(struct adreno_device *adreno_dev,
  59. struct kgsl_drawobj_cmd *cmdobj, u32 flags,
  60. struct adreno_submit_time *time);
  61. #ifdef CONFIG_QCOM_KGSL_CORESIGHT
  62. void a3xx_coresight_init(struct adreno_device *device);
  63. #else
  64. static inline void a3xx_coresight_init(struct adreno_device *device) { }
  65. #endif
  66. #endif /*__A3XX_H */