Robert Noland
8256c347cc
[FreeBSD] We should use dev2unit() rather than minor()
2008-10-23 15:46:32 -04:00
Robert Noland
7dbeb18777
[FreeBSD] This check isn't correct and causes at least mga to lockup.
2008-10-23 15:42:49 -04:00
Robert Noland
f5327aca0c
[FreeBSD] Plug memory leak in drm_rmdraw() and drm_drawable_free_all()
2008-10-10 18:23:11 -04:00
Robert Noland
cdd3e9fc56
[FreeBSD] Rework all of the memory allocations
...
Allocate memory from different pools. This allows the OS to track memory
allocations for us, much like the linux memory debugging. This will ease
tracking down memory leaks since the OS can track the number of allocations
from each pool and help to point us in the right direction. Also replace
drm_alloc and friends with static __inline__ versions while we are here.
2008-10-10 13:06:22 -04:00
Robert Noland
1150a42d43
[FreeBSD] Fix linux list compat list_for_each_safe()
...
linux_for_each_safe would not handle lists with a single entry.
2008-10-09 22:13:26 -04:00
Robert Noland
60cf3a4db4
[FreeBSD] Don't explicitly bzero driver softc.
...
This is already handled for us.
Suggested by John Baldwin
2008-10-03 14:11:20 -04:00
Robert Noland
9c0ce38df3
[FreeBSD] Use M_WAITOK when allocating driver memory.
...
We don't explicitly check for error here and M_WAITOK will just put the
process to sleep waiting on resources to become available.
Suggested by John Baldwin
2008-10-03 14:05:45 -04:00
Robert Noland
4c92abfa8d
[FreeBSD] Do a bit of optimization on drm_order()
2008-10-03 13:56:50 -04: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
Robert Noland
828ae3f6b8
[FreeBSD] We need to call drm_detach before we free dev->driver.
...
The driver is in control of the show, so when you try and unload a module
the driver detach routine is called first. It is what drives the whole
unload process and so lots of panics occur if dev->driver is already
free.
2008-09-08 16:40:52 -04:00
Robert Noland
2880c86eb2
[FreeBSD] Implement drm_ioremap_wc() to set a range of mem to write-combining
2008-09-07 12:44:02 -04:00
Robert Noland
740f09bffd
[FreeBSD] IGP gart needs to be un-cached.
...
Airlied inadvertently discovered that the IGP gart needs to be un-cached
for radeon rs485 and rs690 to work. Initial tests by placing a wbinvd()
after allocating the gart were successful. This is an attempt at a more
appropriate method of achieving success.
2008-09-06 21:08:33 -04:00
vehemens
be5fad45ee
Free temp_pagelist on error. Free in reverse order. Noticed by open.
...
Signed-off-by: Robert Noland <rnoland@2hip.net>
2008-09-06 21:07:46 -04:00
vehemens
9ad5a6d0d7
Pass lock data like linux and open.
...
Signed-off-by: Robert Noland <rnoland@2hip.net>
2008-09-06 18:55:03 -04:00
vehemens
b8a9cebddc
Move order to end like linux.
...
Signed-off-by: Robert Noland <rnoland@2hip.net>
2008-09-06 18:55:03 -04:00
vehemens
0808cf923d
Style white space cleanup part 2.
...
Signed-off-by: Robert Noland <rnoland@2hip.net>
2008-09-06 18:55:03 -04:00
Robert Noland
6f2479c674
[FreeBSD] Ensure that drm_pci_alloc is never called while locks are held.
2008-09-06 18:37:06 -04:00
vehemens
31709aa2be
Reorder lock functions like linux.
...
Signed-off-by: Robert Noland <rnoland@2hip.net>
2008-09-05 12:42:41 -04:00
vehemens
76dd74c64e
Style white space cleanup.
...
Signed-off-by: Robert Noland <rnoland@2hip.net>
2008-09-05 12:42:41 -04:00
vehemens
ed6dd03818
Need M_NOWAIT for malloc.
...
Signed-off-by: Robert Noland <rnoland@2hip.net>
2008-09-05 12:38:41 -04:00
vehemens
2b27804715
[FreeBSD] Use driver features macros and flags
...
Signed-off-by: Robert Noland <rnoland@2hip.net>
2008-08-29 15:46:06 -04:00
vehemens
2649103bf9
[FreeBSD] Convert drm_driver to a pointer like linux.
...
Signed-off-by: Robert Noland <rnoland@2hip.net>
2008-08-29 15:46:05 -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
vehemens
b92f557767
[FreeBSD] Catch up to vblank rework for via.
...
(No, we don't build via right now.)
Signed-off-by: Robert Noland <rnoland@2hip.net>
2008-08-29 15:46:05 -04:00
vehemens
043ad591b5
[FreeBSD] Correct debug message
...
Signed-off-by: Robert Noland <rnoland@2hip.net>
2008-08-29 15:46:05 -04:00
Robert Noland
c7f7b6d7e2
[FreeBSD] Fix a couple of locking problems.
2008-08-29 15:46:05 -04:00
Robert Noland
f8a14b1f95
[FreeBSD] Increase debugging output for vblank code.
...
Doing my part to make DRM_DEBUG more chatty...
2008-08-29 15:46:05 -04:00
Tomas Carnecky
b460aeec3e
Fix drm_realloc when you're reallocing into something smaller.
2008-08-29 00:43:19 +02:00
Robert Noland
bfea578352
[FreeBSD] Add drm_drawable_free_all()
2008-08-24 15:25:20 -04:00
Robert Noland
0687c0a4ec
[FreeBSD] Fix long standing memory leak in drm_remove_magic.
...
We shuffled all the links around to disconnect the entry, but
never free it. We would incorrectly free the last entry in the
hash chain if nothing matched.
2008-08-24 15:25:20 -04:00
vehemens
3e9541230d
[FreeBSD] Move vblank bits into their own structure.
...
Signed-off-by: Robert Noland <rnoland@2hip.net>
2008-08-24 15:25:19 -04:00
vehemens
e6010778a8
[FreeBSD] Fix lock leak.
...
Signed-off-by: Robert Noland <rnoland@2hip.net>
2008-08-24 15:25:19 -04:00
Robert Noland
7a3d6624c4
[FreeBSD] Duh, we need to actually define the drm_modeset_ctl...
2008-07-25 13:46:28 -04:00
Robert Noland
2580a065d8
[FreeBSD] Catch up to linux on vblank-rework
2008-07-24 00:21:00 -04:00
Robert Noland
f57f01f028
[FreeBSD] Improve upper_32_bits define.
...
Thanks to airlied.
2008-07-21 18:06:52 -04:00
Robert Noland
480c317a6a
[FreeBSD] drm_irq.c updates for vblank fixes.
2008-07-17 14:08:06 -04:00
Robert Noland
b0e4619a39
FreeBSD: Fix radeon build
2008-07-16 23:39:25 -04:00
Owain Gordon Ainsworth
74cf1f91be
BSD: change drm_locked_task*() to use the same scheme as linux.
...
The current code can sleep in an interrupt handler, that is bad. So
instead if we can't grab the lock, flag it and run the tasklet on
unlock.
Signed-off-by: Robert Noland <rnoland@2hip.net>
2008-07-16 21:37:39 -04:00
Robert Noland
96580f660e
[FreeBSD] We aren't allowed to hold locks over bus_dma_tag_create or bus_dmamem_alloc.
2008-07-15 16:53:54 -04:00
Robert Noland
29ffa0017d
[FreeBSD] Fix another lock leak
...
Reported by vehemens
2008-06-13 17:41:34 -04:00
Robert Noland
116870a908
I915 suspend/resume for FreeBSD
2008-06-08 13:56:14 -04:00
Robert Noland
3b6ca4bf3f
[FreeBSD] Rework ati_pcigart.c
...
This is mostly just a diff reduction with the linux version.
I'm not convinced that it will make anything better.
2008-06-08 02:00:48 -04:00
Robert Noland
96141bd33c
[FreeBSD] We need to request busmastering support.
...
This seems to be the key to getting at least some radeon
cards working. Most, if not all drivers need it enabled,
so just request it once the driver has attached.
2008-06-08 02:00:48 -04:00
Robert Noland
6d6921719c
[FreeBSD] Incorporate vblank fixes for bsd.
2008-06-08 01:53:45 -04:00
Robert Noland
ec3d996021
[FreeBSD] Forgot to call mtx_destroy on all the locks at unload.
2008-06-08 01:53:45 -04:00
Robert Noland
93c57ff4e5
[FreeBSD] Remove the locks in the vblank_disable_fn
...
They are recursive and causing panics with witness enabled.
2008-06-08 01:53:45 -04:00
Robert Noland
fc74c2e9d6
[FreeBSD] Go back to using vbl_lock and move init/destroy to load/unload.
2008-06-08 01:53:45 -04:00
Robert Noland
416754f1cc
[FreeBSD] Declare vblank_disable_fn callout MPSAFE.
2008-06-01 20:33:30 -07:00