Skip to content

Commit 2955ae8

Browse files
johnharr-inteljlahtine-intel
authored andcommitted
drm/i915: ARL requires a newer GSC firmware
ARL and MTL share a single GSC firmware blob. However, ARL requires a newer version of it. So add differentiate of the PCI ids for ARL from MTL and create ARL as a sub-platform of MTL. That way, all the existing workarounds and such still treat ARL as MTL exactly as before. However, now the GSC code can check for ARL and do an extra version check on the firmware before committing to it. Also, the version extraction code has various ways of failing but the return code was being ignore and so the firmware load would attempt to continue anyway. Fix that by propagating the return code to the next level out. Signed-off-by: John Harrison <[email protected]> Fixes: 213c436 ("drm/i915/mtl: Remove the 'force_probe' requirement for Meteor Lake") Reviewed-by: Daniele Ceraolo Spurio <[email protected]> Acked-by: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Rodrigo Vivi <[email protected]> (cherry picked from commit 67733d7) Signed-off-by: Joonas Lahtinen <[email protected]>
1 parent 7d058e6 commit 2955ae8

File tree

6 files changed

+58
-6
lines changed

6 files changed

+58
-6
lines changed

drivers/gpu/drm/i915/gt/uc/intel_gsc_fw.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,37 @@ int intel_gsc_fw_get_binary_info(struct intel_uc_fw *gsc_fw, const void *data, s
212212
}
213213
}
214214

215+
if (IS_ARROWLAKE(gt->i915)) {
216+
bool too_old = false;
217+
218+
/*
219+
* ARL requires a newer firmware than MTL did (102.0.10.1878) but the
220+
* firmware is actually common. So, need to do an explicit version check
221+
* here rather than using a separate table entry. And if the older
222+
* MTL-only version is found, then just don't use GSC rather than aborting
223+
* the driver load.
224+
*/
225+
if (gsc->release.major < 102) {
226+
too_old = true;
227+
} else if (gsc->release.major == 102) {
228+
if (gsc->release.minor == 0) {
229+
if (gsc->release.patch < 10) {
230+
too_old = true;
231+
} else if (gsc->release.patch == 10) {
232+
if (gsc->release.build < 1878)
233+
too_old = true;
234+
}
235+
}
236+
}
237+
238+
if (too_old) {
239+
gt_info(gt, "GSC firmware too old for ARL, got %d.%d.%d.%d but need at least 102.0.10.1878",
240+
gsc->release.major, gsc->release.minor,
241+
gsc->release.patch, gsc->release.build);
242+
return -EINVAL;
243+
}
244+
}
245+
215246
return 0;
216247
}
217248

drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,12 +698,18 @@ static int check_gsc_manifest(struct intel_gt *gt,
698698
const struct firmware *fw,
699699
struct intel_uc_fw *uc_fw)
700700
{
701+
int ret;
702+
701703
switch (uc_fw->type) {
702704
case INTEL_UC_FW_TYPE_HUC:
703-
intel_huc_fw_get_binary_info(uc_fw, fw->data, fw->size);
705+
ret = intel_huc_fw_get_binary_info(uc_fw, fw->data, fw->size);
706+
if (ret)
707+
return ret;
704708
break;
705709
case INTEL_UC_FW_TYPE_GSC:
706-
intel_gsc_fw_get_binary_info(uc_fw, fw->data, fw->size);
710+
ret = intel_gsc_fw_get_binary_info(uc_fw, fw->data, fw->size);
711+
if (ret)
712+
return ret;
707713
break;
708714
default:
709715
MISSING_CASE(uc_fw->type);

drivers/gpu/drm/i915/i915_drv.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,8 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
546546
#define IS_LUNARLAKE(i915) (0 && i915)
547547
#define IS_BATTLEMAGE(i915) (0 && i915)
548548

549+
#define IS_ARROWLAKE(i915) \
550+
IS_SUBPLATFORM(i915, INTEL_METEORLAKE, INTEL_SUBPLATFORM_ARL)
549551
#define IS_DG2_G10(i915) \
550552
IS_SUBPLATFORM(i915, INTEL_DG2, INTEL_SUBPLATFORM_G10)
551553
#define IS_DG2_G11(i915) \

drivers/gpu/drm/i915/intel_device_info.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ static const u16 subplatform_g12_ids[] = {
203203
INTEL_DG2_G12_IDS(ID),
204204
};
205205

206+
static const u16 subplatform_arl_ids[] = {
207+
INTEL_ARL_IDS(ID),
208+
};
209+
206210
static bool find_devid(u16 id, const u16 *p, unsigned int num)
207211
{
208212
for (; num; num--, p++) {
@@ -260,6 +264,9 @@ static void intel_device_info_subplatform_init(struct drm_i915_private *i915)
260264
} else if (find_devid(devid, subplatform_g12_ids,
261265
ARRAY_SIZE(subplatform_g12_ids))) {
262266
mask = BIT(INTEL_SUBPLATFORM_G12);
267+
} else if (find_devid(devid, subplatform_arl_ids,
268+
ARRAY_SIZE(subplatform_arl_ids))) {
269+
mask = BIT(INTEL_SUBPLATFORM_ARL);
263270
}
264271

265272
GEM_BUG_ON(mask & ~INTEL_SUBPLATFORM_MASK);

drivers/gpu/drm/i915/intel_device_info.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ enum intel_platform {
127127
#define INTEL_SUBPLATFORM_N 1
128128
#define INTEL_SUBPLATFORM_RPLU 2
129129

130+
/* MTL */
131+
#define INTEL_SUBPLATFORM_ARL 0
132+
130133
enum intel_ppgtt_type {
131134
INTEL_PPGTT_NONE = I915_GEM_PPGTT_NONE,
132135
INTEL_PPGTT_ALIASING = I915_GEM_PPGTT_ALIASING,

include/drm/intel/i915_pciids.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -772,15 +772,18 @@
772772
INTEL_ATS_M75_IDS(MACRO__, ## __VA_ARGS__)
773773

774774
/* MTL */
775+
#define INTEL_ARL_IDS(MACRO__, ...) \
776+
MACRO__(0x7D41, ## __VA_ARGS__), \
777+
MACRO__(0x7D51, ## __VA_ARGS__), \
778+
MACRO__(0x7D67, ## __VA_ARGS__), \
779+
MACRO__(0x7DD1, ## __VA_ARGS__)
780+
775781
#define INTEL_MTL_IDS(MACRO__, ...) \
782+
INTEL_ARL_IDS(MACRO__, ## __VA_ARGS__), \
776783
MACRO__(0x7D40, ## __VA_ARGS__), \
777-
MACRO__(0x7D41, ## __VA_ARGS__), \
778784
MACRO__(0x7D45, ## __VA_ARGS__), \
779-
MACRO__(0x7D51, ## __VA_ARGS__), \
780785
MACRO__(0x7D55, ## __VA_ARGS__), \
781786
MACRO__(0x7D60, ## __VA_ARGS__), \
782-
MACRO__(0x7D67, ## __VA_ARGS__), \
783-
MACRO__(0x7DD1, ## __VA_ARGS__), \
784787
MACRO__(0x7DD5, ## __VA_ARGS__)
785788

786789
/* LNL */

0 commit comments

Comments
 (0)