Commit Graph

3344 Commits (0687c0a4ec78730f752cee04a5b0862f47dbf026)

Author SHA1 Message Date
Eric Anholt d198e9b091 Add a function to bufmgr_fake to evict all buffers in the GTT.
This will be used by the X Server for VT switch.
2008-06-05 08:45:39 -07:00
Keith Packard 0903de0c8f Drop struct_mutex while waiting in drm_client_lock_take
struct_mutex cannot be held while blocking on DRM lock.
2008-06-03 21:49:57 -07:00
Eric Anholt 8a3b510405 Fix libdrm to actually include the new code instead of just building it. 2008-06-03 14:44:53 -07:00
Eric Anholt c4857429c7 Fix and hook up bufmgr code to the build. 2008-06-03 14:44:53 -07:00
Eric Anholt 6a9eb08a87 Import bufmgr code to libdrm. Not yet hooked up to the build. 2008-06-03 14:44:53 -07:00
Michel Dänzer ba7263b8c2 vblank: Don't wait or update the counter while the CRTC is supposedly disabled.
Without kernel modesetting, this requires cooperation of the userspace
modesetting driver. We may have to leave the vblank interrupt enabled otherwise
to avoid problems.
2008-06-03 11:28:10 +02:00
Michel Dänzer 237172b767 vblank: Clean up compensation for spurious wraparounds of driver counter.
Only compensate when the driver counter actually appears to have moved
backwards.

The compensation deltas need to be incremental instead of absolute; drop the
vblank_offset field and just use atomic_sub().
2008-06-03 11:28:10 +02:00
Michel Dänzer d1dcb2b32e vblank: Special-case driver vblank counter going back by 1.
Turns out the radeon driver is affected by the same problem that prompted i915
to revert to less useful counter flipping at the end of the vblank interval. In
the long term, we can hopefully implement more reliable methods to achieve
counter flipping at the beginning of vblank, but otherwise this should be an
acceptable workaround.
2008-06-03 11:28:09 +02:00
Michel Dänzer 0144ebeb8a vblank: Don't return current sequence number and time if interrupted by signal. 2008-06-03 11:28:09 +02:00
Michel Dänzer 6b520005c6 Revert "don't copy back if an error was returned."
This reverts commit 6671ad1917.

The vblank ioctl needs to update the userspace parameters when interrupted by
a signal, which was prevented by this. Let's see if this breaks other ioctls...
2008-06-03 11:27:39 +02:00
Dave Airlie d5ae19ebcf drm: sg alloc should write back the handle to userspace 2008-06-03 12:44:06 +10:00
Dave Airlie f1e12d40af drm/ati_pcigart: use proper page mapping function
This should be pci_map_page not pci_map_single
2008-06-03 12:44:06 +10:00
Keith Packard 867c2bb461 [intel-gem] reloc_and_validate_object → object_bind_and_relocate
Just renaming this function and related parameters to match terminology used
elsewhere in the driver.
2008-06-02 12:37:10 -07:00
Keith Packard 1cb2940a25 [intel-gem] Propagate set_domain errors.
set_domain can block waiting for rendering to complete. If that process is
interrupted by a signal, it can return -EINTR. Catch this error in all
callers and correctly deal with the result.
2008-06-02 10:59:15 -07:00
Robert Noland 416754f1cc [FreeBSD] Declare vblank_disable_fn callout MPSAFE. 2008-06-01 20:33:30 -07:00
Robert Noland 4ce47fd328 [FreeBSD] Get rid of vbl_lock and re-use irq_lock. 2008-06-01 20:33:30 -07:00
Robert Noland ac4da86928 [FreeBSD] Add symlink for radeon_microcode.h 2008-06-01 12:07:54 -07:00
Robert Noland 2186f9f6ef [FreeBSD] Call drm_vblank_cleanup during irq uninstall
I needed to re-arrange some functions for this.
Also needed to call DRM_SPINUNINIT on the vbl_lock during cleanup.
2008-06-01 12:07:54 -07:00
Alex Deucher a12cbf8aa5 RADEON: fix typo in last commit 2008-05-30 18:20:01 -04:00
Eric Anholt 461bfa3da6 Merge commit 'origin/master' into drm-gem
Conflicts:

	linux-core/Makefile.kernel
	shared-core/i915_drv.h
	shared-core/nouveau_state.c
2008-05-30 14:42:08 -07:00
Eric Anholt 50bce2bc62 [intel-gem] Only update obj->write_domain if we're actually changing it.
The problem was revealed where on 965, the display list vertex buffer would see:

create		      -> (CPU, CPU)
set_domain (CPU, CPU) -> (CPU, CPU)
set_comain (CPU, 0)   -> (CPU, 0) (no clflush occurred)
execbuf	   (GPU, 0)   -> (CPU+GPU, 0) (still no clflush)

instead of:

create		      -> (CPU, CPU)
set_domain (CPU, CPU) -> (CPU, CPU)
set_comain (CPU, 0)   -> (CPU, CPU)
execbuf	   (GPU, 0)   -> (CPU+GPU, 0) (clflushed)
2008-05-30 13:47:34 -07:00
Eric Anholt 4f92ed3427 [intel-gem] Add an option to check GTT versus CPU coherency at execbuf time. 2008-05-30 12:42:48 -07:00
Dave Airlie 6e8a2cff66 r500: attempt to make AGP work by programming agp base in the MC correctly 2008-05-30 20:27:31 +10:00
Eric Anholt 3b1e4e6dc3 [intel-gem] Write the presumed_offset back out after updating it.
Otherwise, 965 constant state buffers get re-relocated every exec.  Ouch.
2008-05-29 12:53:21 -07:00
Keith Packard 19ff3366e4 [intel-gem] Clean up active/inactive/flushing list debugging. 2008-05-28 23:56:31 -07:00
Dave Airlie 5b86823fa3 radeon: split microcode out into a separate header file. 2008-05-28 11:12:57 +10:00
Eric Anholt e10502002f [intel-gem] Replace idlelock usage with real lock acquisition. 2008-05-27 18:03:18 -07:00
Dave Airlie 0c8a8db1b6 i915: fix BSD bh, DRI2 not uses anywhere else 2008-05-28 10:28:13 +10:00
Dave Airlie c06096d34f radeon: bump release date/version for r500 3D support 2008-05-28 10:02:20 +10:00
Alex Deucher 59c953245c RADEON: add get_param for number of GB pipes 2008-05-27 18:34:33 -04:00
Owain Ainsworth df127c303d [BSD] Move unlock in drm_vm.c from accidental platform #ifdeffing.
Also remove an unreachable unlock.
2008-05-27 15:12:35 -07:00
Owain Ainsworth cc7ad27fe4 [BSD] Fix lock leak in drm_update_draw malloc failure path. 2008-05-27 15:11:25 -07:00
Owain Ainsworth 9a2ae28fbe [BSD] Fix lock leaks in error paths in drm_bufs.c. 2008-05-27 15:07:04 -07:00
Owain Ainsworth 200ac59573 [BSD] Remove superfluous recursive locking in drm_add_magic. 2008-05-27 14:59:38 -07:00
Jie Luo e45f95a03b [i915] Fix typo in (unused) START_ADDR definition. 2008-05-27 14:55:01 -07:00
Robert Noland 8cd045079e [FreeBSD] Add vblank-rework support and get drivers building.
The i915 driver now works again.
2008-05-27 14:25:20 -07:00
Eric Anholt ad8eb0ed01 [FreeBSD] Convert from drm_device_t to struct drm_device for consistency. 2008-05-27 14:25:08 -07:00
Keith Packard 1f4e36081b [intel-gem] Must hold DRM lock while setting object domain
Object domain transfer can involve adding flush ops to the request queue,
and so the DRM lock must be held to avoid having the X server smash pointers
badly.
2008-05-26 17:41:46 -07:00
Keith Packard d434b64f6a [i915] leave interrupts masked off when not in use.
The interrupt enable register cannot be used to temporarily disable
interrupts, instead use the interrupt mask register.

Note that this change means that a pile of buffers will be left stuck on the
chip as the final interrupts will not be recognized to come and drain things.
2008-05-26 03:25:16 -07:00
Keith Packard 7cf3fd29fe [intel-gem] Add DRM_I915_GEM_BUSY ioctl to check for idle buffers.
This new ioctl returns whether re-using the buffer would force a wait.
2008-05-25 20:45:20 -07:00
Keith Packard 6d1d11704a [intel-gem] Compute npages instead of nbytes in flush_pwrite
i915_gem_flush_pwrite optimizes short writes to the buffer by clflushing
only the modified pages, but it was miscomputing the number of pages.
2008-05-25 20:44:19 -07:00
Keith Packard c69b81df62 [intel-gem] replace call to jiffies_to-msec with simple inline 2008-05-25 20:41:42 -07:00
Keith Packard 8c2b207f9b [intel-gem] Encourage multiple caches to hold read data
When reading from multiple domains, allow each cache to continue
to hold data until writes occur somewhere. This is done by
first leaving the read_domains alone at bind time (presumably the CPU read
cache contains valid data still) and then in set_domain, if no write_domain
is specified, the new read domains are simply merged into the existing read
domains.

A huge comment was added above set_domain to explain how things are
expected to work.
2008-05-22 23:08:38 -07:00
Keith Packard 44ed693ca6 [gem] Use CPU domain for new or pageable objects
Newly allocated objects need to be in the CPU domain as they've just been
cleared by the CPU. Also, unmapping objects from the GTT needs to put them
into the CPU domain, both to flush rendering as well as to ensure that any
paging action gets flushed before we remap to the GTT.
2008-05-22 22:00:21 -07:00
Keith Packard 71b09a5f75 [intel-gem] Force ring retire by emiting flush before user-interrupt.
Commands in the ring are parsed and started when the head pointer passes by
them, but they are not necessarily finished until a MI_FLUSH happens. This
patch inserts a flush after the execbuffer (the only place a flush wasn't
already happening).
2008-05-22 22:00:21 -07:00
Keith Packard a51c3a76ff [intel] Add debug code to verify the cached ring tail pointer.
Recording the tail pointer in a local variable improves performance, but if
someone messes up and fails to reload at the right time, the driver will
write commands to the wrong part of the ring and scramble execution badly.

This change (available by setting I915_RING_VALIDATE to 1) checks to make
sure the cached tail pointer matches the hardware tail pointer at each ring
buffer addition, calling BUG_ON when that's not true.
2008-05-22 22:00:21 -07:00
Keith Packard da3f099a7c [intel-gem] invalidate ring locals for pin/unpin/set_domain/free functions
Ring locals must be reloaded from hardware in case the X server ran.
2008-05-22 22:00:21 -07:00
Eric Anholt 5e662f90d1 [gem] Release GEM buffers from work task scheduled from IRQ.
There are now 3 lists.  Active is buffers currently in the ringbuffer.
Flushing is not in the ringbuffer, but needs a flush before unbinding.
Inactive is as before.  This prevents object_free → unbind →
wait_rendering → object_reference and a kernel oops about weird refcounting.

This also avoids an synchronous extra flush and wait when freeing a buffer
which had a write_domain set (such as a temporary rendered to and then from
using the 2d engine).  It will sit around on the flushing list until the
appropriate flush gets emitted, or we need the GTT space for another
operation.
2008-05-22 22:00:21 -07:00
Dave Airlie 49075b678f r500: add two more register ranges for mesa driver to setup 2008-05-23 09:40:26 +10:00
Dave Airlie 74a9ea896e drm: fix nouveau warning 2008-05-23 09:40:26 +10:00