Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save harrykipper/06dda2bb44a600c0e3b46ee0b90216c7 to your computer and use it in GitHub Desktop.
Save harrykipper/06dda2bb44a600c0e3b46ee0b90216c7 to your computer and use it in GitHub Desktop.
Thinkpad X230 FHD kernel patch
diff -Naur linux-4.11-orig/drivers/acpi/pci_root.c linux-4.11/drivers/acpi/pci_root.c
--- linux-4.11-orig/drivers/acpi/pci_root.c 2017-05-22 00:51:27.556822660 +0200
+++ linux-4.11/drivers/acpi/pci_root.c 2017-05-22 00:54:13.046343220 +0200
@@ -500,7 +500,7 @@
} else {
decode_osc_control(root, "OS requested", requested);
decode_osc_control(root, "platform willing to grant", control);
- dev_info(&device->dev, "_OSC failed (%s); disabling ASPM\n",
+ dev_info(&device->dev, "_OSC failed (%s); we keep ASPM on anyway\n",
acpi_format_exception(status));
/*
@@ -510,7 +510,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);
if (device->wakeup.flags.run_wake)
diff -Naur linux-4.11-orig/drivers/gpu/drm/i915/intel_dp.c linux-4.11/drivers/gpu/drm/i915/intel_dp.c
--- linux-4.11-orig/drivers/gpu/drm/i915/intel_dp.c 2017-05-22 00:51:39.207394705 +0200
+++ linux-4.11/drivers/gpu/drm/i915/intel_dp.c 2017-05-22 00:54:51.178800184 +0200
@@ -107,8 +107,7 @@
static bool is_edp(struct intel_dp *intel_dp)
{
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
-
- return intel_dig_port->base.type == INTEL_OUTPUT_EDP;
+ return intel_dig_port->base.type == INTEL_OUTPUT_EDP || strncmp(intel_dp->attached_connector->base.name, "DP-3", 4) == 0;
}
static struct drm_device *intel_dp_to_dev(struct intel_dp *intel_dp)
@@ -5014,7 +5013,7 @@
if (INTEL_GEN(dev_priv) < 5)
return false;
- if (INTEL_GEN(dev_priv) < 9 && port == PORT_A)
+ if (INTEL_GEN(dev_priv) < 9 && port == PORT_D)
return true;
return intel_bios_is_port_edp(dev_priv, port);
diff -Naur linux-4.11-orig/drivers/gpu/drm/i915/intel_lvds.c linux-4.11/drivers/gpu/drm/i915/intel_lvds.c
--- linux-4.11-orig/drivers/gpu/drm/i915/intel_lvds.c 2017-05-22 00:51:40.677468400 +0200
+++ linux-4.11/drivers/gpu/drm/i915/intel_lvds.c 2017-05-22 00:54:13.046343220 +0200
@@ -665,201 +665,10 @@
static const struct dmi_system_id intel_no_lvds[] = {
{
.callback = intel_no_lvds_dmi_callback,
- .ident = "Apple Mac Mini (Core series)",
+ .ident = "modded Thinkpad X230",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Apple"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "Apple Mac Mini (Core 2 series)",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Apple"),
- DMI_MATCH(DMI_PRODUCT_NAME, "Macmini2,1"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "MSI IM-945GSE-A",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "MSI"),
- DMI_MATCH(DMI_PRODUCT_NAME, "A9830IMS"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "Dell Studio Hybrid",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "Studio Hybrid 140g"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "Dell OptiPlex FX170",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex FX170"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "AOpen Mini PC",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "AOpen"),
- DMI_MATCH(DMI_PRODUCT_NAME, "i965GMx-IF"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "AOpen Mini PC MP915",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
- DMI_MATCH(DMI_BOARD_NAME, "i915GMx-F"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "AOpen i915GMm-HFS",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
- DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "AOpen i45GMx-I",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
- DMI_MATCH(DMI_BOARD_NAME, "i45GMx-I"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "Aopen i945GTt-VFA",
- .matches = {
- DMI_MATCH(DMI_PRODUCT_VERSION, "AO00001JW"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "Clientron U800",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Clientron"),
- DMI_MATCH(DMI_PRODUCT_NAME, "U800"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "Clientron E830",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Clientron"),
- DMI_MATCH(DMI_PRODUCT_NAME, "E830"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "Asus EeeBox PC EB1007",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer INC."),
- DMI_MATCH(DMI_PRODUCT_NAME, "EB1007"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "Asus AT5NM10T-I",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
- DMI_MATCH(DMI_BOARD_NAME, "AT5NM10T-I"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "Hewlett-Packard HP t5740",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
- DMI_MATCH(DMI_PRODUCT_NAME, " t5740"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "Hewlett-Packard t5745",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
- DMI_MATCH(DMI_PRODUCT_NAME, "hp t5745"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "Hewlett-Packard st5747",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
- DMI_MATCH(DMI_PRODUCT_NAME, "hp st5747"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "MSI Wind Box DC500",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
- DMI_MATCH(DMI_BOARD_NAME, "MS-7469"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "Gigabyte GA-D525TUD",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co., Ltd."),
- DMI_MATCH(DMI_BOARD_NAME, "D525TUD"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "Supermicro X7SPA-H",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Supermicro"),
- DMI_MATCH(DMI_PRODUCT_NAME, "X7SPA-H"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "Fujitsu Esprimo Q900",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
- DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Q900"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "Intel D410PT",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Intel"),
- DMI_MATCH(DMI_BOARD_NAME, "D410PT"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "Intel D425KT",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Intel"),
- DMI_EXACT_MATCH(DMI_BOARD_NAME, "D425KT"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "Intel D510MO",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Intel"),
- DMI_EXACT_MATCH(DMI_BOARD_NAME, "D510MO"),
- },
- },
- {
- .callback = intel_no_lvds_dmi_callback,
- .ident = "Intel D525MW",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Intel"),
- DMI_EXACT_MATCH(DMI_BOARD_NAME, "D525MW"),
+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "2324B14"),
},
},
diff -Naur linux-4.11-orig/drivers/pci/pci-acpi.c linux-4.11/drivers/pci/pci-acpi.c
--- linux-4.11-orig/drivers/pci/pci-acpi.c 2017-05-22 00:53:18.822969971 +0200
+++ linux-4.11/drivers/pci/pci-acpi.c 2017-05-22 00:54:13.046343220 +0200
@@ -863,8 +863,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 don't give a fuck and keep it enabled\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