Commit Graph

249 Commits (c2184e450e4c5613c1f1a004d183ad478358013e)

Author SHA1 Message Date
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
Eric Anholt b0da5df90a Fix the MGA driver on BSD by passing in the proper chipset flags to the
driver's preinit routine, and by using DRM_COPY_TO_USER_IOCTL when
    copying out to an ioctl's data pointer. Pulled from the latest version
    of my drm-hook-rename.diff and only compile-tested after that.
2005-08-04 07:42:01 +00:00
Eric Anholt 942545721f Correct a couple of descriptions of files in comments (were just
copy'n'pasted).
Submitted by: jkim
2005-07-27 20:20:30 +00:00
Eric Anholt fccd351c8f Link in the savage files from shared-core.
Submitted by: jkim
2005-07-27 20:19:29 +00:00
Eric Anholt ab59dd285c Add latest r300 support from r300.sf.net CVS. Patch submitted by volodya,
with BSD fix from jkim and the r300_reg.h license from Nicolai Haehnle.
    Big thanks to everyone involved!
2005-07-20 21:17:47 +00:00
Eric Anholt c798a382f1 Get the BSD DRM compiling again after MGA and mapping changes. Note that
i915 has been disabled for the moment, rather than working around
    linux-specific code in the shared dir.
2005-06-29 02:54:19 +00:00
Ian Romanick 72cfc797b5 Adds support for PCI cards to MGA DRM
This patch adds serveral new ioctls and a new query to get_param query to
    support PCI MGA cards.
Two ioctls were added to implement interrupt based waiting. With this
    change, the client-side driver no longer needs to map the primary DMA
    region or the MMIO region. Previously, end-of-frame waiting was done by
    busy waiting in the client-side driver until one of the MMIO registers
    (the current DMA pointer) matched a pointer to the end of primary DMA
    space. By using interrupts, the busy waiting and the extra mappings are
    removed.
A third ioctl was added to bootstrap DMA. This ioctl, which is used by the
    X-server, moves a *LOT* of code from the X-server into the kernel. This
    allows the kernel to do whatever needs to be done to setup DMA buffers.
    The entire process and the locations of the buffers are hidden from
    user-mode.
Additionally, a get_param query was added to differentiate between G4x0
    cards and G550 cards. A gap was left in the numbering sequence so that,
    if needed, G450 cards could be distinguished from G400 cards. According
    to Ville Syrjälä, the G4x0 cards and the G550 cards handle
    anisotropic filtering differently. This seems the most compatible way
    to let the client-side driver know which card it's own. Doing this very
    small change now eliminates the need to bump the DRM minor version
    twice.
http://marc.theaimsgroup.com/?l=dri-devel&m=106625815319773&w=2
A number of ioctl handlers in linux-core were also modified so that they
    could be called in-kernel. In these cases, the in-kernel callable
    version kept the existing name (e.g., drm_agp_acquire) and the ioctl
    handler added _ioctl to the name (e.g., drm_agp_acquire_ioctl).
This patch also replaces the drm_agp_do_release function with
    drm_agp_release. drm_agp_release (drm_core_agp_release in the previous
    patch) is very similar to drm_agp_do_release, and I saw no reason to
    have both.
This commit *breaks the build* on BSD. Eric said that he would make the
    required updates to the BSD side soon.
Xorg bug: 3259 Reviewed by: Eric Anholt
2005-06-14 22:34:11 +00:00
Ian Romanick dfc650bd80 Completely re-initialize DMA settings
There were two problems. First, the 'warp' and 'primary' pointers weren't
    cleared, so mga_do_cleanup_dma, which gets called multiple times, would
    try to ioremapfree them multiple times. This resulted in the new error
    messages to syslog. The second problem was the, since the dev_private
    structure isn't reallocated and cleaned out in mga_do_init_dma, when
    the server is reloaded idle-waits would wait for impossible values.
I have given this patch some more riggorous testing. This includes:
- Load module, start server, run GL app, stop server, unload module.
- Load module, start server, run GL app, stop server, unload module, reload
    module, restart server, run GL app.
- Load module, start server, run GL app, stop server, restart server, run
    GL app, stop server, unload module.
In all three cases, everything worked as expected. Please let me know if
    there are any further regressions with this patch.
Xorg bug: 3408 Reported by: Chris Rankin
2005-06-09 21:18:56 +00:00
Eric Anholt 751765dba5 Add a few more bits of Tonnerre's NetBSD port (Still need to deal with the
device attachment).
2005-06-06 06:45:41 +00:00
Ian Romanick 4a84416c45 Modify drm_driver::device_is_agp to return a tri-state value to indicate
that a device absolutely is, absolutely is not, or may or may not be
    AGP. Modify the i915 DRM to use this to force all i9x5 devices to be
    "AGP" (even the PCI-e devices).
Reported by: Lukas Hejtmanek
2005-05-27 23:42:11 +00:00
Ian Romanick a686be5bc8 Change the MGA initialization and cleanup a bit. The dev_private structure
is now allocated (and partially filled in) by the new
    mga_driver_preinit function.
This allows the driver to detect the type of card (i.e., G200 class vs.
    G400 class) on its own. The chipset value passed to mga_dma_init is now
    ignored. This same technique is used by the radeon DRM.
As a result of this, mga_driver_pretakedown was converted to
    mga_driver_postcleanup. This routine gets called in some other places
    than might be expected, and it sets the dev_private pointer to NULL.
    That little gem took over an hour to track down. :(
2005-05-21 02:27:51 +00:00
Ian Romanick e051cd19c0 Added device_is_agp callback to drm_driver. This function is called by the
platform-specific drm_device_is_agp function. Added implementation of
    this function the the Linux-specific portion of the MGA driver to
    detect PCI G450 cards. Added code to the Linux-specific portion of the
    generic DRM layer to not initialize AGP infrastructure if the card is
    not AGP (this matches what already existed in BSD).
Bumped the driver date and the driver patch-level for MGA.
This mostly fixes bugzilla #3248. The BSD side still needs an
    implementation of mga_driver_device_is_agp.
2005-05-16 17:37:10 +00:00
Eric Anholt 6aae7bd5b0 Convert NOMAN to the new preferred spelling NO_MAN to quiet warnings. 2005-04-26 15:27:58 +00:00
Eric Anholt ec111d70fe Convert BSD code to mostly use bus_dma, the dma abstraction for dealing
with IOMMUs and such. There is one usage of the forbidden vtophys()
    left in drm_scatter.c which will be fixed up soon. This required a KPI
    change for drm_pci_alloc/free() to return/use a drm_dma_handle_t that
    keeps track of os-specific bits, rather than just passing around the
    vaddr/busaddr/size.
Submitted by: Tonnerre Lombard (partially) Tested on: FreeBSD: Rage128
    AGP/PCI Linux: Savage4 AGP/PCI
2005-04-26 05:19:11 +00:00
Eric Anholt be9e67a927 Fix a panic on startup with non-initmapping drivers by assigning the
drm_ioremap return value to the map handle again.
Submitted by: Tor Egge, tegge at freebsd dot org
2005-04-24 19:09:09 +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 926298e822 Fix build on FreeBSD-current, thanks to jhb@. 2005-04-13 04:20:08 +00:00
Eric Anholt baeb76076e Merge r1.26 from FreeBSD: Now that mem(4) is a kernel module, we need to
depend on it.
2005-02-19 20:00:55 +00:00
Eric Anholt 3e8792e705 Use fuword32 for DRM_GET_USER_UNCHECKED when available. May help on 64-bit
platforms.
Submitted by: Jung-uk Kim, jkim at niksun dot com
2005-02-14 03:28:01 +00:00
Eric Anholt ed082798f4 Use the proper API to get PCI vendor/device number for a dev.
PR: ports/76879 Submitted by: Alex, lesha at intercaf dot ru.
2005-02-14 03:26: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 ba18d68ff5 Add the first bits necessary for a port of savage to FreeBSD. More to
follow later.
2005-02-13 01:08:29 +00:00
Eric Anholt 81459d6e50 Close a race which could allow for privilege escalation by users with DRI
privileges on Radeon hardware. Essentially, a malicious program could
    submit a packet containing an offset (possibly in main memory) to be
    rendered from/to, while a separate thread switched that offset in
    userspace rapidly between a valid value and an invalid one.
    radeon_check_and_fixup_offset() would pull the offset in from user
    space, check it, and spit it back out to user space to be copied in
    later by the emit code. It would sometimes catch the bad value, but
    sometimes the malicious program could modify it after the check and get
    an invalid offset rendered from/to.
Fix this by allocating a temporary buffer and copying the data in at once.
    While here, make the cliprects stuff not do the VERIFYAREA_READ and
    COPY_FROM_USER_UNCHECKED gymnastics, avoiding a lock order reversal on
    FreeBSD. Performance impact is negligible -- no difference on r200 to
    ~1% improvement on rv200 in quake3 tests (P4 1Ghz, demofour at
    1024x768, n=4 or 5).
2005-02-08 04:17:14 +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 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 7d0cb01cbf Add detection of whether the device is AGP by walking the capabilities
list.
2005-01-17 20:24:52 +00:00
Eric Anholt 3e65f52bda Use SYSCTL_ADD_OID macro instead of calling function directly.
Submitted by: reffie@FreeBSD.org
2004-12-15 03:34:09 +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 67f6c5e36a Don't link in files which no longer exist. 2004-11-07 00:30:15 +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 d37457b599 Add the drm Makefile and update .cvsignores. 2004-11-06 23:05:46 +00:00
Eric Anholt cb5aaa8987 Convert more drivers for bsd-core, moving the ioctl definitions to shared
code. Remove the "drv" from sisdrv, as it's unnecessary. Use the
    drm_pci functions in i915 instead of per-os implementations of the
    same. Avoid whitespace within fields in drm_pciids.txt (one of the r300
    definitions), since it breaks the bsd pciids script. Tested on sis,
    mga, r128. i915 needs more work.
2004-11-06 23:02:07 +00:00
Eric Anholt 7ddbd38dde Remove some core stuff that ended up being unnecessary. 2004-11-06 21:44:54 +00:00
Eric Anholt 7bdccfd0bb Get r128 basically working: Hook up the driver's dma ioctl, use the proper
offset into the driver ioctl array, and don't make the ctx bitmap
    conditional.
2004-11-06 21:18:49 +00:00
Eric Anholt ae7a171313 Move the lock/unlock ioctls to a more logical place, in drm_lock.c. 2004-11-06 20:27:19 +00:00
Eric Anholt cca29ac9be Connect up r128_ioctls in driver config. 2004-11-06 20:21:55 +00:00
Eric Anholt b2f275b46e Hook the debug output up to a sysctl, so you can choose to enable at
runtime.
2004-11-06 11:50:08 +00:00
Eric Anholt 7adee84064 Add file missed in last commit: 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:19:38 +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 cf259f10aa Remove the vestiges of the memory-debug code. 2004-11-06 02:00:04 +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
Erdi Chen 25e319c1ef This patch adds three new ioctl's to the VIA Unichrome/Pro DRM driver:
DRM_IOCTL_VIA_DMA_INIT DRM_IOCTL_VIA_CMDBUFFER DRM_IOCTL_VIA_FLUSH
The first ioctl sets up an area in AGP memory that will be used as the ring
    buffer. The second ioctl copies a command buffer from user space memory
    to the ring buffer. The third ioctl waits for engine idle until it
    returns.
The motivation for this patch is to avoid the wait for engine idle call
    before each buffer flush in the current DRI driver. With this patch,
    the DRI driver can continue to flush its buffer as long as there is
    free space in the ring buffer.
This patch adds an additional copy operation on the command buffer. This
    buffer copying is necessary to support multiple DRI clients rendering
    simultaneously. Otherwise, more CPU time will be spent in the busy loop
    waiting for engine idle between DRI context switch. Even in the single
    client case, the tradeoff is reasonable in comparision to the kernel
    call to check for free buffer space for the client to render directly
    to the ring buffer.
2004-08-24 01:44:37 +00:00
Dave Airlie 5c9ed83094 Merged drmfntbl-0-0-1 2004-08-17 13:10:05 +00:00
Eric Anholt 740ddb9c5d Remove unused pcigart/sg header stuff from i915 driver. 2004-08-14 00:56:34 +00:00
Eric Anholt dd83f39f03 Add a "dev" argument to DRIVER_CTX_[CD]TOR. This will be used in an
upcoming commit for the SiS driver.
2004-08-14 00:46:15 +00:00
Eric Anholt 2376ec4ef8 Hopefully proper fix for corrupted driver name in memcontrol list.
Reported by: Jung-uk Kim <jkim@niksun.com>
2004-08-14 00:03:32 +00:00
Eric Anholt d78db7c930 Enable MTRR usage on AMD64, and use DELAY() instead of rolling our own
udelay code.
Submitted by: Jung-uk Kim <jkim@niksun.com>
2004-08-13 23:17:17 +00:00
Dave Airlie 6c9715eaf5 bring over fix from i865-agp branch, it now probes the driver, X hangs
box..
2004-08-03 11:26:38 +00:00
Dave Airlie 1cec18a5cd add read/write 16 2004-07-29 13:00:48 +00:00
Dave Airlie b1cf4ca7e5 change to agp not pci ... still not working 2004-07-29 12:49:54 +00:00
Dave Airlie 0b02bf9d45 initial port of i915 to BSD, not finished doesn't work.. no idea why... 2004-07-29 11:09:22 +00:00
Eric Anholt eaccc05b26 Fix module loading on alpha by not referencing MTRR symbols on
!__REALLY_HAVE_MTRR.
2004-07-06 00:25:19 +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 c47b611b08 Add mach64 DRM module for BSD (untested, but compiles). 2004-05-09 22:36:19 +00:00
Eric Anholt dfdf8e14d3 Add .cvsignore files. 2004-05-09 22:29:55 +00:00
Eric Anholt 51ed2f5937 Warning fixes. 2004-05-09 22:16:11 +00:00
Eric Anholt d477cc007c - Link in shared files as necessary and clean them up.
- Generate drm_pciids.h automatically.
2004-05-09 22:14:07 +00:00
Eric Anholt c093a03d47 Catch up with sis's DRM tag change. 2004-05-09 22:07:58 +00:00
Eric Anholt 29f2b1c1cf drm_hw_lock_t is now defined in drm.h, remove from here. 2004-05-09 21:56:19 +00:00
Dave Airlie a2f7a9fa5f Commit sysfs and drm PCI changes for 2.6 kernel 2004-05-09 06:45:17 +00:00
Dave Airlie 93bd67ef62 centralise pci ids into one place and use scripts to generate files for
kernel
2004-04-21 12:13:31 +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 2c1172a317 Remove unused variable. 2003-11-06 04:35:08 +00:00
Eric Anholt 66c9e3053f - Tie the DRM to a specific device: setunique no longer succeeds when given
a busid that doesn't correspond to the device the DRM is attached to.
    This is a breaking of backwards-compatibility only for the
    multiple-DRI-head case with X Servers that don't use interface 1.1.
- Move irq_busid to drm_irq.h and make it only return the IRQ for the
    current device. Retains compatibility with previous X Servers, cleans
    up unnecessary code. This means no irq_busid on !__HAVE_IRQ, but can be
    changed if necessary.
- Bump interface version to 1.2. This version when set signifies that the
    control ioctl should ignore the irq number passed in and enable the
    interrupt handler for the attached device. Otherwise it errors out when
    the passed-in irq is not equal to the device's.
- Store the highest version the interface has been set to in the device.
- Fix a recursion on DRM_LOCK in irq_uninstall on FreeBSD. This leaves
    irq_uninstall being done without the lock in some cases, but it was
    racey anyways.
2003-11-05 08:13:52 +00:00
Eric Anholt 8feb046d8c Args for the BSD DRM_PUT_USER_UNCHECKED were swapped. 2003-11-05 02:41:50 +00:00
Eric Anholt e5cad7fced Remove buf_alloc which is unused since the locking commit. 2003-11-05 00:49:35 +00:00
Michel Daenzer 2655ccddf4 Memory layout transition:
the 2D driver initializes MC_FB_LOCATION and related registers sanely
the DRM deduces the layout from these registers
clients use the new SETPARAM ioctl to tell the DRM where they think the
    framebuffer is located in the card's address space
the DRM uses all this information to check client state and fix it up if
    necessary
This is a prerequisite for things like direct rendering with IGP chips and
    video capturing.
2003-11-04 00:46:05 +00:00
Eric Anholt 3f7279cb8e Add a DRM_PUT_USER_UNCHECKED, which will be used by an upcoming radeon
change.
2003-10-27 22:05:38 +00:00