mirror of
https://github.com/torvalds/linux.git
synced 2026-05-03 14:02:43 -04:00
The GSC FW load is a slow process (up to 250 ms), so we defer it to a dedicated worker to avoid stalling the init flow for that long. However, we currently start this worker before the HW init is complete, so there is a chance that the GSC loading code submits to the HW before the engine initialization has completed. We can easily fix this by starting the thread later in the gt_resume flow. From this later spot, the GSC code can still race with the default submission code; we functionally don't care who wins the race (the GSC load doesn't need any state), but since the whole point of the separate worker is to make the main thread faster, we prefer the default submission code to run first. Therefore, make an exception for driver probe and only and start the gsc load from uc_init_late. Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Alan Previn <alan.previn.teres.alexis@intel.com> Reviewed-by: Alan Previn <alan.previn.teres.alexis@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230223172120.3304293-3-daniele.ceraolospurio@intel.com
50 lines
1.3 KiB
C
50 lines
1.3 KiB
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2022 Intel Corporation
|
|
*/
|
|
|
|
#ifndef _INTEL_GSC_UC_H_
|
|
#define _INTEL_GSC_UC_H_
|
|
|
|
#include "intel_uc_fw.h"
|
|
|
|
struct i915_vma;
|
|
struct intel_context;
|
|
|
|
struct intel_gsc_uc {
|
|
/* Generic uC firmware management */
|
|
struct intel_uc_fw fw;
|
|
|
|
/* GSC-specific additions */
|
|
struct i915_vma *local; /* private memory for GSC usage */
|
|
struct intel_context *ce; /* for submission to GSC FW via GSC engine */
|
|
|
|
struct work_struct work; /* for delayed load */
|
|
};
|
|
|
|
void intel_gsc_uc_init_early(struct intel_gsc_uc *gsc);
|
|
int intel_gsc_uc_init(struct intel_gsc_uc *gsc);
|
|
void intel_gsc_uc_fini(struct intel_gsc_uc *gsc);
|
|
void intel_gsc_uc_suspend(struct intel_gsc_uc *gsc);
|
|
void intel_gsc_uc_resume(struct intel_gsc_uc *gsc);
|
|
void intel_gsc_uc_flush_work(struct intel_gsc_uc *gsc);
|
|
void intel_gsc_uc_load_start(struct intel_gsc_uc *gsc);
|
|
|
|
static inline bool intel_gsc_uc_is_supported(struct intel_gsc_uc *gsc)
|
|
{
|
|
return intel_uc_fw_is_supported(&gsc->fw);
|
|
}
|
|
|
|
static inline bool intel_gsc_uc_is_wanted(struct intel_gsc_uc *gsc)
|
|
{
|
|
return intel_uc_fw_is_enabled(&gsc->fw);
|
|
}
|
|
|
|
static inline bool intel_gsc_uc_is_used(struct intel_gsc_uc *gsc)
|
|
{
|
|
GEM_BUG_ON(__intel_uc_fw_status(&gsc->fw) == INTEL_UC_FIRMWARE_SELECTED);
|
|
return intel_uc_fw_is_available(&gsc->fw);
|
|
}
|
|
|
|
#endif
|