Commit Graph

100 Commits (d0904f0f2b87c725d3e67060419c445259bd4a5e)

Author SHA1 Message Date
Dave Airlie 7f6bf84c23 drm: remove lots of spurious whitespace.
Kernel "cleanfile" script run.
2007-11-05 12:42:22 +10:00
Dave Airlie bb5f2158db radeon: set the address to access the aperture on the CPU side correctly
This code relied on the CPU and GPU address for the aperture being the same,
On some r5xx hardware I was playing with I noticed that this isn't always true.
I wonder if this will fix some of those r4xx DRI issues we've seen in the past.
2007-11-03 00:39:44 +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
Eric Anholt e39286eb5e Remove DRM_ERR OS macro.
This was used to make all ioctl handlers return -errno on linux and errno on
*BSD.  Instead, just return -errno in shared code, and flip sign on return from
shared code to *BSD code.
2007-07-20 12:53:52 -07:00
Dave Airlie 24311d5d82 drm: remove drm_buf_t 2007-07-16 13:42:11 +10:00
Dave Airlie 21ee6fbfb8 drm: remove drmP.h internal typedefs 2007-07-16 12:32:51 +10:00
Dave Airlie b95ac8b7b3 drm: detypedef drm.h and fixup all problems 2007-07-16 11:22:15 +10:00
Oliver McFadden 3181573073 r300: Added the CP maximum fetch size and ring rptr update variables. 2007-06-08 19:40:57 +00:00
Dave Airlie 4e9d215bdf radeon: add support for vblank on crtc2
This add support for CRTC2 vblank on radeon similiar to the i915 support
2007-06-03 16:28:21 +10:00
Dave Airlie ce58e53a01 whitespace fixups from kernel 2007-05-26 03:32:34 +10:00
Dave Airlie 9f9c19065c remove DRM_GETSAREA and replace with drm_getsarea function 2007-04-28 15:07:43 +10:00
Oliver McFadden 059b5d9077 rs480: Renamed some unknown registers. See dri-devel list. 2007-04-09 23:23:40 +00:00
Dave Airlie a70f8e0ab2 radeon: add support for reverse engineered xpress200m
The IGPGART setup code was traced using mmio-trace on fglrx by myself
and Phillip Ezolt <phillipezolt@gmail.com> on dri-devel.

This code doesn't let the 3D driver work properly as the card has no
vertex shader support.

Thanks to Matthew Garrett + Ubuntu for providing me some hardware to do this
work on.
2007-04-09 21:52:59 +10:00
Dave Airlie 188a93c9df radeon: make PCI GART aperture size variable, but making table size variable
This is precursor to getting a TTM backend for this stuff, and also
allows the PCI table to be allocated at fb 0
2007-03-04 19:10:46 +11:00
Dave Airlie c9178c3d01 ati: make pcigart code able to handle variable size PCI GART aperture
This code doesn't enable a variable aperture it just modifies the codebase
to allow me fix it up later
2007-03-04 18:16:29 +11:00
Michel Dänzer 8ff026723c radeon: Fix u32 overflows when determining AGP base address in card space.
The overflows could lead to the AGP aperture overlapping the framebuffer area
in the card's address space when the latter is located at the very end of the
32 bit address space, which would result in a freeze on X server startup,
probably because the card read commands from the framebuffer instead of from
AGP.

See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=392915 .
2007-01-11 09:02:07 +01:00
Dave Airlie 3cc64a943a drm: use radeon specific names for radeon flags 2006-09-12 06:13:14 +10:00
Michel Dänzer 35066b51ef Revert "Make sure busmastering gets disabled on module unload."
This reverts af7b89d724 commit. It causes an oops
on X server shutdown here, and for the reporter of bug #7629 as well.
2006-07-26 18:21:32 +02:00
Michel Dänzer 645453ce11 Bug #7629: Fix for CHIP_IS_AGP getting 'restored' with non-AGP cards
Commit 2a47f6bfec caused the CHIP_IS_AGP flag to
get 'restored' with PCI(e) cards. I can't think of a way to fix this without
introducing a (otherwise redundant) CHIP_IS_PCI flag.
2006-07-26 18:19:27 +02:00
Adam Jackson af7b89d724 Make sure busmastering gets disabled on module unload. 2006-07-19 15:35:31 -04:00
Michel Dänzer d5e0f8bdaf Use RADEON_RB3D_DSTCACHE_CTLSTAT instead of RADEON_RB2D_DSTCACHE_CTLSTAT.
The latter seems to be a read-only mirror of the former.
2006-07-19 19:18:32 +02:00
Michel Dänzer 2a47f6bfec Make sure CHIP_IS_AGP flag is set when not overriding to PCI mode.
This allows using AGP after overriding to PCI mode in a previous session
without reloading the DRM.
2006-07-19 19:16:26 +02:00
Michel Dänzer c91748e702 When writeback isn't used, actually disable it in the hardware.
Not doing this might waste bus bandwidth or even cause memory corruption or
system crashes on systems that check bus transfers. No such incident has been
reported though.
2006-07-19 19:13:00 +02:00
Dave Airlie b1a64b8136 add consts to radeon microcode.
From: tilman
2006-05-18 07:32:37 +00:00
Dave Airlie 985738f203 radeon fix up the PCI ids for new memory map like the kernel one.. not
perfect but should be very safe... align some other kernel bits i810
    align with kernel
2006-03-25 07:16:14 +00:00
Roland Scheidegger 06e8bd2a0d Add all radeon pci ids known by ddx, but only r350/rv350 and below (new
chips may be problematic). Leave the existing entries for new chips in
    though. Remove ids not known by ddx (secondary ids, non-existant,...).
    Correct some entries (name/family). Make the radeon family enum look
    more alike the ddx/dri versions. See #5413
2006-02-25 09:51:15 +00:00
Dave Airlie 9fad101da9 add benh's memory management patch 2006-02-18 03:04:30 +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 4c988520a8 step back one reported bugs against that patch 2005-12-28 22:36:51 +00:00
Dave Airlie 274fdf482b fix radeon memory mapping from Ben Herrenschmidt 2005-12-16 08:02:17 +00:00
Eric Anholt c6344e8df5 Assert an MIT copyright on sis_drm.h, since one was lacking and I created
that particular file. Its contents have changed a good bit since the
    original sis code, and the original sis code didn't care much about
    attribution since it routinely disclaims Precision Insight/VA Linux
    from responsibility. Also, adjust formatting around license headers
    (have a comment open immediately before the "Copyright" line, not as a
    runon of any previous comments) for automatic processing into FreeBSD,
    where /*- is used to signal the beginning of license headers for
    automatic compilation of license lists.
2005-11-28 23:10:41 +00:00
Eric Anholt 1a256df480 Catch FreeBSD up to the pcie gart changes. Required minor modification to
radeon_cp.c to use a drm_local_map_t-type mapping (drm_core_ioremap
    rather than drm_ioremap), which contains private device mapping
    information on BSD. I also changed the ati_pcigart interface to use
    "void *" for pointers to kva rather than "unsigned long". While PCIGART
    support appears to be broken on FreeBSD currently, I think this is not
    new, and BusType PCI remains working on my r100 in Linux.
2005-11-08 02:38:01 +00:00
Dave Airlie f42cdc8dcb Add support to turn writeback off via radeon module option 2005-09-30 06:41:10 +00:00
Dave Airlie 6ff57e2d7c fix pci overriding from userspace 2005-09-30 06:35:09 +00:00
Dave Airlie d4dec1db80 hopefully fix server recycling on PCIE 2005-09-25 08:54:31 +00:00
Dave Airlie ba8f4fb778 make PCI Express work on 64-bit machines, thanks to Alex Deucher (agd5f) 2005-09-12 04:35:31 +00:00
Dave Airlie 5565a00916 Add GART in FB support for ati pcigart, and PCIE support for r300 2005-09-11 08:51:23 +00:00
Dave Airlie 7af0186f4c add Egberts 32/64 bit patch (its in kernel already...) 2005-08-16 12:51:57 +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 bb9502ab01 Mark some radeon init variables deprecated. These used to be passed in but
the driver already knew their correct value. For example the physical
    address of the framebuffer and registers.
2005-08-04 13:59:48 +00:00
Eric Anholt ab59dd285c Add latest r300 support from r300.sf.net CVS. Patch submitted by volodya,
with BSD fix from jkim and the r300_reg.h license from Nicolai Haehnle.
    Big thanks to everyone involved!
2005-07-20 21:17:47 +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
Jon Smirl 298b6fcedb Change initialization of radeon register access to _DRM_READ_ONLY. Flags of
zero does not mean no privs, instead it grants write access
    _DRM_READ_ONLY only applies to non-root users. Problem is only in CVS,
    initmaps are not in the kernel yet.
2005-06-20 15:40:48 +00:00
Jon Smirl ae2264d3c9 Remove I2C support from radeon driver. Same support is available from
radeonfb.
2005-06-19 04:15:58 +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
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 0d6b7fcb79 cleanup patch from Adrian Bunk <bunk@stusta.de> 2005-02-01 11:08:31 +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