drm/xe/vf: Setup VRAM based on received config data
VF drivers will obtain VRAM configuration from the GuC as part of the VF self config. Use that configuration instead of trying to read inaccessible registers. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240530133527.1328-6-michal.wajdeczko@intel.com
This commit is contained in:
parent
638d1c79cb
commit
9d85821a58
@ -478,6 +478,23 @@ u16 xe_gt_sriov_vf_guc_ids(struct xe_gt *gt)
|
||||
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;
|
||||
|
@ -20,6 +20,7 @@ int xe_gt_sriov_vf_prepare_ggtt(struct xe_gt *gt);
|
||||
|
||||
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);
|
||||
|
@ -15,8 +15,10 @@
|
||||
#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
|
||||
@ -220,6 +222,22 @@ static int tile_vram_size(struct xe_tile *tile, u64 *vram_size,
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user