Skip to content

Commit

Permalink
drm/xe/huc: Realloc HuC FW in vram for post-hwconfig
Browse files Browse the repository at this point in the history
Similar to GuC, we're using system memory for the initial stage, and
move the image to vram when it's available for subsequent loads (e.g.
after reset).

Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240219130530.1406044-2-michal.winiarski@intel.com
  • Loading branch information
Michał Winiarski authored and Rodrigo Vivi committed Feb 20, 2024
1 parent a44bbac commit 7606f7d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
19 changes: 19 additions & 0 deletions drivers/gpu/drm/xe/xe_huc.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,25 @@ int xe_huc_init(struct xe_huc *huc)
return ret;
}

int xe_huc_init_post_hwconfig(struct xe_huc *huc)
{
struct xe_tile *tile = gt_to_tile(huc_to_gt(huc));
struct xe_device *xe = huc_to_xe(huc);
int ret;

if (!IS_DGFX(huc_to_xe(huc)))
return 0;

if (!xe_uc_fw_is_loadable(&huc->fw))
return 0;

ret = xe_managed_bo_reinit_in_vram(xe, tile, &huc->fw.bo);
if (ret)
return ret;

return 0;
}

int xe_huc_upload(struct xe_huc *huc)
{
if (!xe_uc_fw_is_loadable(&huc->fw))
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/xe/xe_huc.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ enum xe_huc_auth_types {
};

int xe_huc_init(struct xe_huc *huc);
int xe_huc_init_post_hwconfig(struct xe_huc *huc);
int xe_huc_upload(struct xe_huc *huc);
int xe_huc_auth(struct xe_huc *huc, enum xe_huc_auth_types type);
bool xe_huc_is_authenticated(struct xe_huc *huc, enum xe_huc_auth_types type);
Expand Down
4 changes: 4 additions & 0 deletions drivers/gpu/drm/xe/xe_uc.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ int xe_uc_init_post_hwconfig(struct xe_uc *uc)
if (err)
return err;

err = xe_huc_init_post_hwconfig(&uc->huc);
if (err)
return err;

return xe_gsc_init_post_hwconfig(&uc->gsc);
}

Expand Down

0 comments on commit 7606f7d

Please sign in to comment.