Revert "sys/dev/drm/i915: Activate ACPI"
authorMarkus Pfeiffer <markus.pfeiffer@morphism.de>
Mon, 15 Sep 2014 21:19:56 +0000 (21:19 +0000)
committerMarkus Pfeiffer <markus.pfeiffer@morphism.de>
Mon, 15 Sep 2014 21:47:26 +0000 (21:47 +0000)
This reverts commit 813bcdd292df9531f0d499d8cd9202238f51c961.

sys/dev/drm/i915/Makefile
sys/dev/drm/i915/i915_drv.h
sys/dev/drm/i915/intel_opregion.c

index 8e7a210..d5fcc7c 100644 (file)
@@ -30,11 +30,9 @@ SRCS = \
        intel_sprite.c \
        intel_tv.c
 
-
-SRCS   += acpi_if.h device_if.h bus_if.h pci_if.h iicbus_if.h iicbb_if.h opt_drm.h \
+SRCS   += device_if.h bus_if.h pci_if.h iicbus_if.h iicbb_if.h opt_drm.h \
          opt_ktr.h
 
 CFLAGS+= -I${SYSDIR}/dev/drm/include
-CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/source/include
 
 .include <bsd.kmod.mk>
index 91f8e44..33dba21 100644 (file)
@@ -39,8 +39,6 @@
 #include <linux/kref.h>
 #include <linux/workqueue.h>
 
-#define CONFIG_ACPI 1
-
 /* General customization:
  */
 
index c98659c..5a1e799 100644 (file)
@@ -29,9 +29,6 @@
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
 #include "intel_drv.h"
-#include <contrib/dev/acpica/source/include/acpi.h>
-#include <contrib/dev/acpica/source/include/accommon.h>
-#include <dev/acpica/acpivar.h>
 
 #include <linux/io.h>
 
@@ -294,7 +291,6 @@ void intel_opregion_enable_asle(struct drm_device *dev)
 
 static struct intel_opregion *system_opregion;
 
-#if 0
 static int intel_opregion_video_event(struct notifier_block *nb,
                                      unsigned long val, void *data)
 {
@@ -327,17 +323,6 @@ static int intel_opregion_video_event(struct notifier_block *nb,
 static struct notifier_block intel_opregion_notifier = {
        .notifier_call = intel_opregion_video_event,
 };
-#endif
-
-
-static int acpi_is_video_device(ACPI_HANDLE devh) {
-       ACPI_HANDLE h;
-       if (ACPI_FAILURE(AcpiGetHandle(devh, "_DOD", &h)) ||
-           ACPI_FAILURE(AcpiGetHandle(devh, "_DOS", &h))) {
-               return 0;
-       }
-       return 1;
-}
 
 /*
  * Initialise the DIDL field in opregion. This passes a list of devices to
@@ -350,40 +335,26 @@ static void intel_didl_outputs(struct drm_device *dev)
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct intel_opregion *opregion = &dev_priv->opregion;
        struct drm_connector *connector;
-       u32 device_id;
-       ACPI_HANDLE handle, acpi_video_bus, acpi_cdev;
-       ACPI_STATUS status;
-/*     acpi_handle handle;
+       acpi_handle handle;
        struct acpi_device *acpi_dev, *acpi_cdev, *acpi_video_bus = NULL;
        unsigned long long device_id;
-       acpi_status status; */
+       acpi_status status;
        u32 temp;
        int i = 0;
 
-       handle = acpi_get_handle(dev->dev);
-       if (!handle)
+       handle = DEVICE_ACPI_HANDLE(&dev->pdev->dev);
+       if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &acpi_dev)))
                return;
 
-       if (acpi_is_video_device(handle))
-               acpi_video_bus = handle;
+       if (acpi_is_video_device(acpi_dev))
+               acpi_video_bus = acpi_dev;
        else {
-#if 0 /* linux */
                list_for_each_entry(acpi_cdev, &acpi_dev->children, node) {
                        if (acpi_is_video_device(acpi_cdev)) {
                                acpi_video_bus = acpi_cdev;
                                break;
                        }
                }
-#endif
-               acpi_cdev = NULL;
-               acpi_video_bus = NULL;
-               while (AcpiGetNextObject(ACPI_TYPE_DEVICE, handle, acpi_cdev,
-                                        &acpi_cdev) != AE_NOT_FOUND) {
-                       if (acpi_is_video_device(acpi_cdev)) {
-                               acpi_video_bus = acpi_cdev;
-                               break;
-                       }
-               }
        }
 
        if (!acpi_video_bus) {
@@ -391,22 +362,6 @@ static void intel_didl_outputs(struct drm_device *dev)
                return;
        }
 
-       acpi_cdev = NULL;
-       while (AcpiGetNextObject(ACPI_TYPE_DEVICE, acpi_video_bus, acpi_cdev,
-                                &acpi_cdev) != AE_NOT_FOUND) {
-               if (i >= 8) {
-                       device_printf(dev->dev, "More than 8 outputs detected\n");
-                       return;
-               }
-               status = acpi_GetInteger(acpi_cdev, "_ADR", &device_id);
-               if (ACPI_SUCCESS(status)) {
-                       if (!device_id)
-                               goto blind_set;
-                       opregion->acpi->didl[i] = (u32)(device_id & 0x0f0f);
-                       i++;
-               }
-       }
-#if 0 /* linux */
        list_for_each_entry(acpi_cdev, &acpi_video_bus->children, node) {
                if (i >= 8) {
                        dev_printk(KERN_ERR, &dev->pdev->dev,
@@ -424,7 +379,7 @@ static void intel_didl_outputs(struct drm_device *dev)
                        i++;
                }
        }
-#endif
+
 end:
        /* If fewer than 8 outputs, the list must be null terminated */
        if (i < 8)
@@ -436,7 +391,7 @@ blind_set:
        list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
                int output_type = ACPI_OTHER_OUTPUT;
                if (i >= 8) {
-                       device_printf(dev->dev,
+                       dev_printk(KERN_ERR, &dev->pdev->dev,
                                    "More than 8 outputs detected\n");
                        return;
                }
@@ -465,7 +420,7 @@ blind_set:
                temp = ioread32(&opregion->acpi->didl[i]);
                iowrite32(temp | (1<<31) | output_type | i,
                          &opregion->acpi->didl[i]);
-       i++;
+               i++;
        }
        goto end;
 }
@@ -510,9 +465,7 @@ void intel_opregion_init(struct drm_device *dev)
                iowrite32(1, &opregion->acpi->drdy);
 
                system_opregion = opregion;
-#if 0 /* linux */
                register_acpi_notifier(&intel_opregion_notifier);
-#endif
        }
 
        if (opregion->asle)
@@ -531,13 +484,11 @@ void intel_opregion_fini(struct drm_device *dev)
                iowrite32(0, &opregion->acpi->drdy);
 
                system_opregion = NULL;
-#if 0 /* linux */
                unregister_acpi_notifier(&intel_opregion_notifier);
-#endif
        }
 
        /* just clear all opregion memory pointers now */
-       pmap_unmapdev((vm_offset_t)opregion->header, OPREGION_SIZE);
+       iounmap(opregion->header);
        opregion->header = NULL;
        opregion->acpi = NULL;
        opregion->swsci = NULL;