Commit Graph

33 Commits (699d4ad53a62e46344b672365dda0be4001edd99)

Author SHA1 Message Date
Eric Anholt 10ddbc8c8c Use /*- to begin license blocks in BSD code to reduce diffs against FreeBSD
CVS.
2005-04-16 03:02:52 +00:00
Eric Anholt 926298e822 Fix build on FreeBSD-current, thanks to jhb@. 2005-04-13 04:20:08 +00:00
Eric Anholt 5a332a0f61 Restore a debugging message to DRM_DEBUG instead of DRM_ERROR. 2005-02-07 03:10:03 +00:00
Eric Anholt 080a547d4d - Implement drm_initmap, and extend it with the resource number to help
FreeBSD. Add drm_get_resource_{start|len} so linux-specific stuff
    doesn't need to be in shared code.
- Fix mach64 build by using __DECONST to work around passing a const
    pointer to useracc, which is unfortunately not marked const.
- Get rid of a lot of maplist code by not having dev->maplist be a pointer,
    and by sticking the link entries directly in drm_local_map_t rather
    than having a separate structure for the linked list.
- Factor out map uninit and removal into its own routine, rather than
    duplicating in both drm_takedown() and drm_rmmap().
- Hook up more driver functions, and correct FreeBSD-specific bits of
    radeon_cp.c, making radeon work.
- Baby steps towards using bus_space as we should.
2005-02-05 08:00:14 +00:00
Eric Anholt fa3fdbd99c Now that the memory debug code is gone, and all 3 BSDs have M_ZERO, stop
using drm_alloc/drm_free in the core and instead use plain malloc/free.
2004-11-07 00:25:49 +00:00
Eric Anholt d7510ea413 Commit first pieces of port to OpenBSD, done by Martin Lexa (martin at
martinlexa dot cz). Now that we've got porting for all three major BSDs
    (and the fourth being very similar to FreeBSD), move the
    mostly-duplication drm_os_* files into drmP.h. Remove some cruft from
    linux heritage and from pieces of the DRM that have since been removed.
Note that things are still not quite working for even FreeBSD, but these
    are first steps at cleanup, and just a WIP checkpoint.
2004-11-06 11:16:26 +00:00
Eric Anholt c9202c8965 Commit WIP of BSD conversion to core model. Compiles for r128, radeon, but
doesn't run yet. Moves the ioctl definitions for these two drivers back
    to the shared code -- they aren't OS-specific.
2004-11-06 01:41:47 +00:00
Dave Airlie 5c9ed83094 Merged drmfntbl-0-0-1 2004-08-17 13:10:05 +00:00
Eric Anholt 51ed2f5937 Warning fixes. 2004-05-09 22:16:11 +00:00
Eric Anholt fb7b802dda Fix some misuse of NULL where 0 is intended.
Obtained from: FreeBSD CVS
2004-01-06 04:54:25 +00:00
Eric Anholt 9fb6986e83 Don't ioremap the framebuffer area. The ioremapped area wasn't used by
anything, and took up valuable KVA. While I'm in the area, clean up BSD
    MTRR stuff some more.
Suggested by: jonsmirl
2003-12-16 08:57:08 +00:00
Eric Anholt 6e56c39371 Fix a locking nit, and add asserts in some things that should be called
with locks held.
2003-11-12 20:30:51 +00:00
Eric Anholt 1f7598245a Return EBUSY when attempting to addmap a DRM_SHM area with a lock in it if
dev->lock.hw_lock is already set. This fixes the case of two X Servers
    running on the same head on different VTs with interface 1.1, by making
    the 2nd head fail to inizialize like before.
2003-11-06 04:48:06 +00:00
Eric Anholt 6b0424fdcd Clean up BSD MTRR handling. The NetBSD code is untested, but it's my best
shot.
2003-10-20 00:55:56 +00:00
Eric Anholt 0cf1887139 - SMPng lock the DRM. This is only partial -- there are a few code paths
used by root (the X Server) which are not locked. However, it should
    deal with lost-IRQ issues on -current which I think people have been
    experiencing but I am unable to reproduce (though I understand why they
    would occur, because of a bug of mine). Note that most of the locking
    (DRM_LOCK()/UNLOCK()) is all covered by Giant still, so it doesn't
    matter yet.
- Remove locking on FreeBSD-stable and NetBSD. These are covered by the
    fact that there is no reentrancy of the kernel except by interrupts,
    which are locked using spldrm()/splx() instead.
2003-10-19 23:35:58 +00:00
Eric Anholt 9fbfb7ca6a Some code cleanups done while working on locking. Reduces always-true
tests, excessive indenation, convoluted handling of errors, or code
    duplication.
2003-10-03 08:08:10 +00:00
Eric Anholt 929536172c Stylistic preparation for SMPng locking work: DRM_LOCK/DRM_UNLOCK have side
effects, so make them look like functions (add parenthesis).
2003-10-03 07:02:51 +00:00
Eric Anholt a6b84f73e1 Mostly whitespace cleanups and style(9) fixes focused on "if(" -> "if ("
Change some nearby memset()s to bzero()s or to calloc allocations to
    take advantage of M_ZERO). Reverse some error tests to reduce high
    levels of indentation. Move the sg_cleanup() call out of the maplist
    loop in DRM(takedown)-- I can't see any need for it to be inside.
2003-10-02 04:48:54 +00:00
Eric Anholt 963ad33cb6 Fix the debug build. 2003-08-19 02:22:57 +00:00
Eric Anholt ad78a613a4 - Remove $FreeBSD$ tags as they weren't too useful and merges are now being
done through perforce.
- Add copyright headers to drm_os_*bsd.h, still need to research the other
    copyright-less files better.
2003-08-19 00:41:00 +00:00
Michel Daenzer e5d3c7f260 Support AGP bridges where the AGP aperture can't be accessed directly by
the CPU (David Mosberger, Benjamin Herrenschmidt, myself, Paul
    Mackerras, Jeff Wiedemeier)
2003-05-16 23:41:27 +00:00
Eric Anholt ce514e08aa Add PCI DMA memory functions and make addbufs_pci and associated code use
it. To do this we need to save the bus address along with the virtual
    address in the seglist. Also fix some error handling and a few bits of
    whitespace.
2003-04-26 22:52:39 +00:00
Eric Anholt 77ee73f8cd Merge from FreeBSD-current. 2003-04-25 02:27:21 +00:00
Eric Anholt 58650c3a9d Clean up the DRM_COPY_TO_USER()ing of DRM(infobufs), making it more
legible.
2003-04-25 00:02:14 +00:00
Eric Anholt a147df879b Remove more gamma DMA infrastructure. Most of this code was copied straight
from linux, so it could be added back if some driver needed it in the
    future.
2003-04-24 19:09:55 +00:00
Eric Anholt c6d2af70cb Move some common code from addbufs_<type> to addbufs. Make buf_alloc be
protected by the count_lock and make it non-atomic.
2003-04-24 05:56:44 +00:00
Eric Anholt e21473c888 Remove DRM_DMA_HISTOGRAM and associated code. 2003-04-24 00:37:35 +00:00
Eric Anholt 6ef79263b6 Add DRMFILE definitions and supply filp for BSD in the
post-drm-filp-0-1-branch world. The filp is a void * cast from the
    current pid. This is a temporary solution which maintains the status
    quo until a proper solution is implemented.
What is really needed is a unique pointer per open, hopefully with a device
    private area. This can be done in FreeBSD for all entry points except
    mmap, but is difficult (sys/dev/streams/streams.c is an example). I
    have partially completed code for this but have not had time to debug,
    so this is a temporary fix.
2003-03-29 03:38:47 +00:00
Eric Anholt 0bd0dd2300 Merge back from FreeBSD-current, adding FreeBSD ID tags to aid future
merging. Also includes an update to radeon PCI IDs.
2003-03-11 20:51:28 +00:00
Eric Anholt cfa778af9c Merge from bsd-4-0-0-branch. 2003-02-21 23:23:09 +00:00
Eric Anholt 537f2208f0 Remove some noise being spit to the console. 2002-09-29 23:56:17 +00:00
Alan Hourihane 74ef13fd00 merged bsd-3-0-0-branch 2002-07-05 08:31:11 +00:00
David Dawes 16bd14926e Initial revision 2002-01-27 18:23:04 +00:00