Commit Graph

89 Commits (f1fe9178f1a2aef272c7feeb15c8de42c8c609d5)

Author SHA1 Message Date
Thomas Hellstrom 7f269bec7e Merge branch 'master' into modesetting-101
Conflicts:

	linux-core/Makefile.kernel
	linux-core/drm_compat.c
	linux-core/drm_fops.c
	linux-core/drm_lock.c
	shared-core/drm.h
	shared-core/i915_dma.c
	shared-core/i915_drv.h
	shared-core/i915_irq.c
2008-04-28 12:10:44 +02:00
Thomas Hellstrom c9b73ef6da Unlock the BO mutex while waiting for idle, unmapped, unfenced.
Move unfenced checking into idle checking.
Never time out while waiting for software events like unmapped or unfenced.
2008-04-14 12:13:33 +02:00
Thomas Hellstrom 65dd0e68ff Fix up buffer manager locking. 2008-04-14 12:13:17 +02:00
Thomas Hellstrom e89710bef7 Place highmem pages last in the ttm page array. 2008-04-06 11:21:22 +02:00
Thomas Hellstrom c3888b97f6 Use clflush() when available for cache flushing. 2008-04-06 10:32:02 +02:00
Thomas Hellstrom 1f4ba62567 [i915] Report buffer state _after_ fence submission to user-space.
This fixes a problem where the wrong bo->fence_type was reported, and
also saves some memory space.
[bo core] export the drm_bo_fill_rep_arg function.
2008-03-30 15:14:45 +02:00
Dave Airlie e00dea812d Merge branch 'master' of ../../drm into modesetting-101
Conflicts:

	linux-core/drmP.h
	linux-core/drm_drv.c
	linux-core/drm_proc.c
	linux-core/drm_stub.c
	linux-core/drm_sysfs.c
2008-03-06 05:26:23 +10:00
Dave Airlie d5c0101252 ttm: make sure userspace can't destroy kernel create memory managers
this adds something to say the kernel initialised the memory region not
the userspace. and blocks userspace from deallocating kernel areas
2008-03-06 05:37:54 +10:00
Dave Airlie 180c9188f4 drm/ttm: add ioctl to get back memory managed area sized
taken from modesetting branch but could be useful outside it.
2008-03-06 05:31:50 +10:00
Xiang, Haihao 638353103d i915: Evict if relocatee buffer is CACHED_MAPPED before
writting relocations, otherwise the GPU probably sees some
inconsistent data. Fix fd.o bug#14656
2008-03-05 15:09:17 +08:00
Dave Airlie 43891ff2d0 Merge remote branch 'origin/master' into modesetting-101
Conflicts:

	linux-core/drm_compat.c
2008-03-05 10:37:02 +10:00
Eric Anholt d41846adb7 Clarify through the names what drm_ttm_alloc_pages() and friend actually did.
These are all about the page directory (pointers to pages) rather than the
actual pages backing the allocation.
2008-03-04 13:40:46 -08:00
Thomas Hellstrom 8ef838e5ff Add a compat kmap_atomic_prot_pfn to do quick kernel map / unmaps of
PCI- or high memory.
This is substantially more efficient than drm_bo_kmap,
since the mapping only lives on a single processor.
Unmapping is done use kunmap_atomic(). Flushes only a single tlb() entry.

Add a support utility int drm_bo_pfn_prot() that returns the
pfn and desired page protection for a given bo offset.

This is all intended for relocations in bound TTMS or vram.
Mapping-accessing-unmapping must be atomic, either using preempt_xx() macros
or a spinlock.
2008-02-28 14:06:46 +01:00
Dave Airlie cdad850ebc add ioctl to get back memory managed area sized - used for kernel inited areas 2008-02-22 13:49:51 +10:00
Dave Airlie 2c409f9a07 ttm: make sure userspace can't destroy kernel create memory managers 2008-02-20 11:27:22 +10:00
Alan Hourihane f24ed2ad6c Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into modesetting-101
Conflicts:

	linux-core/i915_fence.c
	linux-core/via_fence.c
	shared-core/i915_dma.c
	shared-core/i915_drv.h
	shared-core/i915_irq.c
2008-02-18 22:35:46 +00:00
Thomas Hellstrom c77b0937f2 Add an fence_class_manager::last_queued_sequence member, since a
sequence number may actually turn up before the corresponding fence
object has been queued on the ring.

Fence drivers can use this member to determine whether a
sequence number must be re-reported.
2008-01-31 14:11:12 +01:00
Thomas Hellstrom f1edb7ad91 Simplify the fencing code and differentiate between flushes and
waiting types.
Add a "command_stream_barrier" method to the bo driver.
2008-01-30 22:06:02 +01:00
Dave Airlie e7a41d7f5b Merge remote branch 'origin/master' into modesetting-101
Conflicts:

	linux-core/drm_bo.c
	linux-core/drm_drv.c
	shared-core/drm.h
	shared-core/i915_dma.c
	shared-core/i915_drv.h
	shared-core/i915_irq.c
	shared-core/radeon_irq.c
2008-01-25 15:27:53 +10:00
Keith Packard da3601e43a Change drm_bo_type_dc to drm_bo_type_device and comment usage of this value.
I couldn't figure out what drm_bo_type_dc was for; Dave Airlie finally clued
me in that it was the 'normal' buffer objects with kernel allocated pages
that could be mmapped from the drm device file.

I thought that 'drm_bo_type_device' was a more descriptive name.

I also added a bunch of comments describing the use of the type enum values and
the functions that use them.
2007-12-21 12:16:29 -08:00
Keith Packard d1187641d6 Rename inappropriately named 'mask' fields to 'proposed_flags' instead.
Flags pending validation were stored in a misleadingly named field, 'mask'.
As 'mask' is already used to indicate pieces of a flags field which are
changing, it seems better to use a name reflecting the actual purpose of
this field. I chose 'proposed_flags' as they may not actually end up in
'flags', and in an case will be modified when they are moved over.

This affects the API, but not ABI of the user-mode interface.
2007-12-21 12:16:29 -08:00
Keith Packard 37fb2ac407 Use dummy_read_page for unpopulated kernel-allocated ttm pages.
Previously, dummy_read_page was used only for read-only user allocations; it
filled in pages that were not present in the user address map (presumably,
these were allocated but never written to pages).

This patch allows them to be used for read-only ttms allocated from the
kernel, so that applications can over-allocate buffers without forcing every
page to be allocated.
2007-12-21 12:16:29 -08:00
Keith Packard 881ee70ab7 Move dummy_read_page from drm_ttm_set_user to drm_ttm_create.
I'm hoping to use the dummy_read_page for kernel allocated buffers to avoid
allocating extra pages for read-only buffers (like vertex and batch buffers).
This also eliminates the 'write' parameter to drm_ttm_set_user and just
has DRM_TTM_PAGE_WRITE passed into drm_ttm_create.
2007-12-21 12:16:29 -08:00
Keith Packard 6d44f48002 Clean up and document drm_ttm.c APIs. drm_bind_ttm -> drm_ttm_bind.
Aside from changing drm_bind_ttm to drm_ttm_bind, this patch
adds only documentation and fixes the functions inside drm_ttm.c
to all be prefixed with drm_ttm_.
2007-12-21 12:16:29 -08:00
Keith Packard 5f23519b14 Document drm_bo_handle_validate. Match drm_bo_do_validate parameter order.
Document parameters and usage for drm_bo_handle_validate. Change parameter
order to match drm_bo_do_validate (fence_class has been moved to after
flags, hint and mask values). Existing users of this function have been
changed, but out-of-tree users must be modified separately.
2007-12-15 12:10:42 -08:00
Keith Packard b5181d2506 Document drm_bo_do_validate. Remove spurious 'do_wait' parameter.
Add comments about the parameters to drm_bo_do_validate, along
with comments for the DRM_BO_HINT options. Remove the 'do_wait'
parameter as it is duplicated by DRM_BO_HINT_DONT_BLOCK.
2007-12-15 12:10:42 -08:00
Keith Packard b0bc5f1ae5 Make ttm create/destroy APIs consistent. Pass page_flags in create.
Creating a ttm was done with drm_ttm_init while destruction was done with
drm_destroy_ttm. Renaming these to drm_ttm_create and drm_ttm_destroy makes
their use clearer. Passing page_flags to the create function will allow that
to know whether user or kernel pages are needed, with the goal of allowing
kernel ttms to be saved for later reuse.
2007-12-15 12:10:41 -08:00
Thomas Hellstrom d1b0258b32 Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into modesetting-101 2007-11-15 10:42:47 +01:00
Thomas Hellstrom 6206091e5f mm fixups. 2007-11-15 10:39:41 +01:00
Thomas Hellstrom 5ce43a346c Merge branch 'master' into modesetting-101
Conflicts:

	linux-core/drm_bufs.c
	shared-core/i915_dma.c
	shared-core/i915_drv.h
	shared-core/i915_irq.c
2007-11-05 13:46:06 +01:00
Alan Hourihane 1b91113957 remove unused define 2007-11-05 10:06:37 +00:00
Dave Airlie 7ad3890707 drm/ttm: kernel coding style for bo.c and objects.h 2007-11-05 19:05:32 +10:00
Dave Airlie 7f6bf84c23 drm: remove lots of spurious whitespace.
Kernel "cleanfile" script run.
2007-11-05 12:42:22 +10:00
Thomas Hellstrom 9906c7e54b Merge branch 'master' into modesetting-101 2007-11-02 16:07:36 +01:00
Thomas Hellstrom 94c22c3349 User buffer support. 2007-11-02 16:05:25 +01:00
Jesse Barnes 629c8b0dbf Merge branch 'master' into modesetting-101
Conflicts:

	linux-core/Makefile.kernel
	linux-core/drm_stub.c
	linux-core/i915_drv.c
	shared-core/i915_dma.c
	shared-core/i915_drv.h

Fixup suspend/resume conflicts (basically use what's in DRM master for now).
Also fix up a few other conflicts that snuck in (i915_dma changes etc.).
2007-11-01 15:27:55 -07:00
Dave Airlie 50dec29c80 drm/i915: add driver cache flush entry point
Use clflush on Intel hardware to flush cached objects.
2007-10-30 17:52:13 +10:00
Thomas Hellstrom 1681189e11 Buffer flags and masks are 64-bit.
don't mask off the high dword.
Signed-off-by: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
2007-10-26 10:27:30 +02:00
Thomas Hellstrom 26c32a3d79 Buffer flags and masks are 64-bit.
don't mask off the high dword.
2007-10-26 10:25:57 +02:00
Thomas Hellstrom 9adf8c0256 Merge branch 'master' into modesetting-101
Conflicts:

	linux-core/Makefile.kernel
	linux-core/drm_bo.c
	linux-core/drm_objects.h
2007-10-25 11:00:45 +02:00
Thomas Hellstrom 11f3e5e53f Buffer manager:
Implement a version check IOCTL for drivers that don't use
drmMMInit from user-space.
Remove the minor check from the kernel code. That's really up
to the driver.
Bump major.
2007-10-25 10:12:21 +02:00
Thomas Hellstrom 48b5eaf303 Simple replacement for hardware lock in some cases.
Fix i915 since last commit.
2007-10-20 16:49:43 +02:00
Thomas Hellstrom 733ff56834 No fence_class argument on drmBOSetStatus since it's not
associated with a particular command submission.
2007-10-19 16:28:47 +02:00
Thomas Hellstrom 086c058a41 Remove the op ioctl, and replace it with a setuser ioctl.
Remove need for lock for now.
May create races when we clean memory areas or on takedown.
Needs to be fixed.
Really do a validate on buffer creation in order to avoid problems with
fixed memory buffers.
2007-10-17 10:59:48 +02:00
Thomas Hellstrom 0d1926d36e Revert "Replace NO_MOVE/NO_EVICT flags to buffer objects with an ioctl to set pinning."
This reverts cf2d569dac commit.
2007-10-17 10:59:48 +02:00
Alan Hourihane 90bfc8e611 Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into modesetting-101
Conflicts:

	linux-core/drm_bo.c
	linux-core/drm_objects.h
	shared-core/i915_dma.c
	shared-core/i915_drv.h
2007-10-16 15:28:33 +01:00
Michel Dänzer db1709f2f3 Revert part of earlier commit that caused an unresolved symbol for i915. 2007-10-16 15:10:22 +02:00
Kristian Høgsberg a69c85fec8 Drop destroy ioctls for fences and buffer objects.
We now always create a drm_ref_object for user objects and this is then the only
things that holds a reference to the user object.  This way unreference on will
destroy the user object when the last drm_ref_object goes way.
2007-10-16 22:03:05 +11:00
Kristian Høgsberg dccefba71a Take bo type argument out of the ioctl interface.
The buffer object type is still tracked internally, but it is no longer
part of the user space visible ioctl interface.  If the bo create ioctl
specifies a non-NULL buffer address we assume drm_bo_type_user,
otherwise drm_bo_type_dc.  Kernel side allocations call
drm_buffer_object_create() directly and can still specify drm_bo_type_kernel.
Not 100% this makes sense either, but with this patch, the buffer type
is no longer exported and we can clean up the internals later on.
2007-10-16 22:03:05 +11:00
Thomas Hellstrom c4b3a0f602 Merge branch 'master' into pre-superioctl-branch
Conflicts:

	linux-core/drm_bo.c
	linux-core/drm_fence.c
	linux-core/drm_objects.h
	shared-core/drm.h
2007-09-25 18:03:31 +02:00