Source-Changes-HG archive

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

[src/riastradh-drm2]: src/sys/external/bsd/drm2/dist/drm/i915 NetBSDify (bus_...



details:   https://anonhg.NetBSD.org/src/rev/4b405e02a03c
branches:  riastradh-drm2
changeset: 788405:4b405e02a03c
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jul 24 03:39:23 2013 +0000

description:
NetBSDify (bus_spaceify) i915_disable_vga.  (XXX Move elsewhere?)

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/intel_display.c |  21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diffs (36 lines):

diff -r 2144da0c2d2e -r 4b405e02a03c sys/external/bsd/drm2/dist/drm/i915/intel_display.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_display.c       Wed Jul 24 03:39:05 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_display.c       Wed Jul 24 03:39:23 2013 +0000
@@ -8986,11 +8986,32 @@
        else
                vga_reg = VGACNTRL;
 
+#ifdef __NetBSD__
+    {
+       const bus_size_t vgabase = 0x3c0;
+       const bus_space_tag_t iot = dev->pdev->pd_pa.pa_iot;
+       bus_space_handle_t ioh;
+
+       if (bus_space_map(iot, vgabase, 0x10, 0, &ioh)) {
+               aprint_error_dev(dev->pdev->pd_dev,
+                   "unable to map VGA registers");
+       } else {
+               CTASSERT(vgabase <= VGA_SR_INDEX);
+               CTASSERT(vgabase <= VGA_SR_DATA);
+               bus_space_write_1(iot, ioh, VGA_SR_INDEX - vgabase, SR01);
+               sr1 = bus_space_read_1(iot, ioh, VGA_SR_DATA - vgabase);
+               bus_space_write_1(iot, ioh, VGA_SR_DATA - vgabase,
+                   (sr1 | __BIT(5)));
+               bus_space_unmap(iot, ioh, 0x10);
+       }
+    }
+#else
        vga_get_uninterruptible(dev->pdev, VGA_RSRC_LEGACY_IO);
        outb(SR01, VGA_SR_INDEX);
        sr1 = inb(VGA_SR_DATA);
        outb(sr1 | 1<<5, VGA_SR_DATA);
        vga_put(dev->pdev, VGA_RSRC_LEGACY_IO);
+#endif
        udelay(300);
 
        I915_WRITE(vga_reg, VGA_DISP_DISABLE);



Home | Main Index | Thread Index | Old Index