Commit Graph

144 Commits

Author SHA1 Message Date
maya b8f12c7fce Check pmf_device_register return value. NFC
Appeases static analyzers.
2017-01-20 12:25:07 +00:00
christos ef41e53307 PR/50560: David Binderman: fix memory leaks. 2015-12-15 12:33:03 +00:00
riastradh 4897f1c47a Remove old drm's container_of. 2015-04-20 15:38:13 +00:00
chs 781ea102df initialize "addr" before passing its address to uvm_mmap_dev().
from Onno van der Linden in PR 49536.
2015-01-10 23:34:49 +00:00
chs 6d40f9ff57 add a new "fo_mmap" fileops method to allow use of arbitrary uvm_objects for
mappings of file objects.  move vnode-specific details of mmap()ing a vnode
from uvm_mmap() to the new vnode-specific vn_mmap().  add new uvm_mmap_dev()
and uvm_mmap_anon() convenience functions for mapping character devices
and anonymous memory, and replace all other calls to uvm_mmap() with those.
use the new fileop in drm2 so that libdrm can use mmap() to map things
like on other platforms (instead of the ioctl that we have used so far).
2014-12-14 23:48:58 +00:00
christos 334b0825ac fix the module class. 2014-11-10 16:32:21 +00:00
riastradh 3521230303 Canonicalize boolean result from test_and_set_bit.
Not actually semantically significant for any callers, but Linux
documentation insists it is important, so we'll follow suit.

Fixes last part of PR kern/48999.
2014-10-04 15:51:23 +00:00
matt 0886859292 Rename enum pipe to enum pipe so it won't conflcit with struct pipe. 2014-09-05 09:40:44 +00:00
dholland 9b97857eeb Fix misplaced parenthesis, from Henning Petersen in PR 44804. 2014-07-27 03:49:25 +00:00
dholland f9228f4225 Add d_discard to all struct cdevsw instances I could find.
All have been set to "nodiscard"; some should get a real implementation.
2014-07-25 08:10:31 +00:00
riastradh 7df9e83c86 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.
2014-06-12 15:05:29 +00:00
christos 6d15f6a395 fix pci_intr_string 2014-03-29 19:54:46 +00:00
christos aa2f824875 kill sprintf 2014-03-25 15:33:22 +00:00
dholland a68f9396b6 Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
2014-03-16 05:20:22 +00:00
christos 767345987a remove unused variables 2013-10-17 21:15:18 +00:00
christos b94bb9347c define a new macro that does not declare variables used in output. 2013-10-17 21:15:00 +00:00
christos 86aec73c13 annotate some unused variables the authors want to keep 2013-10-17 21:14:05 +00:00
joerg 0c1143e0a4 Mark mach64_set_dma_eol as unused. 2013-09-14 12:39:28 +00:00
soren 09454bb7c5 Missing AB_QUIET newlines. 2013-07-22 13:43:49 +00:00
mlelstv 78c79fafb1 fix build for 'no options MTRR' 2013-06-06 07:55:46 +00:00
msaitoh 202434cbda Fix wrong reference to dev_priv->saveSWF1. It was clearly wrong. 2012-12-11 07:31:39 +00:00
chs 25ae74a8a7 fix the DRM string sysctls to use copyout() instead of strcat()
to deliver the data to the user buffer.
2012-09-29 14:19:43 +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
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
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
dyoung e265f67bc1 #include <sys/bus.h> instead of <machine/bus.h>. 2011-07-01 18:31:32 +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
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