diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2023-09-27 22:38:54 +0300 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-21 19:41:19 +0300 |
commit | 0e5e77bd9704edf1713ebed37e2da1b4faa25a52 (patch) | |
tree | 25f7f60928c4a5fa53afe9e7250dce2c90898330 /drivers/gpu/drm/xe/xe_pt_types.h | |
parent | b3bb7d9c561d664707717f8887b665ce8fef69ff (diff) | |
download | linux-0e5e77bd9704edf1713ebed37e2da1b4faa25a52.tar.xz |
drm/xe: Use vfunc for pte/pde ppgtt encoding
Move the function to encode pte/pde to be vfuncs inside struct xe_vm.
This will allow to easily extend to platforms that don't have a
compatible encoding.
v2: Fix kunit build
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://lore.kernel.org/r/20230927193902.2849159-4-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_pt_types.h')
-rw-r--r-- | drivers/gpu/drm/xe/xe_pt_types.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_pt_types.h b/drivers/gpu/drm/xe/xe_pt_types.h index 2ed64c0a4485..c58f6926fabf 100644 --- a/drivers/gpu/drm/xe/xe_pt_types.h +++ b/drivers/gpu/drm/xe/xe_pt_types.h @@ -6,8 +6,13 @@ #ifndef _XE_PT_TYPES_H_ #define _XE_PT_TYPES_H_ +#include <linux/types.h> + #include "xe_pt_walk.h" +struct xe_bo; +struct xe_vma; + enum xe_cache_level { XE_CACHE_NONE, XE_CACHE_WT, @@ -29,6 +34,15 @@ struct xe_pt { #endif }; +struct xe_pt_ops { + u64 (*pte_encode_bo)(struct xe_bo *bo, u64 bo_offset, + enum xe_cache_level cache, u32 pt_level); + u64 (*pte_encode_vma)(u64 pte, struct xe_vma *vma, + enum xe_cache_level cache, u32 pt_level); + u64 (*pde_encode_bo)(struct xe_bo *bo, u64 bo_offset, + const enum xe_cache_level cache); +}; + struct xe_pt_entry { struct xe_pt *pt; u64 pte; |