Skip to contentSkip to conversation

Add support for eGPUs on Apple Products

PATCH In review Atharva Tiwari 4 participants 6 messages Feb 3

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v3 cover Add support for eGPUs on Apple Products

This series adds support for eGPUs on Apple products, by enabling apple-set-os on all apple devices.

A side effect of this patch is that the iGPU becomes enabled on iMacs. However, iMacs can’t use the iGPU to drive the display (They can't link-train the internal display),
so displays must be disabled on iMacs.

Changes in v3:
- Disabled apple-set-os on MacBookAir6,1 and 7,1 to avoid regressions
- Reworded 1st patch
Changes in v2:
- Reworded cover-letter
- Transferred logic to has_no_display in the 2nd patch

Link to v2:
https://lore.kernel.org/all/[email protected]/#t

Link to v1:
https://lore.kernel.org/all/[email protected]/

Atharva Tiwari (2):
efi/libstub: Enable apple-set-os for most apple devices drm/i915/display: Disable display for iMac's

 drivers/firmware/efi/libstub/x86-stub.c       | 20 +++++++------------
 .../drm/i915/display/intel_display_device.c   | 14 ++++++++++++-
 2 files changed, 20 insertions(+), 14 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH v3 1/2 efi/libstub: Enable apple-set-os for most apple devices

Enable apple-set-os on Apple Mac systems by default.

Exclude MacBook6,2 and MacBookAir7,2, as enabling apple-set-os on these models causes regressions.

(tested on iMac20,1)

---
 drivers/firmware/efi/libstub/x86-stub.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)
drivers/firmware/efi/libstub/x86-stub.c +7 -13
index cef32e2c82d8..532a713adef5 100644
@@ -303,15 +303,9 @@ static const struct efi_smbios_record *get_table_record(u8 type)
 
 static bool apple_match_product_name(void)
 {
-	static const char type1_product_matches[][15] = {
-		"MacBookPro11,3",
-		"MacBookPro11,5",
-		"MacBookPro13,3",
-		"MacBookPro14,3",
-		"MacBookPro15,1",
-		"MacBookPro15,3",
-		"MacBookPro16,1",
-		"MacBookPro16,4",
+	static const char disabled_product_matches[][14] = {
+		"MacBookPro6,2",
+		"MacBookPro7,2",
 	};
 	const struct efi_smbios_type1_record *record;
 	const u8 *product;
@@ -325,12 +319,12 @@ static bool apple_match_product_name(void)
 	if (!product)
 		return false;
 
-	for (int i = 0; i < ARRAY_SIZE(type1_product_matches); i++) {
-		if (!strcmp(product, type1_product_matches[i]))
-			return true;
+	for (int i = 0; i < ARRAY_SIZE(disabled_product_matches); i++) {
+		if (!strcmp(product, disabled_product_matches[i]))
+			return false;
 	}
 
-	return false;
+	return true;
 }
 
 static void apple_set_os(void)
Signature · 1 line
2.43.0
#2 lore raw

PATCH v3 2/2 drm/i915/display: Disable display for iMac's

In reply to Atharva Tiwari

Disable display on iMacs, as they can't do link training on the internal display.

(tested on iMac20,1)

---
 .../gpu/drm/i915/display/intel_display_device.c    | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_display_device.c +13 -1
index 1170afaa8680..b1fec1018d7e 100644
@@ -3,6 +3,7 @@
  * Copyright © 2023 Intel Corporation
  */
 
+#include <linux/dmi.h>
 #include <linux/pci.h>
 
 #include <drm/drm_color_mgmt.h>
@@ -1435,7 +1436,18 @@ static bool has_no_display(struct pci_dev *pdev)
 		{}
 	};
 
-	return pci_match_id(ids, pdev);
+	static const struct dmi_system_id dmi_ids[] = {
+		{
+			.ident = "Apple Inc. iMac",
+			.matches = {
+				DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Apple Inc."),
+				DMI_MATCH(DMI_PRODUCT_NAME, "iMac"),
+			}
+		},
+		{}
+	};
+
+	return pci_match_id(ids, pdev) || dmi_check_system(dmi_ids);
 }
 
 #define INTEL_DISPLAY_DEVICE(_id, _desc) { .devid = (_id), .desc = (_desc) }
Signature · 1 line
2.43.0
#3 lore raw

Re: [PATCH v3 2/2] drm/i915/display: Disable display for iMac's

Quoted 4 lines · Atharva Tiwari

Disable display on iMacs, as they can't do link training on the internal display.

(tested on iMac20,1)

I thought there were open review comments about this. Why are you resending the same thing?

BR,
Jani.

Quoted 39 lines
---
 .../gpu/drm/i915/display/intel_display_device.c    | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_display_device.c +13 -1
index 1170afaa8680..b1fec1018d7e 100644
@@ -3,6 +3,7 @@
  * Copyright © 2023 Intel Corporation
  */
 
+#include <linux/dmi.h>
 #include <linux/pci.h>
 
 #include <drm/drm_color_mgmt.h>
@@ -1435,7 +1436,18 @@ static bool has_no_display(struct pci_dev *pdev)
 		{}
 	};
 
-	return pci_match_id(ids, pdev);
+	static const struct dmi_system_id dmi_ids[] = {
+		{
+			.ident = "Apple Inc. iMac",
+			.matches = {
+				DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Apple Inc."),
+				DMI_MATCH(DMI_PRODUCT_NAME, "iMac"),
+			}
+		},
+		{}
+	};
+
+	return pci_match_id(ids, pdev) || dmi_check_system(dmi_ids);
 }
 
 #define INTEL_DISPLAY_DEVICE(_id, _desc) { .devid = (_id), .desc = (_desc) }
Signature · 1 line
Jani Nikula, Intel
maintainer
#4 lore raw

Re: [PATCH v3 2/2] drm/i915/display: Disable display for iMac's

In reply to Atharva Tiwari
Quoted 5 lines · Atharva Tiwari

Disable display on iMacs, as they can't do link training on the internal display.

(tested on iMac20,1)

How will you use the iMac if you disable the display?

If this is not in fact what you are doing, please explain in the commit log what exactly you are disabling and why.

#5 lore raw

✗ LGCI.VerificationFailed: failure for Add support for eGPUs on Apple Products (rev3)

In reply to Atharva Tiwari
== Series Details ==

== Series Details ==

Series: Add support for eGPUs on Apple Products (rev3)
URL : https://patchwork.freedesktop.org/series/160655/
State : failure

== Summary ==

Address '[email protected]' is not on the allowlist, which prevents CI from being triggered for this patch. If you want Intel GFX CI to accept this address, please contact the script maintainers at [email protected]. Exception occurred during validation, bailing out!