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
61cbcb5dbe
drm/ttm: add support for cached un-snooped mappings.
...
This mapping allows cached objects to be mapped in/out of the TT space
with the appropriate flushing calls.
It should put back the old CACHED functionality for snooped mappings
2007-11-01 10:34:53 +11: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
b5cad27e05
Fix buffer object flag / mask checking.
2007-10-25 09:49:33 +02:00
Thomas Hellstrom
824330d0e6
Don't clobber the unfenced list with DONT_FENCE operations.
2007-10-22 19:09:36 +02:00
Thomas Hellstrom
3b19b50cb5
Remove the need for the hardware lock in the buffer manager.
...
Add interface entry cleaning a memory type without touching NO_EVICT buffers.
2007-10-21 12:20:56 +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
c0e3537e77
Some comment updates pending removal of the init mutex.
2007-10-19 16:44:12 +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
cf2d1bba55
Remove the clean_unfenced function.
...
Change the restriction that non-creators can't change the buffer flags to
non-creators can't change EVICT and NO_MOVE flags.
2007-10-19 16:24:36 +02:00
Thomas Hellstrom
bb29ba7fa7
Only allow creator to change shared buffer mask.
2007-10-17 10:59:48 +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
Thomas Hellstrom
cd276d9cab
Revert "Copy the important parts of object_validate into object_create()."
...
This reverts f9c27aa50b
commit.
2007-10-17 10:59:48 +02:00
Thomas Hellstrom
12b989a710
Revert "Remove the pinned buffer from the LRU when pinning."
...
This reverts 3a0bc518e3
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
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
[utf-8] Kristian Høgsberg
440fc5113e
Eliminate support for fake buffers.
2007-10-16 21:59:38 +11:00
Dave Airlie
b0473699ed
ttm: returning into dummy causes a buffer object leak
...
as nobody ever derefs dummy, however not returning does the deref
correctly.
2007-10-02 15:48:28 +10:00
Jesse Barnes
5433bbbfde
Remove buffer object user list check in drm_bo_destroy_unlocked
...
In the case of driver allocated buffers, there won't necessarily be a user list
associated with the buffer, so don't bug out on an empty list.
2007-09-25 16:15:48 -07: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
Dave Airlie
bb5516f4f4
drm/ttm: fixup fence class naming and interfaces
...
This is some code for nouveau that Ben Skeggs worked on, and also
fixes the naming (having class in a system header file == C++ keyword == bad plan)
2007-09-25 16:17:17 +10:00
Jesse Barnes
5cc3083179
Merge branch 'master' into modesetting-101 - TTM & typedef removal
...
Conflicts:
linux-core/drmP.h
linux-core/drm_bo.c
linux-core/drm_drv.c
linux-core/drm_objects.h
shared-core/drm.h
shared-core/i915_dma.c
shared-core/i915_drv.h
shared-core/i915_irq.c
Mostly removing typedefs that snuck into the modesetting code and
updating to the latest TTM APIs. As of today, the i915 driver builds,
but there are likely to be problems, so debugging and bugfixes will
come next.
2007-09-24 14:41:46 -07:00
Thomas Hellstrom
54df1b9ff3
Fix pinned buffer fence class.
2007-09-22 14:30:55 +02:00
Thomas Hellstrom
0774090d5b
Fix drm_bo.c compiling.
2007-09-22 13:59:56 +02:00
Thomas Hellstrom
da63f4ba0f
Add fence error member.
...
Modify the TTM backend bind arguments.
Export a number of functions needed for driver-specific super-ioctls.
Add a function to map buffer objects from the kernel, regardless of where they're
currently placed.
A number of error fixes.
2007-09-22 13:57:13 +02:00
Eric Anholt
0055fd5c35
Merge branch 'master' into bo-set-pin
2007-08-16 09:23:09 -07:00
Ben Skeggs
92084c6e05
Export some useful ttm functions to drivers.
2007-08-06 22:11:18 +10:00
Eric Anholt
3a0bc518e3
Remove the pinned buffer from the LRU when pinning.
...
Also, be a little safer with setting the pinned flag within the struct lock.
I'm not 100% sure if this is required, but it seems like it might be.
2007-08-02 14:08:04 -07:00
Eric Anholt
cf4f1a85af
Add a couple of doxygen comments from reading the code.
2007-08-02 13:51:55 -07:00
Eric Anholt
f9c27aa50b
Copy the important parts of object_validate into object_create().
...
This should let us allocate buffers without holding the hardware lock.
While here, add DRM_DEBUG info for the drm_bo ioctls, so you can see something
more specific than just the cmd value per ioctl.
2007-07-26 11:18:27 -07:00
Eric Anholt
cf2d569dac
Replace NO_MOVE/NO_EVICT flags to buffer objects with an ioctl to set pinning.
...
This cleans up the create/validate interfaces for this very uncommon path, and
makes pinned object creation much easier to use for the X Server.
2007-07-26 10:15:11 -07:00
Dave Airlie
4175dd8181
drm/bo: set the req pointer for each buffer to validate
2007-07-26 15:26:36 +10:00
Dave Airlie
e2d00715cc
drm: fix size argument for copy to/from user
2007-07-26 13:26:04 +10:00
Eric Anholt
5b38e13416
Replace DRM_IOCTL_ARGS with (dev, data, file_priv) and remove DRM_DEVICE.
...
The data is now in kernel space, copied in/out as appropriate according to the
This results in DRM_COPY_{TO,FROM}_USER going away, and error paths to deal
with those failures. This also means that XFree86 4.2.0 support for i810 DRM
is lost.
2007-07-20 18:16:42 -07:00
Eric Anholt
c1119b1b09
Replace filp in ioctl arguments with drm_file *file_priv.
...
As a fallout, replace filp storage with file_priv storage for "unique
identifier of a client" all over the DRM. There is a 1:1 mapping, so this
should be a noop. This could be a minor performance improvement, as everything
on Linux dereferenced filp to get file_priv anyway, while only the mmap ioctls
went the other direction.
2007-07-20 13:39:45 -07:00
Dave Airlie
6ad1df2176
drm: remove drm_u64_t, replace with uint64_t everwhere
...
This might break something, stdint.h inclusion in drm.h maybe required
but I'm not sure yet what platforms have it what ones don't.
2007-07-18 09:42:06 +10:00
Dave Airlie
191c062933
drm: remove drm_ref_t
2007-07-16 13:45:39 +10:00
Dave Airlie
be85ad0333
drm: detypedef ttm/bo/fence code
2007-07-16 13:37:02 +10:00
Dave Airlie
6dce9e0735
drm: remove hashtab/sman and object typedefs
2007-07-16 12:48:44 +10:00
Dave Airlie
21ee6fbfb8
drm: remove drmP.h internal typedefs
2007-07-16 12:32:51 +10:00
Dave Airlie
1a07256d60
drm: remove ttm userspace typedefs
2007-07-16 11:30:53 +10:00
Dave Airlie
2c9e05cf4c
Merge branch 'master' into cleanup
...
Conflicts:
libdrm/xf86drm.c
linux-core/drm_bo.c
linux-core/drm_fence.c
2007-07-11 11:23:41 +10:00
Alan Hourihane
8a78dead29
Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into modesetting-101
...
Conflicts:
linux-core/drm_drv.c
linux-core/drm_fops.c
linux-core/drm_objects.h
linux-core/drm_stub.c
shared-core/i915_dma.c
2007-06-29 20:09:44 +01:00
Thomas Hellstrom
00f1a66f22
Fence object reference / dereference cleanup.
...
Buffer object dereference cleanup.
Add a struct drm_device member to fence objects:
This can simplify code, particularly in drivers.
2007-06-29 12:58:45 +02:00
Thomas Hellstrom
3ee31a1f35
Indentation fixes.
2007-06-15 10:31:32 +02:00
Thomas Hellstrom
d34b2c7b9e
Fix refcounting / lock race.
...
Reported by Steve Wilkins / Michel Dnzer.
2007-06-15 10:26:51 +02:00
Thomas Hellstrom
e1b8eabeee
Locking fixes and instrumentation.
2007-06-15 10:26:51 +02:00
Thomas Hellstrom
62082ab3e6
Make sure we read fence->signaled while spinlocked.
2007-06-13 15:38:59 +02:00
Thomas Hellstrom
5156f1c897
Fix fence object deref race.
2007-06-13 15:19:30 +02:00
Thomas Hellstrom
f984b1b8d1
Fix some obvious bugs.
2007-06-12 12:30:33 +02:00
Thomas Hellstrom
b6b5df24b9
Try to make buffer object / fence object ioctl args 64-bit safe.
...
Introduce tile members for future tiled buffer support.
Allow user-space to explicitly define a fence-class.
Remove the implicit fence-class mechanism.
64-bit wide buffer object flag member.
2007-06-12 12:21:38 +02:00
Dave Airlie
58b2ed7832
Revert "drm/ttm: cleanup mm_ioctl ioctls to be separate ioctls."
...
This reverts commit 3fdef0dc20
.
ditto not on master yet
2007-05-26 03:48:08 +10:00
Dave Airlie
3fdef0dc20
drm/ttm: cleanup mm_ioctl ioctls to be separate ioctls.
...
This is the first bunch of ioctls
2007-05-26 03:32:34 +10:00
Alan Hourihane
315cf14af8
Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into modesetting-101
...
Conflicts:
shared-core/i915_dma.c
2007-05-18 13:48:56 +01:00
Dave Airlie
b2a875ba89
ttm: complete drm buffer object ioctl split
...
retain the op operation for validate/fence operations
2007-05-08 18:25:15 +10:00
Dave Airlie
25c51f539f
drm/ttm: ioctl cleanup for buffer object - user side only
...
This just cleans up the xf86drm.c to what I want and drm.h,
I need to fix up the kernel internals to suit these changes now.
I've moved to using struct instead of typedefs for the bo and it doesn't look
that bad so I'll do the same thing for mm and fence..
2007-05-08 17:53:58 +10:00
Dave Airlie
ee8954cb53
drm/ttm: cleanup mm_ioctl ioctls to be separate ioctls.
...
This is the first bunch of ioctls
2007-05-06 11:17:30 +10:00
Jesse Barnes
71d44cda52
drm/ttm: allow drm_buffer_object_create to be used in-kernel
2007-04-26 16:09:24 +10:00
Jesse Barnes
3c384a9ad5
Add new buffer object type for kernel allocations that don't initially have a user mapping.
...
(cherry picked from commit 2e21779992
)
2007-04-26 16:04:09 +10:00
Dave Airlie
e46e028bd2
Merge branch 'origin' into modesetting-101
...
Conflicts:
linux-core/drm_bo.c
Merge in changes from master from Thomas fixiing TTM problems
2007-04-18 14:11:49 +10:00
Thomas Hellstrom
5a96d59ce9
Don't always free up memory space when we unpin buffers.
2007-04-17 14:15:37 +02:00
Thomas Hellstrom
5432cc4abf
Fix buffer object reference problems.
...
(Reported by Dave Airlie).
2007-04-17 10:53:19 +02:00
Dave Airlie
1a5e647f63
I don't think this dec is necessary and my stuff all works without ..
...
with it everything falls over
2007-04-17 18:18:42 +10:00
Dave Airlie
56ef1ab8ac
add some missing export symbols
2007-04-17 18:18:25 +10:00
Thomas Hellstrom
e91ceff6c9
Add a code comment.
2007-04-17 08:46:45 +02:00
Thomas Hellstrom
e6e4946c82
Require the hardware lock for buffer creation
...
(since that implies a validate).
Fix drm_bo_wait_unfenced error messages and codes.
Fix some return codes from libdrm.
2007-04-16 16:23:05 +02:00
David Airlie
27598bacfd
export drm_bo_driver_finish symbol
2007-04-13 14:50:31 +10:00
Jesse Barnes
2e21779992
Add new buffer object type for kernel allocations that don't initially have a user mapping.
2007-04-11 12:51:52 -07:00
Jesse Barnes
78598fdaa8
Various changes for in-kernel modesetting:
...
- allow drm_buffer_object_create to be called w/o dev_mapping
- fixup i915 init code to allocate memory, fb and set modes right
- pass fb to drm_initial_config for setup
- change some debug output to make it easier to spot
- fixup lvds code to use DDC probing correctly
2007-04-11 07:07:54 -07:00
Thomas Hellstrom
7743af9449
Evicted no-move buffers can get lost if they end up in another
...
memory type than local.
2007-04-03 10:29:14 +02:00
Thomas Hellstrom
d85e243259
Fix an oops when trying to clean a not yet initialized memory type.
2007-04-03 10:29:14 +02:00
Dave Airlie
3f70518f0b
drm/bo: avoid oops if the memory manager for this type isn't initialised
2007-03-29 09:25:04 +10:00
Dave Airlie
2463b03cb4
whitespace cleanup pending a kernel merge
2007-03-19 08:23:43 +11:00
Thomas Hellstrom
e0f53e59be
Simple fence object sample driver for via, based on idling the GPU.
...
Buffer object driver for via.
Some changes to buffer object driver callbacks.
Improve fence flushing.
2007-02-16 20:22:24 +01:00
Thomas Hellstrom
7766378d97
Initial support for fence object classes.
...
(Fence objects belonging to different command submission mechanisms).
2007-02-15 12:11:38 +01:00
Thomas Hellstrom
9efdae317c
More bugfixes.
...
Fixed memory, pinned buffers and unmappable memory now seems
fully functional.
2007-02-13 20:05:32 +01:00
Thomas Hellstrom
398913dc0e
Lindent.
2007-02-12 20:34:50 +01:00
Thomas Hellstrom
b0c5339ed6
More bugfixes.
2007-02-12 20:32:03 +01:00
Thomas Hellstrom
f02f83ee08
Cleanup and fix support for pinned buffers.
2007-02-12 17:47:57 +01:00
Thomas Hellstrom
85ee2a8d04
Various bugfixes.
2007-02-10 12:06:36 +01:00
Thomas Hellstrom
57df398072
Reinstate some LRU handling.
2007-02-09 12:43:18 +01:00
Thomas Hellstrom
d32b21e016
Remove some code that should have gone in
...
commit 6a49d9a8ab
2007-02-09 00:11:53 +01:00
Thomas Hellstrom
99acdaee48
Fix copyright statements.
2007-02-09 00:07:29 +01:00
Thomas Hellstrom
6a49d9a8ab
Fix evict_mutex locking range.
...
Implement unmappable buffers. (fault moves them to mappable when needed).
Various bugfixes.
2007-02-09 00:02:02 +01:00
Thomas Hellstrom
b2bcbf874b
Add an accelerated buffer copy cleanup helper.
...
Export helper functions and make some important buffer-object functions non-static.
Add an i915 accelerated blit buffer move for pci memory buffers.
2007-02-08 21:28:33 +01:00
Thomas Hellstrom
a0ed808d05
Don't create a ttm just to copy from.
2007-02-08 19:06:39 +01:00
Thomas Hellstrom
e4b2da4406
A minor function interface change and some memcpy bugfixing.
...
Hooray!! it sort of works with a fixed AGP area as faked VRAM.
2007-02-08 16:21:38 +01:00
Thomas Hellstrom
1257907fa9
Simplify external ttm page allocation.
...
Implement a memcpy fallback for copying between buffers.
2007-02-08 13:29:08 +01:00
Thomas Hellstrom
09984ad77b
Update memory compatibility tests.
...
Now only pinned buffers are broken.
2007-02-08 11:55:24 +01:00
Thomas Hellstrom
c1fbd8a566
Checkpoint commit.
...
Flag handling and memory type selection cleanup.
glxgears won't start.
2007-02-07 17:25:13 +01:00
Thomas Hellstrom
af24465b2e
Fix a stray unlock_kernel() in drm_vm.c
...
Add a file for memory move helpers, drm_bo_move.c
Implement generic memory move.
Cached, no_move and unmapped memory temporarily broken.
2007-02-07 12:52:23 +01:00
Thomas Hellstrom
71b9e876f9
Simplify pci map vs no pci map choice.
2007-02-06 16:59:45 +01:00
Thomas Hellstrom
40ce53dfde
Implement a drm_mem_reg_t substructure in the buffer object type.
2007-02-06 15:56:43 +01:00
Thomas Hellstrom
609e3b0375
Implement a policy for selecting memory types.
2007-02-06 14:20:33 +01:00