Home | History | Annotate | Download | only in pci
History log of /src/sys/dev/pci/agp_i810.c
RevisionDateAuthorComments
 1.126  29-Jan-2024  riastradh agp_i810(4): Use ipi(9) for chipset flush on all CPUs, not xcall(9).

i915 now calls into this with a spin lock held, so we have to use
ipi(9), which spin-waits for the other CPUs to complete, rather than
xcall(9), which may sleep-wait.

Fortunately, this is just to execute WBINVD on x86 (and if this code
ever runs on other architectures, which it probably doesn't, it'll be
a similar barrier instruction), so spinning to wait for that on all
CPUs isn't too costly.

PR kern/57878

XXX pullup-10
 1.125  17-Jul-2022  riastradh branches: 1.125.4;
agp(4): Use bus_space_barrier, not membar_producer.
 1.124  10-Nov-2019  chs in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.123  27-Aug-2018  riastradh Restore gtt page table control register on resume.

Additional subroutine agp_i810_reset is used by i915drmkms to make
sure it happens early enough, since i915drmkms resumes before agp.

XXX pullup-7
XXX pullup-8
 1.122  01-May-2016  nonaka branches: 1.122.10; 1.122.16; 1.122.18;
kern/50453: Separate Pineview chipset from i915-family chipset support.

Should use AGP_I965_IFPADDR instead AGP_I915_IFPADDR in Pineview, becuase
AGP_I915_IFPADDR is used as PCIEXBAR.
 1.121  21-Oct-2015  christos Fix typo
 1.120  21-Oct-2015  christos CID 1328433: Anding with 0 and comparing != 0 will not work very will.
 1.119  13-Oct-2015  riastradh Fix mapping Intel graphics device registers.

- Accept either 32-bit or 64-bit mappings for all devices.
- Let the device always dictate size of the mapping.
- Explain why we don't have a statically fixed mapping size.

Fixes the main part of PR kern/50060. Still a display mode issue
from one submitter, but it is almost certainly an unrelated issue.
 1.118  05-Apr-2015  riastradh Don't use the video BIOS memory as an i915 flush page!
 1.117  06-Mar-2015  riastradh Pass cache-related flags through to the GTT on pre-SNB devices.

I had assumed for ages this would increase the amount of caching and
thereby increase the chance of stale caches leading to rendering
glitches. But apparently I was wrong, and failing to pass these
through was causing all sorts of problems!
 1.116  26-Feb-2015  riastradh Include <sys/atomic.h> for membar_producer.

(Why didn't this fail in my build?)
 1.115  26-Feb-2015  riastradh Issue a write barrier after updating the GTT.

Linux never used to do this...until a month:

https://bugs.freedesktop.org/show_bug.cgi?id=88191

commit 983d308cb8f602d1920a8c40196eb2ab6cc07bd2
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Jan 26 10:47:10 2015 +0000

agp/intel: Serialise after GTT updates
 1.114  24-Aug-2014  riastradh branches: 1.114.2;
Use the right BAR for MMIO register sizing on i810.
 1.113  22-Aug-2014  riastradh Revert to mapping the whole GTTMMADR region all at once for now.

This was split up so we could map the GTT prefetchable without
interfering with the MMIO registers, but it interferes with old drm
which tries to map the whole region and which is still hooked up for
the moment.

Once we unhook old drm for good we can put this back.
 1.112  25-Jul-2014  riastradh branches: 1.112.2;
Mark isc __diagused in agp_i810_unbind_memory.
 1.111  23-Jul-2014  riastradh Tweak style, make it compile...oops.
 1.110  23-Jul-2014  riastradh For the unbind code to work the bind code must set the offset.
 1.109  23-Jul-2014  riastradh Also unbind the right offset.
 1.108  23-Jul-2014  riastradh Bind i810 dcache pages at the requested offset, not at VA start.

From John D Baker in PR xsrc/48344.

XXX pullup to 6 (by patch)
 1.107  01-Jul-2014  riastradh Tweak debug printf directives.
 1.106  27-Jun-2014  riastradh Collect `#ifdef AGP_DEBUG printf(...)' into local DPRINTF macro.
 1.105  25-Jun-2014  riastradh No, that should be unsigned.
 1.104  25-Jun-2014  riastradh Fix integer type mismatch in debug printf.
 1.103  12-Jun-2014  riastradh Get GTT size from PGTBL_CTL on G4X chipsets.
 1.102  12-Jun-2014  riastradh Fix MMIO registers sizes for pre-Ironlake chipsets.
 1.101  12-Jun-2014  riastradh Extend agp_generic_bind_memory with bounds to check.

New routine agp_generic_bind_memory_bounded.

Use it in agp_i810 to replace the pile of code I wrote as a
replacement which is apparently broken.
 1.100  12-Jun-2014  riastradh Fix type in cast too, after changing type of gtt_off.
 1.99  12-Jun-2014  riastradh Check bounds in agp_i810_borrow.

Out of paranoia, do a bus_space_subregion in case the old drm code
tries sizes that the agp_i810 code doesn't agree with.
 1.98  12-Jun-2014  riastradh Use correct type for gtt_off, an offset relative to a bus address.
 1.97  12-Jun-2014  riastradh Ensure we map all the MMIO registers.

For i8xx chipsets, the GTT is in the middle of the MMIO space, so we
can't map it separately. Use a subregion instead.
 1.96  12-Jun-2014  christos Giving a 0 gtt_size for G4X causes a panic when you try to bus map 0 size.
Give it 256, like the default aperture size for it. Now it works again.
 1.95  11-Jun-2014  riastradh Fix fencepost.
 1.94  11-Jun-2014  riastradh Fix various mistakes in yesterday's commit.

- Set mem->am_nseg, particularly before trying to use it.
- Avoid error-prone local copies in agp_i810_bind_memory_main.
- Omit missing DMA unload/free in agp_i810_unbind_memory.
 1.93  11-Jun-2014  riastradh Ignore result of agp_i810_unbind_page in agp_i810_unbind_memory.
 1.92  11-Jun-2014  riastradh Back out previous mistake.

If you mixed `cvs diff' and `cvs commit' in your shell history,
remember to hit C-p the right number of times before RET. Oops.
 1.91  11-Jun-2014  riastradh Add missing bus_dmamap_destroy.
 1.90  11-Jun-2014  riastradh Add missing bus_dmamap_destroy.
 1.89  11-Jun-2014  riastradh Check bounds more carefully to avoid integer overflow.
 1.88  11-Jun-2014  riastradh Don't trust the MSAC register after all; use the GMADR BAR size.

Previously this read the MSAC register from the wrong PCI device.
Experiments reveal that even on the right PCI device, per the
datasheet, the GMADR BAR size is correct.

Not clear that the driver has any business reading any of these GMCH
registers to discern the aperture size -- seems to me they are meant
to be written by the BIOS to determine the GMADR BAR size. Lacking a
variety of hardware to test, though, I'll leave this as is for now...
 1.87  11-Jun-2014  riastradh Fix sense of conditional for GTTMMADR size.
 1.86  10-Jun-2014  riastradh Rework agp_i810 memory binding.

Principal reason is that the GTT size is not necessarily the same as
the aperture size: the GPU may have a bigger virtual address space
than the CPU can see through the aperture.

While here, factor the code a little more legibly and name some magic
constants.
 1.85  10-Jun-2014  riastradh Another round of weed-whacking for agp_i810.

- Make struct agp_i810_softc::gatt specific to i810 chipsets; use other
members of struct agp_i810_softc for non-i810 chipsets.

- agp_i810_init detects and sets isc->gtt_size.

- Map GTT based on the GTT size detected by agp_i810_init.

- Sprinkle some comments particularly about questionable calculations.
 1.84  28-May-2014  riastradh Cosmetic changes require testing too...oops.
 1.83  28-May-2014  riastradh Cosmetics: long lines, needless variables, PCI parameter verbiage.
 1.82  28-May-2014  riastradh Rationalize agp_i810 aprint output. Fix agp_i810_init error branches.
 1.81  28-May-2014  riastradh Oops -- gtt_off is relative to mmadr, not absolute.
 1.80  27-May-2014  riastradh Suppress uninitialized variable warnings in older and dumber GCC.
 1.79  27-May-2014  riastradh Rework agp_i810 attachment code a little.

- Fix up error branches in agp_i810_attach.

- Use a separate bus space handle for the GTT, whether it is in a
separate BAR or a subregion of the MMIO device registers, so that

(a) agp_i810_write_gtt_entry and agp_i810_post_gtt_entry are easier to
follow, and

(b) we can map the GTT prefetchable eventually.
 1.78  26-May-2014  riastradh Use correct address for 64-bit flush page config register.
 1.77  26-May-2014  riastradh Avoid xcall(9) while cold.
 1.76  24-May-2014  riastradh Handle 64-bit paddr registers delicately for non-PAE i386.
 1.75  23-May-2014  riastradh Implement Intel AGP chipset flush.

While here, fix the use of the I915 PCI MSAC register: it lies on the
bridge device (bus 0 dev 0 func 0), not the graphics device (bus 0
dev 2 func 0). I'm not sure we ever need to consult this register,
really -- the PCI BARs should be sized. But I'll leave a rototill of
this mess for another day.
 1.74  18-Mar-2014  riastradh branches: 1.74.2;
Merge riastradh-drm2 to HEAD.
 1.73  04-Apr-2011  dyoung branches: 1.73.4; 1.73.10; 1.73.14; 1.73.16; 1.73.18; 1.73.24; 1.73.26;
Neither pci_dma64_available(), pci_probe_device(), pci_mapreg_map(9),
pci_find_rom(), pci_intr_map(9), pci_enumerate_bus(), nor the match
predicate passed to pciide_compat_intr_establish() should ever modify
their pci_attach_args argument, so make their pci_attach_args arguments
const and deal with the fallout throughout the kernel.

For the most part, these changes add a 'const' where there was no
'const' before, however, some drivers and MD code used to modify
pci_attach_args. Now those drivers either copy their pci_attach_args
and modify the copy, or refrain from modifying pci_attach_args:

Xen: according to Manuel Bouyer, writing to pci_attach_args in
pci_intr_map() was a leftover from Xen 2. Probably a bug. I
stopped writing it. I have not tested this change.

siside(4): sis_hostbr_match() needlessly wrote to pci_attach_args.
Probably a bug. I use a temporary variable. I have not tested this
change.

slide(4): sl82c105_chip_map() overwrote the caller's pci_attach_args.
Probably a bug. Use a local pci_attach_args. I have not tested
this change.

viaide(4): via_sata_chip_map() and via_sata_chip_map_new() overwrote the
caller's pci_attach_args. Probably a bug. Make a local copy of the
caller's pci_attach_args and modify the copy. I have not tested
this change.

While I'm here, make pci_mapreg_submap() static.

With these changes in place, I have tested the compilation of these
kernels:

alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-eb NSLU2
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE GUMSTIX
HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321 IXDP425 IXM1200
KUROBOX_PRO LUBBOCK MARVELL_NAS NAPPI SHEEVAPLUG SMDK2800 TEAMASA_NPWR
TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sgimips GENERIC32_IP2x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC

As of Sun Apr 3 15:26:26 CDT 2011, I could not compile these kernels
with or without my patches in place:

### evbmips-el GDIUM

nbmake: nbmake: don't know how to make /home/dyoung/pristine-nbsd/src/sys/arch/mips/mips/softintr.c. Stop

### evbarm-el MPCSA_GENERIC
src/sys/arch/evbarm/conf/MPCSA_GENERIC:318: ds1672rtc*: unknown device `ds1672rtc'

### ia64 GENERIC

/tmp/genassym.28085/assym.c: In function 'f111':
/tmp/genassym.28085/assym.c:67: error: invalid application of 'sizeof' to incomplete type 'struct pcb'
/tmp/genassym.28085/assym.c:76: error: dereferencing pointer to incomplete type

### sgimips GENERIC32_IP3x

crmfb.o: In function `crmfb_attach':
crmfb.c:(.text+0x2304): undefined reference to `ddc_read_edid'
crmfb.c:(.text+0x2304): relocation truncated to fit: R_MIPS_26 against `ddc_read_edid'
crmfb.c:(.text+0x234c): undefined reference to `edid_parse'
crmfb.c:(.text+0x234c): relocation truncated to fit: R_MIPS_26 against `edid_parse'
crmfb.c:(.text+0x2354): undefined reference to `edid_print'
crmfb.c:(.text+0x2354): relocation truncated to fit: R_MIPS_26 against `edid_print'
 1.72  24-Feb-2011  matt Add Intel Pineview support
 1.71  30-Jan-2011  gsutre Enable 36-bit addressing for chipsets that support it. While there,
factorize offset computation. Inspired from OpenBSD and Intel docs.

Note: agp_i810_bind/unbind_page will now fail with EINVAL if the
physical address is too large for the chipset (instead of silently
truncating it).

ok jmcneill@
 1.70  25-Jan-2011  gsutre Typos, fix memory binding for memory type 2, and add consistency checks.
From OpenBSD.

ok jmcneill@
 1.69  13-Nov-2010  uebayasi branches: 1.69.2; 1.69.4;
Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.68  16-Jun-2010  riz Add AGP support for a number of Intel onboard devices, including
82G41, 82B43, E7221, 82965GME, and "Iron Lake". Device
types (i915, i965, G33, and G4X variants) from the Linux Intel AGP
driver, and (for 82G41) from Henry Bent in PR#42906.

There are a few more varieties that should be relatively low-hanging
fruit ("Pineview" and "Sandy Bridge"), but will require a little bit
of rejiggering of the "chiptype".

OK mrg@
 1.67  04-Apr-2010  jakllsch Add (non-IGP) AGP port support for Intel 82855GM.
agp_intel tested with radeondrm(4). agp_i810 tested with i915drm(4).
 1.66  24-Feb-2010  dyoung branches: 1.66.2;
A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
 1.65  08-Jan-2010  dyoung branches: 1.65.2;
Expand PMF_FN_* macros.
 1.64  04-May-2009  markd Treat G4X like I915 and G33 for MSAC. Fixes aperture setting.
Has been working successfully for me and snj for the last few months.
 1.63  19-Feb-2009  markd Add missing break.
 1.62  27-Jan-2009  markd branches: 1.62.2;
Add some more Intel G4X class chipsets. Also fix gtt_size for G4X chipsets.
Partially from FreeBSD. There is still an issue here as G4X chipsets
report an aperture size of 0.
 1.61  13-Dec-2008  sketch Fix PGTBL sizes.
 1.60  10-Dec-2008  christos fix PGTBL size detection on the intel 965GM. From Anon Ymous.
 1.59  04-Dec-2008  alc Fix regression introducted by the previous commit.

i915 and G33 Intel chipset family need special handling when writing an entry
to the GTT.

reported by: <tnn> [0]
tested by: <tnn>

[0]: http://mail-index.netbsd.org/tech-x11/2008/12/03/msg000276.html
 1.58  29-Nov-2008  christos Add support for the Intel G45 AGP. From Arnaud Lacombe
 1.57  08-Nov-2008  christos Support for Intel G35 as found on Asus P5E-VM HDMI motherboard from
Milos Negovanovic
 1.56  22-Aug-2008  tnn branches: 1.56.2; 1.56.4; 1.56.8;
AGP support for Intel 945GME chipset, found on Acer Aspire One.
 1.55  19-Aug-2008  matthias Add agp support for Intel 946gz.
 1.54  09-Jun-2008  freza branches: 1.54.4;
o Split device_t/softc for agp(4).
o agp_ali.c: remove unused 'agp' member from agp_ali_softc.
o drm: agp_find_device() returns 'void *', not a device_t.
o Use device_t, cfdata_t instead of struct pointers.
o Don't cast void pointers in assignments.
 1.53  10-May-2008  jmcneill Don't use aprint_error in the success path.
 1.52  10-Apr-2008  cegger branches: 1.52.2; 1.52.4; 1.52.6;
use aprint_*_dev and device_xname
 1.51  29-Feb-2008  dyoung Use PMF_FN_ARGS, PMF_FN_PROTO.
 1.50  26-Feb-2008  drochner -Now that the address space conflict is solved, we can re-enable that old
workaround for some VESA BIOS which overwrites PGTBL_CTL. Pointed out
by Yorick Hardy.
-make two variables introduced in the last commit static
 1.49  22-Feb-2008  drochner Add a horrible hack to allow the DRM driver to get at the bus_space_handle
allocated by the AGP driver in the case of Intel chipset graphics.
This is different from the patch by Yorick Hardy circulated a while ago
in that it doesn't change the semantics of reference counting within
the (3rd-party) DRM code -- it just bypasses it.
Needless to say that it is uglier, but it eases future updates to
the DRM code because the change there is just 2 LOC.

Imo, a cleaner solution for all that would be to attach "agp" to "vga"
in the intel chipset graphics case, which better reflects how the hardware
is structured. This would still need a hack to the DRM code, but
it would be confined to childs of the "vga" device, without need for
global variables.
Since there is a variety of intel chipsets with AGP and/or builtin
graphics options, this would need a considerable testing effort.
 1.48  04-Jan-2008  ad branches: 1.48.2; 1.48.6;
Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.
 1.47  09-Dec-2007  jmcneill branches: 1.47.2;
Merge jmcneill-pm branch.
 1.46  24-Nov-2007  markd branches: 1.46.2; 1.46.4;
Add agp support for Intel Q35/G33/Q33.
 1.45  12-Nov-2007  joerg Merge bunch of AGP changes from jmcneill-pm.
 1.44  30-Oct-2007  jnemeth branches: 1.44.2;
PR/37201 - Yasushi Oshima -- Intel 82965G chipset support
 1.43  19-Oct-2007  ad machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.42  15-Aug-2007  markd branches: 1.42.2; 1.42.6;
Add agp support for i965Q.

Based on a patch for FreeBSD by Eric Anholt.
OKed on tech-kern some months ago.
 1.41  20-Jun-2007  sborrill branches: 1.41.2; 1.41.6;
Support more i915 stolen memory configurations (previous limit was 8MB,
some configurations steal up to 64MB). OK christos@
 1.40  24-Mar-2007  christos comment out unmap; breaks X.
 1.39  23-Mar-2007  drochner simplify previous: no need to call pci_mapreg_info()
 1.38  23-Mar-2007  jmcneill Initialize mmadrsize in the non-i910 case, otherwise we end up passing an
uninitialized variable to bus_space_unmap.
 1.37  20-Mar-2007  drochner Import DRM drivers, brought into shape by Yorick Hardy, posted to tech-x11.
Minor modifications by me:
-use an mi device major number
-(coarsly) divided into pci card specific and less specific parts, moved
the latter to dev/drm
-renamed autoconf attributes to reflect this
Todo:
-adapt all card frontends but i915 to drm include file location
-review the mtrr change
-make the change to agp_i810.c coexist with the fix for buggy VESA
BIOSes which is commented out temporarily
-RCS IDs etc style stuff
-LKM support (rescan support for vga)
-test
 1.36  04-Mar-2007  christos branches: 1.36.2; 1.36.4; 1.36.6;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.35  16-Nov-2006  christos branches: 1.35.4;
__unused removal on arguments; approved by core.
 1.34  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.33  24-Sep-2006  jmcneill Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
 1.32  30-Jul-2006  simonb branches: 1.32.4; 1.32.6;
Add support for 82945GM and (untested) 82945P AGP. FreeBSD and
Linux both treat the 945 series exactly the same as the 915 series
for AGP, so just match a few extra device IDs.
 1.31  27-Jun-2006  tron Make this build with GCC 4.x.
 1.30  14-May-2006  elad branches: 1.30.4;
integrate kauth.
 1.29  15-Apr-2006  rpaulo s/#ifdef DEBUG/#ifdef AGP_DEBUG/
 1.28  16-Jan-2006  christos branches: 1.28.2; 1.28.4; 1.28.6; 1.28.8; 1.28.10;
PR/32550: Michael Eriksson: No agp(4) support for i915 integrated graphics
 1.27  11-Dec-2005  christos branches: 1.27.2;
merge ktrace-lwp.
 1.26  28-Jun-2005  thorpej branches: 1.26.2;
Use ANSI function decls and static.
 1.25  27-Feb-2005  perry branches: 1.25.2;
nuke trailing whitespace
 1.24  27-Jan-2005  jmcneill Add agp_i810 powerhook, from Kentaro A. Kurahone
 1.23  06-Nov-2004  xtraeme branches: 1.23.4; 1.23.6;
Add another case to match "PCI_PRODUCT_INTEL_82815_FULL_HUB"
(Intel 82815 Hub) in agp_i810_attach(), closes PR 27863.

Ok'ed christos@
 1.22  20-Mar-2004  jdolecek branches: 1.22.2;
eliminate redundant aperture size printouts
reported in PR kern/24859 by Nicolas Joly
 1.21  23-Dec-2003  tron Support i82845G/GL based motherboards without an Integrated Graphics
Device. Patch supplied by Nicolas Joly in PR kern/23860.
 1.20  07-Sep-2003  tron Compile in the i845/i865 fallback attachment code only if generic AGP Intel
support is enabled.
 1.19  07-Sep-2003  tron If we fail to find the Integrated Graphics Device of an Intel i840 or
i865 chipset try the generic Intel AGP code because it is probably
a motherboard without onboard graphics.
 1.18  26-Aug-2003  tron Add support for i865G integrated graphics support to agp(4). Patches
contributed by Michael D. Allen in PR port-i386/22600.
 1.17  20-Jul-2003  hannken Add support for i855 agp. From FreeBSD.

Approved by: Frank van der Linden <fvdl@netbsd.org>
 1.16  24-Mar-2003  drochner branches: 1.16.2;
Remove an aprint_normal() so that the output looks reasonable
at least in the non-error case.
(The aprint_* stuff makes it hard to keep track of newlines and
device name tags, and it suffers from lack of rules.)
 1.15  31-Jan-2003  thorpej Use aprint_*().
 1.14  13-Dec-2002  scw Add support for i830/i845 agp. From Shingo WATANABE (on tech-x11) and
FreeBSD, with cleanup/KNF by me.

Note: These chipsets are not well supported by the i810 driver in
NetBSD's in-tree xsrc (based on XFree86 4.2.1 at this time). However,
the driver works perfectly using bleeding-edge XFree86-current on my
Omnibook's i830MG with these agp changes.
 1.13  11-Aug-2002  drochner update the is_bound flag for local memory too
 1.12  22-Jan-2002  augustss branches: 1.12.8; 1.12.10;
Don't pretend we can handle i830; it needs a somewhat different AGP driver.
(I added i830 to quickly.)
 1.11  14-Jan-2002  augustss Add i830M to agp chip tables.
 1.10  12-Jan-2002  tsutsui Call malloc(9) with M_ZERO flag instead of memset() after malloc().
 1.9  13-Nov-2001  lukem add RCSID
 1.8  20-Sep-2001  fvdl branches: 1.8.2; 1.8.4;
Add message to explain failure if the internal i810 config registers
weren't found.
 1.7  15-Sep-2001  drochner normalize error message if agp_map_aperture() fails
 1.6  15-Sep-2001  thorpej Clean up the AGP match/attach code somewhat.
 1.5  14-Sep-2001  drochner make the hardware cursor work
 1.4  13-Sep-2001  drochner -allocate DMA maps as large as necessary in the worst case
-Add a really bad hack: The X server (4.1.0 afaict) appearently overwrites
the PGTBL_CTL which contains the base address of the pseudo-GATT.
Restore the original value if we notice this happened.
The X server works now, but only with soft cursor.
 1.3  11-Sep-2001  fvdl branches: 1.3.2;
Fix i810/other intel chipsets attach mishap.
 1.2  10-Sep-2001  fvdl Fix reversed if condition in agp_i810_vgamatch.
 1.1  10-Sep-2001  fvdl AGP GART support code. Originally written by Doug Rabson for FreeBSD,
modifications to fit it into the NetBSD device/config structure and
to use bus_dma by me.
 1.3.2.5  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.2.4  11-Feb-2002  jdolecek Sync w/ -current.
 1.3.2.3  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.2  13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.3.2.1  11-Sep-2001  thorpej file agp_i810.c was added on branch kqueue on 2001-09-13 01:15:50 +0000
 1.8.4.2  01-Oct-2001  fvdl Catch up with -current.
 1.8.4.1  20-Sep-2001  fvdl file agp_i810.c was added on branch thorpej-devvp on 2001-10-01 12:45:51 +0000
 1.8.2.6  19-Dec-2002  thorpej Sync with HEAD.
 1.8.2.5  13-Aug-2002  nathanw Catch up to -current.
 1.8.2.4  28-Feb-2002  nathanw Catch up to -current.
 1.8.2.3  14-Nov-2001  nathanw Catch up to -current.
 1.8.2.2  21-Sep-2001  nathanw Catch up to -current.
 1.8.2.1  20-Sep-2001  nathanw file agp_i810.c was added on branch nathanw_sa on 2001-09-21 22:35:53 +0000
 1.12.10.1  26-Jan-2003  jmc Pullup revisions 1.12-1.13 (requested by manu in ticket #1073)
update the is_bound flag for local memory too
 1.12.8.1  29-Aug-2002  gehenna catch up with -current.
 1.16.2.7  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.16.2.6  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.16.2.5  04-Feb-2005  skrll Sync with HEAD.
 1.16.2.4  14-Nov-2004  skrll Sync with HEAD.
 1.16.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.16.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.16.2.1  03-Aug-2004  skrll Sync with HEAD
 1.22.2.1  12-Nov-2004  jmc Pullup rev 1.23 (requested by xtraeme in ticket #938)

Add another case to match "PCI_PRODUCT_INTEL_82815_FULL_HUB"
(Intel 82815 Hub) in agp_i810_attach(). PR#27863
 1.23.6.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.23.6.1  12-Feb-2005  yamt sync with head.
 1.23.4.1  29-Apr-2005  kent sync with -current
 1.25.2.1  14-Feb-2006  riz Pull up following revision(s) (requested by tron in ticket #1168):
sys/dev/pci/agp_i810.c: revision 1.28
sys/arch/i386/pci/pchb.c: revision 1.57
sys/dev/pci/agpvar.h: revision 1.11
sys/dev/pci/agp_via.c: revision 1.9
sys/dev/pci/agp.c: revision 1.37
sys/dev/pci/agpreg.h: revision 1.10
sys/dev/pci/pcidevs: revision 1.757
sys/dev/pci/agp_amd.c: revision 1.14
sys/dev/pci/agp_intel.c: revision 1.17
sys/dev/pci/agp_sis.c: revision 1.8
sys/dev/pci/agp_ali.c: revision 1.9
sys/arch/i386/pci/pchb_rnd.c: revision 1.16
PR/32550: Michael Eriksson: No agp(4) support for i915 integrated graphics
 1.26.2.9  17-Mar-2008  yamt sync with head.
 1.26.2.8  27-Feb-2008  yamt sync with head.
 1.26.2.7  21-Jan-2008  yamt sync with head
 1.26.2.6  07-Dec-2007  yamt sync with head
 1.26.2.5  15-Nov-2007  yamt sync with head.
 1.26.2.4  27-Oct-2007  yamt sync with head.
 1.26.2.3  03-Sep-2007  yamt sync with head.
 1.26.2.2  30-Dec-2006  yamt sync with head.
 1.26.2.1  21-Jun-2006  yamt sync with head.
 1.27.2.1  01-Feb-2006  yamt sync with head.
 1.28.10.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.28.8.1  19-Apr-2006  elad sync with head.
 1.28.6.2  11-Aug-2006  yamt sync with head
 1.28.6.1  24-May-2006  yamt sync with head.
 1.28.4.1  22-Apr-2006  simonb Sync with head.
 1.28.2.1  09-Sep-2006  rpaulo sync with head
 1.30.4.1  13-Jul-2006  gdamore Merge from HEAD.
 1.32.6.2  10-Dec-2006  yamt sync with head.
 1.32.6.1  22-Oct-2006  yamt sync with head
 1.32.4.1  18-Nov-2006  ad Sync with head.
 1.35.4.3  15-Apr-2007  yamt sync with head.
 1.35.4.2  24-Mar-2007  yamt sync with head.
 1.35.4.1  12-Mar-2007  rmind Sync with HEAD.
 1.36.6.1  29-Mar-2007  reinoud Pullup to -current
 1.36.4.1  11-Jul-2007  mjf Sync with head.
 1.36.2.4  23-Oct-2007  ad Sync with head.
 1.36.2.3  20-Aug-2007  ad Sync with HEAD.
 1.36.2.2  15-Jul-2007  ad Sync with head.
 1.36.2.1  10-Apr-2007  ad Sync with head.
 1.41.6.13  08-Dec-2007  jmcneill Rename pnp(9) -> pmf(9), as requested by many.
 1.41.6.12  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.41.6.11  14-Nov-2007  joerg Sync with HEAD.
 1.41.6.10  06-Nov-2007  joerg Refactor PNP API:
- Make suspend/resume directly a device functionality. It consists of
three layers (class logic, device logic, bus logic), all of them being
optional. This replaces D0/D3 transitions.
- device_is_active returns true if the device was not disabled and was
not suspended (even partially), device_is_enabled returns true if the
device was enabled.
- Change pnp_global_transition into pnp_system_suspend and
pnp_system_resume. Before running any suspend/resume handlers, check
that all currently attached devices support power management and bail
out otherwise. The latter is not done for the shutdown/panic case.
- Make the former bus-specific generic network handlers a class handler.
- Make PNP message like volume up/down/toogle PNP events. Each device
can register what events they are interested in and whether the handler
should be global or not.
- Introduce device_active API for devices to mark themselve in use from
either the system or the device. Use this to implement the idle handling
for audio and input devices. This is intended to replace most ad-hoc
watchdogs as well.
- Fix somes situations in which audio resume would lose mixer settings.
- Make USB host controllers better deal with suspend in the light of
shared interrupts.
- Flush filesystem cache on suspend.
- Flush disk caches on suspend. Put ATA disks into standby on suspend as
well.
- Adopt drivers to use the new PNP API.
- Fix a critical bug in the generic cardbus layer that made D0->D3
break.
- Fix ral(4) to set if_stop.
- Convert cbb(4) to the new PNP API.
- Apply the PCI Express SCI fix on resume again.
 1.41.6.9  31-Oct-2007  joerg Sync with HEAD.
 1.41.6.8  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.41.6.7  01-Oct-2007  joerg Extend device API by device_power_private and device_power_set_private.
The latter is a temporary mean until the pnp_register API itself is
overhault. This functions allow a generic power handler to store its
state independent of the driver.

Use this and revamp the PCI power handling. Pretty much all PCI devices
had power handlers that did the same thing, generalize this in
pci_generic_power_register/deregister and the handler. This interface
offers callbacks for the drivers to save and restore state on
transistions. After a long discussion with jmcneill@ it was considered
to be powerful enough until evidence is shown that devices can handle
D1/D2 with less code and higher speed than without the full
save/restore. The generic code is carefully written to handle device
without PCI-PM support and ensure that the correct registers are written
to when D3 loses all state.

Reimplement the generic PCI network device handling on
top of PCI generic power handling.

Introduce pci_disable_retry as used and implemented locally at least by
ath(4) and iwi(4). Use it in this drivers to restore behaviour from
before the introduction of generic PCI network handling.

Convert all PCI drivers that were using pnp_register to the new
framework. The only exception is vga(4) as it is commonly used as
console device. Add a note therein that this should be fixed later.
 1.41.6.6  06-Sep-2007  jmcneill Add Intel G33 AGP support, resolves PR36902, PR36903, PR36904, PR36906,
PR36907, PR36908, PR36909, PR36910, PR36911, PR36912, PR36913, and PR36925.
 1.41.6.5  27-Aug-2007  jmcneill Add 965PM support.
 1.41.6.4  16-Aug-2007  jmcneill Sync with HEAD.
 1.41.6.3  07-Aug-2007  jmcneill Add i810 power handler.
 1.41.6.2  06-Aug-2007  jmcneill Move agp_i810_power to agp, since it does nothing specific to the i810
hardware. Allow agp front-ends to override the default power handler if
specific configuration needs to take place, and expose agp_power via
agpvar.h so the front-ends can call back to it to do generic initialization.
 1.41.6.1  03-Aug-2007  jmcneill Pull in power management changes from private branch.
 1.41.2.1  15-Aug-2007  skrll Sync with HEAD.
 1.42.6.2  13-Nov-2007  bouyer Sync with HEAD
 1.42.6.1  25-Oct-2007  bouyer Sync with HEAD.
 1.42.2.3  23-Mar-2008  matt sync with HEAD
 1.42.2.2  09-Jan-2008  matt sync with HEAD
 1.42.2.1  06-Nov-2007  matt sync with HEAD
 1.44.2.4  18-Feb-2008  mjf Sync with HEAD.
 1.44.2.3  27-Dec-2007  mjf Sync with HEAD.
 1.44.2.2  08-Dec-2007  mjf Sync with HEAD.
 1.44.2.1  19-Nov-2007  mjf Sync with HEAD.
 1.46.4.1  11-Dec-2007  yamt sync with head.
 1.46.2.1  26-Dec-2007  ad Sync with head.
 1.47.2.1  08-Jan-2008  bouyer Sync with HEAD
 1.48.6.5  17-Jan-2009  mjf Sync with HEAD.
 1.48.6.4  28-Sep-2008  mjf Sync with HEAD.
 1.48.6.3  29-Jun-2008  mjf Sync with HEAD.
 1.48.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.48.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.48.2.1  24-Mar-2008  keiichi sync with head.
 1.52.6.2  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.52.6.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.52.4.5  11-Aug-2010  yamt sync with head.
 1.52.4.4  11-Mar-2010  yamt sync with head
 1.52.4.3  16-May-2009  yamt sync with head
 1.52.4.2  04-May-2009  yamt sync with head.
 1.52.4.1  16-May-2008  yamt sync with head.
 1.52.2.2  17-Jun-2008  yamt sync with head.
 1.52.2.1  18-May-2008  yamt sync with head.
 1.54.4.2  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.54.4.1  19-Oct-2008  haad Sync with HEAD.
 1.56.8.1  21-Apr-2010  matt sync to netbsd-5
 1.56.4.2  20-Nov-2010  riz Pull up following revision(s) (requested by jakllsch in ticket #1362):
sys/dev/pci/pcidevs: revision 1.1026
sys/dev/pci/agp_intel.c: revision 1.35
sys/dev/pci/agp_i810.c: revision 1.67
Add Intel 82855GM Host-AGP Bridge.
regen
Add (non-IGP) AGP port support for Intel 82855GM.
agp_intel tested with radeondrm(4). agp_i810 tested with i915drm(4).
 1.56.4.1  05-May-2009  bouyer Pull up following revision(s) (requested by snj in ticket #737):
sys/arch/x86/pci/pchb.c: revisions 1.15 - 1.17
sys/dev/pci/agp.c: revisions 1.63 - 1.65
sys/dev/pci/agp_i810.c: revisions 1.57 - 1.64
sys/dev/pci/pcidevs: revisions 1.965, 1.967 via patch
sys/dev/pci/agpreg.h: revision 1.20
Add AGP support for Intel G35, G45, and Q45.
 1.56.2.2  03-Mar-2009  skrll Sync with HEAD.
 1.56.2.1  19-Jan-2009  skrll Sync with HEAD.
 1.62.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.65.2.2  17-Aug-2010  uebayasi Sync with HEAD.
 1.65.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.66.2.4  21-Apr-2011  rmind sync with head
 1.66.2.3  05-Mar-2011  rmind sync with head
 1.66.2.2  03-Jul-2010  rmind sync with head
 1.66.2.1  30-May-2010  rmind sync with head
 1.69.4.2  05-Mar-2011  bouyer Sync with HEAD
 1.69.4.1  08-Feb-2011  bouyer Sync with HEAD
 1.69.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.73.26.2  05-Mar-2014  riastradh Expose agp_i810_write_gtt_entry for drm2.

Also add an agp_i810_post_gtt_entry to do a posting read for that GTT
entry.
 1.73.26.1  05-Mar-2014  riastradh Expose the agp_i810 softc.

This is an Intel-specific kludge so that i915drmkms can get at the
GTT, graphics translation table, for pre-Sandy Bridge Intel graphics
devices.
 1.73.24.1  08-Aug-2014  msaitoh Pull up following revision(s) (requested by riastradh in ticket #1105):
src/sys/dev/pci/agp_i810.c 1.108-1.110 via patch.
Bind i810 dcache pages at the requested offset, not at VA start.
From John D Baker in PR xsrc/48344.
 1.73.18.1  18-May-2014  rmind sync with head
 1.73.16.1  08-Aug-2014  msaitoh Pull up following revision(s) (requested by riastradh in ticket #1105):
src/sys/dev/pci/agp_i810.c 1.108-1.110 via patch.
Bind i810 dcache pages at the requested offset, not at VA start.
From John D Baker in PR xsrc/48344.
 1.73.14.2  03-Dec-2017  jdolecek update from HEAD
 1.73.14.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.73.10.1  08-Aug-2014  msaitoh Pull up following revision(s) (requested by riastradh in ticket #1105):
src/sys/dev/pci/agp_i810.c 1.108-1.110 via patch.
Bind i810 dcache pages at the requested offset, not at VA start.
From John D Baker in PR xsrc/48344.
 1.73.4.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.74.2.1  10-Aug-2014  tls Rebase.
 1.112.2.5  27-Jan-2016  snj Pull up following revision(s) (requested by riastradh in ticket #1078):
sys/dev/pci/agp_i810.c: revision 1.120
sys/dev/pci/agp_i810.c: revision 1.121
CID 1328433: Anding with 0 and comparing != 0 will not work very will.
Fix typo
 1.112.2.4  06-Nov-2015  riz Pull up following revision(s) (requested by riastradh in ticket #1000):
sys/dev/pci/agp_i810.c: revision 1.119
Fix mapping Intel graphics device registers.
- Accept either 32-bit or 64-bit mappings for all devices.
- Let the device always dictate size of the mapping.
- Explain why we don't have a statically fixed mapping size.
Fixes the main part of PR kern/50060. Still a display mode issue
from one submitter, but it is almost certainly an unrelated issue.
 1.112.2.3  23-Apr-2015  snj Pull up following revision(s) (requested by mrg in ticket #718):
sys/arch/x86/include/pmap.h: revision 1.56
sys/arch/x86/x86/pmap.c: revision 1.188
sys/dev/pci/agp_amd64.c: revision 1.8
sys/dev/pci/agp_i810.c: revision 1.118
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: revision 1.16
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.29
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_agp.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: revision 1.4
sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_agp.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_crtc.c: revision 1.2
sys/external/bsd/drm2/dist/drm/radeon/radeon_object.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c: revision 1.7
sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c: revisions 1.7-1.10
sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c: revision 1.5
sys/external/bsd/drm2/i915drm/intelfb.c: revision 1.13
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: revisions 1.12, 1.13
sys/external/bsd/drm2/include/linux/mm.h: revision 1.5
sys/external/bsd/drm2/include/linux/pci.h: revisions 1.16, 1.17
sys/external/bsd/drm2/nouveau/nouveaufb.c: revision 1.2
sys/external/bsd/drm2/radeon/radeon_pci.c: revisions 1.8, 1.9
sys/uvm/uvm_init.c: revision 1.46
Hack against the blank console problem:
Leave the CLUT alone on ancient cards. At least this leaves us with a
semi working console (red and blue are flipped). Leave an example of what
seems to be happening but disable it because colors are better than 444 bit
greyscale.
--
Initialize P->V tracking for unmanaged device pages in uvm_init.

Conditional on __HAVE_PMAP_PV_TRACK until we add it to all pmaps.

MI part of pmap_pv(9) change proposed on tech-kern:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html
--
Implement pmap_pv(9) for x86 for P->V tracking of unmanaged pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html
--
Use pmap_pv(9) to remove mappings of Intel graphics aperture pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html

Further background at:

https://mail-index.netbsd.org/tech-kern/2014/07/23/msg017392.html
--
Use pmap_pv(9) to remove mappings of device pages in TTM.

Adapt nouveau and radeon to do pmap_pv_track for their device pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html

Further background at:

https://mail-index.netbsd.org/tech-kern/2014/07/23/msg017392.html
--
Fix error branches in agp_amd64.c.

- agp_generic_detach always.
- Free asc if it was allocated. (Found by Brainy, noted by maxv@.)
- Free the GATT if it was allocated.
--
pmf_device_register returns false on failure, not true
--
In DRM_SPIN_WAIT_ON, don't stop after waiting only one tick.

Continue the loop to recheck the condition and count the whole
duration.
--
Don't use the video BIOS memory as an i915 flush page!
--
Don't let anyone else allocate the video BIOS either.
--
Missed a zero: it's 0x100000, not 0x10000.
--
Don't reserve if atomic -- caller must have pre-pinned the buffer.
--
Don't reserve if atomic -- caller must have pre-pinned the buffer.
--
almost add radeondrmkms suspend/resume support. it unfortunately doesn't work.
--
Need the page's uvm object lock to do pmap_page_protect.
--
Use KASSERTMSG to show bad base/offset.
--
KASSERT about page-alignment on initialization too.
--
Don't break when hardclock_ticks wraps around.

Since we now only count time spent in wait, rather than determining
the end time and checking whether we've passed it, timeouts might be
marginally longer in effect. Unlikely to be an issue.
--
Remove broken drm2 vm_mmap stub. Can't possibly have ever worked.
--
apply some of the additional changes from Arto Huusko in PR#49645:
- call pmf_device_deregister on detach.

i've kept the "resume = true" for radeon_resume_kms() call as it
seems to work for me (indeed, code inspection shows it is unused
on netbsd :-)

my old nforce4 box that can resume old drm (or could, last i tried
several years ago) while X and GL apps were running, can at least
survive a resume if X hasn't started. my one attempt so far with
X exited, but having run, did not work.
--
First attempt to make ttm_buffer_object_transfer less bogus.
--
Make sure mem.bus.is_iomem is initialized. PR 49833
 1.112.2.2  17-Mar-2015  riz Pull up following revision(s) (requested by snj in ticket #590):
sys/external/bsd/drm2/i915drm/intel_gtt.c: revision 1.5
sys/external/bsd/drm2/drm/drm_drv.c: revision 1.15
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.28
sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/clock/nouveau_subdev_clock_nv50.c: revision 1.3
sys/dev/pci/agp_i810.c: revision 1.115
sys/dev/pci/agp_i810.c: revision 1.116
sys/external/bsd/drm2/include/drm/intel-gtt.h: revision 1.5
sys/dev/pci/agp_i810.c: revision 1.117
sys/external/bsd/drm2/drm/drm_gem_vm.c: revision 1.6
sys/dev/pci/agp_i810var.h: revision 1.6
Issue a write barrier after updating the GTT.
Linux never used to do this...until a month:
<a rel="nofollow" href="https://bugs.freedesktop.org/show_bug.cgi?id=88191">https://bugs.freedesktop.org/show_bug.cgi?id=88191</a>
commit 983d308cb8f602d1920a8c40196eb2ab6cc07bd2
Author: Chris Wilson &lt;chris%chris-wilson.co.uk@localhost&gt;
Date: Mon Jan 26 10:47:10 2015 +0000
agp/intel: Serialise after GTT updates
Include &lt;sys/atomic.h&gt; for membar_producer.
(Why didn't this fail in my build?)
Pass cache-related flags through to the GTT on pre-SNB devices.
I had assumed for ages this would increase the amount of caching and
thereby increase the chance of stale caches leading to rendering
glitches. But apparently I was wrong, and failing to pass these
through was causing all sorts of problems!
Dedup the NetBSD portion of the code (ok Riastradh), no functional change.
Don't return events that are too large and leave them in the list.
Apply access control to gem mmap.
fix gcc is stupid.
 1.112.2.1  18-Sep-2014  martin Pull up following revision(s) (requested by riastradh in ticket #94):
sys/dev/pci/agp_i810.c: revision 1.113
sys/dev/pci/agp_i810.c: revision 1.114
Revert to mapping the whole GTTMMADR region all at once for now and
use the right BAR for MMIO register sizing on i810.
 1.114.2.3  29-May-2016  skrll Sync with HEAD
 1.114.2.2  27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.114.2.1  06-Apr-2015  skrll Sync with HEAD
 1.122.18.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.122.18.1  10-Jun-2019  christos Sync with HEAD
 1.122.16.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.122.10.1  31-Aug-2018  martin Pull up following revision(s) (requested by riastradh in ticket #998):

sys/dev/pci/agp_i810var.h: revision 1.7
sys/external/bsd/drm2/i915drm/intel_gtt.c: revision 1.7
sys/dev/pci/agp_i810.c: revision 1.123

Restore gtt page table control register on resume.

Additional subroutine agp_i810_reset is used by i915drmkms to make
sure it happens early enough, since i915drmkms resumes before agp.

XXX pullup-7
XXX pullup-8
 1.125.4.1  03-Feb-2024  martin Pull up following revision(s) (requested by riastradh in ticket #574):

sys/dev/pci/agp_i810.c: revision 1.126

agp_i810(4): Use ipi(9) for chipset flush on all CPUs, not xcall(9).

i915 now calls into this with a spin lock held, so we have to use
ipi(9), which spin-waits for the other CPUs to complete, rather than
xcall(9), which may sleep-wait.

Fortunately, this is just to execute WBINVD on x86 (and if this code
ever runs on other architectures, which it probably doesn't, it'll be
a similar barrier instruction), so spinning to wait for that on all
CPUs isn't too costly.

PR kern/57878

RSS XML Feed