Commit Graph

32 Commits (66d2714f5435944a26685be4210e0e0d7138f3db)

Author SHA1 Message Date
Robert Noland 44fec1a8e4 FreeBSD: Improve the debug output of drm_mmap(). 2009-03-16 00:35:18 -05:00
Robert Noland 81952c7dd1 Use devfs_get_cdevpriv in mmap as well.
d_mmap gets called twice and we are only able to associate the file_priv
during the first call.  The second call will return EBADF and we need to
assume that the call was succesful.  d_mmap will not tolerate having an
error returned for the second call.
2008-10-01 20:49:03 -04:00
Robert Noland 8ca06eb492 [FreeBSD] Convert to using cdevpriv for file_priv tracking 2008-09-17 23:15:08 -04:00
vehemens 973c634eaa Remove incomplete and obsolete free/net/open code.
Signed-off-by: Robert Noland <rnoland@2hip.net>
2008-09-10 23:35:10 -04:00
vehemens 71f0a3e389 [FreeBSD] Replace typedefs on bsd.
Signed-off-by: Robert Noland <rnoland@2hip.net>
2008-08-29 15:46:05 -04:00
Owain Ainsworth df127c303d [BSD] Move unlock in drm_vm.c from accidental platform #ifdeffing.
Also remove an unreachable unlock.
2008-05-27 15:12:35 -07:00
Eric Anholt ad8eb0ed01 [FreeBSD] Convert from drm_device_t to struct drm_device for consistency. 2008-05-27 14:25:08 -07:00
Eric Anholt 5346fc5f36 BSD: Replace brief description in each file's first line with doxygen later on.
The brief descriptions usually had the wrong filename in them.
2007-08-15 11:06:49 -07:00
Eric Anholt 5b38e13416 Replace DRM_IOCTL_ARGS with (dev, data, file_priv) and remove DRM_DEVICE.
The data is now in kernel space, copied in/out as appropriate according to the
This results in DRM_COPY_{TO,FROM}_USER going away, and error paths to deal
with those failures.  This also means that XFree86 4.2.0 support for i810 DRM
is lost.
2007-07-20 18:16:42 -07:00
Eric Anholt e39286eb5e Remove DRM_ERR OS macro.
This was used to make all ioctl handlers return -errno on linux and errno on
*BSD.  Instead, just return -errno in shared code, and flip sign on return from
shared code to *BSD code.
2007-07-20 12:53:52 -07:00
Eric Anholt 19c5c56779 Fix Savage DRI without ShadowStatus NO by allowing the shadow area to be
mapped.
2005-11-15 04:37:51 +00:00
Eric Anholt 55bea952b3 [1] Fix BSD DRM for the nonroot changes. [2] Don't attempt to acquire the
DMA lock in a non-DMA driver, as it will be uninitialized.
Submitted by: [1] jkim (minor changes by me)
2005-08-26 00:16:01 +00:00
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 0d2eb2b90c Fix bad copy'n'pastage of copyrights -- don't disclaim anything for VA
Linux or PI in my copyrights when I should be doing it for myself.
2005-02-13 01:18:25 +00:00
Eric Anholt 2239c55a30 Remove some annoying trailing whitespace. 2005-02-07 01:14:42 +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 a1d9e5abaf Refine the locking of the DRM. Most significant is covering the driver
ioctls with dev_lock, which is a major step toward being able to remove
    Giant. Covers some new pieces (dev->unique*) in the core, and avoids
    one call down into system internals with the drm lock held, which is
    usually bad (FreeBSD LOR #23, #27).
2004-11-07 04:11:15 +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
Eric Anholt 694291fbd3 MFC as of 20040705: dev_t -> struct cdev * change. 2004-07-06 00:23:42 +00:00
Eric Anholt 853adb8be3 Merge from FreeBSD-current. Mostly 64-bit cleanliness fixes, but a few
driver interface changes from -current.
2004-05-11 04:43:43 +00:00
Eric Anholt 86e6325e5a - Add DRM_GET_PRIV_WITH_RETURN macro. This can be used in shared code to
get the drm_file_t * based on the filp passed in ioctl handlers.
- Use this macro on BSD for simplification and improve its error reporting.
    Make failure to find the drm_file_t * print as an error, not debug.
    This failure may be part of the problem with KDE.
- Make debug and error print macros include the pid on BSD.
2003-10-22 22:08:53 +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 e187d665e4 Add an MIT-style copyright, assigned to myself, to these files. I think
I've touched enough of the code here, and there was no previous
    copyright. Do some drive-by style fixes while I'm here.
2003-10-02 20:52:44 +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
Eric Anholt 77ee73f8cd Merge from FreeBSD-current. 2003-04-25 02:27:21 +00:00
Eric Anholt 6f88a5351c Whitespace and remove a dead commented line. 2003-04-01 18:53:24 +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 3f786dbd18 Update mmap handling for FreeBSD-current (Based on r1.3 of FreeBSD CVS). 2003-03-05 06:04:50 +00:00
Eric Anholt cfa778af9c Merge from bsd-4-0-0-branch. 2003-02-21 23:23:09 +00:00
Alan Hourihane 74ef13fd00 merged bsd-3-0-0-branch 2002-07-05 08:31:11 +00:00
David Dawes 14945ada16 Import of XFree86 4.2.0 2002-01-27 18:23:04 +00:00