return gt->sriov.vf.self_config.num_ctxs;
}
+/**
+ * xe_gt_sriov_vf_lmem - VF LMEM configuration.
+ * @gt: the &xe_gt
+ *
+ * This function is for VF use only.
+ *
+ * Return: size of the LMEM assigned to VF.
+ */
+u64 xe_gt_sriov_vf_lmem(struct xe_gt *gt)
+{
+ xe_gt_assert(gt, IS_SRIOV_VF(gt_to_xe(gt)));
+ xe_gt_assert(gt, gt->sriov.vf.guc_version.major);
+ xe_gt_assert(gt, gt->sriov.vf.self_config.lmem_size);
+
+ return gt->sriov.vf.self_config.lmem_size;
+}
+
static int vf_balloon_ggtt(struct xe_gt *gt)
{
struct xe_gt_sriov_vf_selfconfig *config = >->sriov.vf.self_config;
u32 xe_gt_sriov_vf_gmdid(struct xe_gt *gt);
u16 xe_gt_sriov_vf_guc_ids(struct xe_gt *gt);
+u64 xe_gt_sriov_vf_lmem(struct xe_gt *gt);
u32 xe_gt_sriov_vf_read32(struct xe_gt *gt, struct xe_reg reg);
void xe_gt_sriov_vf_print_config(struct xe_gt *gt, struct drm_printer *p);
#include "xe_device.h"
#include "xe_force_wake.h"
#include "xe_gt_mcr.h"
+#include "xe_gt_sriov_vf.h"
#include "xe_mmio.h"
#include "xe_module.h"
+#include "xe_sriov.h"
#include "xe_vram.h"
#define BAR_SIZE_SHIFT 20
int err;
u32 reg;
+ if (IS_SRIOV_VF(xe)) {
+ struct xe_tile *t;
+ int id;
+
+ offset = 0;
+ for_each_tile(t, xe, id)
+ for_each_if(t->id < tile->id)
+ offset += xe_gt_sriov_vf_lmem(t->primary_gt);
+
+ *tile_size = xe_gt_sriov_vf_lmem(gt);
+ *vram_size = *tile_size;
+ *tile_offset = offset;
+
+ return 0;
+ }
+
err = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
if (err)
return err;