Skip to content

Commit

Permalink
Fix 2009 patch for kernel 6.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeeq committed Jul 26, 2023
1 parent c0db79a commit bd8e280
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions 2009-apple-gmux-allow-switching-to-igpu-at-probe.patch
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ index 3fe277bc233f..ee7792a350e5 100644
@@ -2058,6 +2058,9 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
int ret, retry = 0, i;
bool supports_atomic = false;

+ if (vga_switcheroo_client_probe_defer(pdev))
+ return -EPROBE_DEFER;
+
Expand All @@ -48,7 +48,7 @@ index 365e6ddbe90f..cf357cd3389d 100644
+ if (apple_gmux_present() && !vgasr_priv.handler_flags)
return true;
}

diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index f80b6ec88dc3..952652944fbd 100644
--- a/drivers/pci/vgaarb.c
Expand All @@ -58,36 +58,36 @@ index f80b6ec88dc3..952652944fbd 100644
vga_default = pci_dev_get(pdev);
}
+EXPORT_SYMBOL_GPL(vga_set_default_device);

/**
* vga_remove_vgacon - deactivete vga console
diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c
index 4cbdc9f9bd10..008d215dd2d5 100644
--- a/drivers/platform/x86/apple-gmux.c
+++ b/drivers/platform/x86/apple-gmux.c
@@ -22,6 +22,7 @@
@@ -21,7 +21,6 @@
#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/vga_switcheroo.h>
+#include <linux/vgaarb.h>
#include <linux/debugfs.h>
#include <asm/io.h>
@@ -99,6 +100,10 @@ struct apple_gmux_config {

@@ -106,10 +105,6 @@ struct apple_gmux_config {
#define GMUX_BRIGHTNESS_MASK 0x00ffffff
#define GMUX_MAX_BRIGHTNESS GMUX_BRIGHTNESS_MASK

+static bool force_igd;
+module_param(force_igd, bool, 0);
+MODULE_PARM_DESC(force_idg, "Switch gpu to igd on module load. Make sure that you have apple-set-os set up and the iGPU is in `lspci -s 00:02.0`. (default: false) (bool)");
+
static u8 gmux_pio_read8(struct apple_gmux_data *gmux_data, int port)
{
return inb(gmux_data->iostart + port);
@@ -938,6 +943,20 @@ static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
@@ -938,19 +933,6 @@ static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
gmux_enable_interrupts(gmux_data);
gmux_read_switch_state(gmux_data);

+
+ if (force_igd) {
+ struct pci_dev *pdev;
Expand All @@ -105,6 +105,6 @@ index 4cbdc9f9bd10..008d215dd2d5 100644
/*
* Retina MacBook Pros cannot switch the panel's AUX separately
* and need eDP pre-calibration. They are distinguishable from
--
--
2.39.1

0 comments on commit bd8e280

Please sign in to comment.