compat-drivers: drm: Revert ACPI table size check for < 3.6
authorOzan Çağlayan <ozancag@gmail.com>
Sun, 28 Oct 2012 17:55:44 +0000 (19:55 +0200)
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>
Sun, 4 Nov 2012 17:25:14 +0000 (09:25 -0800)
acpi_get_table_with_size() was exported with kernels >= 3.6. Revert the
size checking for kernels < 3.6.

Signed-off-by: Ozan Çağlayan <ozancag@gmail.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
patches/drm/10-radeon-revert-acpi-table-size-check.patch [new file with mode: 0644]

diff --git a/patches/drm/10-radeon-revert-acpi-table-size-check.patch b/patches/drm/10-radeon-revert-acpi-table-size-check.patch
new file mode 100644 (file)
index 0000000..d595a98
--- /dev/null
@@ -0,0 +1,29 @@
+acpi_get_table_with_size() was exported with kernels >= 3.6. Revert the
+size checking for kernels < 3.6.
+
+Index: compat-drivers/drivers/gpu/drm/radeon/radeon_bios.c
+===================================================================
+--- compat-drivers.orig/drivers/gpu/drm/radeon/radeon_bios.c
++++ compat-drivers/drivers/gpu/drm/radeon/radeon_bios.c
+@@ -554,12 +554,21 @@ static bool radeon_acpi_vfct_bios(struct
+ {
+       bool ret = false;
+       struct acpi_table_header *hdr;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
+       acpi_size tbl_size;
++#else
++      /* acpi_get_table_with_size() not exported on kernels < 3.6 */
++      acpi_size tbl_size = 0x7fffffff;
++#endif
+       UEFI_ACPI_VFCT *vfct;
+       GOP_VBIOS_CONTENT *vbios;
+       VFCT_IMAGE_HEADER *vhdr;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
+       if (!ACPI_SUCCESS(acpi_get_table_with_size("VFCT", 1, &hdr, &tbl_size)))
++#else
++      if (!ACPI_SUCCESS(acpi_get_table("VFCT", 1, &hdr)))
++#endif
+               return false;
+       if (tbl_size < sizeof(UEFI_ACPI_VFCT)) {
+               DRM_ERROR("ACPI VFCT table present but broken (too short #1)\n");