Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/i915 Use a prefetchable linea...



details:   https://anonhg.NetBSD.org/src/rev/03319235b211
branches:  trunk
changeset: 365971:03319235b211
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 07:26:30 2018 +0000

description:
Use a prefetchable linear bus space mapping.  No __iomem.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_drv.h       |   6 ++++-
 sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c |  25 ++++++++++++++++---
 2 files changed, 26 insertions(+), 5 deletions(-)

diffs (99 lines):

diff -r c840f953bf6e -r 03319235b211 sys/external/bsd/drm2/dist/drm/i915/i915_drv.h
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h    Mon Aug 27 07:26:18 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h    Mon Aug 27 07:26:30 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_drv.h,v 1.19 2018/08/27 07:19:01 riastradh Exp $  */
+/*     $NetBSD: i915_drv.h,v 1.20 2018/08/27 07:26:30 riastradh Exp $  */
 
 /* i915_drv.h -- Private header for the I915 driver -*- linux-c -*-
  */
@@ -475,6 +475,10 @@
 #endif
 
 struct intel_opregion {
+#ifdef __NetBSD__
+       bus_space_tag_t bst;
+       bus_space_handle_t bsh;
+#endif
        struct opregion_header *header;
        struct opregion_acpi *acpi;
        struct opregion_swsci *swsci;
diff -r c840f953bf6e -r 03319235b211 sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c      Mon Aug 27 07:26:18 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c      Mon Aug 27 07:26:30 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_opregion.c,v 1.12 2018/08/27 06:34:44 riastradh Exp $    */
+/*     $NetBSD: intel_opregion.c,v 1.13 2018/08/27 07:26:30 riastradh Exp $    */
 
 /*
  * Copyright 2008 Intel Corporation <hong.liu%intel.com@localhost>
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_opregion.c,v 1.12 2018/08/27 06:34:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_opregion.c,v 1.13 2018/08/27 07:26:30 riastradh Exp $");
 
 #include <linux/printk.h>
 #include <linux/acpi.h>
@@ -600,7 +600,7 @@
 intel_opregion_video_event(ACPI_HANDLE hdl, uint32_t notify, void *opaque)
 {
        device_t self = opaque;
-       struct opregion_acpi __iomem *acpi;
+       struct opregion_acpi *acpi;
 
        DRM_DEBUG_DRIVER("notify=0x%08x\n", notify);
 
@@ -647,9 +647,11 @@
 }
 #endif
 
+#ifndef __NetBSD__
 static struct notifier_block intel_opregion_notifier = {
        .notifier_call = intel_opregion_video_event,
 };
+#endif
 
 /*
  * Initialise the DIDL field in opregion. This passes a list of devices to
@@ -895,7 +897,11 @@
        }
 
        /* just clear all opregion memory pointers now */
+#ifdef __NetBSD__
+       bus_space_unmap(opregion->bst, opregion->bsh, OPREGION_SIZE);
+#else
        memunmap(opregion->header);
+#endif
        opregion->header = NULL;
        opregion->acpi = NULL;
        opregion->swsci = NULL;
@@ -989,7 +995,14 @@
        INIT_WORK(&opregion->asle_work, asle_work);
 #endif
 #ifdef __NetBSD__
-       base = acpi_os_ioremap(asls, OPREGION_SIZE);
+       opregion->bst = dev->pdev->pd_pa.pa_memt;
+       err = -bus_space_map(opregion->bst, asls, OPREGION_SIZE,
+           BUS_SPACE_MAP_LINEAR|BUS_SPACE_MAP_PREFETCHABLE, &opregion->bsh);
+       if (err) {
+               DRM_DEBUG_DRIVER("Failed to map opregion: %d", err);
+               return err;
+       }
+       base = bus_space_vaddr(opregion->bst, opregion->bsh);
 #else
        base = memremap(asls, OPREGION_SIZE, MEMREMAP_WB);
 #endif
@@ -1029,7 +1042,11 @@
        return 0;
 
 err_out:
+#ifdef __NetBSD__
+       bus_space_unmap(opregion->bst, opregion->bsh, OPREGION_SIZE);
+#else
        memunmap(base);
+#endif
        return err;
 }
 



Home | Main Index | Thread Index | Old Index