Commit Graph

13 Commits

Author SHA1 Message Date
jmcneill 875766b9be Revert previous, i915drm works again. 2008-06-29 12:49:08 +00:00
bjs 16e84d5575 - Don't use btop, as only three (?) platforms define this macro; use
round_page(x) >> PAGE_SHIFT instead.

- Add bus_space_mmap() in drm_vm.c to give a proper cookie to the device pager;
  this gets rid of one of the two #ifdef macppc conditionals.
2008-06-20 05:53:46 +00:00
bjs 6c1a2fee8f - Use the extent manager to track mappings and provide sane offset
"cookies" for mmap.  Now the radeon driver works on amd64!

- Use bus_dma for nearly all map types (carried over from prior patch).

- Plug some lock leaks in drm_bufs.c and remove superfluous locking in
  drm_add_magic() (from git).

- Lower spl of mutexes to IPL_NONE (and so are now adaptive instead of
  spin mutexes), save for irq_lock which is a spin mutex at IPL_VM.
  Use mutex_spin_enter()/mutex_spin_exit() for irq_lock.

ok jmcneill@
2008-06-20 00:14:28 +00:00
bjs 829081eaa7 Revert last commit -- breaks i915. 2008-05-06 01:45:47 +00:00
bjs a65a4adb77 A few steps down the yellow brick road toward bus_dma-ification:
- Add drm_dmamem_alloc/drm_dmamem_free to drm_memory.c to nicely wrap up
   the bus_dma API.

 - Start using the above in drm_pci.c.

 - Add DRM_NETBSD_DMA_ADDR/DRM_NETBSD_DMA_VADDR macros.

 Locking:

 - Use IPL_NONE for all locks except the IRQ lock, which runs at IPL_VM.

 - Use IPL_VM instead of IPL_TTY with pci_intr_establish() for consistency's
   sake. These two changes seem to eliminate the presistent lockups I was
   having (NetBSD-current/amd64 r300).

 - Start getting rid of DRM_SPININIT/DRM_SPINUNINIT and DRM_SPINLOCK/
   DRM_SPINUNLOCK ... these annoy me to no end--not to mention that they
   locks may or may not be spinlocks!  It's a linux frob, really.
   We're way beyond merging any useful bsd-core code on a large scale, which
   was the only good reason to keep them around.

 Memory allocation:

  - Change drm_memory.c so that it contains generally useful, memory
    allocation functions using kmem(9) (mostly used by the drivers
    themselves).  However, I expect to use this more in the future
    in the "bsd core".  These functions always use KM_NOSLEEP.
    The new drm_dmamem_alloc function has a wait argument which
    takes DRM_DMA_WAIT/DRM_DMA_NOWAIT (defined as their bus_dma
    counterparts), and honors this hint in its calls to kmem(9)
    and bus_dma(9) functions.

  - Got rid of these functions' "area" argument--it's been deprecated for
    ages.  Provide macros in drmP.h to deal with the os-independent code.

  - Declare these functions inline -- I believe they're used enough
    by the i915 and radeon drivers to justify it.  Please let me know
    if I am mistaken.

    NOTE: With these changes, a glxgears score which was previously
    ~3900fps is now ~4400fps (same setup as mentioned above).  I realize
    that using kmem(9) could cause problems, but I can't seem to run into
    any with my test setup.  If anyone smells regression, please let me
    know.
2008-05-06 01:26:14 +00:00
bjs 9edaf4a46f Fix bus_dmamem_free() call to provide 'segs' as the second argument.
While here, add DRM_PCI_DMAADDR macro so that we set handle->busaddr
in a portable way.
Next is the more difficult [annoying] part: use bus_dma(9) with
scatter/gather buffers.
2008-03-02 07:12:15 +00:00
lukem afb2a5863e use __KERNEL_RCSID() 2007-12-11 11:17:30 +00:00
bjs 72127ffc00 drm unbreaking, round 1:
Fix the bus_dma(9) use in drm_pci.c and chnage struct drm_dma_handle_t
to match it.  Remove member dmaaddr from drm_dma_handle_t as well,
as I don't see it used anywhere.  Compile-tested only for now; please
report any problems to me.  Thanks.
2007-12-04 12:51:13 +00:00
bjs 27bbf3c565 Remove #ifdef __OpSys__ sections to make this readable. Add RCS tags.
Nothing done in header files, nor in dev/pci/drm (we might not want to
touch this for the sake of merging) yet.  Compile tested; please let
me know if this broke anything.
2007-11-21 19:22:12 +00:00
drochner d414de4f1a since no boundary restrictions apply, a zero boundary argument to
bus_dmamem_alloc() is the right thing
2007-03-21 17:15:53 +00:00
xtraeme feef686ef0 Fix previous, use %zd. 2007-03-21 03:22:16 +00:00
macallan fb308a7a59 - pass a sane boundary parameter to bus_dmamem_alloc
- sprinkle aprint_error()
2007-03-21 03:10:31 +00:00
drochner 2d9e04fc35 Import DRM drivers, brought into shape by Yorick Hardy, posted to tech-x11.
Minor modifications by me:
-use an mi device major number
-(coarsly) divided into pci card specific and less specific parts, moved
 the latter to dev/drm
-renamed autoconf attributes to reflect this
Todo:
-adapt all card frontends but i915 to drm include file location
-review the mtrr change
-make the change to agp_i810.c coexist with the fix for buggy VESA
 BIOSes which is commented out temporarily
-RCS IDs etc style stuff
-LKM support (rescan support for vga)
-test
2007-03-20 18:05:25 +00:00