Commit Graph

333 Commits (66d2714f5435944a26685be4210e0e0d7138f3db)

Author SHA1 Message Date
Robert Noland 51d6346f9f Move drm_vblank_cleanup() after lastclose.
This may prevent a possible panic on shutdown.
2009-03-31 13:36:04 -05:00
Robert Noland e8d3476255 FreeBSD: Set up the nouveau build infrastructure
disabled by default until the rest of the patches are in.
2009-03-16 01:17:00 -05:00
Robert Noland dec955d728 FreeBSD: Add support for matching solely on vedor id.
This also adds that ability to set device name from VPD, but that
doesn't seem to be working...
2009-03-16 00:41:23 -05:00
Robert Noland 44fec1a8e4 FreeBSD: Improve the debug output of drm_mmap(). 2009-03-16 00:35:18 -05:00
Robert Noland f8f49aa6ec FreeBSD: Add list_for_each_prev() to our bank of compat functions. 2009-03-16 00:30:28 -05:00
Robert Noland 6777c6bb8b FreeBSD: Don't set the PZERO flag to mtx_sleep.
We also don't support anything old enough to need tsleep.
2009-03-16 00:17:54 -05:00
Robert Noland 06e182d025 FreeBSD: use flsl() instead of ffsl().
I noticed that we were computing drm_order differently than linux.
2009-03-16 00:08:06 -05:00
Robert Noland 2ce00c6b67 FreeBSD: Minor code cleanup. 2009-03-16 00:07:31 -05:00
Robert Noland b0acc88606 FreeBSD: Increase MAX_PCI_RESOURCE
We can have more than 3 BARs to access.
2009-03-16 00:03:40 -05:00
Robert Noland f78040266b FreeBSD: Cast map handles to vm_offset_t
This prevents some warnings with nouveau.
2009-03-16 00:01:47 -05:00
Robert Noland 82eac8060b FreeBSD: Fix the printing of maps on amd64/i386 to be consistent 2009-03-09 13:37:57 -05:00
Robert Noland a3ba51bd04 FreeBSD: Fix up the flags for bus_dmamem here as well. 2009-03-09 13:34:26 -05:00
Robert Noland af1afb3c38 FreeBSD: Fix up the flags to bus_dmamem_*
Allow it to sleep waiting for resources during the allocation stage.
Only use BUS_DMA_NOWAIT when loading the map.
2009-03-08 22:55:01 -05:00
vehemens 2221e16703 FreeBSD use kdev for kernel device name
Signed-off-by: Robert Noland <rnoland@2hip.net>
2009-03-08 22:18:43 -05:00
Robert Noland 14503dafa7 FreeBSD: Rework DRM_[DEBUG,ERROR,INFO] macros a bit. 2009-03-05 00:47:26 -06:00
Robert Noland 0a227a3361 FreeBSD: Garbage collect entries from pcireg.h since we now include it. 2009-03-05 00:46:32 -06:00
Robert Noland 222dc6582e FreeBSD: We only want drm to ever attach to the primary pci device.
Intel 855 chips present the same pci id for both heads.  This prevents
us from attaching to the dummy second head.  All other chips that I
am aware of either only present a single pci id, or different ids
for each head so that we only match on the correct head.
2009-03-05 00:44:56 -06:00
Robert Noland 4a27f1c638 FreeBSD: rework drm_scatter.c which allocates scatter / gather pages for use by
ati pci gart to use bus_dma to handle the allocations.  This fixes
a garbled screen issue on at least some radeons (X1400 tested).
2009-03-05 00:42:52 -06:00
Robert Noland ad64ff30d0 FreeBSD: Introduce a kernel tuneable to disable msi at boot time. 2009-02-27 18:16:18 -06:00
Robert Noland 957b10695b Move vblank_init to driver load time. 2009-02-27 18:16:17 -06:00
Robert Noland ab582f64fd FreeBSD: Fix up some ioctl permissions issues missed many times over.
This was somehow hit with r600 demo.

Submitted by: 	Jung-uk Kim <jkim@FreeBSD.org>
2009-02-26 23:51:57 -06:00
Robert Noland 948af0bd9b i915: Backport jbarnes gm45 vblank counter patch. 2009-02-25 14:20:52 -06:00
Robert Noland e96fc62e53 FreeBSD: Drop the Giant lock. 2009-02-24 15:49:45 -06:00
Robert Noland b9b8e8f3cc FreeBSD: Turn on msi
There is a blacklist for devices that advertise the capability, but
don't work properly.
2009-02-24 15:47:35 -06:00
Robert Noland 153a0803db FreeBSD: Add some vblank related debugging and replace DRM_WAIT_ON with a local instance. 2009-02-24 14:21:10 -06:00
Robert Noland d45bc6667c i915: This was part of a sync to the intel driver at some point
-Remove the old TTM interface
	-Move register definitions to i915_reg.h
	-Rework the irq handler
2009-02-24 12:24:29 -06:00
Robert Noland 1c381092a3 FreeBSD: Rip out the locked task support now that i915 no longer uses it. 2009-02-24 00:22:56 -06:00
Robert Noland 9d402905c0 FreeBSD: There is no compelling reason to hold the lock here.
When I was lock profiling, this was high up on the list and I
see no reason to do it.
2009-02-23 20:22:44 -06:00
Robert Noland d6c9786836 FreeBSD: Don't set PZERO in mtx_sleep. 2009-02-23 20:16:15 -06:00
Robert Noland a9486ee3a8 FreeBSD: Set MAP_NOSYNC on mmaps.
There is no reason to gratuitously sync these maps to swap.
2009-02-23 20:07:44 -06:00
Robert Noland 58d557c73b [FreeBSD] Fix build on FreeBSD after modesetting import. 2008-12-23 13:56:23 -05:00
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