diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2023-05-26 09:43:39 -0700 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-19 18:34:01 -0500 |
commit | 72906d340b60f3dae545deef77376a0f598bece7 (patch) | |
tree | 9c138c8196ad81402804fcbf5ecbccc102a2f212 /drivers/gpu/drm/xe/xe_wa.c | |
parent | a9bd807eb16be11e11f6c6d3921119381cc43135 (diff) | |
download | lwn-72906d340b60f3dae545deef77376a0f598bece7.tar.gz lwn-72906d340b60f3dae545deef77376a0f598bece7.zip |
drm/xe/rtp: Split rtp process initialization
The selection between hwe and gt is exposed to the outside of rtp, by
the xe_rtp_process() function. However it doesn't make seense from the
caller point of view to pass a hwe and a gt as argument since the gt
should always be the one containing the hwe.
This clarifies the interface by separating the context creation into an
initializer. The initializer then passes the correct value and there
should never be a case with hwe and gt set: when hwe is passed, the gt
is the one containing it. Internally the functions continue receiving
the argument separately.
v2: Leave the device-only context to a separate patch if they are indeed
needed later
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://lore.kernel.org/r/20230526164358.86393-3-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_wa.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_wa.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/xe/xe_wa.c b/drivers/gpu/drm/xe/xe_wa.c index b0bb2f4438f4..4b236b6f4c8e 100644 --- a/drivers/gpu/drm/xe/xe_wa.c +++ b/drivers/gpu/drm/xe/xe_wa.c @@ -579,7 +579,9 @@ __diag_pop(); */ void xe_wa_process_gt(struct xe_gt *gt) { - xe_rtp_process(gt_was, >->reg_sr, gt, NULL); + struct xe_rtp_process_ctx ctx = XE_RTP_PROCESS_CTX_INITIALIZER(gt); + + xe_rtp_process(&ctx, gt_was, >->reg_sr); } EXPORT_SYMBOL_IF_KUNIT(xe_wa_process_gt); @@ -593,7 +595,9 @@ EXPORT_SYMBOL_IF_KUNIT(xe_wa_process_gt); */ void xe_wa_process_engine(struct xe_hw_engine *hwe) { - xe_rtp_process(engine_was, &hwe->reg_sr, hwe->gt, hwe); + struct xe_rtp_process_ctx ctx = XE_RTP_PROCESS_CTX_INITIALIZER(hwe); + + xe_rtp_process(&ctx, engine_was, &hwe->reg_sr); } /** @@ -606,5 +610,7 @@ void xe_wa_process_engine(struct xe_hw_engine *hwe) */ void xe_wa_process_lrc(struct xe_hw_engine *hwe) { - xe_rtp_process(lrc_was, &hwe->reg_lrc, hwe->gt, hwe); + struct xe_rtp_process_ctx ctx = XE_RTP_PROCESS_CTX_INITIALIZER(hwe); + + xe_rtp_process(&ctx, lrc_was, &hwe->reg_lrc); } |