#ifndef _GVT_GTT_H_
#define _GVT_GTT_H_
#include <linux/kernel.h>
#include <linux/kref.h>
#include <linux/mutex.h>
#include <linux/radix-tree.h>
#include "gt/intel_gtt.h"
struct intel_gvt;
struct intel_vgpu;
struct intel_vgpu_mm;
#define I915_GTT_PAGE_SHIFT …
#define INTEL_GVT_INVALID_ADDR …
struct intel_gvt_gtt_entry { … };
struct intel_gvt_gtt_pte_ops { … };
struct intel_gvt_gtt_gma_ops { … };
struct intel_gvt_gtt { … };
enum intel_gvt_gtt_type { … };
enum intel_gvt_mm_type { … };
#define GVT_RING_CTX_NR_PDPS …
struct intel_gvt_partial_pte { … };
struct intel_vgpu_mm { … };
struct intel_vgpu_mm *intel_vgpu_create_ppgtt_mm(struct intel_vgpu *vgpu,
enum intel_gvt_gtt_type root_entry_type, u64 pdps[]);
static inline void intel_vgpu_mm_get(struct intel_vgpu_mm *mm)
{ … }
void _intel_vgpu_mm_release(struct kref *mm_ref);
static inline void intel_vgpu_mm_put(struct intel_vgpu_mm *mm)
{ … }
static inline void intel_vgpu_destroy_mm(struct intel_vgpu_mm *mm)
{ … }
struct intel_vgpu_guest_page;
struct intel_vgpu_scratch_pt { … };
struct intel_vgpu_gtt { … };
int intel_vgpu_init_gtt(struct intel_vgpu *vgpu);
void intel_vgpu_clean_gtt(struct intel_vgpu *vgpu);
void intel_vgpu_reset_ggtt(struct intel_vgpu *vgpu, bool invalidate_old);
void intel_vgpu_invalidate_ppgtt(struct intel_vgpu *vgpu);
int intel_gvt_init_gtt(struct intel_gvt *gvt);
void intel_gvt_clean_gtt(struct intel_gvt *gvt);
struct intel_vgpu_mm *intel_gvt_find_ppgtt_mm(struct intel_vgpu *vgpu,
int page_table_level,
void *root_entry);
struct intel_vgpu_oos_page { … };
#define GTT_ENTRY_NUM_IN_ONE_PAGE …
struct intel_vgpu_ppgtt_spt { … };
int intel_vgpu_sync_oos_pages(struct intel_vgpu *vgpu);
int intel_vgpu_flush_post_shadow(struct intel_vgpu *vgpu);
int intel_vgpu_pin_mm(struct intel_vgpu_mm *mm);
void intel_vgpu_unpin_mm(struct intel_vgpu_mm *mm);
unsigned long intel_vgpu_gma_to_gpa(struct intel_vgpu_mm *mm,
unsigned long gma);
struct intel_vgpu_mm *intel_vgpu_find_ppgtt_mm(struct intel_vgpu *vgpu,
u64 pdps[]);
struct intel_vgpu_mm *intel_vgpu_get_ppgtt_mm(struct intel_vgpu *vgpu,
enum intel_gvt_gtt_type root_entry_type, u64 pdps[]);
int intel_vgpu_put_ppgtt_mm(struct intel_vgpu *vgpu, u64 pdps[]);
int intel_vgpu_emulate_ggtt_mmio_read(struct intel_vgpu *vgpu,
unsigned int off, void *p_data, unsigned int bytes);
int intel_vgpu_emulate_ggtt_mmio_write(struct intel_vgpu *vgpu,
unsigned int off, void *p_data, unsigned int bytes);
void intel_vgpu_destroy_all_ppgtt_mm(struct intel_vgpu *vgpu);
void intel_gvt_restore_ggtt(struct intel_gvt *gvt);
#endif