Commit Graph

76 Commits

Author SHA1 Message Date
riastradh
ca2a6957fa Handle 64-bit paddr registers delicately for non-PAE i386. 2014-05-24 14:17:29 +00:00
riastradh
824cf4b929 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.
2014-05-23 22:58:56 +00:00
riastradh
6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
dyoung
d3e53912d2 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'
2011-04-04 20:37:49 +00:00
matt
95ad459439 Add Intel Pineview support 2011-02-24 20:01:53 +00:00
gsutre
877d0fbda9 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@
2011-01-30 23:43:08 +00:00
gsutre
b1dbb239c6 Typos, fix memory binding for memory type 2, and add consistency checks.
From OpenBSD.

ok jmcneill@
2011-01-25 10:52:11 +00:00
uebayasi
8184d5dc03 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.
2010-11-13 13:51:57 +00:00
riz
42943652d9 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@
2010-06-16 03:35:01 +00:00
jakllsch
058c4e6e3b Add (non-IGP) AGP port support for Intel 82855GM.
agp_intel tested with radeondrm(4).  agp_i810 tested with i915drm(4).
2010-04-04 14:40:05 +00:00
dyoung
c1b390d493 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.
2010-02-24 22:37:54 +00:00
dyoung
cd6e1fbf91 Expand PMF_FN_* macros. 2010-01-08 19:53:10 +00:00
markd
a44286a718 Treat G4X like I915 and G33 for MSAC. Fixes aperture setting.
Has been working successfully for me and snj for the last few months.
2009-05-04 11:05:45 +00:00
markd
e985093766 Add missing break. 2009-02-19 05:58:37 +00:00
markd
70250ff52e 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.
2009-01-27 08:39:33 +00:00
sketch
8be734c633 Fix PGTBL sizes. 2008-12-13 20:12:13 +00:00
christos
453b04f5be fix PGTBL size detection on the intel 965GM. From Anon Ymous. 2008-12-10 15:48:49 +00:00
alc
0976fc9588 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
2008-12-04 19:07:35 +00:00
christos
78b9002948 Add support for the Intel G45 AGP. From Arnaud Lacombe 2008-11-29 23:48:12 +00:00
christos
71ede8ab96 Support for Intel G35 as found on Asus P5E-VM HDMI motherboard from
Milos Negovanovic
2008-11-08 17:26:28 +00:00
tnn
d49a05b3bf AGP support for Intel 945GME chipset, found on Acer Aspire One. 2008-08-22 18:05:44 +00:00
matthias
0cbadedafe Add agp support for Intel 946gz. 2008-08-19 09:59:54 +00:00
freza
6e9d339816 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.
2008-06-09 06:49:54 +00:00
jmcneill
11830b6203 Don't use aprint_error in the success path. 2008-05-10 14:08:15 +00:00
cegger
9d57c80079 use aprint_*_dev and device_xname 2008-04-10 19:13:36 +00:00
dyoung
f580a3a869 Use PMF_FN_ARGS, PMF_FN_PROTO. 2008-02-29 06:13:39 +00:00
drochner
d1cb76fad4 -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
2008-02-26 20:44:15 +00:00
drochner
d9ffad8652 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.
2008-02-22 19:47:06 +00:00
ad
0664a0459b 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.
2008-01-04 21:17:40 +00:00
jmcneill
4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
markd
769813d901 Add agp support for Intel Q35/G33/Q33. 2007-11-24 02:19:37 +00:00
joerg
ade410e9d5 Merge bunch of AGP changes from jmcneill-pm. 2007-11-12 20:00:14 +00:00
jnemeth
d7d1da9b0d PR/37201 - Yasushi Oshima -- Intel 82965G chipset support 2007-10-30 12:20:03 +00:00
ad
a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
markd
89d3c65ccd Add agp support for i965Q.
Based on a patch for FreeBSD by Eric Anholt.
OKed on tech-kern some months ago.
2007-08-15 02:26:13 +00:00
sborrill
8d4b49cb31 Support more i915 stolen memory configurations (previous limit was 8MB,
some configurations steal up to 64MB). OK christos@
2007-06-20 08:17:12 +00:00
christos
bf9f72425e comment out unmap; breaks X. 2007-03-24 23:02:24 +00:00
drochner
ca93d5d12d simplify previous: no need to call pci_mapreg_info() 2007-03-23 16:39:07 +00:00
jmcneill
046c275369 Initialize mmadrsize in the non-i910 case, otherwise we end up passing an
uninitialized variable to bus_space_unmap.
2007-03-23 16:27:59 +00:00
drochner
2d9e04fc35 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
2007-03-20 18:05:25 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
christos
168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
jmcneill
f135e0d607 Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
2006-09-24 03:53:07 +00:00
simonb
6c1cfac08b 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.
2006-07-30 04:23:44 +00:00
tron
9021894476 Make this build with GCC 4.x. 2006-06-27 10:34:25 +00:00
elad
2867b68bc3 integrate kauth. 2006-05-14 21:42:26 +00:00
rpaulo
6885ff5af3 s/#ifdef DEBUG/#ifdef AGP_DEBUG/ 2006-04-15 20:23:32 +00:00
christos
a39411c0d7 PR/32550: Michael Eriksson: No agp(4) support for i915 integrated graphics 2006-01-16 22:59:36 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00