platform/upstream/libdrm.git
16 years ago[intel-gem] Execute MI_FLUSH in leavevt_ioctl
Keith Packard [Sat, 14 Jun 2008 02:49:47 +0000 (19:49 -0700)]
[intel-gem] Execute MI_FLUSH in leavevt_ioctl

In leavevt_ioctl, queue an MI_FLUSH and then block waiting for it to
complete. This will empty the active and flushing lists. That leaves only
the inactive list to evict.

16 years ago[intel-gem] inactive list may contain objects in CPU write domain
Keith Packard [Sat, 14 Jun 2008 02:47:23 +0000 (19:47 -0700)]
[intel-gem] inactive list may contain objects in CPU write domain

Pin/unpin need to know whether to remove/add objects from the inactive list,
inactive objects cannot be in any GPU write domain as those would be on the
flushing list instead. However, inactive objects may be in the CPU write
domain.

16 years ago[intel-gem] BUG_ON active objects in gem_object_unbind
Keith Packard [Sat, 14 Jun 2008 02:43:40 +0000 (19:43 -0700)]
[intel-gem] BUG_ON active objects in gem_object_unbind

Now that gem_object_unbind waits for rendering to complete, objects should
not be active when they are being pulled from the GTT. BUG_ON if this is
broken.

16 years ago[intel-gem] Debugging -- verify inactive list invariants
Keith Packard [Sat, 14 Jun 2008 02:40:16 +0000 (19:40 -0700)]
[intel-gem] Debugging -- verify inactive list invariants

Inactive list elements may not be pinned, active or have non-CPU write
domains.

16 years ago[intel-gem] whitespace fixes
Keith Packard [Sat, 14 Jun 2008 02:37:44 +0000 (19:37 -0700)]
[intel-gem] whitespace fixes

16 years ago[intel-gem] show total GTT space in /proc/dri/*/gem_objects
Keith Packard [Sat, 14 Jun 2008 02:35:22 +0000 (19:35 -0700)]
[intel-gem] show total GTT space in /proc/dri/*/gem_objects

16 years ago[intel-gem] Wait for rendering to complete before unbinding.
Keith Packard [Sat, 14 Jun 2008 00:06:35 +0000 (17:06 -0700)]
[intel-gem] Wait for rendering to complete before unbinding.

Moving to the CPU domain doesn't ensure that rendering is finished, the
buffer may still be in use as a texture or other data source.

16 years ago[libdrm] Restart all ioctls on signal receipt
Keith Packard [Fri, 13 Jun 2008 23:03:22 +0000 (16:03 -0700)]
[libdrm] Restart all ioctls on signal receipt

Receiving a signal should be ignored by the library, so just restart any
ioctl which returns EINTR or EAGAIN.

16 years ago[intel-gem] add gtt and pin counts to /proc/dri/*/gem_objects
Keith Packard [Fri, 13 Jun 2008 22:43:02 +0000 (15:43 -0700)]
[intel-gem] add gtt and pin counts to /proc/dri/*/gem_objects

Not quite portable, but these are useful for intel. Some more general
mechanism could be done...

16 years ago[intel-gem] Left the last exec buffer pinned. oops.
Keith Packard [Fri, 13 Jun 2008 22:38:13 +0000 (15:38 -0700)]
[intel-gem] Left the last exec buffer pinned. oops.

Loop end variable 'pinned' was set one too low.

16 years ago[intel-gem] Pin objects during execbuffer
Keith Packard [Fri, 13 Jun 2008 21:28:18 +0000 (14:28 -0700)]
[intel-gem] Pin objects during execbuffer

Pinning the objects avoids accidentally evicting them while binding
other objects.

16 years ago[intel-gem] throttle based on frames rather than time. Reduces jitter.
Keith Packard [Fri, 13 Jun 2008 19:06:13 +0000 (12:06 -0700)]
[intel-gem] throttle based on frames rather than time. Reduces jitter.

Record the last execbuffer sequence for each client.
Record that sequence in the throttle ioctl as the 'throttle sequence'.
Wait for the last throttle sequence in the throttle ioctl.

16 years ago[intel-gem] evict_something was failing when wait_request freed objects
Keith Packard [Fri, 13 Jun 2008 18:33:27 +0000 (11:33 -0700)]
[intel-gem] evict_something was failing when wait_request freed objects

When i915_wait_request clears object from the active list, it may end up
freeing them and not moving them to the inactive list. This ends up
unbinding objects from the GTT without there ever being new objects visible
to i915_gem_evict_something on the inactive list. As the only success
condition required the presence of objects on the inactive list, this would
falsely assume that no GTT space had been made available, and end up
returning -ENOMEM to the application.

16 years ago[intel] Enable MSI for i915 IRQ
Keith Packard [Fri, 13 Jun 2008 17:27:39 +0000 (10:27 -0700)]
[intel] Enable MSI for i915 IRQ

16 years ago[intel] Restructure irq to pend all work until after iir write.
Keith Packard [Wed, 11 Jun 2008 01:19:19 +0000 (18:19 -0700)]
[intel] Restructure irq to pend all work until after iir write.

The interrupt identity register must be writen before any work occurs lest
we drop an interrupt on the floor. This patch just shuffles code around to
make sure that IIR is written as early as possible.

16 years ago[intel-gem] Use a delayed_work instead of a timer + work_struct
Keith Packard [Fri, 13 Jun 2008 16:19:30 +0000 (09:19 -0700)]
[intel-gem] Use a delayed_work instead of a timer + work_struct

We want request retirement to occur about once a second when the request
queue is non-empty. This was done with a timer that queued a work_struct,
using a delayed_work instead makes a lot more sense.

16 years ago[intel-gem] Reorder i915_add_request to schedule work last
Keith Packard [Wed, 11 Jun 2008 01:11:15 +0000 (18:11 -0700)]
[intel-gem] Reorder i915_add_request to schedule work last

i915_add_request was calling schedule_delayed_work before adding the request
to the list; it makes more sense to do that last.

16 years agoUse /bin/pwd instead of trusting shell built-in
Keith Packard [Wed, 11 Jun 2008 00:53:32 +0000 (17:53 -0700)]
Use /bin/pwd instead of trusting shell built-in

16 years agoFix i915_wait_irq in the presence of interrupt masking.
Eric Anholt [Fri, 13 Jun 2008 17:47:33 +0000 (10:47 -0700)]
Fix i915_wait_irq in the presence of interrupt masking.

In the short-circuit code for the breadcrumb already being new enough, we
need to update the sarea_priv copy of the breadcrumb just as if we had
waited.  Otherwise userland error checking will notice that we returned
too early based on its wrong information, and call wait_irq again (leading
to spinning until someone else comes along and updates the sarea_priv).

This bug was hidden when we had interrupt masking disabled, such as in
master, since the interrupt handler would update sarea_priv.

16 years ago[gem] Catch -EINTR from blocking ioctls and restart them.
Eric Anholt [Fri, 13 Jun 2008 17:04:14 +0000 (10:04 -0700)]
[gem] Catch -EINTR from blocking ioctls and restart them.

Thanks to Thomas Hellstrom for catching the issue, no thanks to the kernel
developer who authoritatively told me that they would get restarted on their
own.

16 years ago[gem] Remove the interrupt handler for retiring requests.
Eric Anholt [Fri, 13 Jun 2008 16:53:36 +0000 (09:53 -0700)]
[gem] Remove the interrupt handler for retiring requests.

This was insufficient once we started masking interrupts to only when someone
was waiting for them (and would thus retire requests themselves).  It was
replaced by the retire_timer.

16 years ago[gem] Don't require the lock in execbuf now that it's not needed for the ring.
Eric Anholt [Fri, 13 Jun 2008 16:49:05 +0000 (09:49 -0700)]
[gem] Don't require the lock in execbuf now that it's not needed for the ring.

16 years agoBump libdrm version to 2.4.0.
Eric Anholt [Thu, 12 Jun 2008 20:22:40 +0000 (13:22 -0700)]
Bump libdrm version to 2.4.0.

We need a version to depend on from the other components that require GEM and
the bufmgr code.  Some interfaces will be removed before the 2.4.0 release.

16 years agoDon't clear USER_INTERRUPT if we're not handling it.
Eric Anholt [Thu, 12 Jun 2008 17:56:37 +0000 (10:56 -0700)]
Don't clear USER_INTERRUPT if we're not handling it.

This fixes a regression from commit d434b64f6a760d85295e32298a9a1f3624ee1b69
which could cause us to fail to wake up for user interrupts if we lost a race.

16 years ago[gem] Remove the drm_client_lock_take in set_domain.
Eric Anholt [Wed, 11 Jun 2008 23:19:23 +0000 (16:19 -0700)]
[gem] Remove the drm_client_lock_take in set_domain.

We no longer need to use it to protect against shared ringbuffer access.

16 years agoMove the renaming of mm.c symbols to #defines in the header.
Eric Anholt [Wed, 11 Jun 2008 22:58:33 +0000 (15:58 -0700)]
Move the renaming of mm.c symbols to #defines in the header.

This reduces the diff from Mesa and reduces the illegibility of what I did.

16 years ago[gem] Another round of cleanups from checkpatch.pl
Eric Anholt [Wed, 11 Jun 2008 22:51:17 +0000 (15:51 -0700)]
[gem] Another round of cleanups from checkpatch.pl

16 years ago[gem] Move potentially device-specific ioctls to the intel driver.
Eric Anholt [Wed, 11 Jun 2008 21:42:40 +0000 (14:42 -0700)]
[gem] Move potentially device-specific ioctls to the intel driver.

This is the create (may want location flags), pread/pwrite/mmap
(performance tuning hints), and set_domain (will 32 bits be enough for
everyone?) ioctls.  Left in the generic set are just flink/open/close.

The 2D driver must be updated for this change, and API but not ABI is broken
for 3D.  The driver version is bumped to mark this.

16 years agoRemove override of drm module list in preparation for merge.
Eric Anholt [Wed, 11 Jun 2008 19:20:56 +0000 (12:20 -0700)]
Remove override of drm module list in preparation for merge.

16 years ago[gem] Remove carefully-sprinkled i915_kernel_lost_context().
Eric Anholt [Wed, 11 Jun 2008 18:28:20 +0000 (11:28 -0700)]
[gem] Remove carefully-sprinkled i915_kernel_lost_context().

They are not unnecessary since the kernel's the only thing touching the ring.

16 years ago[intel] Fix BUG_ON trigger in irq masking if you did on/off with irqs disabled.
Eric Anholt [Wed, 11 Jun 2008 06:10:33 +0000 (23:10 -0700)]
[intel] Fix BUG_ON trigger in irq masking if you did on/off with irqs disabled.

16 years ago[gem] Manage the ringbuffer from the kernel in the GEM case.
Eric Anholt [Tue, 10 Jun 2008 22:30:23 +0000 (15:30 -0700)]
[gem] Manage the ringbuffer from the kernel in the GEM case.

This requires that the X Server use the execbuf interface for buffer
submission, as it no longer has direct access to the ring.  This is
therefore a flag day for the gem interface.

This also adds enter/leavevt ioctls for use by the X Server.  These would
get stubbed out in a modesetting implementation, but are required while
in an environment where the device's state is only managed by the DRM while
X has the VT.

16 years ago[gem] Don't forget to munmap in the non-bo-reuse object-freeing case.
Eric Anholt [Sat, 7 Jun 2008 00:13:16 +0000 (17:13 -0700)]
[gem] Don't forget to munmap in the non-bo-reuse object-freeing case.

16 years ago[intel] remove settable use_mi_batchbuffer_start
Keith Packard [Fri, 6 Jun 2008 20:26:03 +0000 (13:26 -0700)]
[intel] remove settable use_mi_batchbuffer_start

The driver can know what hardware requires MI_BATCH_BUFFER vs
MI_BATCH_BUFFER_START; there's no reason to let user mode configure this.

16 years ago[intel-gem] Use timers to retire requests periodically.
Keith Packard [Fri, 6 Jun 2008 19:59:52 +0000 (12:59 -0700)]
[intel-gem] Use timers to retire requests periodically.

Without the user IRQ running constantly, there's no wakeup when the ring
empties to go retire requests and free buffers. Use a 1 second timer to make
that happen more often.

16 years ago[intel] free the hardware status page at driver_unload
Keith Packard [Fri, 6 Jun 2008 19:58:41 +0000 (12:58 -0700)]
[intel] free the hardware status page at driver_unload

This goes with the other hardware status page patch.

16 years ago[intel-gem] Add explicit throttle ioctl
Keith Packard [Fri, 6 Jun 2008 19:57:01 +0000 (12:57 -0700)]
[intel-gem] Add explicit throttle ioctl

Instead of throttling and execbuffer time, have the application ask to
throttle explicitly. This allows the throttle to happen less often, and
without holding the DRM lock.

16 years ago[libdrm/intel] Eliminate extra dri_gem_bo_bucket_entry structure
Keith Packard [Thu, 5 Jun 2008 23:05:35 +0000 (16:05 -0700)]
[libdrm/intel] Eliminate extra dri_gem_bo_bucket_entry structure

Place the buffer reuse links right into the dri_bo_gem object.

16 years ago[libdrm/intel] Remove unused intel_validate_entry structure
Keith Packard [Thu, 5 Jun 2008 22:58:55 +0000 (15:58 -0700)]
[libdrm/intel] Remove unused intel_validate_entry structure

16 years ago[libdrm/intel] Reuse entire dri_bo_gem structure
Keith Packard [Thu, 5 Jun 2008 22:58:09 +0000 (15:58 -0700)]
[libdrm/intel] Reuse entire dri_bo_gem structure

The code was discarding the dri_bo_gem structure and saving only the kernel
handle. This lost the mmap address, causing pain when the next buffer user
wanted to map the buffer.

16 years ago[intel] Allocate hardware status page at driver load time
Keith Packard [Thu, 5 Jun 2008 21:09:57 +0000 (14:09 -0700)]
[intel] Allocate hardware status page at driver load time

I couldn't get the re-allocated HWS to work on my 965GM, so I just gave up
and made it persist across the lifetime of the driver instead.

16 years agoIgnore X server provided mmio address
Keith Packard [Thu, 5 Jun 2008 20:49:21 +0000 (13:49 -0700)]
Ignore X server provided mmio address

16 years ago[intel-gem] Dump error status on wait_request failure
Keith Packard [Thu, 5 Jun 2008 20:47:41 +0000 (13:47 -0700)]
[intel-gem] Dump error status on wait_request failure

16 years agoAdd a function to bufmgr_fake to evict all buffers in the GTT.
Eric Anholt [Thu, 5 Jun 2008 15:44:46 +0000 (08:44 -0700)]
Add a function to bufmgr_fake to evict all buffers in the GTT.

This will be used by the X Server for VT switch.

16 years agoDrop struct_mutex while waiting in drm_client_lock_take
Keith Packard [Wed, 4 Jun 2008 04:49:51 +0000 (21:49 -0700)]
Drop struct_mutex while waiting in drm_client_lock_take

struct_mutex cannot be held while blocking on DRM lock.

16 years agoFix libdrm to actually include the new code instead of just building it.
Eric Anholt [Tue, 3 Jun 2008 21:34:54 +0000 (14:34 -0700)]
Fix libdrm to actually include the new code instead of just building it.

16 years agoFix and hook up bufmgr code to the build.
Eric Anholt [Tue, 3 Jun 2008 17:20:49 +0000 (10:20 -0700)]
Fix and hook up bufmgr code to the build.

16 years agoImport bufmgr code to libdrm. Not yet hooked up to the build.
Eric Anholt [Tue, 3 Jun 2008 16:27:37 +0000 (09:27 -0700)]
Import bufmgr code to libdrm.  Not yet hooked up to the build.

16 years ago[intel-gem] reloc_and_validate_object → object_bind_and_relocate
Keith Packard [Mon, 2 Jun 2008 19:37:10 +0000 (12:37 -0700)]
[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.

16 years ago[intel-gem] Propagate set_domain errors.
Keith Packard [Mon, 2 Jun 2008 17:59:15 +0000 (10:59 -0700)]
[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.

16 years agoMerge commit 'origin/master' into drm-gem
Eric Anholt [Fri, 30 May 2008 21:42:08 +0000 (14:42 -0700)]
Merge commit 'origin/master' into drm-gem

Conflicts:

linux-core/Makefile.kernel
shared-core/i915_drv.h
shared-core/nouveau_state.c

16 years ago[intel-gem] Only update obj->write_domain if we're actually changing it.
Eric Anholt [Fri, 30 May 2008 20:47:34 +0000 (13:47 -0700)]
[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)

16 years ago[intel-gem] Add an option to check GTT versus CPU coherency at execbuf time.
Eric Anholt [Fri, 30 May 2008 17:04:22 +0000 (10:04 -0700)]
[intel-gem] Add an option to check GTT versus CPU coherency at execbuf time.

16 years agor500: attempt to make AGP work by programming agp base in the MC correctly
Dave Airlie [Fri, 30 May 2008 10:27:31 +0000 (20:27 +1000)]
r500: attempt to make AGP work by programming agp base in the MC correctly

16 years ago[intel-gem] Write the presumed_offset back out after updating it.
Eric Anholt [Thu, 29 May 2008 19:53:13 +0000 (12:53 -0700)]
[intel-gem] Write the presumed_offset back out after updating it.

Otherwise, 965 constant state buffers get re-relocated every exec.  Ouch.

16 years ago[intel-gem] Clean up active/inactive/flushing list debugging.
Keith Packard [Tue, 27 May 2008 23:49:49 +0000 (16:49 -0700)]
[intel-gem] Clean up active/inactive/flushing list debugging.

16 years agoradeon: split microcode out into a separate header file.
Dave Airlie [Wed, 28 May 2008 01:12:57 +0000 (11:12 +1000)]
radeon: split microcode out into a separate header file.

16 years ago[intel-gem] Replace idlelock usage with real lock acquisition.
Eric Anholt [Wed, 28 May 2008 00:50:39 +0000 (17:50 -0700)]
[intel-gem] Replace idlelock usage with real lock acquisition.

16 years agoi915: fix BSD bh, DRI2 not uses anywhere else
Dave Airlie [Wed, 28 May 2008 00:28:13 +0000 (10:28 +1000)]
i915: fix BSD bh, DRI2 not uses anywhere else

16 years agoradeon: bump release date/version for r500 3D support
Dave Airlie [Wed, 28 May 2008 00:02:20 +0000 (10:02 +1000)]
radeon: bump release date/version for r500 3D support

16 years agoRADEON: add get_param for number of GB pipes
Alex Deucher [Tue, 27 May 2008 22:33:33 +0000 (18:33 -0400)]
RADEON: add get_param for number of GB pipes

16 years ago[BSD] Move unlock in drm_vm.c from accidental platform #ifdeffing.
Owain Ainsworth [Tue, 27 May 2008 22:12:35 +0000 (15:12 -0700)]
[BSD] Move unlock in drm_vm.c from accidental platform #ifdeffing.

Also remove an unreachable unlock.

16 years ago[BSD] Fix lock leak in drm_update_draw malloc failure path.
Owain Ainsworth [Tue, 27 May 2008 22:11:25 +0000 (15:11 -0700)]
[BSD] Fix lock leak in drm_update_draw malloc failure path.

16 years ago[BSD] Fix lock leaks in error paths in drm_bufs.c.
Owain Ainsworth [Tue, 27 May 2008 22:07:04 +0000 (15:07 -0700)]
[BSD] Fix lock leaks in error paths in drm_bufs.c.

16 years ago[BSD] Remove superfluous recursive locking in drm_add_magic.
Owain Ainsworth [Tue, 27 May 2008 21:59:38 +0000 (14:59 -0700)]
[BSD] Remove superfluous recursive locking in drm_add_magic.

16 years ago[i915] Fix typo in (unused) START_ADDR definition.
Jie Luo [Tue, 27 May 2008 21:55:01 +0000 (14:55 -0700)]
[i915] Fix typo in (unused) START_ADDR definition.

16 years ago[FreeBSD] Add vblank-rework support and get drivers building.
Robert Noland [Fri, 23 May 2008 18:36:05 +0000 (14:36 -0400)]
[FreeBSD] Add vblank-rework support and get drivers building.

The i915 driver now works again.

16 years ago[FreeBSD] Convert from drm_device_t to struct drm_device for consistency.
Eric Anholt [Tue, 27 May 2008 21:12:51 +0000 (14:12 -0700)]
[FreeBSD] Convert from drm_device_t to struct drm_device for consistency.

16 years ago[intel-gem] Must hold DRM lock while setting object domain
Keith Packard [Tue, 27 May 2008 00:41:46 +0000 (17:41 -0700)]
[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.

16 years ago[i915] leave interrupts masked off when not in use.
Keith Packard [Mon, 26 May 2008 10:25:16 +0000 (03:25 -0700)]
[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.

16 years ago[intel-gem] Add DRM_I915_GEM_BUSY ioctl to check for idle buffers.
Keith Packard [Mon, 26 May 2008 03:45:20 +0000 (20:45 -0700)]
[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.

16 years ago[intel-gem] Compute npages instead of nbytes in flush_pwrite
Keith Packard [Mon, 26 May 2008 03:44:19 +0000 (20:44 -0700)]
[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.

16 years ago[intel-gem] replace call to jiffies_to-msec with simple inline
Keith Packard [Mon, 26 May 2008 03:41:42 +0000 (20:41 -0700)]
[intel-gem] replace call to jiffies_to-msec with simple inline

16 years ago[intel-gem] Encourage multiple caches to hold read data
Keith Packard [Fri, 23 May 2008 06:08:38 +0000 (23:08 -0700)]
[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.

16 years ago[gem] Use CPU domain for new or pageable objects
Keith Packard [Thu, 22 May 2008 18:34:56 +0000 (11:34 -0700)]
[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.

16 years ago[intel-gem] Force ring retire by emiting flush before user-interrupt.
Keith Packard [Thu, 22 May 2008 17:59:59 +0000 (10:59 -0700)]
[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).

16 years ago[intel] Add debug code to verify the cached ring tail pointer.
Keith Packard [Thu, 22 May 2008 17:48:32 +0000 (10:48 -0700)]
[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.

16 years ago[intel-gem] invalidate ring locals for pin/unpin/set_domain/free functions
Keith Packard [Wed, 21 May 2008 07:32:02 +0000 (00:32 -0700)]
[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.

16 years ago[gem] Release GEM buffers from work task scheduled from IRQ.
Eric Anholt [Wed, 14 May 2008 22:13:14 +0000 (15:13 -0700)]
[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.

16 years agor500: add two more register ranges for mesa driver to setup
Dave Airlie [Thu, 22 May 2008 23:39:54 +0000 (09:39 +1000)]
r500: add two more register ranges for mesa driver to setup

16 years agodrm: fix nouveau warning
Dave Airlie [Thu, 15 May 2008 01:13:03 +0000 (11:13 +1000)]
drm: fix nouveau warning

16 years ago[gem] Replace ring throttling hack with actual time measurement.
Eric Anholt [Tue, 20 May 2008 23:27:05 +0000 (16:27 -0700)]
[gem] Replace ring throttling hack with actual time measurement.

16 years ago[gem] Fix bad test for list_for_each completion.
Eric Anholt [Wed, 21 May 2008 22:15:58 +0000 (15:15 -0700)]
[gem] Fix bad test for list_for_each completion.

Since it's a circular list, the entry won't be NULL at termination.

16 years ago[gem] Hold a reference on the object in i915_gem_wait_space.
Eric Anholt [Wed, 21 May 2008 22:03:47 +0000 (15:03 -0700)]
[gem] Hold a reference on the object in i915_gem_wait_space.

Otherwise, in the middle of the function called using it the last ref
might disappear.

16 years ago[intel-gem] invalidate ring locals for pin/unpin/set_domain/free functions
Keith Packard [Wed, 21 May 2008 07:32:02 +0000 (00:32 -0700)]
[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.

16 years agors690/r500: vblank support.
Dave Airlie [Wed, 21 May 2008 10:14:45 +0000 (20:14 +1000)]
rs690/r500: vblank support.

The new display controller has the vblank interrupts in a different place.

Add support for vbl interrupts for these chips

16 years ago[gem] Use a separate sequence number field from classic/ttm
Eric Anholt [Tue, 20 May 2008 21:03:27 +0000 (14:03 -0700)]
[gem] Use a separate sequence number field from classic/ttm

This lets us get some qualities we desire, such as using the full 32-bit
range (except zero), avoiding DRM_WAIT_ON, and a 1:1 mapping of active
sequence numbers to request structs, which will be used soon for throttling
and interrupt-driven list cleanup.

16 years ago[gem] Rename sequence numbers from "cookie" to "seqno"
Eric Anholt [Tue, 20 May 2008 17:52:24 +0000 (10:52 -0700)]
[gem] Rename sequence numbers from "cookie" to "seqno"

16 years ago[gem] Clean up active/inactive list handling using helper functions.
Eric Anholt [Tue, 20 May 2008 17:48:36 +0000 (10:48 -0700)]
[gem] Clean up active/inactive list handling using helper functions.

Additionally, a boolean active field is added to indicate which list an
object is on, rather than smashing last_rendering_cookie to 0 to show
inactive.  This will help with flush-reduction later on, and makes the code
clearer.

16 years agor500: add more register ranges for Mesa driver
Dave Airlie [Sat, 17 May 2008 00:22:12 +0000 (10:22 +1000)]
r500: add more register ranges for Mesa driver

16 years ago[gem] Hold dev->struct_mutex to protect structure data.
Eric Anholt [Thu, 15 May 2008 18:21:11 +0000 (11:21 -0700)]
[gem] Hold dev->struct_mutex to protect structure data.

16 years ago[gem] Rename the GTT LRU lists to active (executing) and inactive (idle).
Eric Anholt [Thu, 15 May 2008 16:37:49 +0000 (09:37 -0700)]
[gem] Rename the GTT LRU lists to active (executing) and inactive (idle).

16 years ago[gem] typo fix in comment.
Eric Anholt [Thu, 15 May 2008 16:32:34 +0000 (09:32 -0700)]
[gem] typo fix in comment.

16 years agoati_pcigart: oops wrong way around not that it actually mattered
Dave Airlie [Wed, 14 May 2008 12:48:12 +0000 (22:48 +1000)]
ati_pcigart: oops wrong way around not that it actually mattered

16 years agoati_pcigart: stop working in the evenings you mess up too often
Dave Airlie [Wed, 14 May 2008 12:44:22 +0000 (22:44 +1000)]
ati_pcigart: stop working in the evenings you mess up too often

16 years agoRevert "ati_pcigart: fixup properly this version might even work"
Dave Airlie [Wed, 14 May 2008 12:43:28 +0000 (22:43 +1000)]
Revert "ati_pcigart: fixup properly this version might even work"

This reverts commit bc0836e12a9790f1cc83f8bc29bc05043c4bc840.

tree has some kref hacks in it - oops

16 years agoati_pcigart: fixup properly this version might even work
Dave Airlie [Wed, 14 May 2008 12:42:21 +0000 (22:42 +1000)]
ati_pcigart: fixup properly this version might even work

16 years agoati_pcigart: fill out 40-bit gart table support properly
Dave Airlie [Wed, 14 May 2008 12:35:32 +0000 (22:35 +1000)]
ati_pcigart: fill out 40-bit gart table support properly

Thanks to Alex for supplying this info.

16 years agoRS4xx: separate out RS400 and RS480 IGP chips
Alex Deucher [Wed, 14 May 2008 01:02:17 +0000 (21:02 -0400)]
RS4xx: separate out RS400 and RS480 IGP chips

RS400 (intel based IGP) and RS480 (AMD based IGP) have
different MC and GART setups.  Currently we only support
RS480.

16 years ago[GEM] Update testcases for new API.
Eric Anholt [Mon, 12 May 2008 22:42:20 +0000 (15:42 -0700)]
[GEM] Update testcases for new API.