Commit Graph

212 Commits

Author SHA1 Message Date
rnoland
8c8d9fdda2 Fix botched git -> svn merge.
MFC after:	2 weeks
2009-10-30 18:30:13 +00:00
rnoland
faaa17b8ab Cleanup in r600_blit
- Don't bother to assign vb until we know we have enough space
 - Add variables for sx2, sy2, dx2, dy2 so that these aren't
   calculated over and over, also reduce chance of errors.
 - Use switch to assign color/format

MFC after:	3 days
2009-10-30 18:08:46 +00:00
rnoland
3f46299092 A bit of cleanup work on radeon_freelist_get()
* Fix the main loop to search all buffers before sleeping.
  * Remove dead code

MFC after:	3 days
2009-10-30 18:07:22 +00:00
rnoland
d58762730f Some general cleanup of scatter/gather memory allocation
- We don't need to check malloc return values with M_WAITOK
 - remove variables that we don't really need
 - cleanup the error paths by just calling drm_sg_cleanup()
 - fix drm_sg_cleanup() to be safe to call at any time

MFC after:	2 weeks
2009-10-30 18:02:10 +00:00
rnoland
352d93ce10 Use system specified memory barriers rather than rolling our own. 2009-10-30 16:59:58 +00:00
rnoland
9bb26a1a59 Fix blitter support for RS880 chips
MFC after:	3 days
2009-10-30 16:55:31 +00:00
brueffer
629bb93ae9 Check pointer for NULL before dereferencing it, not after.
PR:		138383
Submitted by:	Patroklos Argyroudis <argp@census-labs.com>
Reviewed by:	rnoland
MFC after:	1 week
2009-10-21 15:54:45 +00:00
rnoland
c98bb6fb8f Add support for Intel G41 chipset
Submitted by:	Artyom Mirgorodsky <man@email.com.ua>
MFC after:	3 days
2009-10-11 01:54:00 +00:00
rnoland
d19f2a3393 Fix offset handling
MFC after:	1 week
2009-09-28 22:41:28 +00:00
rnoland
ac4eceb715 radeon_family is an enum, so ordering can be important.
sync up with what amd is shipping.

MFC after:	1 week
2009-09-28 22:40:29 +00:00
rnoland
ae3bae8fe3 Fix blit pitch for 4 byte transfers on r600.
MFC after:	1 week
2009-09-28 22:38:44 +00:00
rnoland
c27ab7e948 R600 doesn't support IRQs yet, so don't try to use them.
MFC after:	1 week
2009-09-28 22:37:07 +00:00
rnoland
5e6cfce650 Add a couple of small fixes from the AMD folks.
- max tex height is 8192
	- increment src/dst by the full transfer amount

MFC after:	3 days
2009-09-13 11:10:38 +00:00
rnoland
7ea7343ded Add missing pci id for Radeon 4850 X2
MFC after:	3 days
2009-09-13 11:08:06 +00:00
rnoland
61ec6f94ad Add GET_PARAM support for Z pipes.
This is needed for occulsion queries on rv530 chips.

MFC after:	2 weeks
2009-08-23 15:02:58 +00:00
rnoland
8a453d9508 Add kernel support for Radeon R6/7xx 3D.
You will still need Mesa from git and possibly an updated DDX driver,
but this is working fairly well now.

MFC after:	2 weeks
2009-08-23 14:55:57 +00:00
rnoland
02d6d1fd6e Add a read only sysctl tracking the hw.drm.msi tunable.
MFC after:	2 weeks
2009-08-23 14:33:12 +00:00
rnoland
f98d8dac77 Clean up the handling of device minors
Submitted by:	Ed
MFC after:	2 weeks
2009-08-23 14:31:20 +00:00
rnoland
b149016ae8 Clean up the locking in drm_alloc_resource()
MFC after:	2 weeks
2009-08-23 14:27:46 +00:00
jhb
9b0755de9f Temporarily revert the new-bus locking for 8.0 release. It will be
reintroduced after HEAD is reopened for commits by re@.

Approved by:	re (kib), attilio
2009-08-20 19:17:53 +00:00
rnoland
83ee73d6f0 Add support for radeon RS880 IGP chips to drm.
Approved by:	re (kib)
MFC after:	0 days
2009-08-12 12:57:02 +00:00
rnoland
12ae833b1c Add some additional radeon pci ids to drm.
Approved by:	re (kib)
MFC after:	0 days
2009-08-12 12:50:15 +00:00
attilio
7f42e47a67 Make the newbus subsystem Giant free by adding the new newbus sxlock.
The newbus lock is responsible for protecting newbus internIal structures,
device states and devclass flags. It is necessary to hold it when all
such datas are accessed. For the other operations, softc locking should
ensure enough protection to avoid races.

Newbus lock is automatically held when virtual operations on the device
and bus are invoked when loading the driver or when the suspend/resume
take place. For other 'spourious' operations trying to access/modify
the newbus topology, newbus lock needs to be automatically acquired and
dropped.

For the moment Giant is also acquired in some key point (modules subsystem)
in order to avoid problems before the 8.0 release as module handlers could
make assumptions about it. This Giant locking should go just after
the release happens.

Please keep in mind that the public interface can be expanded in order
to provide more support, if there are really necessities at some point
and also some bugs could arise as long as the patch needs a bit of
further testing.

Bump __FreeBSD_version in order to reflect the newbus lock introduction.

Reviewed by:    ed, hps, jhb, imp, mav, scottl
No answer by:   ariff, thompsa, yongari
Tested by:      pho,
                G. Trematerra <giovanni dot trematerra at gmail dot com>,
                Brandon Gooch <jamesbrandongooch at gmail dot com>
Sponsored by:   Yahoo! Incorporated
Approved by:	re (ksmith)
2009-08-02 14:28:40 +00:00
rnoland
59625c6f0c Add support for Radeon HD 4770 (RV740) chips.
Approved by:	re@ (kib)
MFC after:	3 days
2009-07-09 16:39:28 +00:00
rnoland
8bd1f80d45 We shouldn't need to drop and reaquire the lock here.
MFC after:	3 days
2009-06-25 19:23:25 +00:00
rnoland
bd6fb92679 Some more cleanups for vblank code on Intel.
The Intel 2d driver calls modeset before reinstalling the handler on
a vt switch.  This means that vblank status ends up getting cleared
after it has been setup.  Restore saved values for the pipestat registers
rather than just wiping them out.

MFC after:	3 days
2009-06-25 18:27:08 +00:00
rnoland
c47a69b0ad Initialize max_vblank_count earlier.
Small cleanup of the error paths while I'm here.

MFC after:	3 days
2009-06-25 16:17:07 +00:00
rnoland
e96ab5a0ec Keep track of the hardware counter more aggressively while interrupts
are enabled.  This should help to reduce cases where the hardware
counter reference jumps by large amounts.

MFC after:	3 days
2009-06-25 15:47:32 +00:00
rnoland
c191a3bf7a Fix one use of atomic for refcount missed in last commit.
MFC after:	3 days
2009-06-25 15:36:11 +00:00
rnoland
87697759f9 Additional vblank cleanups.
Use the vbl_lock when maniputlating the refcount.  Eventually I want to
convert this to use our internal refcount code.  Continue to use atomic
ops for manipulating vblank count since we access it often just for
reading.

MFC after:	3 days
2009-06-25 15:30:25 +00:00
rnoland
ccfd747271 Ensure that we always hold the lock when calling vblank_disable_fn()
MFC after:	3 days
2009-06-25 14:15:45 +00:00
rnoland
f75c2385c6 Add some sysctl info so that we can see what is going on with vblanks.
MFC after:	3 days
2009-06-23 20:19:02 +00:00
rnoland
504701419d Only release irq resources if we were actually using them.
MFC after:	3 days
2009-06-23 18:24:09 +00:00
rnoland
a1716da758 Using signals for vblank events is prone to issues. There have never
been any consumers and likely will never be.  Furthermore, we have
never enabled the code for it, so just get rid of it.

MFC after:	3 days
2009-06-23 18:09:35 +00:00
rnoland
5e047db7b1 Given that vblanks generally occur 60 times a second, waiting 3 seconds
seems rather excessive.

MFC after:	3 days
2009-06-23 17:52:41 +00:00
rnoland
aaadc6c547 vblank[crtc].last represents the hardware counter while request.sequence
represents the software counter.  Don't currupt things here.

MFC after:	3 days
2009-06-23 17:50:35 +00:00
rnoland
e2c228d3d4 Hold the lock while we save/restore register for suspend/resume.
MFC after:	3 days
2009-06-23 17:38:28 +00:00
rnoland
4f053b7460 The G45 docs indicate that all G4X chips use the new framecount register.
Intel agrees with my reading of the docs, make it so for all G4X chips.

The new register also has a 32 bit width as opposed to 24 bits.  Fix
things up so that the counters roll over properly.

MFC after:	3 days
2009-06-20 16:45:14 +00:00
rnoland
36023fcd02 realloc() behaves identically to malloc when passed a NULL object pointer
If an error does occur we would have left max_context with an incorrect
value.

MFC after:	3 days
2009-06-20 16:40:48 +00:00
rnoland
4b0b98bba1 Don't panic if drm_rmmap is called with a NULL map pointer.
MFC after:	3 days
2009-06-20 16:37:24 +00:00
rnoland
f0aed0f29a Don't try to setup interrupts for drivers that don't support them.
This causes sis and probably a couple of other driver to panic and fail.

Tested by:	cpghost <cpghost@cordula.ws>
PR:		133554
MFC after:	3 days
2009-04-19 16:54:33 +00:00
rnoland
2444e34b78 check offsets for R300_ZB_ZPASS_ADDR
Submitted by:	Maciej Cencora <m.cencora@gmail.com>
MFC after:	3 days
2009-04-07 22:26:53 +00:00
rnoland
f5751c34ee Add regs required for occlusion queries support
Submitted by:	Maciej Cencora <m.cencora@gmail.com>
MFC after:	3 days
2009-04-07 22:20:58 +00:00
rnoland
d8382f1581 Add support for RV790 (HD 4890) asics
MFC after:	3 days
2009-04-03 19:23:14 +00:00
rnoland
c5caf6772f A little more cleanup from AMD, if we don't have the right microcode
there is no reason to mess with the chip.

MFC after:	3 days
2009-04-03 19:21:39 +00:00
rnoland
166d59298a Simplify the radeon microcode loading.
Submitted by:	Christoph Mallon
MFC after:	3 days
2009-03-31 17:52:05 +00:00
rnoland
7c16ec50d6 We don't know what these pages are going to be used for, they should be
un-cached.  This got lost somewhere with all the bus_dma fixups.

MFC after:	3 days
2009-03-30 18:01:42 +00:00
rnoland
5bf93e3bc7 Load the right microcode for RS780.
MFC after:	3 days
2009-03-30 17:49:21 +00:00
rnoland
71edadf45e Fix up waiting on vblank again... This reverts a last minute change that
I made on the last patch, it seems to upset suspend/resume and shutdown.

MFC after:	3 days
2009-03-26 02:10:18 +00:00
rnoland
f7c1e3a6bf Rework the management of vblank interrupts a bit.
When a vt switch occurs the irq handler is uninstalled.  Interrupts
and the state tracking of what was enabled/disabled wasn't working
properly.  This should resolve the reports of "slow windows" after a
vt switch, among other things.  The radeon 2d driver seems to work a
bit more correctly than the Intel driver.  With the Intel driver,
vblank interrupts will be enabled at system startup and will only
be disabled after an additional modeset (vt switch, dpms, randr event).

With this patch, I am able to run glxgears synced to vblank and
vt switch while it is running without ill effects.

MFC after:	3 days
2009-03-25 01:50:56 +00:00