Skip to content

Commit

Permalink
drm/xe/vf: Custom uC initialization
Browse files Browse the repository at this point in the history
VF drivers can't modify WOPCM registers nor upload firmwares to
GuC, HuC or GSC.  Modify xe_uc initialization functions to skip
those steps if running in the VF mode, or defer to a new custom
helper function that would not include those steps.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240604212231.1416-3-michal.wajdeczko@intel.com
  • Loading branch information
Michal Wajdeczko committed Jun 6, 2024
1 parent 05e49e0 commit d9cf98e
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions drivers/gpu/drm/xe/xe_uc.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
#include "xe_gsc_proxy.h"
#include "xe_gt.h"
#include "xe_gt_printk.h"
#include "xe_gt_sriov_vf.h"
#include "xe_guc.h"
#include "xe_guc_pc.h"
#include "xe_huc.h"
#include "xe_sriov.h"
#include "xe_uc_fw.h"
#include "xe_wopcm.h"

Expand Down Expand Up @@ -53,6 +55,9 @@ int xe_uc_init(struct xe_uc *uc)
if (!xe_device_uc_enabled(uc_to_xe(uc)))
return 0;

if (IS_SRIOV_VF(uc_to_xe(uc)))
return 0;

ret = xe_wopcm_init(&uc->wopcm);
if (ret)
goto err;
Expand Down Expand Up @@ -141,6 +146,31 @@ int xe_uc_init_hwconfig(struct xe_uc *uc)
return 0;
}

static int vf_uc_init_hw(struct xe_uc *uc)
{
int err;

err = xe_uc_sanitize_reset(uc);
if (err)
return err;

err = xe_guc_enable_communication(&uc->guc);
if (err)
return err;

err = xe_gt_sriov_vf_connect(uc_to_gt(uc));
if (err)
return err;

uc->guc.submission_state.enabled = true;

err = xe_gt_record_default_lrcs(uc_to_gt(uc));
if (err)
return err;

return 0;
}

/*
* Should be called during driver load, after every GT reset, and after every
* suspend to reload / auth the firmwares.
Expand All @@ -153,6 +183,9 @@ int xe_uc_init_hw(struct xe_uc *uc)
if (!xe_device_uc_enabled(uc_to_xe(uc)))
return 0;

if (IS_SRIOV_VF(uc_to_xe(uc)))
return vf_uc_init_hw(uc);

ret = xe_huc_upload(&uc->huc);
if (ret)
return ret;
Expand Down

0 comments on commit d9cf98e

Please sign in to comment.