Skip to content

Instantly share code, notes, and snippets.

@gma
Last active December 7, 2021 05:02
Show Gist options
  • Save gma/fcacfcf6ae7bb560f09bd525e760ec9f to your computer and use it in GitHub Desktop.
Save gma/fcacfcf6ae7bb560f09bd525e760ec9f to your computer and use it in GitHub Desktop.
Linux kernel patch for ThinkPad X230 with FHD (1080p) screen mod
diff -aur linux-5.13.0/drivers/acpi/pci_root.c linux-5.13.0-x230/drivers/acpi/pci_root.c
--- linux-5.13.0/drivers/acpi/pci_root.c 2021-09-14 20:19:11.000000000 +0100
+++ linux-5.13.0-x230/drivers/acpi/pci_root.c 2021-09-18 10:33:18.099360328 +0100
@@ -508,7 +508,6 @@
* flag here, to defer the action until after the ACPI
* root scan.
*/
- *no_aspm = 1;
}
}
@@ -604,8 +603,6 @@
goto remove_dmar;
}
- if (no_aspm)
- pcie_no_aspm();
pci_acpi_add_bus_pm_notifier(device);
device_set_wakeup_capable(root->bus->bridge, device->wakeup.flags.valid);
diff -aur linux-5.13.0/drivers/gpu/drm/i915/display/intel_dp.c linux-5.13.0-x230/drivers/gpu/drm/i915/display/intel_dp.c
--- linux-5.13.0/drivers/gpu/drm/i915/display/intel_dp.c 2021-09-14 20:19:11.000000000 +0100
+++ linux-5.13.0-x230/drivers/gpu/drm/i915/display/intel_dp.c 2021-09-18 10:33:18.103360323 +0100
@@ -102,8 +102,7 @@
bool intel_dp_is_edp(struct intel_dp *intel_dp)
{
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
-
- return dig_port->base.type == INTEL_OUTPUT_EDP;
+ return dig_port->base.type == INTEL_OUTPUT_EDP || strncmp(intel_dp->attached_connector->base.name, "DP-3", 4) == 0;
}
static void intel_dp_unset_edid(struct intel_dp *intel_dp);
@@ -4652,7 +4651,7 @@
if (DISPLAY_VER(dev_priv) < 5)
return false;
- if (DISPLAY_VER(dev_priv) < 9 && port == PORT_A)
+ if (DISPLAY_VER(dev_priv) < 9 && port == PORT_D)
return true;
return intel_bios_is_port_edp(dev_priv, port);
diff -aur linux-5.13.0/drivers/gpu/drm/i915/display/intel_lvds.c linux-5.13.0-x230/drivers/gpu/drm/i915/display/intel_lvds.c
--- linux-5.13.0/drivers/gpu/drm/i915/display/intel_lvds.c 2021-09-14 20:19:11.000000000 +0100
+++ linux-5.13.0-x230/drivers/gpu/drm/i915/display/intel_lvds.c 2021-09-18 10:46:34.247274650 +0100
@@ -723,6 +723,14 @@
DMI_MATCH(DMI_PRODUCT_NAME, "P845"),
},
},
+ {
+ .callback = intel_no_lvds_dmi_callback,
+ .ident = "Modified ThinkPad X230",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "2324B14"),
+ },
+ },
{ } /* terminating entry */
};
diff -aur linux-5.13.0/drivers/pci/pci-acpi.c linux-5.13.0-x230/drivers/pci/pci-acpi.c
--- linux-5.13.0/drivers/pci/pci-acpi.c 2021-09-14 20:19:11.000000000 +0100
+++ linux-5.13.0-x230/drivers/pci/pci-acpi.c 2021-09-18 10:33:18.103360323 +0100
@@ -1372,8 +1372,7 @@
}
if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) {
- pr_info("ACPI FADT declares the system doesn't support PCIe ASPM, so disable it\n");
- pcie_no_aspm();
+ pr_info("ACPI FADT declares the system doesn't support PCIe ASPM, but we ignore that on this X230\n");
}
ret = register_acpi_bus_type(&acpi_pci_bus);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment