adreno-smmu-priv.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (C) 2020 Google, Inc
  4. */
  5. #ifndef __ADRENO_SMMU_PRIV_H
  6. #define __ADRENO_SMMU_PRIV_H
  7. #include <linux/io-pgtable.h>
  8. /**
  9. * struct adreno_smmu_priv - private interface between adreno-smmu and GPU
  10. *
  11. * @cookie: An opque token provided by adreno-smmu and passed
  12. * back into the callbacks
  13. * @get_ttbr1_cfg: Get the TTBR1 config for the GPUs context-bank
  14. * @set_ttbr0_cfg: Set the TTBR0 config for the GPUs context bank. A
  15. * NULL config disables TTBR0 translation, otherwise
  16. * TTBR0 translation is enabled with the specified cfg
  17. *
  18. * The GPU driver (drm/msm) and adreno-smmu work together for controlling
  19. * the GPU's SMMU instance. This is by necessity, as the GPU is directly
  20. * updating the SMMU for context switches, while on the other hand we do
  21. * not want to duplicate all of the initial setup logic from arm-smmu.
  22. *
  23. * This private interface is used for the two drivers to coordinate. The
  24. * cookie and callback functions are populated when the GPU driver attaches
  25. * it's domain.
  26. */
  27. struct adreno_smmu_priv {
  28. const void *cookie;
  29. const struct io_pgtable_cfg *(*get_ttbr1_cfg)(const void *cookie);
  30. int (*set_ttbr0_cfg)(const void *cookie, const struct io_pgtable_cfg *cfg);
  31. };
  32. #endif /* __ADRENO_SMMU_PRIV_H */