~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/adreno-smmu-priv.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-only
  2 /*
  3  * Copyright (C) 2020 Google, Inc
  4  */
  5 
  6 #ifndef __ADRENO_SMMU_PRIV_H
  7 #define __ADRENO_SMMU_PRIV_H
  8 
  9 #include <linux/io-pgtable.h>
 10 
 11 /**
 12  * struct adreno_smmu_fault_info - container for key fault information
 13  *
 14  * @far: The faulting IOVA from ARM_SMMU_CB_FAR
 15  * @ttbr0: The current TTBR0 pagetable from ARM_SMMU_CB_TTBR0
 16  * @contextidr: The value of ARM_SMMU_CB_CONTEXTIDR
 17  * @fsr: The fault status from ARM_SMMU_CB_FSR
 18  * @fsynr0: The value of FSYNR0 from ARM_SMMU_CB_FSYNR0
 19  * @fsynr1: The value of FSYNR1 from ARM_SMMU_CB_FSYNR0
 20  * @cbfrsynra: The value of CBFRSYNRA from ARM_SMMU_GR1_CBFRSYNRA(idx)
 21  *
 22  * This struct passes back key page fault information to the GPU driver
 23  * through the get_fault_info function pointer.
 24  * The GPU driver can use this information to print informative
 25  * log messages and provide deeper GPU specific insight into the fault.
 26  */
 27 struct adreno_smmu_fault_info {
 28         u64 far;
 29         u64 ttbr0;
 30         u32 contextidr;
 31         u32 fsr;
 32         u32 fsynr0;
 33         u32 fsynr1;
 34         u32 cbfrsynra;
 35 };
 36 
 37 /**
 38  * struct adreno_smmu_priv - private interface between adreno-smmu and GPU
 39  *
 40  * @cookie:        An opque token provided by adreno-smmu and passed
 41  *                 back into the callbacks
 42  * @get_ttbr1_cfg: Get the TTBR1 config for the GPUs context-bank
 43  * @set_ttbr0_cfg: Set the TTBR0 config for the GPUs context bank.  A
 44  *                 NULL config disables TTBR0 translation, otherwise
 45  *                 TTBR0 translation is enabled with the specified cfg
 46  * @get_fault_info: Called by the GPU fault handler to get information about
 47  *                  the fault
 48  * @set_stall:     Configure whether stall on fault (CFCFG) is enabled.  Call
 49  *                 before set_ttbr0_cfg().  If stalling on fault is enabled,
 50  *                 the GPU driver must call resume_translation()
 51  * @resume_translation: Resume translation after a fault
 52  *
 53  *
 54  * The GPU driver (drm/msm) and adreno-smmu work together for controlling
 55  * the GPU's SMMU instance.  This is by necessity, as the GPU is directly
 56  * updating the SMMU for context switches, while on the other hand we do
 57  * not want to duplicate all of the initial setup logic from arm-smmu.
 58  *
 59  * This private interface is used for the two drivers to coordinate.  The
 60  * cookie and callback functions are populated when the GPU driver attaches
 61  * it's domain.
 62  */
 63 struct adreno_smmu_priv {
 64     const void *cookie;
 65     const struct io_pgtable_cfg *(*get_ttbr1_cfg)(const void *cookie);
 66     int (*set_ttbr0_cfg)(const void *cookie, const struct io_pgtable_cfg *cfg);
 67     void (*get_fault_info)(const void *cookie, struct adreno_smmu_fault_info *info);
 68     void (*set_stall)(const void *cookie, bool enabled);
 69     void (*resume_translation)(const void *cookie, bool terminate);
 70 };
 71 
 72 #endif /* __ADRENO_SMMU_PRIV_H */
 73 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php