Commit Graph

24 Commits (4f92ed34270ae4afaa0ddba38d227c6e359bcc98)

Author SHA1 Message Date
Eric Anholt e10502002f [intel-gem] Replace idlelock usage with real lock acquisition. 2008-05-27 18:03:18 -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
Eric Anholt 7dced2f33a [gem] Hold dev->struct_mutex to protect structure data. 2008-05-15 18:45:23 -07:00
Eric Anholt aafafe507b [gem] typo fix in comment. 2008-05-15 11:59:57 -07:00
Keith Packard 6aeff6b9e3 [gem] Set write domain to CPU when doing pwrite.
Leave the flush call in place, which can fix domains up if necessary.
2008-05-12 13:01:57 -07:00
Keith Packard ff39db099b [GEM] Make pread/pwrite manage memory domains. No luck with movnti though.
pread and pwrite must update the memory domains to ensure consistency with
the GPU. At some point, it should be possible to avoid clflush through this
path, but that isn't working for me.
2008-05-11 00:10:16 -07:00
Keith Packard 1e26ca44c9 [gem] API cleanup. allocate->create unreference->close name->flink
Make the API names a bit more consistent.
2008-05-09 12:18:09 -07:00
Keith Packard 07ad5ce1e1 Clean up whinging from checkpatch.pl in drm_gem.c
Whitespace changes, a few too-long-lines and some extra braces.
2008-05-08 13:08:22 -07:00
Keith Packard 9af4c49743 [intel-gem] Move domains to relocation records. add set_domain ioctl.
Domain information is about buffer relationships, not buffer contents. That
means a relocation contains the domain information as it knows how the
source buffer references the target buffer.

This also adds the set_domain ioctl so that user space can move buffers to
the cpu domain.
2008-05-08 10:44:02 -07:00
Arjan van de Ven aa0621a19f Apply a few stylistic cleanups to match kernel code. 2008-05-07 15:54:53 -07:00
Keith Packard 61253f4f67 [intel-GEM] Add memory domain support.
Memory domains allow the kernel to track which caches to flush and how to
move objects before buffer execution.
2008-05-06 20:00:23 -07:00
Keith Packard 631e86c5c4 Start coding up memory domains 2008-05-06 14:43:49 -07:00
Keith Packard 5f0614b86f Check for do_mmap errors 2008-05-02 17:13:11 -07:00
Keith Packard ab3549d133 Add a bit of /proc/dri/*/gem support. Clean up some refcount/pagelock issues.
Track named objects in /proc/dri/0/gem_names.
Track total object count in /proc/dri/0/gem_objects.
Initialize device gem data.
return -ENODEV for gem ioctls if the driver doesn't support gem.
Call unlock_page when unbinding from gtt.
Add numerous misssing calls to drm_gem_object_unreference.
2008-05-02 16:34:16 -07:00
Keith Packard 39e20bcd5f Add name/open ioctls, separate handle and pointer ref counts.
Names are just another unique integer set (from another idr object).
Names are removed when the user refernces (handles) are all destroyed --
this required that handles for objects be counted separately from
internal kernel references (so that we can tell when the handles are all
gone).
2008-05-02 12:29:17 -07:00
Keith Packard 49e8e3372a Remove drm_driver argument to functions taking drm_gem_object.
Now that drm_gem_object has a drm_driver * in it, functions don't need both
parameters.
2008-05-02 10:36:00 -07:00
Keith Packard 30efad5113 Fix gem ioctls to be 32/64-bit clean.
mixed 32/64 bit systems need 'special' help for ioctl where the user-space
and kernel-space datatypes differ. Fixing the datatypes to be the same size,
and align the same way for both 32 and 64-bit ppc and x86 environments will
elimiante the need to have magic 32/64-bit ioctl translation code.
2008-05-01 20:31:16 -07:00
Keith Packard abc896638f Use krefs for refcounting.
krefs are way easier than a custom-coded spinlock+int combo.
2008-05-01 20:12:39 -07:00
Eric Anholt 3f641b56c7 Fix missing member settings in obj/obj_priv, and some error paths. 2008-05-01 16:48:25 -07:00
Eric Anholt 7d5f783eca Make GEM object handles be nonzero. 2008-05-01 16:38:37 -07:00
Eric Anholt d2529d1396 Remove _args from gem ioctl argument structure tags. 2008-05-01 16:27:03 -07:00
Eric Anholt ccd1bae0f6 checkpoint: relocations support. 2008-05-01 15:22:21 -07:00
Eric Anholt 5af87acbc2 checkpoint: gtt binding written. 2008-05-01 14:20:44 -07:00
Eric Anholt 2140e102f9 checkpoint: rename to GEM and a few more i915 bits. 2008-05-01 11:39:20 -07:00