Commit graph

168 commits

Author SHA1 Message Date
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
Eric Anholt
9cad6fb4e0 Bugzilla #3217: Create a new __drm_pci_free which is used internally in
linux-core to free pci memory without freeing the structure. Linux-core
    internals often create pci dma handle structures on the stack due to
    the lack of a drm_local_map_t to store them in properly. Fix the
    original drm_pci_free to actually free the dma handle structure instead
    of leaking it.
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
2005-05-28 20:36:22 +00:00
Alan Hourihane
54fbf85125 Actually check for drm_fb_loaded before trying to initialize the sysdev
approach.
2005-05-28 00:08:53 +00:00
Alan Hourihane
45f1db8db9 Re-implement the power management.
There's two choices when fb is or isn't loaded as we treat ourselves as a
    PCI driver in the latter case.
If we are a PCI driver, then register the suspend/resume functions
    directly. If not, then we register as a sysdev and pick up the
    suspend/resume actions and pump them down into a generic *power
    function.
It'll be nice when this little mess is sorted out with regard to being a
    real PCI driver ;-/
2005-05-28 00:00:08 +00:00
Eric Anholt
ec111d70fe Convert BSD code to mostly use bus_dma, the dma abstraction for dealing
with IOMMUs and such. There is one usage of the forbidden vtophys()
    left in drm_scatter.c which will be fixed up soon. This required a KPI
    change for drm_pci_alloc/free() to return/use a drm_dma_handle_t that
    keeps track of os-specific bits, rather than just passing around the
    vaddr/busaddr/size.
Submitted by: Tonnerre Lombard (partially) Tested on: FreeBSD: Rage128
    AGP/PCI Linux: Savage4 AGP/PCI
2005-04-26 05:19:11 +00:00
Dave Airlie
956a701544 fix up AGP multi-head support for kernel 2.6.12 2005-03-25 09:48:34 +00:00
Dave Airlie
ca04fbc7ba fix bug with XFree86 4.3 on core drm
Signed-off-by: Dave Airlie <airlied@linux.ie>
2005-03-25 09:05:10 +00:00
Dave Airlie
dc4defe742 Invalid bound check of driver defined ioctls in drm_ioctl
Bug 2489 Reporter: Aapo Tahkola <aet@rasterburn.org>
2005-02-07 22:55:54 +00:00
Dave Airlie
03ddea5b27 change DRIVER_ to CORE_ makes things look nicer, also change it so the
driver name is marked on resource allocations
2005-02-07 11:20:43 +00:00
Felix Kuehling
ed165a2529 Added a new DRM map type _DRM_CONSISTENT for consistent PCI memory. It uses
drm_pci_alloc/free for allocating/freeing the memory. Only implemented
    in the Linux DRM so far.
2005-01-01 20:03:15 +00:00
Thomas Hellstrom
98d01f9542 Patch from Jon Smirl from Nov. 2nd that makes older X servers behave well
with linux-core. Without this, they will fail on their second
    invocation since the drm already has a busID assigned.
Submitted by: Jon Smirl
2004-12-07 12:18:47 +00:00
Jon Smirl
b37efdadca Round 2 of getting rid of inter_module_get() 2004-10-23 18:12:34 +00:00
Jon Smirl
43cbf43a5f Revert symbol_get() changes from drm_drv 2004-10-23 14:43:06 +00:00
Dave Airlie
4b29f85768 fix inter module put/get 2004-10-23 14:00:53 +00:00
Jon Smirl
9ea6fe7aa6 Prepare to eliminate inter_module_get("agp") 2004-10-23 04:21:27 +00:00
Jon Smirl
ca1ec9268f drm-core, Clean up bug error path on stealth mode exit 2004-10-19 02:50:14 +00:00
Jose Fonseca
0d89b19325 Update Doxygen configuration & comments. 2004-10-18 14:16:41 +00:00
Jon Smirl
fa50e2b513 Switch linux-core over to 2.6 parameter model to enable debug use
drm_debug=1
2004-10-15 02:59:35 +00:00
Jon Smirl
ad70dc676e Breakout heads into their own data structures. 2004-10-12 03:59:17 +00:00
Jon Smirl
ad549c5ae6 Rename fn_tbl to driver. Core driver now uses pci_driver name which
reflects the personality name.
2004-10-10 22:54:55 +00:00
Jon Smirl
3981f17227 Fix refcount bug in stealth mode 2004-10-08 14:31:25 +00:00
Jon Smirl
6dee8401a6 enable the device in the right order, remove __devinit from drm_int 2004-10-05 02:58:14 +00:00
Jon Smirl
9f9a8f1382 Lindent of core build. Drivers checked for no binary diffs. A few files
weren't Lindent's because their comments didn't convert very well. A
    bunch of other minor clean up with no code implact included.
2004-09-30 21:12:10 +00:00
Jon Smirl
1c0a437fa2 Move things around to reduce public symbols and even out files. Switch to
get_order from drm_order.
2004-09-30 19:26:35 +00:00
Jon Smirl
3aef3841d0 Make fops per driver instead of global, remove default flush, poll, read
functions
2004-09-30 18:13:33 +00:00
Jon Smirl
0bff0d9eb6 Getting the AGP module is a global resource. Make sure a dual PCI/AGP
driver doesn't release it on unload since an AGP driver may also be
    loaded.
2004-09-28 22:25:06 +00:00
Jon Smirl
fa6b1d129e First check in for DRM that splits core from personality modules 2004-09-27 19:51:38 +00:00
Jon Smirl
6f31c42fe9 Remove size restriction on permanent addmap 2004-09-20 19:23:27 +00:00
Dave Airlie
5654880eee remove HAVE_COUNTERS 2004-09-20 11:29:16 +00:00
Jon Smirl
c7c9d3ef7b Let's try adding the dyn-minor patch again. This patch will reuse minor
numbers if a card is hotplugged in/out instead of just having them
    increase.
2004-09-16 18:42:03 +00:00
Jon Smirl
eeb0ef1a70 Back dyn-minor patch out for now. fops handling is broken on some cards 2004-09-15 17:44:30 +00:00
Jon Smirl
64ef12c55c Dynamic device minor support. Minor device numbers will be reused if the
device is hotplugged in/out of the system
2004-09-15 00:20:21 +00:00
Jon Smirl
13cb3f1b00 Fix error path in probe() to release resources if there is an error. 2004-09-12 19:24:08 +00:00
Jon Smirl
e6d468ad7f More general patch to mark resources in use by all DRM drivers. Makes the
code Linux specific.
2004-09-10 16:44:28 +00:00
Dave Airlie
c33f4449fc missed fix as part of last checkin 2004-09-05 23:33:57 +00:00
Dave Airlie
eeae6a0a38 merge back bunch of whitespace and misc changes from kernel 2004-09-05 10:54:59 +00:00
Dave Airlie
4499ea42ea Fixup OS_HAS_AGP/OS_HAS_MTRR along lines of patches going to kernel, as
suggested by Arjan..
Signed-off-by: Dave Airlie <airlied@linux.ie>
2004-09-04 23:21:40 +00:00
Jon Smirl
a070d15b53 Fix ref count problem in stealth mode. pci_get_subsys() with last parameter
set does the pci_dev_put for you.
2004-09-02 04:11:27 +00:00
Dave Airlie
da6b448497 implement drm_core_check_feature and use it .. looks lots nicer 2004-08-30 11:34:51 +00:00
Dave Airlie
55c6e72306 remove hacky context thing that was gamma only 2004-08-29 12:17:26 +00:00
Dave Airlie
1430163b4b Drop GAMMA DRM from a great height ... 2004-08-29 12:04:35 +00:00
Jon Smirl
4a89c75456 Initialize pdev to NULL correctly so that pci_get_subsys() will work. 2004-08-28 23:59:51 +00:00
Jon Smirl
60f23ebc5c Make DRM detect vesafb and revert to stealth mode to avoid resource
conflicts
2004-08-27 02:26:07 +00:00
Dave Airlie
d4dbf45781 Merged drmfntbl-0-0-2 2004-08-24 11:15:53 +00:00
Dave Airlie
eac498baea addmap-base-2 patch from Jon Smirl:
sets up the DRM to have the ability to have permanent maps while the driver
    is loaded...
2004-08-24 10:43:45 +00:00
Erdi Chen
25e319c1ef This patch adds three new ioctl's to the VIA Unichrome/Pro DRM driver:
DRM_IOCTL_VIA_DMA_INIT DRM_IOCTL_VIA_CMDBUFFER DRM_IOCTL_VIA_FLUSH
The first ioctl sets up an area in AGP memory that will be used as the ring
    buffer. The second ioctl copies a command buffer from user space memory
    to the ring buffer. The third ioctl waits for engine idle until it
    returns.
The motivation for this patch is to avoid the wait for engine idle call
    before each buffer flush in the current DRI driver. With this patch,
    the DRI driver can continue to flush its buffer as long as there is
    free space in the ring buffer.
This patch adds an additional copy operation on the command buffer. This
    buffer copying is necessary to support multiple DRI clients rendering
    simultaneously. Otherwise, more CPU time will be spent in the busy loop
    waiting for engine idle between DRI context switch. Even in the single
    client case, the tradeoff is reasonable in comparision to the kernel
    call to check for free buffer space for the client to render directly
    to the ring buffer.
2004-08-24 01:44:37 +00:00
Dave Airlie
5c9ed83094 Merged drmfntbl-0-0-1 2004-08-17 13:10:05 +00:00
Jon Smirl
23bbff24aa Add dev to DRIVER_CTX_DTOR( dev, pos->handle) so that sis driver will
compile #if 0 get_pci_driver use in hotplug function until fbdev work
    around is written
2004-08-15 15:35:14 +00:00