Skip to content

Commit 67733d7

Browse files
johnharr-intelrodrigovivi
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]>
1 parent 594cf78 commit 67733d7

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
@@ -536,6 +536,8 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
536536
#define IS_LUNARLAKE(i915) (0 && i915)
537537
#define IS_BATTLEMAGE(i915) (0 && i915)
538538

539+
#define IS_ARROWLAKE(i915) \
540+
IS_SUBPLATFORM(i915, INTEL_METEORLAKE, INTEL_SUBPLATFORM_ARL)
539541
#define IS_DG2_G10(i915) \
540542
IS_SUBPLATFORM(i915, INTEL_DG2, INTEL_SUBPLATFORM_G10)
541543
#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
@@ -200,6 +200,10 @@ static const u16 subplatform_g12_ids[] = {
200200
INTEL_DG2_G12_IDS(ID),
201201
};
202202

203+
static const u16 subplatform_arl_ids[] = {
204+
INTEL_ARL_IDS(ID),
205+
};
206+
203207
static bool find_devid(u16 id, const u16 *p, unsigned int num)
204208
{
205209
for (; num; num--, p++) {
@@ -257,6 +261,9 @@ static void intel_device_info_subplatform_init(struct drm_i915_private *i915)
257261
} else if (find_devid(devid, subplatform_g12_ids,
258262
ARRAY_SIZE(subplatform_g12_ids))) {
259263
mask = BIT(INTEL_SUBPLATFORM_G12);
264+
} else if (find_devid(devid, subplatform_arl_ids,
265+
ARRAY_SIZE(subplatform_arl_ids))) {
266+
mask = BIT(INTEL_SUBPLATFORM_ARL);
260267
}
261268

262269
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)