Commit Graph

200 Commits

Author SHA1 Message Date
darrenr
109f582a52 ansify new functio definitions 2012-07-22 16:13:16 +00:00
darrenr
13885a6659 Merge IPFilter 5.1.2 into HEAD 2012-07-22 14:27:35 +00:00
chs
bb833a1164 when freeing the DRM_SHM kernel memory that can be mapped by a user process,
remove any user mappings before freeing the memory, so that a user process
doesn't have still have access to that physical memory after it's reused.
this really shouldn't be using kernel malloc'd memory at all,
but changing that would be much more involved.
2012-06-17 15:15:34 +00:00
tsutsui
0a449abb14 Make i915drm work on Atom N4xx/D410/D510 + GMA3150 integrated graphic devices.
Patch is taken from FreeBSD:
 http://www.freebsd.org/cgi/query-pr.cgi?pr=143427
and tested on MSI U135DX running NetBSD/i386 6.0_BETA2 with this patch.

Should be pulled up to netbsd-6.
2012-06-11 16:51:04 +00:00
dsl
e21a34c25e Add some pre-processor magic to verify that the type of the data item
passed to sysctl_createv() actually matches the declared type for
  the item itself.
In the places where the caller specifies a function and a structure
  address (typically the 'softc') an explicit (void *) cast is now needed.
Fixes bugs in sys/dev/acpi/asus_acpi.c sys/dev/bluetooth/bcsp.c
  sys/kern/vfs_bio.c sys/miscfs/syncfs/sync_subr.c and setting
  AcpiGbl_EnableAmlDebugObject.
(mostly passing the address of a uint64_t when typed as CTLTYPE_INT).
I've test built quite a few kernels, but there may be some unfixed MD
  fallout. Most likely passing &char[] to char *.
Also add CTLFLAG_UNSIGNED for unsiged decimals - not set yet.
2012-06-02 21:36:41 +00:00
christos
0c6adeca02 apply our changes.
- prototypes
- ip_h323_pxy.c is missing from the distribution
- original tar distribution is missing <$>Id values in most files
2012-03-23 20:39:49 +00:00
christos
c2aa585c8d import kernel portion of ipfilter 5.1.1 2012-03-23 20:36:52 +00:00
christos
139782ccab Use the release date as suggested.
XXX: I bet this is going to be broken in the next import because nobody
will remember to fix it.
2012-02-19 16:45:03 +00:00
christos
5fd581afdb Fix for MKREPRO = yes
XXX: pullup to 6
2012-02-19 05:07:10 +00:00
drochner
38123a2b84 remove incomplete conversion to kmem_alloc -- inconsistent use
leads at least to diagnostic panics
2012-01-29 11:49:02 +00:00
para
e62ee4d475 extending vmem(9) to be able to allocated resources for it's own needs.
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)

releng@ acknowledged
2012-01-27 19:48:38 +00:00
jmcneill
3076984ffe have pci register itself as a module, and make PCI driver modules depend on it 2011-08-29 14:47:07 +00:00
jmcneill
5a2b8072e4 return 'error' not 0, fixes non-module build 2011-08-28 20:37:06 +00:00
jmcneill
7dc79b6997 return 'error' not 0, fixes non-module build 2011-08-28 20:22:42 +00:00
jmcneill
97d971731f add mach64drm, mgadrm, r128drm, savagedrm, sisdrm, and tdfxdrm modules 2011-08-28 16:19:07 +00:00
jmcneill
5494668f55 Split out ati_pcigart into a separate module so it can be shared with r128drm 2011-08-28 15:56:21 +00:00
jmcneill
54d6e22c5d set default WARNS for modules to 3 -- the only one that needs < 3 now is pf 2011-08-28 15:40:49 +00:00
dholland
ef311a878c Requires stdint.h. 2011-08-22 00:33:16 +00:00
mrg
59a63b01d0 add a little bit of DRM_NO_AGP to help build on ofppc 2011-08-03 06:42:59 +00:00
jakllsch
52d2d92c08 Add additional Radeon devices from FreeBSD via Dragon Fly BSD. 2011-07-25 14:21:52 +00:00
joerg
3eb244d801 Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
2011-07-17 20:54:30 +00:00
dyoung
e265f67bc1 #include <sys/bus.h> instead of <machine/bus.h>. 2011-07-01 18:31:32 +00:00
jruoho
f16280b523 More __UNCONST(3). 2011-06-28 09:27:49 +00:00
jruoho
30c90d58f5 Adjust for ACPICA 20110623. 2011-06-28 09:11:33 +00:00
jruoho
8ad757efb2 Merge ACPICA 20110623. 2011-06-28 09:04:29 +00:00
jruoho
a8e4c04612 Import ACPICA 20110623.
Selected changes since 20110211 include, among other things, fixes to _PRW
parsing, fix to a regression with the Load() operator, improvements in NULL
package element removal, support for "spurious" global lock interrupts,
execution of orphaned _REG methods under acpiec(4), and smaller iasl(8)
improvements.
2011-06-28 09:01:37 +00:00
joerg
38d1b26693 dma_addr_t may not be a 64bit type, so add an explicit cast here instead
of silent truncation
2011-06-09 14:47:15 +00:00
joerg
e9589da531 Fix format strings to match arguments 2011-05-30 13:52:26 +00:00
joerg
232e4194f9 Remove invalid const, the content is later passed to free. 2011-05-30 13:50:36 +00:00
christos
409ea14c30 more wrong formats. 2011-05-25 15:15:55 +00:00
christos
44751c73dc fix printf formats. 2011-05-25 14:11:36 +00:00
joerg
04061efbeb Use some format specifiers that actually exist 2011-05-24 18:22:02 +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
tron
987385a05b Fix build of "radeondrm" kernel module. 2011-03-30 19:59:04 +00:00
mlelstv
4970268137 Add missing agp.h include file. 2011-03-30 17:21:04 +00:00
mlelstv
818c0190bf Make code compile when the kernel has no support for AGP. For now this also
rules out PCIE support without AGP because all the code is drm_agpsupport.c
2011-03-27 08:45:11 +00:00
jakllsch
65734ab916 Make interrupt establishment failure be noted like most other PCI drivers do. 2011-03-05 21:43:38 +00:00
jakllsch
ae52eb0e4e Correct #endif comment. 2011-03-05 21:38:34 +00:00
jmcneill
f99cc07e58 use pa_intrpin instead of pa_intrline for irq#, since drivers treat irq=0
as "no irq" and this matches pa_intrpin encoding
2011-02-27 01:02:39 +00:00
mrg
cba6b56402 change "int pipe" into "unsigned int pipe". 2011-02-24 08:02:55 +00:00
mrg
310cb41fcc convert all crtc values passed in from userland to be unsigned instead
of signed.  there's still some more internal to the i915 driver that
should be converted.

tested on a radeon x1550.
2011-02-24 07:59:44 +00:00
jruoho
93a12f383b Fix wrong note in a comment. 2011-02-20 06:09:16 +00:00
jruoho
95a56e1be2 Provide ACPI_CAST_PTHREAD_T(x). 2011-02-18 17:31:14 +00:00
jruoho
eb474d132b Revert previous. 2011-02-18 17:26:07 +00:00
jmcneill
4add633a5d sync viadrm with FreeBSD, big new feature is AGP DMA and PCI DMA support 2011-02-18 14:26:09 +00:00
jruoho
d47b7e1166 Cast pthread_self(3) to uintptr_t. ACPICA 20100915:
The ACPI_THREAD_ID type is no longer configurable, internally it is now
always UINT64.  This simplifies the ACPICA code, especially any printf
output.  UINT64 is the only common data type for all thread_id types across
all operating systems.  It is now up to the host OSL to cast the native
thread_id type to UINT64 before returning the value to ACPICA (via
AcpiOsGetThreadId).  Lin Ming, Bob Moore.
2011-02-18 13:01:22 +00:00
jmcneill
88c6140601 get rid of this stale copy of via_drv.c, the one we want is in bsd-core 2011-02-18 02:52:42 +00:00
jmcneill
3d85f4c008 get rid of #ifdef __FreeBSD__ sections
use ioconf & add a module dependency on "drm"
2011-02-18 02:00:36 +00:00
jakllsch
1ed4f910c6 Add the RS880 device IDs to radeondrm(4). 2011-02-17 23:21:53 +00:00
jruoho
fa8715d817 Fix ACPI_DEBUG build. 2011-02-17 12:08:14 +00:00
jruoho
2edec7caea Sigh. Why some people are unable to write proper C? 2011-02-17 11:21:40 +00:00
jruoho
f92834d9d6 __UNCONST(3). 2011-02-17 10:59:31 +00:00
jruoho
15a9932e12 Update for ACPICA 20110211. 2011-02-17 10:13:35 +00:00
jruoho
72daaf98ee ACPI_THREAD_ID type was changed to uint64_t, which is good enough for us. 2011-02-17 10:12:50 +00:00
jruoho
159c4e26bd Merge ACPICA 20110211. 2011-02-17 10:09:40 +00:00
jruoho
124f4c82e1 Import 20110211. 2011-02-17 10:00:50 +00:00
jruoho
ba4af2fdd7 Add the build glue. 2011-02-17 07:27:17 +00:00
jruoho
df3b2cd4aa Revert the change made by cegger@ to the GPE reference counting.
The forthcoming version includes a rewritten GPE handling, so it
is unclear how relevant and safe this change is. If needed, this
will be re-applied later.
2011-02-17 07:24:41 +00:00
jruoho
716c1ee010 Apply our local patches. 2011-02-17 07:21:14 +00:00
jruoho
28c506b8f8 Reimport ACPICA 20100528 to a new location. 2011-02-17 07:16:14 +00:00
jmcneill
8f6ebfdd74 map the framebuffer and agp with BUS_SPACE_MAP_PREFETCHABLE 2011-02-15 14:24:23 +00:00
jmcneill
18b8e65603 wsdisplay isn't module friendly so don't add genfb support to the kmod for now 2011-02-12 14:49:54 +00:00
jmcneill
65c6f254b0 Make DRM work with genfb again. 2011-02-11 01:13:02 +00:00
dyoung
153bc7928e unifdef -U__linux__ -U__FreeBSD__. No functional change intended. 2011-01-21 21:57:16 +00:00
cegger
f150925704 recognize Radeon HD 4200. This lets radeondrm(4) attach.
"go ahead" macallan@
2011-01-06 11:07:48 +00:00
mrg
1109ac3635 use a sysctllog structure, and sysctl_teardown(), to destroy the drm data.
this should actually now fix PR#40029.
2010-11-10 05:22:55 +00:00
mrg
a3ccd86a62 call the sysctl destroy functions upon failure and unload, which
should fix PR#40029.  while there, fix the radeon unload, which
was improperly matching mutex init/destroy operations and leading
to trying to destroy lock that was never initialised.
2010-11-06 22:06:10 +00:00
jmcneill
3df8768a1c Get viadrm working again 2010-08-21 11:54:36 +00:00
hannken
1664eae7f3 Using vfinddev() leads to vnode races as it returns an unreferenced
vnode that may disappear before the caller has a chance to reference it.

Reference the vnode while the specfs cache is locked.

Welcome to 5.99.37.

No objections on tech-kern.
2010-07-21 09:06:37 +00:00
mrg
857eb74b8b also make radeondrm depend upon firmload, not just r128drm.
should fix kern/43646 from kre.
2010-07-21 03:14:32 +00:00
mrg
7d9a68ec2a radeondrm depends upon firmload now; noted by rjs. 2010-07-06 16:33:31 +00:00
mrg
9dd0ef545a kill these old built-in firmware headers; we use the ones installed into
the filesystem from src/sys/microcode/radeon now.
2010-07-06 04:15:44 +00:00
mrg
ad13e17661 move all the radeondrm firmware images into the filesystem. check that
some firmware sizes are the expected size.  (XXX make all.)

based upon similar changes seen in the linux radeon drm driver.

this saves about 250KB in the kernel or module.
2010-07-05 20:32:23 +00:00
rmind
3c507045e2 Remove pfind() and pgfind(), fix locking in various broken uses of these.
Rename real routines to proc_find() and pgrp_find(), remove PFIND_* flags
and have consistent behaviour.  Provide proc_find_raw() for special cases.
Fix memory leak in sysctl_proc_corename().

COMPAT_LINUX: rework ptrace() locking, minimise differences between
different versions per-arch.

Note: while this change adds some formal cosmetics for COMPAT_DARWIN and
COMPAT_IRIX - locking there is utterly broken (for ages).

Fixes PR/43176.
2010-07-01 02:38:26 +00:00
mrg
ca255ec20b add minimal support for radeon 5xxx. there's not enough for it to be
useful yet, but that's not a big deal since the latest xf86-video-ati
doesn't support DRM on these yet.

new microcode images obtained from:
	http://people.freedesktop.org/~agd5f/radeon_ucode/

XXX: need to fix max_hw_contexts handling at the very least.

XXX: should convert radeondrm to use firmload(9)
2010-06-26 23:05:13 +00:00
mrg
b274f3a3b2 add the latest generation of radeon cards. 2010-06-26 23:00:19 +00:00
mrg
dd166cb036 add CHIP_CEDAR, CHIP_REDWOOD, CHIP_JUNIPER, CHIP_CYPRESS and CHIP_HEMLOCK. 2010-06-26 22:59:31 +00:00
mrg
280989eb06 use round_page() for PAGE_ALIGN(). from Onno van der Linden
<o.vd.linden@quicknet.nl> in PR#38700, though apparently i didn't
commit it way back when i closed that bug.  oops?
2010-05-24 08:51:53 +00:00
mrg
bcf0a7d7e9 add r600_blit.c and radeon_cs.c. 2010-05-24 01:57:06 +00:00
mrg
4351b00b10 implement DRM_RADEON_CS ioctl, necessary for r600_dri to function.
this is mostly from freebsd (though it also exists in other versions
of the drm code) svn commits:

--
SVN rev 196470 on 2009-08-23 14:55:57Z by rnoland

Add kernel support for Radeon R6/7xx 3D.

You will still need Mesa from git and possibly an updated DDX driver,
but this is working fairly well now.
--
SVN rev 196142 on 2009-08-12 12:57:02Z by rnoland

Add support for radeon RS880 IGP chips to drm.
--
SVN rev 195501 on 2009-07-09 16:39:28Z by rnoland

Add support for Radeon HD 4770 (RV740) chips.
--
SVN rev 196471 on 2009-08-23 15:02:58Z by rnoland

Add GET_PARAM support for Z pipes.

This is needed for occulsion queries on rv530 chips.
--
SVN rev 198695 on 2009-10-30 18:07:22Z by rnoland

A bit of cleanup work on radeon_freelist_get()

  * Fix the main loop to search all buffers before sleeping.
  * Remove dead code
--
SVN rev 197606 on 2009-09-28 22:41:28Z by rnoland

Fix offset handling
--
SVN rev 197605 on 2009-09-28 22:40:29Z by rnoland

radeon_family is an enum, so ordering can be important.

sync up with what amd is shipping.
--
SVN rev 197603 on 2009-09-28 22:37:07Z by rnoland

R600 doesn't support IRQs yet, so don't try to use them.
--

special thanks to robert noland @ freebsd for making this an
easy port!
2010-05-24 01:39:06 +00:00
mrg
c049f1739e only use bus_space*() on drm_local_map_t's that have been mapped into
some bus space somewhere.  otherwise, just use normal accesses since
it is normal memory.

this fixes radeondrm on x86 since bus_space_tag_t became a pointer.

add the "GEM" and "TTM" mapping types to sysctl support (though right
now we will never have them in our list of maps.)
2010-05-19 22:14:20 +00:00
mrg
c8c2757eb3 don't pass "maxaddr" as a boundary in bus_dmamap_create() like rev 1.8
did for _alloc().
2010-03-20 02:53:35 +00:00
mrg
b68c326c4a make suspend/resume actually work:
- we have to DRM_LOCK()/DRM_UNLOCK(), thus s/rad_dev/dev/ in a variable name
- only call into radeon_cp_{stop,resume}() if the device is active

with this my nforce4 dual core amd system is able to suspend/resume with both
X and drm active.
2010-03-03 03:48:39 +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
jmorse
f3d653714c PR/42262: Support drm drivers (intel G33/G45) submapping pci resources 2010-01-26 08:01:26 +00:00
dyoung
3022acc4eb Expand PMF_FN_* macros. 2010-01-08 19:42:11 +00:00
kefren
df341ead56 add suspend/resume hooks for command processor 2009-12-14 21:01:07 +00:00
kefren
498a190b81 add stub pmf hook 2009-12-12 14:15:25 +00:00
dyoung
b9e4d3a3cb Delete the do-nothing device-activation hook, drm_activate(). 2009-12-06 22:51:25 +00:00
jmcneill
00081f593e deregister with pmf on detach 2009-09-27 12:59:38 +00:00
jmcneill
ae0ded3a5f register with pmf 2009-09-27 12:58:51 +00:00
jmcneill
ef43763f40 Port viadrm to NetBSD and fix a bunch of compile issues:
viadrm0 at vga1: VIA P4M900 / VN896
 viadrm0: AGP at 0xf0000000 128MB
 viadrm0: Initialized via 2.11.1 20070202

xf86-video-openchrome seems happy with it, although 3d acceleration isn't
supported on the P4M900 so I can't test that part.
2009-09-27 12:39:04 +00:00
mrg
f4964bc1fa make sure to call pci_intr_*stablish() with the right first argument;
it worked by C-luck on x86, but macppc picked it up.
2009-09-27 03:48:07 +00:00
drochner
1e4e3d1be4 fix some confusion between highest DMA address and the boundary not to
be crossed in a transfer,
back out previous fixes which only added to the confusion
2009-09-12 17:16:41 +00:00
christos
5a2044242f PR/42041: Jasper Wallace: Stopgap fix for kernel assert
("(boundary & (boundary - 1)) == 0") triggers with i915drm in recent -5 kernel

Read the comment in the code for a detailed explanation. This should be fixed
properly in the i386 bus code, but it is too intrusive to do for -5.
XXX: pullup for 5.x
2009-09-10 18:11:21 +00:00
mrg
6769a80c80 - normalize netbsd drm_mtrr_del() with freebsd, removing a few #if's
- make the mtrr code do nothing on non-x86
2009-09-02 01:36:41 +00:00
mrg
2d22194137 remove a memset() that isn't necessary. 2009-09-02 01:34:34 +00:00
mrg
783fe8b458 introduce an ugly but simple hack to work around external software
requirements: set the drm pci "domain" to the pci bus unit number.
this matches what libpciaccess does for netbsd and now drm is much
happier again.
2009-08-26 01:37:10 +00:00
mrg
60e6e5077b on netbsd with the single final close() action, make sure we clean up
all the files attached to dev->files.  we check for one per "open_count"
that is above 1.  could perhaps assert() that we are empty afterwards.

this fixes restarting X + drm after actually using drm.
2009-08-23 08:55:16 +00:00
mrg
71b88e73aa - stash the fbmap into the radeon dev_priv handle so we can ..
- call drm_rmmap() in radeon_do_cleanup_cp on the two maps created
- in several vblank functions, check to make sure we have mappings
  enabled before doing something that might blow up.  fixes PR#41715.
2009-08-08 17:59:25 +00:00