public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Add support for eGPUs on Apple Products
@ 2026-02-03  7:31 Atharva Tiwari
  2026-02-03  7:31 ` [PATCH v3 1/2] efi/libstub: Enable apple-set-os for most apple devices Atharva Tiwari
  2026-02-03  7:31 ` [PATCH v3 2/2] drm/i915/display: Disable display for iMac's Atharva Tiwari
  0 siblings, 2 replies; 5+ messages in thread
From: Atharva Tiwari @ 2026-02-03  7:31 UTC (permalink / raw)
  Cc: Atharva Tiwari, Ard Biesheuvel, Jani Nikula, Rodrigo Vivi,
	Joonas Lahtinen, Tvrtko Ursulin, David Airlie, Simona Vetter,
	Thomas Zimmermann, Javier Martinez Canillas, Francesco Pompo,
	Borislav Petkov (AMD), Lenny Szubowicz, linux-efi, linux-kernel,
	intel-gfx, intel-xe, dri-devel

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/20260128145855.1071-1-atharvatiwarilinuxdev@gmail.com/#t

Link to v1:
https://lore.kernel.org/all/20260125001111.1269-1-atharvatiwarilinuxdev@gmail.com/

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

-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3 1/2] efi/libstub: Enable apple-set-os for most apple devices
  2026-02-03  7:31 [PATCH v3 0/2] Add support for eGPUs on Apple Products Atharva Tiwari
@ 2026-02-03  7:31 ` Atharva Tiwari
  2026-02-03  7:31 ` [PATCH v3 2/2] drm/i915/display: Disable display for iMac's Atharva Tiwari
  1 sibling, 0 replies; 5+ messages in thread
From: Atharva Tiwari @ 2026-02-03  7:31 UTC (permalink / raw)
  Cc: Atharva Tiwari, Ard Biesheuvel, Jani Nikula, Rodrigo Vivi,
	Joonas Lahtinen, Tvrtko Ursulin, David Airlie, Simona Vetter,
	Javier Martinez Canillas, Thomas Zimmermann, Lenny Szubowicz,
	Borislav Petkov (AMD), Francesco Pompo, linux-efi, linux-kernel,
	intel-gfx, intel-xe, dri-devel

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)

Signed-off-by: Atharva Tiwari <atharvatiwarilinuxdev@gmail.com>
---
 drivers/firmware/efi/libstub/x86-stub.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
index cef32e2c82d8..532a713adef5 100644
--- a/drivers/firmware/efi/libstub/x86-stub.c
+++ b/drivers/firmware/efi/libstub/x86-stub.c
@@ -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)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v3 2/2] drm/i915/display: Disable display for iMac's
  2026-02-03  7:31 [PATCH v3 0/2] Add support for eGPUs on Apple Products Atharva Tiwari
  2026-02-03  7:31 ` [PATCH v3 1/2] efi/libstub: Enable apple-set-os for most apple devices Atharva Tiwari
@ 2026-02-03  7:31 ` Atharva Tiwari
  2026-02-03 11:09   ` Jani Nikula
  2026-02-03 11:12   ` Ard Biesheuvel
  1 sibling, 2 replies; 5+ messages in thread
From: Atharva Tiwari @ 2026-02-03  7:31 UTC (permalink / raw)
  Cc: Atharva Tiwari, Jani Nikula, Ard Biesheuvel, Jani Nikula,
	Rodrigo Vivi, Joonas Lahtinen, Tvrtko Ursulin, David Airlie,
	Simona Vetter, Thomas Zimmermann, Javier Martinez Canillas,
	Borislav Petkov (AMD), Ingo Molnar, Francesco Pompo,
	Lenny Szubowicz, linux-efi, linux-kernel, intel-gfx, intel-xe,
	dri-devel

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

(tested on iMac20,1)

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Atharva Tiwari <atharvatiwarilinuxdev@gmail.com>
---
 .../gpu/drm/i915/display/intel_display_device.c    | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c
index 1170afaa8680..b1fec1018d7e 100644
--- a/drivers/gpu/drm/i915/display/intel_display_device.c
+++ b/drivers/gpu/drm/i915/display/intel_display_device.c
@@ -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) }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 2/2] drm/i915/display: Disable display for iMac's
  2026-02-03  7:31 ` [PATCH v3 2/2] drm/i915/display: Disable display for iMac's Atharva Tiwari
@ 2026-02-03 11:09   ` Jani Nikula
  2026-02-03 11:12   ` Ard Biesheuvel
  1 sibling, 0 replies; 5+ messages in thread
From: Jani Nikula @ 2026-02-03 11:09 UTC (permalink / raw)
  To: Atharva Tiwari
  Cc: Atharva Tiwari, Ard Biesheuvel, Rodrigo Vivi, Joonas Lahtinen,
	Tvrtko Ursulin, David Airlie, Simona Vetter, Thomas Zimmermann,
	Javier Martinez Canillas, Borislav Petkov (AMD), Ingo Molnar,
	Francesco Pompo, Lenny Szubowicz, linux-efi, linux-kernel,
	intel-gfx, intel-xe, dri-devel

On Tue, 03 Feb 2026, Atharva Tiwari <atharvatiwarilinuxdev@gmail.com> wrote:
> 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.


>
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> Signed-off-by: Atharva Tiwari <atharvatiwarilinuxdev@gmail.com>
> ---
>  .../gpu/drm/i915/display/intel_display_device.c    | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c
> index 1170afaa8680..b1fec1018d7e 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_device.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_device.c
> @@ -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) }

-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 2/2] drm/i915/display: Disable display for iMac's
  2026-02-03  7:31 ` [PATCH v3 2/2] drm/i915/display: Disable display for iMac's Atharva Tiwari
  2026-02-03 11:09   ` Jani Nikula
@ 2026-02-03 11:12   ` Ard Biesheuvel
  1 sibling, 0 replies; 5+ messages in thread
From: Ard Biesheuvel @ 2026-02-03 11:12 UTC (permalink / raw)
  To: Atharva Tiwari
  Cc: Jani Nikula, Jani Nikula, Rodrigo Vivi, Joonas Lahtinen,
	Tvrtko Ursulin, David Airlie, Simona Vetter, Thomas Zimmermann,
	Javier Martinez Canillas, Borislav Petkov (AMD), Ingo Molnar,
	Francesco Pompo, Lenny Szubowicz, linux-efi, linux-kernel,
	intel-gfx, intel-xe, dri-devel



On Tue, 3 Feb 2026, at 08:31, Atharva Tiwari wrote:
> 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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-02-03 11:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-03  7:31 [PATCH v3 0/2] Add support for eGPUs on Apple Products Atharva Tiwari
2026-02-03  7:31 ` [PATCH v3 1/2] efi/libstub: Enable apple-set-os for most apple devices Atharva Tiwari
2026-02-03  7:31 ` [PATCH v3 2/2] drm/i915/display: Disable display for iMac's Atharva Tiwari
2026-02-03 11:09   ` Jani Nikula
2026-02-03 11:12   ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox