Commit Graph

467 Commits (d7756397d695e5573647258f8412e9ecfb2645d4)

Author SHA1 Message Date
Eric Anholt d7756397d6 Bugzilla #3217: The size field in the new dma handle structure was
uninitialized, and its use in drm_pci_free later resulted in panics.
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
2005-05-28 20:25:04 +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
Ian Romanick 4a84416c45 Modify drm_driver::device_is_agp to return a tri-state value to indicate
that a device absolutely is, absolutely is not, or may or may not be
    AGP. Modify the i915 DRM to use this to force all i9x5 devices to be
    "AGP" (even the PCI-e devices).
Reported by: Lukas Hejtmanek
2005-05-27 23:42:11 +00:00
Ian Romanick a686be5bc8 Change the MGA initialization and cleanup a bit. The dev_private structure
is now allocated (and partially filled in) by the new
    mga_driver_preinit function.
This allows the driver to detect the type of card (i.e., G200 class vs.
    G400 class) on its own. The chipset value passed to mga_dma_init is now
    ignored. This same technique is used by the radeon DRM.
As a result of this, mga_driver_pretakedown was converted to
    mga_driver_postcleanup. This routine gets called in some other places
    than might be expected, and it sets the dev_private pointer to NULL.
    That little gem took over an hour to track down. :(
2005-05-21 02:27:51 +00:00
Ian Romanick fced784140 Refactor common, boilerplate ioctl code from drm_addbufs_* functions into
drm_addbufs. This makes the code more like the BSD code, and makes the
    drm_addbufs_* functions callable in-kernel.
Reviewed by: Dave Airlie
2005-05-20 00:17:40 +00:00
Felix Kuehling 6d4b9a830b Savage doesn't require AGP any more. Enable build even without CONFIG_AGP. 2005-05-17 02:08:02 +00:00
Ian Romanick e051cd19c0 Added device_is_agp callback to drm_driver. This function is called by the
platform-specific drm_device_is_agp function. Added implementation of
    this function the the Linux-specific portion of the MGA driver to
    detect PCI G450 cards. Added code to the Linux-specific portion of the
    generic DRM layer to not initialize AGP infrastructure if the card is
    not AGP (this matches what already existed in BSD).
Bumped the driver date and the driver patch-level for MGA.
This mostly fixes bugzilla #3248. The BSD side still needs an
    implementation of mga_driver_device_is_agp.
2005-05-16 17:37:10 +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
Thomas Hellstrom 699d4ad53a A fix for a locking bug which is triggered when a client tries to lock with
flag DMA_QUIESCENT (typically the X server), but gets interrupted by a
    signal. The locking IOCTL should then return an error, but if
    DMA_QUIESCENT succeeds it returns 0, and the client falsely thinks it
    has the lock. In addition The client waits for DMA_QUISCENT and
    possibly DMA_READY without having the lock.
2005-04-20 18:50:49 +00:00
Dave Airlie b0c461c8e3 Revert last commit, it affect via things 2005-04-19 00:31:16 +00:00
Adam Jackson 0a5e02c7b5 Add skeletal imagine driver (but don't build it yet). 2005-03-29 01:47:38 +00:00
Thomas Hellstrom 532ccb98b5 Via updates:
New PCI command parser. Moved from via_dma.c to via_verifier.c so functions
    with similar functionality are close to eachother.
Moved video related functions to via_video.c, which might be extended in
    the future, as new video functionality is added.
New device-specific generic IRQ IOCTL, similar to the general VBLANK IOCTL,
    but with support for multiple device IRQ sources and functionality.
Support for Unichrome Pro PM800/CN400 video DMA commands in verifier and
    PCI parser.
Support for Unichrome Pro PM800/CN400 HQV IRQs in the new generic IRQ
    IOCTL.
Bumped minor. New version 2.6.0.
2005-03-28 21:21:42 +00:00
Dave Airlie c6161eff86 Description: Rather than use custom code in DRM_WAIT_ON() to do exactly
what wait_event_interruptible_timeout() does, use the function and just
    change the return values appropriately.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
2005-03-27 07:05:28 +00:00
Dave Airlie 385f927692 Some ia64 platforms may not support write combining on all type of memory,
so we need to consult the EFI memory map before we try to set the write
    combine attribute of a page. This patch will try to map a page write
    combined if it's not an AGP page and the EFI memory map says it's ok,
    otherwise it falls back to a regular, uncached mapping. Can someone
    please apply this to the drm tree?
From: Jesse Barnes
2005-03-27 06:58:12 +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 2ad8387428 verify_area is deprecated, replaced by access_ok. Seems I missed this one
when I did the big overall conversion.
Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
2005-03-25 09:47:36 +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 c8d2d5d419 3dfx DRM depends on PCI
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2005-03-25 09:02:20 +00:00
Dave Airlie df6ef4836e For 2.6.12 and 2.6.11.x:
Remove incorrect "drm_"-prefix from parameter description.
Signed-off-by: Magnus Damm <damm@opensource.se>
2005-03-25 09:01:27 +00:00
Dave Airlie 7d3c42b589 Fix for bug 2673 from Egbert Eich - memset the version 2005-03-08 23:47:11 +00:00
Eric Anholt 81459d6e50 Close a race which could allow for privilege escalation by users with DRI
privileges on Radeon hardware. Essentially, a malicious program could
    submit a packet containing an offset (possibly in main memory) to be
    rendered from/to, while a separate thread switched that offset in
    userspace rapidly between a valid value and an invalid one.
    radeon_check_and_fixup_offset() would pull the offset in from user
    space, check it, and spit it back out to user space to be copied in
    later by the emit code. It would sometimes catch the bad value, but
    sometimes the malicious program could modify it after the check and get
    an invalid offset rendered from/to.
Fix this by allocating a temporary buffer and copying the data in at once.
    While here, make the cliprects stuff not do the VERIFYAREA_READ and
    COPY_FROM_USER_UNCHECKED gymnastics, avoiding a lock order reversal on
    FreeBSD. Performance impact is negligible -- no difference on r200 to
    ~1% improvement on rv200 in quake3 tests (P4 1Ghz, demofour at
    1024x768, n=4 or 5).
2005-02-08 04:17:14 +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
Dave Airlie 300e0866d6 fix agp detection on linux 2005-02-07 10:44:28 +00:00
Eric Anholt 080a547d4d - Implement drm_initmap, and extend it with the resource number to help
FreeBSD. Add drm_get_resource_{start|len} so linux-specific stuff
    doesn't need to be in shared code.
- Fix mach64 build by using __DECONST to work around passing a const
    pointer to useracc, which is unfortunately not marked const.
- Get rid of a lot of maplist code by not having dev->maplist be a pointer,
    and by sticking the link entries directly in drm_local_map_t rather
    than having a separate structure for the linked list.
- Factor out map uninit and removal into its own routine, rather than
    duplicating in both drm_takedown() and drm_rmmap().
- Hook up more driver functions, and correct FreeBSD-specific bits of
    radeon_cp.c, making radeon work.
- Baby steps towards using bus_space as we should.
2005-02-05 08:00:14 +00:00
Dave Airlie 1dd948f280 make functions static in i915, remove unused functions 2005-02-01 10:43:42 +00:00
Dave Airlie 62e0a58ecf update i830 similiar to the kernel, add statics 2005-02-01 10:33:51 +00:00
Dave Airlie 8d4c731aa1 make more functions static in i810 and fix pageflip cleanup 2005-02-01 10:18:27 +00:00
Dave Airlie 41cbbb47af fix radeon drv 2005-01-29 23:05:35 +00:00
Dave Airlie 311da0f212 hopefully fix drm_core setversion ioctl... pointed out by Eric on irc 2005-01-24 01:05:07 +00:00
Alan Hourihane 9620a0b8bb Fix cut & paste problem 2005-01-19 10:03:33 +00:00
Dave Airlie 37318f1675 remove duplicate drm_sysfs.o 2005-01-16 07:49:55 +00:00
Dave Airlie 354dd17d25 The patch makes drmAddBufs/drmMapBufs can handle buffers in video memory
The attached patch adds a new buffer type DRM_FB_BUFFER. It works like AGP
    memory but uses video memory.
From: austinyuan@viatech.com.cn (fd.o bug 1668) Signed-off-by: Dave Airlie
    <airlied@linux.ie>
2005-01-16 05:40:12 +00:00
Felix Kuehling ffc51f1f32 Setup MTRRs for frame buffer and aperture manually on Savage3D and
Savage4-based cards. Automatic setup in drm_initmap doesn't work due to
    the weird alignment and size of the aperture.
2005-01-15 16:55:01 +00:00
Felix Kuehling d4a8f16eb6 Use virt_to_page instead of vmalloc_to_page in drm_do_vm_shm_nopage for
consistent pages allocated with drm_pci_alloc.
2005-01-12 16:07:49 +00:00
Jon Smirl 6e38fd3576 Adjust 4 level page check for <= 2.6.10 2005-01-09 17:30:44 +00:00
Thomas Hellstrom fb6a4d0a7d via updates: moved the verifier state struct to dev_priv. Implemented AGP
alignment check.
2005-01-07 11:37:01 +00:00
Jon Smirl c6c7496ca0 Adjust drm-memory for 4 level page tables in 2.6.10 ifdef'd to use 3 levels
in kernels older than 2.6.10
2005-01-06 17:09:22 +00:00
Felix Kuehling 04842e8bcf Completeley rewritten Savage DRM which can be considered secure (modulo
implementation errors). Direct hardware (MMIO, BCI) access is no longer
    needed in the Mesa driver. Bumped version to 2.0.0. Corresponding
    changes to the DDX and Mesa drivers are being committed.
2005-01-01 20:22:58 +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
Dave Airlie fe4ade81bb i810/i830 bug with Jon's file operations changes 2005-01-01 12:07:51 +00:00
Dave Airlie b4782ba76b Use wbinvd macro instead of assembly for it,
From: Stefan Dirsch <sndirsch@suse.de> Signed-off-by: Dave Airlie
    <airlied@linux.ie>
2004-12-10 11:53:24 +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
Thomas Hellstrom 267e064527 Added 3D functionality to the via command verifier. Modified the via
ring-buffer code somewhat to workaround hardware problems. Bumped via
    minor version number.
2004-12-03 23:03:36 +00:00
Dave Airlie f0a86288fa patch from bug 1803 - will try and push to kernel soon 2004-11-11 11:09:11 +00:00
Jon Smirl 4b4df875b2 Fix more build problems on linux-core 2004-11-09 16:58:02 +00:00
Jon Smirl 76b1a7f2b4 make linux-core build again 2004-11-09 03:36:06 +00:00
Eric Anholt cb5aaa8987 Convert more drivers for bsd-core, moving the ioctl definitions to shared
code. Remove the "drv" from sisdrv, as it's unnecessary. Use the
    drm_pci functions in i915 instead of per-os implementations of the
    same. Avoid whitespace within fields in drm_pciids.txt (one of the r300
    definitions), since it breaks the bsd pciids script. Tested on sis,
    mga, r128. i915 needs more work.
2004-11-06 23:02:07 +00:00
Jon Smirl 000c8eb18e Fix Linux build. Why won't this complile? extern int const foo; static
struct drm_driver driver = { .var = foo }; error says foo is not
    constant
2004-11-06 16:41:24 +00:00