diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c index 6156d8689430..c4f7ffd03987 100644 --- a/drivers/gpu/drm/xe/xe_pci.c +++ b/drivers/gpu/drm/xe/xe_pci.c @@ -813,7 +813,7 @@ static int xe_info_init_early(struct xe_device *xe, xe->info.max_gt_per_tile = desc->max_gt_per_tile; xe->info.tile_count = 1 + desc->max_remote_tiles; - xe_step_platform_get(xe); + xe_step_platform_get(xe, &xe->info.step); err = xe_tile_init_early(xe_device_get_root_tile(xe), xe, 0); if (err) @@ -965,7 +965,7 @@ static int xe_info_init(struct xe_device *xe, if (desc->pre_gmdid_graphics_ip) { graphics_ip = desc->pre_gmdid_graphics_ip; media_ip = desc->pre_gmdid_media_ip; - xe_step_pre_gmdid_get(xe); + xe_step_pre_gmdid_get(xe, &xe->info.step); } else { xe_assert(xe, !desc->pre_gmdid_media_ip); ret = handle_gmdid(xe, &graphics_ip, &media_ip, @@ -973,7 +973,7 @@ static int xe_info_init(struct xe_device *xe, if (ret) return ret; - xe_step_gmdid_get(xe, graphics_gmdid_revid, media_gmdid_revid); + xe_step_gmdid_get(xe, graphics_gmdid_revid, media_gmdid_revid, &xe->info.step); } /* diff --git a/drivers/gpu/drm/xe/xe_step.c b/drivers/gpu/drm/xe/xe_step.c index fb9c31613ca7..49dc64f2b363 100644 --- a/drivers/gpu/drm/xe/xe_step.c +++ b/drivers/gpu/drm/xe/xe_step.c @@ -111,11 +111,12 @@ __diag_pop(); /** * xe_step_platform_get - Determine platform-level stepping from PCI revid * @xe: Xe device + * @step: Pointer to the step struct to update * * Convert the PCI revid into a platform-level stepping value and store that - * in the device info. + * in @step->platform. */ -void xe_step_platform_get(struct xe_device *xe) +void xe_step_platform_get(struct xe_device *xe, struct xe_step_info *step) { /* * Not all platforms map PCI revid directly into our symbolic stepping @@ -127,17 +128,20 @@ void xe_step_platform_get(struct xe_device *xe) */ if (xe->info.platform == XE_NOVALAKE_P) - xe->info.step.platform = STEP_A0 + xe->info.revid; + step->platform = STEP_A0 + xe->info.revid; } /** * xe_step_pre_gmdid_get - Determine IP steppings from PCI revid * @xe: Xe device + * @step: Pointer to the step struct to update * - * Convert the PCI revid into proper IP steppings. This should only be - * used on platforms that do not have GMD_ID support. + * Convert the PCI revid into proper IP steppings and update @step->basedie, + * @step->graphics and @step->media accordingly. + * + * This should only be used on platforms that do not have GMD_ID support. */ -void xe_step_pre_gmdid_get(struct xe_device *xe) +void xe_step_pre_gmdid_get(struct xe_device *xe, struct xe_step_info *step) { const struct xe_step_info *revids = NULL; u16 revid = xe->info.revid; @@ -234,9 +238,9 @@ void xe_step_pre_gmdid_get(struct xe_device *xe) } done: - xe->info.step.graphics = graphics; - xe->info.step.media = media; - xe->info.step.basedie = basedie; + step->graphics = graphics; + step->media = media; + step->basedie = basedie; } /** @@ -244,8 +248,10 @@ void xe_step_pre_gmdid_get(struct xe_device *xe) * @xe: Xe device * @graphics_gmdid_revid: value of graphics GMD_ID register's revid field * @media_gmdid_revid: value of media GMD_ID register's revid field + * @step: Poninter to the step struct to update. * - * Convert the revid fields of the GMD_ID registers into proper IP steppings. + * Convert the revid fields of the GMD_ID registers into proper IP steppings + * and update @step->graphics and @step->media accordingly. * * GMD_ID revid values are currently expected to have consistent meanings on * all platforms: major steppings (A0, B0, etc.) are 4 apart, with minor @@ -253,7 +259,8 @@ void xe_step_pre_gmdid_get(struct xe_device *xe) */ void xe_step_gmdid_get(struct xe_device *xe, u32 graphics_gmdid_revid, - u32 media_gmdid_revid) + u32 media_gmdid_revid, + struct xe_step_info *step) { u8 graphics = STEP_A0 + graphics_gmdid_revid; u8 media = STEP_A0 + media_gmdid_revid; @@ -270,8 +277,8 @@ void xe_step_gmdid_get(struct xe_device *xe, media_gmdid_revid); } - xe->info.step.graphics = graphics; - xe->info.step.media = media; + step->graphics = graphics; + step->media = media; } #define STEP_NAME_CASE(name) \ diff --git a/drivers/gpu/drm/xe/xe_step.h b/drivers/gpu/drm/xe/xe_step.h index ea36b22cc297..c6cea95a3727 100644 --- a/drivers/gpu/drm/xe/xe_step.h +++ b/drivers/gpu/drm/xe/xe_step.h @@ -12,12 +12,13 @@ struct xe_device; -void xe_step_platform_get(struct xe_device *xe); +void xe_step_platform_get(struct xe_device *xe, struct xe_step_info *step); -void xe_step_pre_gmdid_get(struct xe_device *xe); +void xe_step_pre_gmdid_get(struct xe_device *xe, struct xe_step_info *step); void xe_step_gmdid_get(struct xe_device *xe, u32 graphics_gmdid_revid, - u32 media_gmdid_revid); + u32 media_gmdid_revid, + struct xe_step_info *step); static inline u32 xe_step_to_gmdid(enum intel_step step) { return step - STEP_A0; } const char *xe_step_name(enum intel_step step);