History log of /freebsd-11-stable/sys/dev/drm/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
331411 23-Mar-2018 emaste

MFC r331333: Fix kernel memory disclosure in drm_infobufs

drm_infobufs() has a structure on the stack, fills it out and copies it
to userland. There are 2 elements in the struct that are not filled out
and left uninitialized. This will leak uninitialized kernel stack data
to userland.

Submitted by: Domagoj Stolfa <ds815@cam.ac.uk>
Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Security: Kernel memory disclosure (798)

331409 23-Mar-2018 emaste

MFC r331339: Correct signedness bug in drm_modeset_ctl

drm_modeset_ctl() takes a signed in from userland, does a boundscheck,
and then uses it to index into a structure and write to it. The
boundscheck only checks upper bound, and never checks for nagative
values. If the int coming from userland is negative [after conversion]
it will bypass the boundscheck, perform a negative index into an array
and write to it, causing memory corruption.

Note that this is in the "old" drm driver; this issue does not exist
in drm2.

Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed by: cem
Sponsored by: The FreeBSD Foundation

331017 15-Mar-2018 kevans

MFC r317055,r317056 (glebius): Include sys/vmmeter.h as included

r317055: All these files need sys/vmmeter.h, but now they got it implicitly
included via sys/pcpu.h.

r317056: Typo!


/freebsd-11-stable/sys/amd64/amd64/efirt.c
/freebsd-11-stable/sys/amd64/amd64/minidump_machdep.c
/freebsd-11-stable/sys/amd64/amd64/uma_machdep.c
/freebsd-11-stable/sys/arm/arm/intr.c
/freebsd-11-stable/sys/arm/arm/machdep.c
/freebsd-11-stable/sys/arm/arm/trap-v4.c
/freebsd-11-stable/sys/arm/arm/trap-v6.c
/freebsd-11-stable/sys/arm/arm/undefined.c
/freebsd-11-stable/sys/arm64/arm64/minidump_machdep.c
/freebsd-11-stable/sys/arm64/arm64/uma_machdep.c
/freebsd-11-stable/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c
/freebsd-11-stable/sys/cddl/compat/opensolaris/sys/kmem.h
/freebsd-11-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
drmP.h
/freebsd-11-stable/sys/dev/drm2/drmP.h
/freebsd-11-stable/sys/fs/msdosfs/msdosfs_denode.c
/freebsd-11-stable/sys/fs/msdosfs/msdosfs_vnops.c
/freebsd-11-stable/sys/kern/kern_mib.c
/freebsd-11-stable/sys/kern/kern_thread.c
/freebsd-11-stable/sys/kern/subr_intr.c
/freebsd-11-stable/sys/kern/subr_syscall.c
/freebsd-11-stable/sys/mips/include/intr_machdep.h
/freebsd-11-stable/sys/mips/mips/minidump_machdep.c
/freebsd-11-stable/sys/mips/mips/uma_machdep.c
/freebsd-11-stable/sys/ofed/drivers/infiniband/core/umem.c
/freebsd-11-stable/sys/powerpc/powerpc/uma_machdep.c
/freebsd-11-stable/sys/sparc64/sparc64/intr_machdep.c
/freebsd-11-stable/sys/sparc64/sparc64/machdep.c
/freebsd-11-stable/sys/sparc64/sparc64/mem.c
/freebsd-11-stable/sys/ufs/ffs/ffs_balloc.c
/freebsd-11-stable/sys/ufs/ffs/ffs_vfsops.c
/freebsd-11-stable/sys/vm/device_pager.c
/freebsd-11-stable/sys/vm/memguard.c
/freebsd-11-stable/sys/vm/sg_pager.c
/freebsd-11-stable/sys/vm/vm_reserv.c
/freebsd-11-stable/sys/x86/x86/intr_machdep.c
/freebsd-11-stable/sys/x86/xen/xenpv.c
330446 05-Mar-2018 eadler

MFC r327231,r327232:

kernel: Fix several typos and minor errors
lib: Fix several typos and minor errors

- duplicate words
- typos
- references to old versions of FreeBSD

316073 28-Mar-2017 kib

MFC r315281:
Use atop() instead of OFF_TO_IDX() for convertion of addresses or
addresses offsets, as intended.

MFC r315580 (by alc):
Simplify the logic for clipping the range returned by the pager to fit
within the map entry.
Use atop() rather than OFF_TO_IDX() on addresses.

302408 08-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
298955 03-May-2016 pfg

sys/dev: minor spelling fixes.

Most affect comments, very few have user-visible effects.


295881 22-Feb-2016 skra

As <machine/param.h> is included from <sys/param.h>, there is no need
to include it explicitly when <sys/param.h> is already included.

Reviewed by: alc, kib
Differential Revision: https://reviews.freebsd.org/D5378


295880 22-Feb-2016 skra

As <machine/pmap.h> is included from <vm/pmap.h>, there is no need to
include it explicitly when <vm/pmap.h> is already included.

Reviewed by: alc, kib
Differential Revision: https://reviews.freebsd.org/D5373


286640 11-Aug-2015 kwm

Instead of defining the actualy user and group id in the drmP.h files
define GID_VIDEO in sys/conf.h, and use it together with UID_ROOT
to define DRM_DEV_UID and DRM_DEV_GID in the drmP.h files.

So there is one place where the UID's and GID's are defined.

Submitted by: ed@
Reviewed by: ed@, dumbbell@
Differential Revision: https://reviews.freebsd.org/D3360


286524 09-Aug-2015 kwm

Add a new group named 'video' with the id of 44. And make drm create
devices in /dev/dri/ with this new group.

This will allow ports and users to more easily access to these devices
for OpenGL and OpenCL support.

Reviewed by: dumbbell@
Approved by: dumbbell@
Differential Revision: https://reviews.freebsd.org/D1260


283999 04-Jun-2015 jhb

Remove compatibility shims for FreeBSD versions older than 8.0.


283998 04-Jun-2015 jhb

Add a new file operations hook for mmap operations. File type-specific
logic is now placed in the mmap hook implementation rather than requiring
it to be placed in sys/vm/vm_mmap.c. This hook allows new file types to
support mmap() as well as potentially allowing mmap() for existing file
types that do not currently support any mapping.

The vm_mmap() function is now split up into two functions. A new
vm_mmap_object() function handles the "back half" of vm_mmap() and accepts
a referenced VM object to map rather than a (handle, handle_type) tuple.
vm_mmap() is now reduced to converting a (handle, handle_type) tuple to a
a VM object and then calling vm_mmap_object() to handle the actual mapping.
The vm_mmap() function remains for use by other parts of the kernel
(e.g. device drivers and exec) but now only supports mapping vnodes,
character devices, and anonymous memory.

The mmap() system call invokes vm_mmap_object() directly with a NULL object
for anonymous mappings. For mappings using a file descriptor, the
descriptors fo_mmap() hook is invoked instead. The fo_mmap() hook is
responsible for performing type-specific checks and adjustments to
arguments as well as possibly modifying mapping parameters such as flags
or the object offset. The fo_mmap() hook routines then call
vm_mmap_object() to handle the actual mapping.

The fo_mmap() hook is optional. If it is not set, then fo_mmap() will
fail with ENODEV. A fo_mmap() hook is implemented for regular files,
character devices, and shared memory objects (created via shm_open()).

While here, consistently use the VM_PROT_* constants for the vm_prot_t
type for the 'prot' variable passed to vm_mmap() and vm_mmap_object()
as well as the vm_mmap_vnode() and vm_mmap_cdev() helper routines.
Previously some places were using the mmap()-specific PROT_* constants
instead. While this happens to work because PROT_xx == VM_PROT_xx,
using VM_PROT_* is more correct.

Differential Revision: https://reviews.freebsd.org/D2658
Reviewed by: alc (glanced over), kib
MFC after: 1 month
Sponsored by: Chelsio


275856 17-Dec-2014 gleb

Adjust printf format specifiers for dev_t and ino_t in kernel.

ino_t and dev_t are about to become uint64_t.

Reviewed by: kib, mckusick


271013 03-Sep-2014 glebius

Remove always false comparison.

Sponsored by: Nginx, Inc.


268351 07-Jul-2014 marcel

Remove ia64.

This includes:
o All directories named *ia64*
o All files named *ia64*
o All ia64-specific code guarded by __ia64__
o All ia64-specific makefile logic
o Mention of ia64 in comments and documentation

This excludes:
o Everything under contrib/
o Everything under crypto/
o sys/xen/interface
o sys/sys/elf_common.h

Discussed at: BSDcan


267992 28-Jun-2014 hselasky

Pull in r267961 and r267973 again. Fix for issues reported will follow.


267985 27-Jun-2014 gjb

Revert r267961, r267973:

These changes prevent sysctl(8) from returning proper output,
such as:

1) no output from sysctl(8)
2) erroneously returning ENOMEM with tools like truss(1)
or uname(1)
truss: can not get etype: Cannot allocate memory


267961 27-Jun-2014 hselasky

Extend the meaning of the CTLFLAG_TUN flag to automatically check if
there is an environment variable which shall initialize the SYSCTL
during early boot. This works for all SYSCTL types both statically and
dynamically created ones, except for the SYSCTL NODE type and SYSCTLs
which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to
be used in the case a tunable sysctl has a custom initialisation
function allowing the sysctl to still be marked as a tunable. The
kernel SYSCTL API is mostly the same, with a few exceptions for some
special operations like iterating childrens of a static/extern SYSCTL
node. This operation should probably be made into a factored out
common macro, hence some device drivers use this. The reason for
changing the SYSCTL API was the need for a SYSCTL parent OID pointer
and not only the SYSCTL parent OID list pointer in order to quickly
generate the sysctl path. The motivation behind this patch is to avoid
parameter loading cludges inside the OFED driver subsystem. Instead of
adding special code to the OFED driver subsystem to post-load tunables
into dynamically created sysctls, we generalize this in the kernel.

Other changes:
- Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask"
to "hw.pcic.intr_mask".
- Removed redundant TUNABLE statements throughout the kernel.
- Some minor code rewrites in connection to removing not needed
TUNABLE statements.
- Added a missing SYSCTL_DECL().
- Wrapped two very long lines.
- Avoid malloc()/free() inside sysctl string handling, in case it is
called to initialize a sysctl from a tunable, hence malloc()/free() is
not ready when sysctls from the sysctl dataset are registered.
- Bumped FreeBSD version to indicate SYSCTL API change.

MFC after: 2 weeks
Sponsored by: Mellanox Technologies


267548 16-Jun-2014 attilio

- Modify vm_page_unwire() and vm_page_enqueue() to directly accept
the queue where to enqueue pages that are going to be unwired.
- Add stronger checks to the enqueue/dequeue for the pagequeues when
adding and removing pages to them.

Of course, for unmanaged pages the queue parameter of vm_page_unwire() will
be ignored, just as the active parameter today.
This makes adding new pagequeues quicker.

This change effectively modifies the KPI. __FreeBSD_version will be,
however, bumped just when the full cache of free pages will be
evicted.

Sponsored by: EMC / Isilon storage division
Reviewed by: alc
Tested by: pho


267446 13-Jun-2014 jhb

Add missing calls to bus_dmamap_unload() when freeing static DMA
allocations.

Reviewed by: scottl


261326 31-Jan-2014 jamie

Back out r261266 pending security buy-in.

r261266:
Add a jail parameter, allow.kmem, which lets jailed processes access
/dev/kmem and related devices (i.e. grants PRIV_IO and PRIV_KMEM_WRITE).
This in conjunction with changing the drm driver's permission check from
PRIV_DRIVER to PRIV_KMEM_WRITE will allow a jailed Xorg server.


261266 29-Jan-2014 jamie

Add a jail parameter, allow.kmem, which lets jailed processes access
/dev/kmem and related devices (i.e. grants PRIV_IO and PRIV_KMEM_WRITE).
This in conjunction with changing the drm driver's permission check from
PRIV_DRIVER to PRIV_KMEM_WRITE will allow a jailed Xorg server.

Submitted by: netchild
MFC after: 1 week


259902 26-Dec-2013 dim

In sys/dev/drm/mach64_dma.c, remove static function mach64_set_dma_eol(),
which has never been used, even by upstream, since its initial upstream
commit (see http://cgit.freedesktop.org/mesa/drm/commit/?id=873e1c4d )

MFC after: 3 days


258780 30-Nov-2013 eadler

Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this
shifts into the sign bit. Instead use (1U << 31) which gets the
expected result.

This fix is not ideal as it assumes a 32 bit int, but does fix the issue
for most cases.

A similar change was made in OpenBSD.

Discussed with: -arch, rdivacky
Reviewed by: cperciva


258779 30-Nov-2013 eadler

Similar to the (1 << 31) case it is not defined to do (2 << 30).


254025 07-Aug-2013 jeff

Replace kernel virtual address space allocation with vmem. This provides
transparent layering and better fragmentation.

- Normalize functions that allocate memory to use kmem_*
- Those that allocate address space are named kva_*
- Those that operate on maps are named kmap_*
- Implement recursive allocation handling for kmem_arena in vmem.

Reviewed by: alc
Tested by: pho
Sponsored by: EMC / Isilon Storage Division


249816 23-Apr-2013 jkim

Fix white spaces.


249799 23-Apr-2013 eadler

Remove always-true conditions from if statement.

PR: kern/176712
Submitted by: Hiren Panchasara <hiren.panchasara@gmail.com>
Approved by: cperciva (mentor)


248084 09-Mar-2013 attilio

Switch the vm_object mutex to be a rwlock. This will enable in the
future further optimizations where the vm_object lock will be held
in read mode most of the time the page cache resident pool of pages
are accessed for reading purposes.

The change is mostly mechanical but few notes are reported:
* The KPI changes as follow:
- VM_OBJECT_LOCK() -> VM_OBJECT_WLOCK()
- VM_OBJECT_TRYLOCK() -> VM_OBJECT_TRYWLOCK()
- VM_OBJECT_UNLOCK() -> VM_OBJECT_WUNLOCK()
- VM_OBJECT_LOCK_ASSERT(MA_OWNED) -> VM_OBJECT_ASSERT_WLOCKED()
(in order to avoid visibility of implementation details)
- The read-mode operations are added:
VM_OBJECT_RLOCK(), VM_OBJECT_TRYRLOCK(), VM_OBJECT_RUNLOCK(),
VM_OBJECT_ASSERT_RLOCKED(), VM_OBJECT_ASSERT_LOCKED()
* The vm/vm_pager.h namespace pollution avoidance (forcing requiring
sys/mutex.h in consumers directly to cater its inlining functions
using VM_OBJECT_LOCK()) imposes that all the vm/vm_pager.h
consumers now must include also sys/rwlock.h.
* zfs requires a quite convoluted fix to include FreeBSD rwlocks into
the compat layer because the name clash between FreeBSD and solaris
versions must be avoided.
At this purpose zfs redefines the vm_object locking functions
directly, isolating the FreeBSD components in specific compat stubs.

The KPI results heavilly broken by this commit. Thirdy part ports must
be updated accordingly (I can think off-hand of VirtualBox, for example).

Sponsored by: EMC / Isilon storage division
Reviewed by: jeff
Reviewed by: pjd (ZFS specific review)
Discussed with: alc
Tested by: pho


242825 09-Nov-2012 rdivacky

Cast VIA_READ to (void) where the result is unused.


242132 26-Oct-2012 nwhitehorn

Make sure to define __BIG_ENDIAN and __LITTLE_ENDIAN with the appropriate
number of underscores for Linux compatibility in drm(4).

Submitted by: sendtomatt at gmail dot com
MFC after: 2 weeks


239303 15-Aug-2012 hselasky

Streamline use of cdevpriv and correct some corner cases.

1) It is not useful to call "devfs_clear_cdevpriv()" from
"d_close" callbacks, hence for example read, write, ioctl and
so on might be sleeping at the time of "d_close" being called
and then then freed private data can still be accessed.
Examples: dtrace, linux_compat, ksyms (all fixed by this patch)

2) In sys/dev/drm* there are some cases in which memory will
be freed twice, if open fails, first by code in the open
routine, secondly by the cdevpriv destructor. Move registration
of the cdevpriv to the end of the drm open routines.

3) devfs_clear_cdevpriv() is not called if the "d_open" callback
registered cdevpriv data and the "d_open" callback function
returned an error. Fix this.

Discussed with: phk
MFC after: 2 weeks


228979 30-Dec-2011 dim

In sys/dev/drm/radeon_state.c, use the correct printf length modifiers
for ints.

MFC after: 1 week


228572 16-Dec-2011 se

Fix format string Z --> z, since the former is a deprecated and (in FreeBSD)
unsupported form of the latter. This change has been reviewed and accepted
in the -hackers list.

Submitted by: Alexander Best
Reviewed by: David Schulz


228443 12-Dec-2011 mdf

Do not define bool/true/false if the symbols already exist.

MFC after: 2 weeks
Sponsored by: Isilon Systems, LLC


220979 23-Apr-2011 kib

Fix display of the drm sysctls.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days


219902 23-Mar-2011 jhb

Do a sweep of the tree replacing calls to pci_find_extcap() with calls to
pci_find_cap() instead.


218937 22-Feb-2011 miwi

- Remove no longer in use

PR: kern/152354
Submitted by: vehemens <vehemens@verizon.net>
Discussion with:kib
Approved by: rwatson (mentor)


218909 21-Feb-2011 brucec

Fix typos - remove duplicate "the".

PR: bin/154928
Submitted by: Eitan Adler <lists at eitanadler.com>
MFC after: 3 days


216699 25-Dec-2010 alc

Introduce and use a new VM interface for temporarily pinning pages. This
new interface replaces the combined use of vm_fault_quick() and
pmap_extract_and_hold() throughout the kernel.

In collaboration with: kib@


216374 11-Dec-2010 avg

fix atomic_set_xxx misuse in drm

It seems that atomic_set_xxx and atomic_store_xxx were confused.

Reviewed by: jhb
MFC after: 3 weeks


215367 16-Nov-2010 nwhitehorn

Make drm(4) build, if not work reliably, on PowerPC.


215034 09-Nov-2010 brucec

Fix typos.

PR: bin/148894
Submitted by: olgeni


210819 03-Aug-2010 olli

Add support for ATI Radeon HD 4250.

PR: kern/149041
Submitted by: olli
Reviewed by: rnoland
Approved by: des (mentor)
MFC after: 1 week


207648 05-May-2010 alc

Push down the acquisition of the page queues lock into vm_page_unwire().


207617 04-May-2010 alc

Add page locking to the vm_page_cow* functions.

Push down the acquisition and release of the page queues lock into
vm_page_wire().

Reviewed by: kib


207574 03-May-2010 alc

Acquire the page lock around vm_page_unwire(). For consistency, extend the
scope of the object lock in agp_i810.c. (In this specific case, the scope
of the object lock shouldn't matter, but I don't want to create a bad
example that might be copied to a case where it did matter.)

Reviewed by: kib


207410 30-Apr-2010 kmacy

On Alan's advice, rather than do a wholesale conversion on a single
architecture from page queue lock to a hashed array of page locks
(based on a patch by Jeff Roberson), I've implemented page lock
support in the MI code and have only moved vm_page's hold_count
out from under page queue mutex to page lock. This changes
pmap_extract_and_hold on all pmaps.

Supported by: Bitgravity Inc.

Discussed with: alc, jeffr, and kib


207318 28-Apr-2010 rnoland

fx->lock is used as an index, correct test case.

MFC after: 1 week


207156 24-Apr-2010 rnoland

remove vm obect tracker that slipped in from prior work.

MFC after: 2 weeks


207118 23-Apr-2010 rnoland

Address some WITNESS panics that occur when using the via driver.

Some of these cases should be safe in a non-atomic fashion, however
since all of the driver ioctls are locked, a lot of work is required to
fix it correctly. Just don't sleep now.

MFC after: 2 weeks


207069 22-Apr-2010 rnoland

Now that we properly set write-combining on the pages that back the GART,
disable snooping on radeons.

MFC after: 2 weeks


207067 22-Apr-2010 rnoland

re-write scatter gather memory allocation yet again...

This time, abandon the use of busdma and start interacting with the VM
system directly. Make use of the new kmem_alloc_attr() which allows us
to easily allocate non-contiguous pages to back the GART table. This
should help a lot when starting or restarting X after the system has
been running for a while and memory has become fragmented.

MFC after: 2 weeks


207066 22-Apr-2010 rnoland

Rework how drm maps are handled.

* On 32 bit platforms we steal the upper 4 bits of the map handle
to store a unique map id.
* On 64 bit platforms we steal the upper 24 bits.

Resolves issues where the offsets that are handed to mmap may overlap the VRAM on some cards.

Tested on: radeon, intel, mga, and via.

This will break nouveau. I will spin new patches shortly.


205126 13-Mar-2010 rnoland

Fix build after typo.

Reported by: Sergey V. Dyatko <sergey.dyatko@gmail.com>
MFC after: 3 days


205120 13-Mar-2010 rnoland

Add support for Intel Pineview chips, aka IGD

Slightly modified version of the submitted patch.

PR: 143427
Submitted by: Mamoru Sumida <msumida@mvc.biglobe.ne.jp>
MFC after: 3 days


203288 31-Jan-2010 rnoland

Welcome drm support for VIA unichrome chips.

MFC after: 2 weeks


203287 31-Jan-2010 rnoland

Import simple drm memory manager.

This is required for the VIA driver and at least some parts are needed
for GEM.

MFC after: 2 weeks


201223 29-Dec-2009 rnoland

Update d_mmap() to accept vm_ooffset_t and vm_memattr_t.

This replaces d_mmap() with the d_mmap2() implementation and also
changes the type of offset to vm_ooffset_t.

Purge d_mmap2().

All driver modules will need to be rebuilt since D_VERSION is also
bumped.

Reviewed by: jhb@
MFC after: Not in this lifetime...


198697 30-Oct-2009 rnoland

Fix botched git -> svn merge.

MFC after: 2 weeks


198696 30-Oct-2009 rnoland

Cleanup in r600_blit

- Don't bother to assign vb until we know we have enough space
- Add variables for sx2, sy2, dx2, dy2 so that these aren't
calculated over and over, also reduce chance of errors.
- Use switch to assign color/format

MFC after: 3 days


198695 30-Oct-2009 rnoland

A bit of cleanup work on radeon_freelist_get()

* Fix the main loop to search all buffers before sleeping.
* Remove dead code

MFC after: 3 days


198694 30-Oct-2009 rnoland

Some general cleanup of scatter/gather memory allocation

- We don't need to check malloc return values with M_WAITOK
- remove variables that we don't really need
- cleanup the error paths by just calling drm_sg_cleanup()
- fix drm_sg_cleanup() to be safe to call at any time

MFC after: 2 weeks


198692 30-Oct-2009 rnoland

Use system specified memory barriers rather than rolling our own.


198691 30-Oct-2009 rnoland

Fix blitter support for RS880 chips

MFC after: 3 days


198332 21-Oct-2009 brueffer

Check pointer for NULL before dereferencing it, not after.

PR: 138383
Submitted by: Patroklos Argyroudis <argp@census-labs.com>
Reviewed by: rnoland
MFC after: 1 week


197951 11-Oct-2009 rnoland

Add support for Intel G41 chipset

Submitted by: Artyom Mirgorodsky <man@email.com.ua>
MFC after: 3 days


197606 28-Sep-2009 rnoland

Fix offset handling

MFC after: 1 week


197605 28-Sep-2009 rnoland

radeon_family is an enum, so ordering can be important.

sync up with what amd is shipping.

MFC after: 1 week


197604 28-Sep-2009 rnoland

Fix blit pitch for 4 byte transfers on r600.

MFC after: 1 week


197603 28-Sep-2009 rnoland

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

MFC after: 1 week


197155 13-Sep-2009 rnoland

Add a couple of small fixes from the AMD folks.

- max tex height is 8192
- increment src/dst by the full transfer amount

MFC after: 3 days


197154 13-Sep-2009 rnoland

Add missing pci id for Radeon 4850 X2

MFC after: 3 days


196471 23-Aug-2009 rnoland

Add GET_PARAM support for Z pipes.

This is needed for occulsion queries on rv530 chips.

MFC after: 2 weeks


196470 23-Aug-2009 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.

MFC after: 2 weeks


196466 23-Aug-2009 rnoland

Add a read only sysctl tracking the hw.drm.msi tunable.

MFC after: 2 weeks


196465 23-Aug-2009 rnoland

Clean up the handling of device minors

Submitted by: Ed
MFC after: 2 weeks


196464 23-Aug-2009 rnoland

Clean up the locking in drm_alloc_resource()

MFC after: 2 weeks


196403 20-Aug-2009 jhb

Temporarily revert the new-bus locking for 8.0 release. It will be
reintroduced after HEAD is reopened for commits by re@.

Approved by: re (kib), attilio


196142 12-Aug-2009 rnoland

Add support for radeon RS880 IGP chips to drm.

Approved by: re (kib)
MFC after: 0 days


196141 12-Aug-2009 rnoland

Add some additional radeon pci ids to drm.

Approved by: re (kib)
MFC after: 0 days


196037 02-Aug-2009 attilio

Make the newbus subsystem Giant free by adding the new newbus sxlock.
The newbus lock is responsible for protecting newbus internIal structures,
device states and devclass flags. It is necessary to hold it when all
such datas are accessed. For the other operations, softc locking should
ensure enough protection to avoid races.

Newbus lock is automatically held when virtual operations on the device
and bus are invoked when loading the driver or when the suspend/resume
take place. For other 'spourious' operations trying to access/modify
the newbus topology, newbus lock needs to be automatically acquired and
dropped.

For the moment Giant is also acquired in some key point (modules subsystem)
in order to avoid problems before the 8.0 release as module handlers could
make assumptions about it. This Giant locking should go just after
the release happens.

Please keep in mind that the public interface can be expanded in order
to provide more support, if there are really necessities at some point
and also some bugs could arise as long as the patch needs a bit of
further testing.

Bump __FreeBSD_version in order to reflect the newbus lock introduction.

Reviewed by: ed, hps, jhb, imp, mav, scottl
No answer by: ariff, thompsa, yongari
Tested by: pho,
G. Trematerra <giovanni dot trematerra at gmail dot com>,
Brandon Gooch <jamesbrandongooch at gmail dot com>
Sponsored by: Yahoo! Incorporated
Approved by: re (ksmith)


195501 09-Jul-2009 rnoland

Add support for Radeon HD 4770 (RV740) chips.

Approved by: re@ (kib)
MFC after: 3 days


194996 25-Jun-2009 rnoland

We shouldn't need to drop and reaquire the lock here.

MFC after: 3 days


194986 25-Jun-2009 rnoland

Some more cleanups for vblank code on Intel.

The Intel 2d driver calls modeset before reinstalling the handler on
a vt switch. This means that vblank status ends up getting cleared
after it has been setup. Restore saved values for the pipestat registers
rather than just wiping them out.

MFC after: 3 days


194969 25-Jun-2009 rnoland

Initialize max_vblank_count earlier.

Small cleanup of the error paths while I'm here.

MFC after: 3 days


194966 25-Jun-2009 rnoland

Keep track of the hardware counter more aggressively while interrupts
are enabled. This should help to reduce cases where the hardware
counter reference jumps by large amounts.

MFC after: 3 days


194965 25-Jun-2009 rnoland

Fix one use of atomic for refcount missed in last commit.

MFC after: 3 days


194963 25-Jun-2009 rnoland

Additional vblank cleanups.

Use the vbl_lock when maniputlating the refcount. Eventually I want to
convert this to use our internal refcount code. Continue to use atomic
ops for manipulating vblank count since we access it often just for
reading.

MFC after: 3 days


194960 25-Jun-2009 rnoland

Ensure that we always hold the lock when calling vblank_disable_fn()

MFC after: 3 days


194759 23-Jun-2009 rnoland

Add some sysctl info so that we can see what is going on with vblanks.

MFC after: 3 days


194749 23-Jun-2009 rnoland

Only release irq resources if we were actually using them.

MFC after: 3 days


194748 23-Jun-2009 rnoland

Using signals for vblank events is prone to issues. There have never
been any consumers and likely will never be. Furthermore, we have
never enabled the code for it, so just get rid of it.

MFC after: 3 days


194746 23-Jun-2009 rnoland

Given that vblanks generally occur 60 times a second, waiting 3 seconds
seems rather excessive.

MFC after: 3 days


194745 23-Jun-2009 rnoland

vblank[crtc].last represents the hardware counter while request.sequence
represents the software counter. Don't currupt things here.

MFC after: 3 days


194741 23-Jun-2009 rnoland

Hold the lock while we save/restore register for suspend/resume.

MFC after: 3 days


194540 20-Jun-2009 rnoland

The G45 docs indicate that all G4X chips use the new framecount register.

Intel agrees with my reading of the docs, make it so for all G4X chips.

The new register also has a 32 bit width as opposed to 24 bits. Fix
things up so that the counters roll over properly.

MFC after: 3 days


194539 20-Jun-2009 rnoland

realloc() behaves identically to malloc when passed a NULL object pointer

If an error does occur we would have left max_context with an incorrect
value.

MFC after: 3 days


194537 20-Jun-2009 rnoland

Don't panic if drm_rmmap is called with a NULL map pointer.

MFC after: 3 days


191274 19-Apr-2009 rnoland

Don't try to setup interrupts for drivers that don't support them.

This causes sis and probably a couple of other driver to panic and fail.

Tested by: cpghost <cpghost@cordula.ws>
PR: 133554
MFC after: 3 days


190833 07-Apr-2009 rnoland

check offsets for R300_ZB_ZPASS_ADDR

Submitted by: Maciej Cencora <m.cencora@gmail.com>
MFC after: 3 days


190831 07-Apr-2009 rnoland

Add regs required for occlusion queries support

Submitted by: Maciej Cencora <m.cencora@gmail.com>
MFC after: 3 days


190675 03-Apr-2009 rnoland

Add support for RV790 (HD 4890) asics

MFC after: 3 days


190674 03-Apr-2009 rnoland

A little more cleanup from AMD, if we don't have the right microcode
there is no reason to mess with the chip.

MFC after: 3 days


190595 31-Mar-2009 rnoland

Simplify the radeon microcode loading.

Submitted by: Christoph Mallon
MFC after: 3 days


190565 30-Mar-2009 rnoland

We don't know what these pages are going to be used for, they should be
un-cached. This got lost somewhere with all the bus_dma fixups.

MFC after: 3 days


190563 30-Mar-2009 rnoland

Load the right microcode for RS780.

MFC after: 3 days


190433 26-Mar-2009 rnoland

Fix up waiting on vblank again... This reverts a last minute change that
I made on the last patch, it seems to upset suspend/resume and shutdown.

MFC after: 3 days


190401 25-Mar-2009 rnoland

Rework the management of vblank interrupts a bit.

When a vt switch occurs the irq handler is uninstalled. Interrupts
and the state tracking of what was enabled/disabled wasn't working
properly. This should resolve the reports of "slow windows" after a
vt switch, among other things. The radeon 2d driver seems to work a
bit more correctly than the Intel driver. With the Intel driver,
vblank interrupts will be enabled at system startup and will only
be disabled after an additional modeset (vt switch, dpms, randr event).

With this patch, I am able to run glxgears synced to vblank and
vt switch while it is running without ill effects.

MFC after: 3 days


190400 25-Mar-2009 rnoland

Intel handled the management of the breadcrumb counter inconsistently.
Make sure that we always handle it the same way.

MFC after: 3 days


190399 25-Mar-2009 rnoland

The GART allocations are a propery of the gart, not of scatter-gather
memory. Track them in the appropriate structure.

MFC after: 3 days


190282 22-Mar-2009 rnoland

Fix up the flags to bus_dmamem again. The man page incorrectly showed
the BUS_DMA_NOCACHE flags as being a valid flag for load instead of alloc.

Discussed with: kib
MFC after: 3 days


190170 20-Mar-2009 rnoland

vm_offset_t is unsigned, so compare of >= 0 is not needed.

Found with: Coverity Prevent(tm)
CID: 2259

MFC after: 3 days


190166 20-Mar-2009 rnoland

Remove the DRM_ERROR to fix build. It didn't make any sense anyway.

MFC after: 3 days


190164 20-Mar-2009 rnoland

Fix what appears to be a typo, and restore the registers correctly.

Found with: Coverity Prevent(tm)
CID: 2454


190163 20-Mar-2009 rnoland

Don't deref dev->dev_private before checking that it exists.

Found with: Coverity Prevent(tm)
CID: 2940

MFC after: 3 days


190125 20-Mar-2009 rnoland

Only issue the wakeup and store the counter if vblank is enabled on
the pipe.

MFC after: 3 days


190124 20-Mar-2009 rnoland

Add a couple of radeon pci ids.

MFC after: 3 days


190123 20-Mar-2009 rnoland

Adjust the flags to bus_dmamem around here too.

MFC after: 3 days


190023 19-Mar-2009 rnoland

Add some debugging so I can see when syscalls are being restarted
consistantly. After a lengthy irc discussion it seems like we
shouldn't need to worry about them, but it's nice to know about.

MFC after: 3 days


190022 19-Mar-2009 rnoland

Rework vblank handling to try to resolve some reports of "slow" windows
after vt switch or suspend. I can't really test this on Intel right now
but I think I've heard reports of it on radeon as well. I can't break
it on the radeon here.

MFC after: 3 days


190021 19-Mar-2009 rnoland

Sync up the rest of the code that we use with what Intel is shipping

-Some irq/vblank related changes that hopefully will help.
-A little more cleanup while I'm here.

MFC after: 3 days


190020 19-Mar-2009 rnoland

Pull in some suspend / resume changes from Intel's code

Tested by: mav@
MFC after: 3 days


189916 17-Mar-2009 rnoland

Cast to (unsigned long) to make printf happy on i386

MFC after: 3 days


189915 17-Mar-2009 rnoland

Add support for matching solely on vendor id.

We will use this method with nouveau

MFC after: 3 days


189914 17-Mar-2009 rnoland

Improve the debugging output of drm_mmap

MFC after: 3 days


189913 17-Mar-2009 rnoland

Add list_for_each_prev to our linux compatibility.

We need this for nouveau

MFC after: 3 days


189912 17-Mar-2009 rnoland

Minor code cleanup

MFC after: 3 days


189911 17-Mar-2009 rnoland

We can have more than 3 pci resources

MFC after: 3 days


189910 17-Mar-2009 rnoland

Cast register maps and offsets to vm_offset_t

MFC after: 3 days


189909 17-Mar-2009 rnoland

Change the logic around to match ati_pcigart.

MFC after: 3 days


189908 17-Mar-2009 rnoland

Use flsl() here rather than ffsl()

I discovered that we were computing page_order differently than linux.

MFC after: 3 days


189899 16-Mar-2009 rnoland

Use the right MSI_REARM for RS600.

MFC after: 3 days


189869 16-Mar-2009 rnoland

Get rid of any remaining PZERO flags in mtx_sleep()

Also, clean up some ifdef mess while I'm here.

MFC after: 3 days


189868 16-Mar-2009 rnoland

Fix R600 writeback across suspend/resume.

This is likely a NOOP for us, since I haven't ported the suspend/resume
code yet.

MFC after: 3 days


189563 09-Mar-2009 rnoland

Consistently use kdev for the kernel device.

Submitted by: vehemens <vehemens@verizon.net>
MFC after: 3 days


189562 09-Mar-2009 rnoland

Clean up the printing on amd64. Should also be consistent on i386.

MFC after: 3 days


189561 09-Mar-2009 rnoland

There is no need to sync these buffers to swap.

MFC after: 3 days


189560 09-Mar-2009 rnoland

Change the flags to bus_dmamem around to allow it to sleep waiting for
resources during allocation, but not during map load. Also, zero the
buffers here.

MFC after: 3 days


189559 09-Mar-2009 rnoland

Fix the flags to bus_dmamem_* to allow the allocation to sleep while
waiting for resources. It is really the load that we can't defer.
BUS_DMA_NOCACHE belongs on bus_dmamap_load() as well.

MFC after: 3 days


189558 09-Mar-2009 rnoland

-Make the PCI(E)/AGP calculations consistent
-Calculate the scratch address correctly

MFC after: 10 days


189557 09-Mar-2009 rnoland

Call the right function for the right chipset.

MFC after: 10 days


189499 07-Mar-2009 rnoland

Import support for ATI Radeon R600 and R700 series chips.

Tested on an HD3850 (RV670) on loan from Warren Block.

Currently, you need one of the following for this to be useful:

x11-drivers/xf86-video-radeonhd-devel (not tested)
xf86-video-ati from git (EXA works, xv is too fast)
xf86-video-radeonhd from git (EXA works, xv works)

There is no 3d support available from dri just yet.

MFC after: 2 weeks


189130 28-Feb-2009 rnoland

Initialize the vblank structures at load time. Previously we did this
at irq install/uninstall time, but when we vt switch, we uninstall the
irq handler. When the irq handler is reinstalled, the modeset ioctl
happens first. The modeset ioctl is supposed to tell us that we can
disable vblank interrupts if there are no active consumers. This will
fail after a vt switch until another modeset ioctl is called via dpms
or xrandr. Leading to cases where either interrupts are on and can't
be disabled, or worse, no interrupts at all.

MFC after: 2 weeks


189128 28-Feb-2009 rnoland

Add a tuneable to allow disabling msi on drm at runtime.

Suggested by: jhb@

MFC after: 2 weeks


189099 27-Feb-2009 rnoland

Fix up some ioctl permissions issues long overlooked.

Submitted by: jkim@
MFC after: 2 weeks


189054 25-Feb-2009 rnoland

The GM45 handles vblank differently. Pull the changes from Intel in.

MFC after: 2 Weeks


189053 25-Feb-2009 rnoland

Remove D_NEEDGIANT.

MFC after: 2 weeks


189052 25-Feb-2009 rnoland

Turn on MSI if the card supports it. There is a blacklist for chips
which report that they are capable of MSI, but don't work correctly.

MFC after: 2 weeks


189051 25-Feb-2009 rnoland

Prepare the radeon driver for MSI support.

MFC after: 2 weeks


189050 25-Feb-2009 rnoland

Add some vblank related debugging and replace the DRM_WAIT_ON macro
with a localized version.

MFC after: 2 weeks


189049 25-Feb-2009 rnoland

This was part of a sync to the code that Intel is shipping in linux.

- Remove the old TTM interface
- Move register definitions to i915_reg.h
- Overhaul the irq handler

MFC after: 2 weeks


189048 25-Feb-2009 rnoland

The i915 driver was the only consumer of locked task support.

Now that it doesn't use it anymore, get right of the taskqueue
and locked task support.

MFC after: 2 weeks


189047 25-Feb-2009 rnoland

The vblank_swap ioctl was fundamentally race prone. Get rid of it.

MFC after: 2 weeks


189046 25-Feb-2009 rnoland

There is no reason to hold the lock here.

When I was LOCK_PROFILING this was pretty high up and there is no
reason for it.

MFC after: 2 weeks


189045 25-Feb-2009 rnoland

Remove the PZERO priority from mtx_sleep.

MFC after: 2 weeks


186465 23-Dec-2008 rnoland

Only set registers if irqs are enabled

Approved by: kib
Obtained from: drm git


186386 21-Dec-2008 rnoland

Convert DRM_[DEBUG,ERROR,INFO] macros to c99 __VA_ARGS__.

Approved by: kib


186300 18-Dec-2008 rnoland

Garbage collect entries from pcireg.h since we now include it.

Approved by: kib@
MFC after: 2 weeks


186299 18-Dec-2008 rnoland

We only want drm to ever attach to the primary pci device.
Intel 855 chips present the same pci id for both heads. This prevents
us from attaching to the dummy second head. All other chips that I
am aware of either only present a single pci id, or different ids
for each head so that we only match on the correct head.

Approved by: kib@
MFC after: 2 weeks


186295 18-Dec-2008 rnoland

rework drm_scatter.c which allocates scatter / gather pages for use by
ati pci gart to use bus_dma to handle the allocations. This fixes
a garbled screen issue on at least some radeons (X1400 tested). It is
also likely that this is the correct fix for PR# 119324, though that
is not confirmed yet.

Reviewed by: jhb@ (mentor, prior version)
Approved by: kib@
MFC after: 2 weeks


184375 27-Oct-2008 rnoland

Fix error in busmaster enable logic

rs400/rs480 should clear the RADEON_BUS_MASTER_DIS bit. This should get
the rs485 IGP chips going again.

Approved by: jhb (mentor)
Obtained from: drm git master


184374 27-Oct-2008 rnoland

Fix some fallout from the busmaster disable cleanup

rs400 is just like rs480

Approved by: jhb (mentor)
Obtained from: drm git


184373 27-Oct-2008 rnoland

Don't report GEM capability until we actually have GEM support.

This was causing the newer Intel video drivers to fail and abort X.

Approved by: jhb (mentor)


184263 25-Oct-2008 rnoland

drm/i915: fix ioremap of a user address for non-root (CVE-2008-3831)

Olaf Kirch noticed that the i915_set_status_page() function of the i915
kernel driver calls ioremap with an address offset that is supplied by
userspace via ioctl. The function zeroes the mapped memory via memset
and tells the hardware about the address. Turns out that access to that
ioctl is not restricted to root so users could probably exploit that to
do nasty things. We haven't tried to write actual exploit code though.

It only affects the Intel G33 series and newer.

Approved by: bz (secteam)
Obtained from: Intel drm repo
Security: CVE-2008-3831


184213 23-Oct-2008 rnoland

Replace calls to minor() with dev2unit(). Ed already fixed this once,
but I inadvertently overwrote the change when I synced to git. Commit
the fix in both places, so this doesn't happen again.

Approved by: jhb (mentor)
MFC after: 2 weeks


184212 23-Oct-2008 rnoland

This check is invalid and I disabled it once already. I accidentally
reintroduced it with the sync to git master. Commit the fix in both
places this time.

Approved by: jhb (mentor)
MFC after: 2 weeks


183834 13-Oct-2008 rnoland

Correct memory leak of info->rects. Previously we would free info, but
but abandon info->rects.

Approved by: jhb (mentor)


183833 13-Oct-2008 rnoland

Rework memory allocation to allocate memory with different type names. This
will ease the identification of memory leaks as the OS will be able to track
allocations for us by malloc type. vmstat -m will show all of the
allocations.

Convert the calls to drm_alloc() and friends, which are used in shared code
to static __inline__ while we are here.

Approved by: jhb (mentor)


183832 13-Oct-2008 rnoland

The linux list compat code had an error which prevented list_for_each_safe()
from operating on a list with a single item. This code is used much more by
the i915 driver with xorg-7.4. Correct it to match the actual linux
implementation.

Approved by: jhb (mentor)


183831 13-Oct-2008 rnoland

Correct the interrupt handling in the Intel i915 driver.

Approved by: jhb (mentor)


183830 13-Oct-2008 rnoland

Several of the newer radeon cards have moved around the registers for enabling
busmastering support. This also adds register definitions for MSI support,
which we will be using shortly.

Approved by: jhb (mentor)
Obtained from: drm git master


183828 13-Oct-2008 rnoland

Add support for Radeon rs740 (HD 2100)

Approved by: jhb (mentor)
Obtained from: drm git master


183605 04-Oct-2008 rnoland

Don't explicitly bzer driver softc

new-bus already handles this for us.

Suggested by jhb@

Approved by: jhb (mentor)


183604 04-Oct-2008 rnoland

Use M_WAITOK when allocating driver memory

We don't explicity check for error here and M_WAITOK will just put the
process to sleep waiting on resources to become available.

Suggested by jhb@

Approved by: jhb (mentor)


183603 04-Oct-2008 rnoland

Change drm_order() to use ffsl()

pointed out by jhb@

Approved by: jhb (mentor)


183573 03-Oct-2008 rnoland

resync to git master

This reverts a private patch which is causing issues with many Intel chipsets.
I will review that patch and see what we need to do to fix it up later, but
for the time being, we will just get these chips working again.

This update contains a lot of code cleanup and is post gem merge
(no, we don't have gem support). It should prove much easier to read the
code now. A lot of thanks goes to vehemens for that work. I have adapted
the code to use cdevpriv for tracking per open file data. That alleviates
the old ugly hack that we used to try and accomplish the task and helped to
clean up the open / close behavior a good bit. This also replaces the hack
that was put in place a year or so ago to prevent radeons from locking up
with AIGLX enabled. I have had a couple of radeon testers report that it
still works as expected, though I no longer have radeon hardware to test with
myself. Other various fixes from the linux crew and Intel, many of
which are muddled in with the gem merge.

Approved by: jhb (mentor)
Obtained from: mesa/drm git master
MFC after: 2 weeks


183397 27-Sep-2008 ed

Replace all calls to minor() with dev2unit().

After I removed all the unit2minor()/minor2unit() calls from the kernel
yesterday, I realised calling minor() everywhere is quite confusing.
Character devices now only have the ability to store a unit number, not
a minor number. Remove the confusion by using dev2unit() everywhere.

This commit could also be considered as a bug fix. A lot of drivers call
minor(), while they should actually be calling dev2unit(). In -CURRENT
this isn't a problem, but it turns out we never had any problem reports
related to that issue in the past. I suspect not many people connect
more than 256 pieces of the same hardware.

Reviewed by: kib


182884 09-Sep-2008 rnoland

IGP based radeon cards such as the rs485 and rs690 require that the GART table
be un-cached. Our previous memory barrier was not sufficient. This patch
allocates the IGP GART tables using the BUS_DMA_NOCACHE flag to get these
cards working.

Approved by: kib


182883 09-Sep-2008 rnoland

We should never call drm_pci_alloc() while holding locks, due the the
calls to bus_dma. There were multiple paths that held different locks or
no locks at all. This patch ensures that all of the calling paths drop
their lock(s) before calling drm_pci_alloc().

Reviewed by: kib


182469 30-Aug-2008 rnoland

Don't return EINVAL when trying to unlock.

anholt thinks that he added this check as part of some regression testing,
but it is failing at least some of the time. I don't want to remove it
just yet. I added a bit of debugging to help identify the issue.

Approved by: kib


182468 30-Aug-2008 rnoland

We need to lock around driver unload now.

The i915 driver installs it's register map at load time now. We can't
remove the map during unload without holding the lock.

Approved by: kib


182467 30-Aug-2008 rnoland

Free the device lock around the call to drm_drawable_free_all()

This function manipulates a spin lock and we can't hold a mutex over it.

Approved by: kib


182080 23-Aug-2008 rnoland

Update drm kernel drivers.

This is a sync to mesa/drm pre-gem, with a few fixes on top of that.
It also contains one local patch supplied by kib@ that I can't apply to
git.master shared code.

Approved by: flz
Obtained from: mesa/drm git.master
MFC after: 2 weeks


177480 21-Mar-2008 remko

Add the i915 GME device to DRM.

PR: kern/121808
Submitted by: Volker Werth <volker at vwsoft dot com>
Approved by: imp (mentor, implicit for trivial changes)
MFC after: 3 days


176624 27-Feb-2008 remko

Add support for the 965GM.

PR: kern/120978
Submitted by: Dominic Fandrey <kamikaze at bsdforen dot de>
Approved by: imp (mentor, implicit), anholt (drm maintainer)
MFC after: 3 days


175381 16-Jan-2008 remko

Dont accidentally remove a filesocket which is still in use. This gives
problems when the DRM driver is loaded and the AIXGL extension is loaded
, the AIXGL driver requests a drm_close and this will cause the radeon
driver to fail while starting X windows.

PR: kern/114688
Submitted by: vehemens <vehemens at verizon dot net>
Prodded by: Robert Noland
Approved by: imp (mentor, a while ago already), anholt
MFC After: 1 week


173573 12-Nov-2007 jhb

Move the agp(4) driver from sys/pci to sys/dev/agp. __FreeBSD_version was
bumped to 800004 to note the change though userland apps should not be
affected since they use <sys/agpio.h> rather than the headers in
sys/dev/agp.

Discussed with: anholt
Repocopy by: simon


171909 21-Aug-2007 kib

Properly initialize the dev_priv before calling the i915_dma_cleanup().
This fixes my rev. 1.5.

Reviewed by: anholt
Approved by: re (kensmith)
MFC after: 2 weeks


171394 12-Jul-2007 kib

bus_dma_tag_create() and bus_dma_mem_alloc() shall not be called with a
non-sleepable lock held. drm_pci_alloc() calls them, thus drm mutex shall
not be held during the call.

Move the drm_pci_alloc() to the start of the i915_initialize() and drop the
the drm mutex around it.

Reported by: Ganbold <ganbold micom mng net>
Reviewed by: anholt
Approved by: re (hrs)
MFC after: 1 week


166901 23-Feb-2007 piso

o break newbus api: add a new argument of type driver_filter_t to
bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Reviewed by: many
Approved by: re@


165598 28-Dec-2006 jhb

Update __FreeBSD_version check for pci_find_extcap() now that it is
present in 6.x.


164033 06-Nov-2006 rwatson

Sweep kernel replacing suser(9) calls with priv(9) calls, assigning
specific privilege names to a broad range of privileges. These may
require some future tweaking.

Sponsored by: nCircle Network Security, Inc.
Obtained from: TrustedBSD Project
Discussed on: arch@
Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri,
Alex Lyashkov <umka at sevcity dot net>,
Skip Ford <skip dot ford at verizon dot net>,
Antoine Brodin <antoine dot brodin at laposte dot net>


162132 07-Sep-2006 anholt

Merge from DRM upstream:
- Add support for Intel 965 Express chipsets.
- Add support for R200 vertex programs, along with minor bugfixes.
- Add support for vblank synchronization to pipe B of Intel hardware
(laptop screens).


158683 17-May-2006 anholt

Update to current DRM CVS, bringing in a fix for a NULL pointer chase when
running 3d apps on i915.


158682 17-May-2006 anholt

Merge from DRM CVS:
Set entry->virtual for sg maps, fixing ATI PCI/PCIE GART support.

PR: kern/97056
Submitted by: Stanislav Sedov <ssedov@mbsd.msk.ru>


157831 18-Apr-2006 anholt

Reorder the DRM_*_AGP enums to match linux and what our code expects, fixing
i915 attachment.

Submitted by: Jonathan Fosburgh <jonathan@fosburgh.org>


157719 13-Apr-2006 ru

Re-apply changes to make this compile with -Wundef:

/usr/src/sys/modules/drm/radeon/../../../dev/drm/radeon_state.c:2976:5: "BITS_PER_LONG" is not defined

(Previous revision has trashed my changes.)


157617 09-Apr-2006 anholt

Update to DRM CVS as of 2006-04-09. The most notable new feature is the updated
Radeon memmap code, which with a new DDX driver and DRI drivers should fix
long-term stability issues with Radeons. Also adds support for r200's
ATI_fragment_shader, r300 texrect support and texture caching fixes, i915
vblank support and bugfixes, and new PCI IDs.


153579 20-Dec-2005 jhb

- Bump FreeBSD version for the hostb(4) and vgapci(4) drivers as well as
the addition of pci_find_extcap().
- Change the drm drivers to attach to vgapci. This is #ifdef'd so the
code can be shared across branches.
- Use pci_find_extcap() to look for AGP and PCIE capabilities in drm.
- GC all the drmsub stuff for i810/i830/i915. The agp and drm devices are
now both children of vgapci.


153087 04-Dec-2005 ru

Use compile-time detection of 64-bit addressing.


153082 04-Dec-2005 ru

Fix -Wundef warnings and properly check the size of long, FWIW.


153033 03-Dec-2005 anholt

Merge DRM CVS as of 2005-12-02, adding i915 DRM support thanks to Alexey Popov,
and a new r300 PCI ID.


153032 03-Dec-2005 anholt

Make cleaner diffs by munging the $FreeBSD$s from the FreeBSD CVS sources back
into the new sources.


153013 02-Dec-2005 anholt

Restore the enabling of debugging by default by the DRM_DEBUG kernel option.
It remains controlled by hw.dri.*.debug no matter what.

PR: kern/85479
Submitted by: Oliver Fromme <olli@secnetix.de>


152909 28-Nov-2005 anholt

Update DRM to CVS snapshot as of 2005-11-28. Notable changes:
- S3 Savage driver ported.
- Added support for ATI_fragment_shader registers for r200.
- Improved r300 support, needed for latest r300 DRI driver.
- (possibly) r300 PCIE support, needs X.Org server from CVS.
- Added support for PCI Matrox cards.
- Software fallbacks fixed for Rage 128, which used to render badly or hang.
- Some issues reported by WITNESS are fixed.
- i915 module Makefile added, as the driver may now be working, but is untested.
- Added scripts for copying and preprocessing DRM CVS for inclusion in the
kernel. Thanks to Daniel Stone for getting me started on that.


148624 01-Aug-2005 anholt

Fix a buffer aging problem in new r300 code that could lead to hangs with some
apps.

Obtained from: DRM CVS


148211 20-Jul-2005 anholt

Add the latest r300 code from r300.sf.net. This is based on the patch supplied
by Vladimir Dergachev for inclusion in DRM CVS, with minor modifications for
FreeBSD CVS and the appropriate license from Nicolai Haehnle on r300_reg.h.
Fixes hangs when using r300.sf.net userland, tested on a Radeon 9600 on amd64.


147648 28-Jun-2005 anholt

Disable the drm_initmap calls in radeon_cp.c, due to them resulting in improper
handling of pci resources, and mapping framebuffer leading to panics on X
startup. The proper solution involves use of bus_alloc_resource without
RF_ACTIVE, but this code is being rewritten in DRM CVS currently, and disabling
for now doesn't remove any features, so take the easy route.

PR: kern/80718
Approved by: re (scottl)


147590 24-Jun-2005 anholt

Mark the permanent map for radeon registers read-only. Failure to set this flag
allowed writing to the registers by any user that can open the DRI device, and
therefore ability to initiate DMA. This came in with the merge from DRI CVS on
2005-04-15.

Approved by: re (scottl)
Obtained from: DRM CVS


145478 24-Apr-2005 anholt

Fix a panic on X startup for drivers that don't init maps themselves by storing
the return value of drm_ioremap in the right place again.

Submitted by: tegge


145132 16-Apr-2005 anholt

Update to DRM CVS as of 2005-04-12, bringing many changes:
- Split core DRM routines back into their own module, rather than using the
nasty templated system like before.
- Development-class R300 support in radeon driver (requires userland pieces, of
course).
- Mach64 driver (haven't tested in a while -- my mach64s no longer fit in the
testbox). Covers Rage Pros, Rage Mobility P/M, Rage XL, and some others.
- i915 driver files, which just need to get drm_drv.c fixed to allow attachment
to the drmsub device. Covers i830 through i915 integrated graphics.
- savage driver files, which should require minimal changes to work. Covers the
Savage3D, Savage IX/MX, Savage 4, ProSavage.
- Support for color and texture tiling and HyperZ features of Radeon.

Thanks to: scottl (much p4 handholding)
Jung-uk Kim (helpful prodding)
PR: [1] kern/76879, [2] kern/72548
Submitted by: [1] Alex, lesha at intercaf dot ru
[2] Shaun Jurrens, shaun at shamz dot net


144501 01-Apr-2005 jhb

- Change the vm_mmap() function to accept an objtype_t parameter specifying
the type of object represented by the handle argument.
- Allow vm_mmap() to map device memory via cdev objects in addition to
vnodes and anonymous memory. Note that mmaping a cdev directly does not
currently perform any MAC checks like mapping a vnode does.
- Unbreak the DRM getbufs ioctl by having it call vm_mmap() directly on the
cdev the ioctl is acting on rather than trying to find a suitable vnode
to map from.

Reviewed by: alc, arch@


142567 26-Feb-2005 sam

move ptr deref's to after null checks

Noticed by: Coverity Prevent analysis tool


142223 22-Feb-2005 phk

Neuter DRM(mapbufs) until somebody finds time to try to fix it.

It is _never_ OK to find a vnode from a struct cdev because you have
no way of telling if you get the right one. You might be in jail or
chroot for instance.


139839 07-Jan-2005 scottl

Fix typo from previous commit.


139762 06-Jan-2005 maxim

Unbreak the tinderbox, make this compile.


139749 06-Jan-2005 imp

Start each of the license/copyright comments with /*-, minor shuffle of lines


138882 15-Dec-2004 ssouhlal

Use the SYSCTL_ADD_OID macro, instead of directly calling sysctl_add_oid().

Approved by: anholt, grehan (mentor)


138308 02-Dec-2004 obrien

Specifically use the 32-bit version of fuword/suword since that's what
we really want vs. the size changing 'long' (i386 vs. AMD64).
This fixes the problem with DRM with Radeon's on AMD64.

Submitted by: Jung-uk Kim <jkim@niksun.com>


134474 29-Aug-2004 ru

Fixed the module name (macros don't work here).


133160 05-Aug-2004 mux

Now that mem(4) is a kernel module, we need to add a dependency on
it in drm(4) for mem_range_attr_set(). This fixes loading a DRM
driver as a module.

Reviewed by: anholt


130585 16-Jun-2004 phk

Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.


130331 11-Jun-2004 anholt

Merge from DRI CVS as of 2004-05-26. Most of the meat is new PCI IDs and a new
packet for Radeon.


127135 17-Mar-2004 njl

Convert callers to the new bus_alloc_resource_any(9) API.

Submitted by: Mark Santcroos <marks@ripe.net>
Reviewed by: imp, dfr, bde


126534 03-Mar-2004 obrien

Prefer uintptr_t to intptr_t.


126533 03-Mar-2004 obrien

Use a long as the opaque type so that it matches the size of a pointer
on both 32-bit and 64-bit platforms.


126525 03-Mar-2004 obrien

Use a long as the opaque type so that it matches the size of a pointer
on both 32-bit and 64-bit platforms.


126524 03-Mar-2004 obrien

Add memory barrier routines for AMD64.


126523 03-Mar-2004 obrien

Cast thru intptr_t on the way to void* for success on 64-bit platforms.


126137 23-Feb-2004 rwatson

Limit the amount of memory userspace processes can cause the kernel to
allocate via DRI on r128 devices.

Obtained from: Thomas Biege <thomas@suse.de>
Reviewed by: scottl


126080 21-Feb-2004 phk

Device megapatch 4/6:

Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.


126076 21-Feb-2004 phk

Device megapatch 1/6:

Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.


125807 14-Feb-2004 phk

This is not a D_TTY driver.


124164 06-Jan-2004 anholt

Merge from DRI CVS. No longer maps the framebuffer into KVA on radeon, r128,
and mga. MTRR code cleanups. Includes new Radeon and Rage 128 PCI IDs.


123769 23-Dec-2003 se

Fix a few more places where NULL was used instead of 0.


122580 12-Nov-2003 anholt

Update from DRI CVS. Includes locking fixes (including PR 59202), changes for
Radeon IGP support (still lacking PCI IDs), and DRM interface 1.2 updates which
include finally tying the DRM instances to specific devices rather than relying
on the X Server.


121974 03-Nov-2003 anholt

Change the DRM_ERROR about authenticator not found back to DRM_DEBUG. It's
noisier than I expected, and I don't have the time to actually get it fixed.


121486 24-Oct-2003 anholt

Don't try to use dev->dma_lock unless dma is initialized (dev->dma != NULL)
in bufs_info sysctl handler. dev->dma and dev->dma_lock existence are
protected by DRM_LOCK(). Fixes panic on sysctl hw.dri when the device is
uninitialied (when you aren't in X).


121447 24-Oct-2003 anholt

Update to latest from DRI CVS. Primary new feature is mostly-complete smpng
locking, and the apparently unnecessary locking for -stable has been removed.
This may fix issues with missed interrupts since April, which manifested
themselves as slowdowns or hangs in radeon, in particular. Many cleanups also
took place. In the shared code, there are improvements to r128 driver
stability.


119895 09-Sep-2003 anholt

Merge from DRI CVS. Includes newly ported SiS 300/305/540/630/730 driver and
updates to allow system memory to be used for textures on PCI Radeons.

Sponsored by: LinuxFund


119428 24-Aug-2003 anholt

Comment out a couple of __inline__s until we can get inlines to be actually
respected or at least shut the warning up.


119418 24-Aug-2003 obrien

Use __FBSDID().
Also some minor style cleanups.


119277 22-Aug-2003 imp

Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.


119098 19-Aug-2003 anholt

Update DRM from DRI CVS as of today. Notable changes include Radeon
suspend/resume support and Rage 128 pageflipping support (both of which require
XFree86 from CVS), along with miscellaneous cleanups.


115510 31-May-2003 phk

Do not define memset() to bzero(). We have a memset().

Found by: FlexeLint


114054 26-Apr-2003 anholt

Merge from DRI CVS: Disable MTRRs on FreeBSD-stable to work around hangs with
SMP machines. and use i386 asm for atomic_cmpset_int on -stable. This is in
preparation for MFCing the DRM.


113995 25-Apr-2003 anholt

Update the DRM to the latest from DRI CVS. Includes some bugfixes and removal
of the infrastructure for the gamma driver which was removed a while back.
The DRM_LINUX option is removed because the handler is now provided by the
linux compat code itself.


112569 25-Mar-2003 jake

- Add vm_paddr_t, a physical address type. This is required for systems
where physical addresses larger than virtual addresses, such as i386s
with PAE.
- Use this to represent physical addresses in the MI vm system and in the
i386 pmap code. This also changes the paddr parameter to d_mmap_t.
- Fix printf formats to handle physical addresses >4G in the i386 memory
detection code, and due to kvtop returning vm_paddr_t instead of u_long.

Note that this is a name change only; vm_paddr_t is still the same as
vm_offset_t on all currently supported platforms.

Sponsored by: DARPA, Network Associates Laboratories
Discussed with: re, phk (cdevsw change)


112451 20-Mar-2003 jhb

Use td->td_ucred instead of td->td_proc->p_ucred.


112073 11-Mar-2003 anholt

Update Radeon PCI IDs and naming from pciids.sf.net.


112015 09-Mar-2003 anholt

Update the DRM to latest from DRI CVS. This is approximately the version
included in XFree86 4.3, but includes some fixes. Notable changes include
Radeon 8500-9100 support, PCI Radeon/Rage 128 support, transform & lighting
support for Radeons, and vblank syncing support for r128, radeon, and mga.
The gamma driver was removed due to lack of any users.


111817 03-Mar-2003 phk

Don't initialize d_kqfilter to 0.


111815 03-Mar-2003 phk

Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by: re(scottl)


111462 25-Feb-2003 mux

Cleanup of the d_mmap_t interface.

- Get rid of the useless atop() / pmap_phys_address() detour. The
device mmap handlers must now give back the physical address
without atop()'ing it.
- Don't borrow the physical address of the mapping in the returned
int. Now we properly pass a vm_offset_t * and expect it to be
filled by the mmap handler when the mapping was successful. The
mmap handler must now return 0 when successful, any other value
is considered as an error. Previously, returning -1 was the only
way to fail. This change thus accidentally fixes some devices
which were bogusly returning errno constants which would have been
considered as addresses by the device pager.
- Garbage collect the poorly named pmap_phys_address() now that it's
no longer used.
- Convert all the d_mmap_t consumers to the new API.

I'm still not sure wheter we need a __FreeBSD_version bump for this,
since and we didn't guarantee API/ABI stability until 5.1-RELEASE.

Discussed with: alc, phk, jake
Reviewed by: peter
Compile-tested on: LINT (i386), GENERIC (alpha and sparc64)
Runtime-tested on: i386


111119 19-Feb-2003 imp

Back out M_* changes, per decision of the TRB.

Approved by: trb


109623 21-Jan-2003 alfred

Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.


107625 04-Dec-2002 anholt

Remove an unused variable that snuck in the last commit.

Submitted by: Christian Brueffer <chris@unixpages.org>
Approved by: re (rwatson)


107617 04-Dec-2002 anholt

Fix witness warning in DRM memory info sysctl by making a temporary copy of the
data under the lock and outputting it to the sysctl later.

Reviewed by: scottl
Approved by: re


104393 03-Oct-2002 truckman

In an SMP environment post-Giant it is no longer safe to blindly
dereference the struct sigio pointer without any locking. Change
fgetown() to take a reference to the pointer instead of a copy of the
pointer and call SIGIO_LOCK() before copying the pointer and
dereferencing it.

Reviewed by: rwatson


102775 01-Sep-2002 anholt

Remove drm_linux.h, move the two useful defines into drm_drv.h. Use fd locking
on -current. Actually copy in data from userspace to kernel in the
linux-compat ioctl path. Make sure ioctl sizes are as expected in the handler
functions.

Reviewed by: rwatson


102003 17-Aug-2002 rwatson

In continuation of early fileop credential changes, modify fo_ioctl() to
accept an 'active_cred' argument reflecting the credential of the thread
initiating the ioctl operation.

- Change fo_ioctl() to accept active_cred; change consumers of the
fo_ioctl() interface to generally pass active_cred from td->td_ucred.
- In fifofs, initialize filetmp.f_cred to ap->a_cred so that the
invocations of soo_ioctl() are provided access to the calling f_cred.
Pass ap->a_td->td_ucred as the active_cred, but note that this is
required because we don't yet distinguish file_cred and active_cred
in invoking VOP's.
- Update kqueue_ioctl() for its new argument.
- Update pipe_ioctl() for its new argument, pass active_cred rather
than td_ucred to MAC for authorization.
- Update soo_ioctl() for its new argument.
- Update vn_ioctl() for its new argument, use active_cred rather than
td->td_ucred to authorize VOP_IOCTL() and the associated VOP_GETATTR().

Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs


98309 16-Jun-2002 des

Remove <sys/select.h> to unbreak the build. I'm not sure if this affects
the functionality of the drm module, but hopefully it will tide us over
until Eric can take a look at it.


97683 31-May-2002 anholt

Warnings cleanup for gcc3. Also __FUNCTION__ -> __func__

Approved by: des


96130 06-May-2002 bde

Include <sys/lockmgr.h> for definitions of deprecated locking interfaces --
don't depend on namespace pollution in other headers.


96122 06-May-2002 alfred

Make funsetown() take a 'struct sigio **' so that the locking can
be done internally.

Ensure that no one can fsetown() to a dying process/pgrp. We need
to check the process for P_WEXIT to see if it's exiting. Process
groups are already safe because there is no such thing as a pgrp
zombie, therefore the proctree lock completely protects the pgrp
from having sigio structures associated with it after it runs
funsetownlst.

Add sigio lock to witness list under proctree and allproc, but over
proc and pgrp.

Seigo Tanimura helped with this.


95972 03-May-2002 tanimura

The first argument of pgsigio() is now struct sigio **.


95746 29-Apr-2002 anholt

More diff reduction: Shuffle around some header code as was done in
drmcommand-0-0-1-branch of DRI CVS, more return code cleanup, and remove some
gratuitous ifdefs.

Approved by: des


95693 29-Apr-2002 anholt

Diff reduction to my experimental code: clean up return code handling.

Approved by: des


95607 28-Apr-2002 anholt

Hook the DRM up to the build and add it to NOTES.

Approved by: des


95584 27-Apr-2002 anholt

Add the code for the DRM, based on the code from the drm-kmod port.
This is not hooked up yet, that will come later.

Approved by: des