Commit Graph

295 Commits (54fbf85125ef231f77b333d9e72cbc56b5bc012d)

Author SHA1 Message Date
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
Dave Airlie c9abd2fec5 add radeon registers from VHA code these are the "unknown" registers 2005-05-27 07:23:44 +00:00
Thomas Hellstrom e1fd79b31e VIA:
64-bit fixes. Bumped driver date and patchlevel.
2005-05-23 20:56:54 +00:00
Ian Romanick 955791f064 Refactor the routines for "calculating" the size of the WARP microcode. The
two routines (one for G200 and one for G400) were replaced with static
    const variables and a single function that returns the correct size.
    The code to generate an error if the allocated WARP region is too small
    was refactored from mga_warp_install_{g200,g400}_microcode to
    mga_wrap_install_microcode.
mga_warp_microcode_size is global to the MGA DRM because it will soon be
    used by code in another file.
2005-05-22 04:36:33 +00:00
Ian Romanick 75cb43ccd7 Forgot to bump the patchlevel and driver date on last commit. 2005-05-21 02:31:08 +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
Dave Airlie 4ca48cb4d8 Add i945G pci ids to drm
From: Christopher Allen Wing <wingc@engin.umich.edu> Signed-off-by: Dave
    Airlie <airlied@linux.ie>
2005-05-18 06:35:16 +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
Dave Airlie bd72c6990f wrap config.h include with defined for KERNEL 2005-05-15 10:19:21 +00:00
Thomas Hellstrom e0fc400b68 VIA: Fix for oops when AGP ring-buffer initialization is called and there
is no AGP memory acquired.
2005-05-08 20:33:04 +00:00
Eric Anholt 2fcf66a02f Clean up some const qualifier cast warnings. 2005-04-26 06:03:39 +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
Eric Anholt 31a06d0bac Use msleep instead of tsleep to drop the DRM device lock and avoid a
sleep-with- mutex held. This probably ought to be an os-independent
    sleep function ala DRM_USLEEP.
2005-04-26 05:11:20 +00:00
Thomas Hellstrom 2b8dc25dc5 VIA: Interrupt handler bugfixes. Bumped patchlevel to 2.6.2. 2005-04-20 10:16:52 +00:00
Thomas Hellstrom a08343e3e0 VIA:
1) Security fix: Stopped possible MMIO access to PCI DMA area for the
    unichrome Pro.
2) Fixed an odd cpu usage problem by padding small AGP DMA submissions.
    Bumped patchlevel.
2005-04-18 08:26:00 +00:00
Thomas Hellstrom cb5f6c22b5 Missing file via_video.c commited. 2005-03-29 09:48:12 +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
Alan Hourihane 459ef48629 Don't know who set the i915GM PCI ID incorrectly but it should be 0x2592 2005-03-25 13:44:47 +00:00
Dave Airlie 9182891b26 From Xorg CVS realign the i915_drv.h
From: Tungsten Graphics Signed-off-by: Dave Airlie <airlied@linux.ie>
2005-03-25 13:16:38 +00:00
Michel Daenzer ab396776fb Add support for production version of ATI RN50/ES1000. (ATI Technologies
Inc.)
2005-03-18 22:51:43 +00:00
Roland Scheidegger 34563921dd add R200_EMIT_PP_TRI_PERF_CNTL packet to support brilinear filtering on
r200
2005-03-15 22:12:30 +00:00
Thomas Hellstrom d2fd920095 via changes:
1. Initialize futex locks to zero on device init.
2. Remove some stray defines from via_drm.h
3. Prepare via_drm.h for drm client inclusion. The goal is to share a
    common file with common definitions.
4. Sync shared / shared-core via_drm.h
5. Bump minor, because of the futex lock initialization.
2005-03-14 22:50:21 +00:00
Felix Kuehling a396617dbc Command DMA optimizations:
- don't waste DMA memory when small command buffers are flushed
- minimized padding with noops
- slightly simplified faked DMA flushing
2005-03-13 02:16:10 +00:00
Felix Kuehling 95fa851769 Tracked down random lockups related to command DMA that occurred in Quake3
after ~5min: buffer aging was subtly broken. Part of this may have also
    affected vertex DMA buffer aging and client-side texture heap aging,
    though with less fatal consequences. Bumped minor version and driver
    date.
2005-03-07 12:19:49 +00:00
Dave Airlie 32b6823a25 minor pointer cast typo 2005-03-07 09:40:18 +00:00
Felix Kuehling 15995234b4 Added support for command DMA on Savage4-based hardware. Unfortunately
command and vertex DMA don't work at the same time. Command DMA
    performance is superior and works with all vertex formats. Bumped minor
    version and driver date.
2005-03-06 01:41:06 +00:00
Dave Airlie 26f04a1664 add some idct type 3 packets for reference 2005-03-04 03:04:37 +00:00
Felix Kuehling bc54ede0a8 Use wrap counter to extend 16-bit hardware event tags to 32-bit logical
event counters in the SAVAGE_EVENT_EMIT/WAIT ioctls. This is needed for
    reliable client-side texture heap aging. Slightly simplified DMA buffer
    aging while at it. Bumped minor version and driver date.
2005-02-23 16:34:30 +00:00
Thomas Hellstrom f3cf4bc5f2 Fix VIA K8M800 PCI ID. 2005-02-20 00:05:43 +00:00
Eric Anholt 56cdeff231 Fix a couple of gcc warnings in DRM_INFOs. 2005-02-19 22:07:07 +00:00
Michel Daenzer 49e19c8d00 fd.o bug #2576: Add support for ATI RN50/ES1000. (ATI Technologies Inc.) 2005-02-18 20:06:10 +00:00
Eric Anholt 2f7cd38c12 Initialize kbuf to NULL to quiet the compiler about uninit variables
(wasn't an issue). Don't forget to free kbuf if the copyin fails.
2005-02-14 03:22:58 +00:00
Thomas Hellstrom 650c0fe391 Fixed Futex release bug. Bumped driver date and patchlevel. 2005-02-13 23:03:48 +00:00
Roland Scheidegger 732cdc5cef add support for texture micro tiling on radeon/r200. Add support for r100
cube maps (since it also requires a version bump) at the same time.
2005-02-10 19:22:43 +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 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
Thomas Hellstrom 270ca5f3ce Via driver: Add missing drm_poll function to via driver in core. 2005-02-03 10:51:22 +00:00
Eric Anholt 7f7bbdcbed Declare r128_do_cleanup_pageflip static since it's only used here and its
prototype went away.
2005-02-03 01:06:10 +00:00
Eric Anholt ed31275144 Cast user data to correct type in radeon_surface_free's copyin. 2005-02-03 01:05:34 +00:00
Dave Airlie 0d6b7fcb79 cleanup patch from Adrian Bunk <bunk@stusta.de> 2005-02-01 11:08:31 +00:00
Dave Airlie 1dd948f280 make functions static in i915, remove unused functions 2005-02-01 10:43:42 +00:00
Thomas Hellstrom cd9ef39c76 Fixed multiple devices DMA bug. Fixed PCI path FIRE command detection 2005-01-27 22:48:47 +00:00
Dave Airlie 77045dc516 fix incorrect PCI id for ATI radeon 2005-01-27 09:13:42 +00:00
Roland Scheidegger 43c3223de6 (Stephane Marchesin,me) Add radeon framebuffer tiling support to radeon
drm. Add new ioctls to manage surfaces which cover the tiled areas
2005-01-26 17:48:59 +00:00
Roland Scheidegger 408376b203 replace magic number with macro constant RADEON_ZBLOCK16 2005-01-26 14:19:24 +00:00
Felix Kuehling 39d5c831a0 Removed one bogus Savage3D PCI ID. Corrected another one. Restored
numerical ordering.
2005-01-20 23:33:24 +00:00
Adam Jackson 36ec8d82e7 Add a Savage3D PCI ID 2005-01-20 19:05:42 +00:00