Commit Graph

221 Commits (f68ad6d1abdce7d3c11cc2e90745c0d1e565fe77)

Author SHA1 Message Date
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 c1119b1b09 Replace filp in ioctl arguments with drm_file *file_priv.
As a fallout, replace filp storage with file_priv storage for "unique
identifier of a client" all over the DRM.  There is a 1:1 mapping, so this
should be a noop.  This could be a minor performance improvement, as everything
on Linux dereferenced filp to get file_priv anyway, while only the mmap ioctls
went the other direction.
2007-07-20 13:39:45 -07:00
Eric Anholt 35de486836 BSD: Replace symlink building with symlinks in git. 2007-07-20 12:53:53 -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 f4e1c1d05c FreeBSD warnings cleanup. 2007-07-19 06:46:13 -07:00
Eric Anholt e544286eae FreeBSD: Fix the recently added drawable add/remove/update code. 2007-07-19 06:17:58 -07:00
Eric Anholt 50cb405f93 Fix the getclient test (Need this feature for future tests). 2007-07-19 06:02:20 -07:00
Eric Anholt 33a50412c2 Add dry-coded DRM drawable private information storage for FreeBSD.
With this, all modules build again.
2007-07-18 14:22:49 -07:00
Eric Anholt 3f04fe7890 Fix FreeBSD build. 2007-07-16 01:53:06 -07:00
Arthur Huillet 04e4922c0c Made drm_sg_alloc accessible from inside the DRM - drm_sg_alloc_ioctl is the ioctl wrapper 2007-07-11 02:34:00 +02:00
Jung-uk Kim b0c8d885ce Update a bunch of FreeBSD port code.
Tested on r200/r300.  i915 updates still remain to be done.
2007-05-29 15:02:44 -07:00
Eric Anholt 5d69640a6a Catch up to new interrupt API, and retire FreeBSD 4.x support here. 2007-03-24 09:39:09 -07:00
Michel Dänzer 74a92bbf6e Core build fix for BSD. 2006-12-01 11:00:32 +01:00
Michel Dänzer a97bb85c2a Unshare drm_drawable.c again for now.
The current version didn't build on BSD, where the new functionality isn't used
yet anyway. Whoever changes that will hopefully be able to make the OSes share
this file as well.
2006-12-01 10:46:21 +01:00
Alan Hourihane 7b6cd95bb6 Fix bug #8839 - a comment 2006-10-31 10:01:53 +00:00
Michel Dänzer 29598e5253 Add support for tracking drawable information to core
Actually make the existing ioctls for adding and removing drawables do
something useful, and add another ioctl for the X server to update drawable
information. The only kind of drawable information tracked so far is cliprects.
2006-09-28 15:41:35 +02:00
Eric Anholt dddacd7a3a Use the DRM_INIT_WAITQUEUE argument (needed on Linux) to avoid a warning. 2006-09-06 23:26:50 -07:00
Eric Anholt 55057660f0 Put the PCI device/vendor id in the drm_device_t.
This helps us unbreak FreeBSD DRM from the 965 changes.
2006-09-06 23:25:14 -07:00
Eric Anholt d572676185 Add a typedef for u64. 2006-09-06 23:08:29 -07:00
Michel Dänzer b9243ce3d5 .cvsignore -> .gitignore
Sort the merged file, remove the redundant explicit .ko lines and add
some generated symlinks.
2006-07-19 18:31:43 +02:00
Eric Anholt bdd381a7ce Set entry->virtual for sg maps, fixing ATI PCI/PCIE GART support.
PR: kern/97056 Submitted by: Stanislav Sedov <ssedov@mbsd.msk.ru>
2006-05-17 06:07:57 +00:00
Eric Anholt dcfcf1a84d Add the bits for vblank support on FreeBSD, which most importantly avoids
chasing a NULL pointer at the first 3d app invocation.
2006-05-17 05:44:39 +00:00
Eric Anholt 7ea4a88fa3 Add the workaround that's in the kernel to suppress GCC's warning about
refusal to inline functions that (in some cases, at least) aren't that
    large.
2006-05-17 05:41:48 +00:00
Eric Anholt 2abd1f270b Reorder the DRM_*_AGP enum to match linux's numbers (oops). Fixes i915
attachment. Make our mga_drv.c use them, while I'm here.
Submitted by: Jonathan Fosburgh <jonathan@fosburgh.org>
2006-04-18 06:08:17 +00:00
Eric Anholt 7f2c7f9977 Merge patch from jhb to catch up with FreeBSD-current vgapci master device
changes.
2005-12-30 02:17:05 +00:00
Eric Anholt 2911edaed7 Remove driver.device_is_agp code duplicated in drm_device_find_capability,
when it really wanted to live in drm_device_is_agp.
2005-12-05 10:53:06 +00:00
Eric Anholt 20fcbae5ac Finish the last bits necessary to get the i915 DRM port working on FreeBSD
Submitted by: Alexey Popov <llp@iteranet.com>
2005-12-02 23:41:47 +00:00
Eric Anholt 422002dc84 FreeBSD PR kern/85479: Restore the enabling of debugging by default by the
DRM_DEBUG kernel option. It remains controlled by hw.dri.*.debug no
    matter what.
2005-12-02 08:47:04 +00:00
Eric Anholt 1835dff04a Fix AGP support guessing: Implement the same bridge checking in the MGA
driver as Linux uses, and actually use the driver's device_is_agp if
    available (hopefully fixing i915).
2005-11-28 21:15:46 +00:00
Eric Anholt c575b7e19e Fix compiling and reenable build of i915 driver. 2005-11-15 09:22:09 +00: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 cc1a4dd856 Fix breakage from the move of driver ioctl externs to header files. 2005-11-11 09:36:58 +00:00
Eric Anholt c7af46cf7d Correct another LOR issue with resource allocation. This leaves the
drm_get_resource_* resource allocation a little racy, but they're
    getting called at either X Server startup or driver load, so it's
    serialized anyway.
2005-11-08 21:36:54 +00:00
Eric Anholt a10d8178e3 Initial port of savage to FreeBSD for the AGP and !ShadowStatus case. Adds
drm_mtrr_{add,del} for handling the MTRR setup. Still has a LOR issue
    with DRM_VERIFYAREA_READ/DRM_COPY_FROM_USER_UNCHECKED in savage_bci.c
    -- this won't work with the fine-grained locking in use, and just doing
    a single copyin to a temporary will probably work fine. Also note that
    the module leaks approximately 4 kb on unload.
2005-11-08 20:25:00 +00:00
Eric Anholt 4b2235d2e0 Correct a LOR related to the PCI resource allocations by simply moving the
uninit to unload time rather than lastclose.
2005-11-08 06:11:55 +00:00
Eric Anholt 71f9b7357c Fix FreeBSD DRM for latest MGA changes to agp support, which cleans things
up a good bit, I think. Also, remove the agp_uninit() function which
    has lain around as a noop for years now. The FreeBSD DRM is now all
    compiling, with the exception of via. One known sleeping-with-lock-held
    issue remains.
2005-11-08 05:29:26 +00:00
Eric Anholt 1a256df480 Catch FreeBSD up to the pcie gart changes. Required minor modification to
radeon_cp.c to use a drm_local_map_t-type mapping (drm_core_ioremap
    rather than drm_ioremap), which contains private device mapping
    information on BSD. I also changed the ati_pcigart interface to use
    "void *" for pointers to kva rather than "unsigned long". While PCIGART
    support appears to be broken on FreeBSD currently, I think this is not
    new, and BusType PCI remains working on my r100 in Linux.
2005-11-08 02:38:01 +00:00
Eric Anholt 145b23b552 Correct a recursion on non-recursive mutex in drm_addmap from radeon's
firstopen, by making drm_addmap require the drm device lock to be held.
    Also, make matching of kernel maps match linux by requiring shm matches
    to have the contains_lock flag set if the offset doesn't match.
2005-11-08 01:12:08 +00:00
Eric Anholt 900a7e4c36 Re-disable the via driver while it's broken on BSD. 2005-11-06 06:32:25 +00:00
Dave Airlie f42cdc8dcb Add support to turn writeback off via radeon module option 2005-09-30 06:41:10 +00:00
Eric Anholt 4b2a94db46 Fix the spelling of DRM_AUTH so that the bsd core stuff builds again. Next
up is pcigart.
2005-09-12 05:35:51 +00:00
Dave Airlie 0d346a07a8 convert ioctl flags to use flags instead of separate ints 2005-09-03 03:27:14 +00:00
Eric Anholt 22ec8ebb17 - Don't try to allocate mappings of less than a PAGE_SIZE in MGA DMA code.
- Comment out the "is this mapping/bufs in allocated AGP" bits in BSD
    because they break mga (which uses AGP allocation that doesn't track
    entries). It's not a security issue when we still have the related
    ioctls marked root-only.
- Apply some power-of-two alignment restrictions to hopefully avoid some
    panicing in bad cases of drm_pci_alloc() on FreeBSD.
- Add verbosity to some error handling that I found useful while debugging.
2005-08-26 23:27:19 +00:00
Eric Anholt c425ad1a34 Previously, drm_get_resource_start() and drm_get_resource_len() would
allocate the resource RF_ACTIVE, pull out the appropriate value, and
    return it. However, allocating large framebuffers RF_ACTIVE would run
    the system out of KVA, and this also left open the possibility of the
    resource getting moved after getting the offset. Instead, when either
    of these are called, allocate the resource if it isn't allocated
    already (non-RF_ACTIVE) and store it in the DRM device, to be cleaned
    up on lastclose.
2005-08-26 20:56:11 +00:00
Eric Anholt 5105f9ea59 Fix a lack of parenthesis in macro usage that showed up with INVARIANTS
turned on, i.e. in a kernel build.
2005-08-26 19:07:03 +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
Dave Airlie 8ac2fcb193 add agp buffer token 2005-08-17 22:59:00 +00:00
Eric Anholt 8c21b783c3 Port the VIA DRM to FreeBSD. Original patch by Jake, with some cleanup by
me to match other drivers and avoid ifdeffing. The linux via_drv.c will
    be moved from shared-core to linux-core soon by repocopy.
Submitted by: Jake Burkholder <jake@FreeBSD.org> Tested by: unichrome
2005-08-15 18:07:12 +00:00
Eric Anholt 4050f5066a Fix build after linux-side checkin of master/root-only split. Still only
cares about root on the BSD side, but should be secure.
2005-08-12 17:18:08 +00:00
Eric Anholt c789ea1521 Rename the driver hooks in the DRM to something a little more
understandable: preinit -> load postinit -> (removed) presetup ->
    firstopen postsetup -> (removed) open_helper -> open prerelease ->
    preclose free_filp_priv -> postclose pretakedown -> lastclose
    postcleanup -> unload release -> reclaim_buffers_locked version ->
    (removed)
postinit and version were replaced with generic code in the Linux DRM
    (drivers now set their version numbers and description in the driver
    structure, like on BSD). postsetup wasn't used at all. Fixes the savage
    hooks for initializing and tearing down mappings at the right times.
    Testing involved at least starting X, running glxgears, killing
    glxgears, exiting X, and repeating.
Tested on: FreeBSD (g200, g400, r200, r128) Linux (r200, savage4)
2005-08-05 03:50:23 +00:00