Commit Graph

165 Commits (7bb112fecadc6fe42e5828b861600691071ccd91)

Author SHA1 Message Date
Dave Airlie 7bb112feca checkpoint commit: added getresources, crtc and output
This adds the user interfaces from Jakob and hooks them up for 3 ioctls
GetResources, GetCrtc and GetOutput.

I've made the ids for everything fbs, crtcs, outputs and modes go via idr as
per krh's suggestion on irc as it make the code nice and consistent.
2007-04-05 17:06:42 +10:00
Dave Airlie 5bffbd6e27 initial userspace interface to get modes 2007-04-05 13:34:50 +10:00
Dave Airlie 209870a882 rename badly named define 2007-03-20 10:13:58 +11:00
Dave Airlie c991f8e049 cleanup ioctl expansion code 2007-03-19 08:46:39 +11:00
Dave Airlie bbb6fc9307 make drm fops const from kernel 2007-03-19 08:36:01 +11:00
Thomas Hellstrom 582637641a Remove a scary error printed when we were leaking memory caches.
We don't use memory caches anymore...

Fix memory accounting initialization to only use low or DMA32 memory.
2007-01-25 14:27:29 +01:00
Thomas Hellstrom 38ed67196f Remove the memory caches for fence objects and memory manager nodes,
since the support for memory caches has gone from 2.6.20.
2006-12-15 12:37:24 +01:00
Thomas Hellstrom 3624e43282 Bug #8707, 2.6.19-rc compatibility for memory manager code. 2006-10-20 15:06:31 +02:00
Thomas Hellstrom f22f89e6b3 Add vma list memory usage to memory accounting.
Use byte unit for /proc printout of memory usage for small sizes to be
able to detect memory allocation bugs more easily.
2006-10-17 19:52:34 +02:00
Thomas Hellstrom d515936ea7 Add memory usage accounting to avoid DOS problems. 2006-10-17 19:40:57 +02:00
Thomas Hellstrom 5881ce1b91 Extend generality for more memory types.
Fix up init and destruction code.
2006-10-17 11:05:37 +02:00
Thomas Hellstrom f2db76e2f2 Big update:
Adapt for new functions in the 2.6.19 kernel.
Remove the ability to have multiple regions in one TTM.
   This simplifies a lot of code.
Remove the ability to access TTMs from user space.
   We don't need it anymore without ttm regions.
Don't change caching policy for evicted buffers. Instead change it only
   when the buffer is accessed by the CPU (on the first page fault).
   This tremendously speeds up eviction rates.
Current code is safe for kernels <= 2.6.14.
Should also be OK with 2.6.19 and above.
2006-10-11 13:40:35 +02:00
Thomas Hellstrom c58574c605 Use a nopage-based approach to fault in pfns. 2006-10-10 10:37:26 +02:00
Thomas Hellstrom cee659afb5 Get rid of all ugly PTE hacks. 2006-10-03 12:08:07 +02:00
Thomas Hellstrom a31046b873 Add a buffer object manager for TTM maps. 2006-10-02 14:03:15 +02:00
Michel Dänzer 00531cecad Change first valid DRM drawable ID to be 1 instead of 0.
This makes it easier for userspace to know when it needs to allocate an ID.

Also free drawable information memory when it's no longer needed.
(cherry picked from df7551ef73 commit)
2006-09-29 12:55:08 +02:00
Michel Dänzer 67e88e5628 Hook up DRM_IOCTL_UPDATE_DRAW ioctl.
(cherry picked from 98a8950458 commit)
2006-09-29 12:55:08 +02:00
Thomas Hellstrom 8c613a8363 Fix memory cache initialization. 2006-09-05 11:00:52 +02:00
Thomas Hellstrom a6b8e3eaf4 Make memory caches global so that they can be used with
multiple heads.
2006-09-04 16:57:20 +02:00
Thomas Hellstrom 11f51a9a87 Bugfixes,
Memory allocation optimizations.
Buffer manager takedown.
2006-09-01 15:41:55 +02:00
Thomas Hellstrom d39055174b Remove the buffer object hint field and use it only
as an argument.
Validate stub.
2006-08-30 17:40:07 +02:00
Thomas Hellstrom e47a4fda2e Memory manager init and takedown. 2006-08-30 13:04:08 +02:00
Thomas Hellstrom 4ddabd1562 Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into drm-ttm-0-2-branch
Conflicts:

	linux-core/drmP.h
2006-08-28 09:28:10 +02:00
Dave Airlie 60ddaaf2e0 add static function, and remove bad attributions 2006-08-28 11:28:38 +10:00
Dave Airlie b4feb2c04e remove some DRM_ARRAY_SIZE from linux core code 2006-08-28 11:27:05 +10:00
Thomas Hellstrom b4b7b99760 Remove the ioctl multiplexing, and instead allow for generic
drm ioctls 0x80 - 0xFF.
2006-08-27 21:16:13 +02:00
Thomas Hellstrom 166da9355d User / Kernel space fence objects (device-independent part). 2006-08-21 21:02:08 +02:00
Thomas Hellstrom 42c2cfcf7d Generic DRM support base-class support for user-space objects, like
fence objects and buffer objects:
Refcounting,
Inter-process sharing,
Synchronization
Destruction.
2006-08-21 20:30:19 +02:00
Thomas Hellstrom 0316f93d51 Remove hash tables on DRM exit. 2006-08-16 16:36:56 +02:00
Thomas Hellstrom 4daa024918 Avoid kernel oops in some error paths calling drm_lastclose(). 2006-08-14 17:11:14 +02:00
Dave Airlie 09c901e4bd remove incorrect exit marking on cleanup pci as this is called from other paths 2006-07-24 11:09:41 +10:00
Dave Airlie 5cfbd5dbab switch drm to use Linux mutexes instead of semaphore.
I hope the fallback compat code works if not shout at me.
2006-07-24 10:51:27 +10:00
Thomas Hellstrom 1a9e5bae10 Fix drm_remove_magic potential memory leak / corruption. Move drm
authentication token hashing to new generic hash table implementation.
2006-06-06 17:46:17 +00:00
Dave Airlie ac5bd25208 make add context non master... 2006-04-03 08:06:51 +00:00
Dave Airlie 4791dc8856 major realigment of DRM CVS with kernel code, makes integration much easier 2006-02-18 02:53:36 +00:00
Dave Airlie 585f34c3e5 fix card unload 2006-02-18 02:38:07 +00:00
Dave Airlie 92150972e5 use drm_cards_limit instead of cards_limit 2006-01-02 05:54:10 +00:00
Dave Airlie 36356df3cb A bunch of create_proc_dir_entry() calls creating directories had crept in
since the last sweep; converted to proc_mkdir().
From: Al Viro (via kernel)
2005-11-11 08:59:57 +00:00
Ian Romanick 39615ec06e Converts the remaining drm_agp_foo functions to be a drm_agp_foo and
drm_agp_foo_ioctl pair. Modifies the MGA DRM to use the drm_agp_foo
    functions instead of the drm_foo_agp functions. The drm_foo_agp
    functions are no longer exported by drm.ko.
Ensures that dma->seg_count and dma->page_count are properly set in
    drm_addbufs_{agp,sg,fb}. drm_addbufs_pci was already correct.
Ensures that mga_do_agp_dma_bootstrap correctly sets agp_buffer_token.
At this point PCI DMA is still broken.
Xorg bug: #4797 Reviewed by: Dave Airlie, Eric Anholt Signed-off-by: Ian
    Romanick <idr@us.ibm.com>
2005-11-03 00:38:25 +00:00
Dave Airlie 0d346a07a8 convert ioctl flags to use flags instead of separate ints 2005-09-03 03:27:14 +00:00
Eric Anholt c789ea1521 Rename the driver hooks in the DRM to something a little more
understandable: preinit -> load postinit -> (removed) presetup ->
    firstopen postsetup -> (removed) open_helper -> open prerelease ->
    preclose free_filp_priv -> postclose pretakedown -> lastclose
    postcleanup -> unload release -> reclaim_buffers_locked version ->
    (removed)
postinit and version were replaced with generic code in the Linux DRM
    (drivers now set their version numbers and description in the driver
    structure, like on BSD). postsetup wasn't used at all. Fixes the savage
    hooks for initializing and tearing down mappings at the right times.
    Testing involved at least starting X, running glxgears, killing
    glxgears, exiting X, and repeating.
Tested on: FreeBSD (g200, g400, r200, r128) Linux (r200, savage4)
2005-08-05 03:50:23 +00:00
Jon Smirl ea2c7a895d Split the control of master vs root priv. Everything is still marked as
needing root.
2005-08-04 13:15:27 +00:00
Eric Anholt 5d96c74ff1 - Remove drm_initmap and replace its usage with drm_addmap. This reduces
code duplication, and it also hands you the map pointer so you don't
    need to re-find it.
- Remove the permanent maps flag. Instead, for register and framebuffer
    maps, we always check whether there's already a map of that type and
    offset around. Move the Radeon map initialization into presetup (first
    open) so it happens again after every takedown.
- Remove the split cleanup of maps between driver takedown (last close) and
    cleanup (module unload). Instead, always tear down maps on takedown,
    and drivers can recreate them on first open.
- Make MGA always use addmap, instead of allocating consistent memory in
    the PCI case and then faking up a map for it, which accomplished nearly
    the same thing, in a different order. Note that the maps are exposed to
    the user again: we may want to expose a flag to avoid this, but it's
    not a security concern, and saves us a lot of code.
- Remove rmmaps in the MGA driver. Since the function is only called during
    takedown anyway, we can let them die a natural death.
- Make removal of maps happen in one function, which is called by both
    drm_takedown and drm_rmmap_ioctl.
Reviewed by: idr (previous revision) Tested on: mga (old/new/pci dma),
    radeon, savage
2005-06-28 20:58:34 +00:00
Alan Hourihane b6b270a260 Given that BenH says using the sysdev approach for DRM is bogus, I'll yank
the code for it, rather than introducing something that isn't going to
    work 100% of the time.
2005-06-28 08:03:33 +00:00
Jon Smirl 2b845f25c5 Make sysdev class only register when fbdev detected 2005-06-24 21:50:40 +00:00
Jon Smirl 5b0e93de32 More err path clean up for drm_pm Add mandatory sysdev shutdown function 2005-06-24 19:31:06 +00:00
Jon Smirl 4152605ea1 Get the power management hooks into the right place so that everything gets
freed correctly.
2005-06-22 05:49:56 +00:00
Ian Romanick 72cfc797b5 Adds support for PCI cards to MGA DRM
This patch adds serveral new ioctls and a new query to get_param query to
    support PCI MGA cards.
Two ioctls were added to implement interrupt based waiting. With this
    change, the client-side driver no longer needs to map the primary DMA
    region or the MMIO region. Previously, end-of-frame waiting was done by
    busy waiting in the client-side driver until one of the MMIO registers
    (the current DMA pointer) matched a pointer to the end of primary DMA
    space. By using interrupts, the busy waiting and the extra mappings are
    removed.
A third ioctl was added to bootstrap DMA. This ioctl, which is used by the
    X-server, moves a *LOT* of code from the X-server into the kernel. This
    allows the kernel to do whatever needs to be done to setup DMA buffers.
    The entire process and the locations of the buffers are hidden from
    user-mode.
Additionally, a get_param query was added to differentiate between G4x0
    cards and G550 cards. A gap was left in the numbering sequence so that,
    if needed, G450 cards could be distinguished from G400 cards. According
    to Ville Syrjälä, the G4x0 cards and the G550 cards handle
    anisotropic filtering differently. This seems the most compatible way
    to let the client-side driver know which card it's own. Doing this very
    small change now eliminates the need to bump the DRM minor version
    twice.
http://marc.theaimsgroup.com/?l=dri-devel&m=106625815319773&w=2
A number of ioctl handlers in linux-core were also modified so that they
    could be called in-kernel. In these cases, the in-kernel callable
    version kept the existing name (e.g., drm_agp_acquire) and the ioctl
    handler added _ioctl to the name (e.g., drm_agp_acquire_ioctl).
This patch also replaces the drm_agp_do_release function with
    drm_agp_release. drm_agp_release (drm_core_agp_release in the previous
    patch) is very similar to drm_agp_do_release, and I saw no reason to
    have both.
This commit *breaks the build* on BSD. Eric said that he would make the
    required updates to the BSD side soon.
Xorg bug: 3259 Reviewed by: Eric Anholt
2005-06-14 22:34:11 +00:00
Jon Smirl 1252890ff1 drm_mem_init should be done at core load, not driver init 2005-06-09 13:22:12 +00:00
Dave Airlie 805a07714f misc cleanup patch from Adrian Bunk 2005-06-04 06:18:11 +00:00