Commit Graph

241 Commits (84dfe702e27e0ef22801f8fe366120bea90adf4f)

Author SHA1 Message Date
Jon Smirl e4a2a9c040 Switch pci enumeration call to work on both 2.4 and 2.6 pci_for_each_dev is
not supported on 2.6
2003-10-24 17:40:54 +00:00
Eric Anholt b79d1b341f Move to "old-style" probing as documented in linux/Documentation/pci.txt.
This should resolve the probe problems with radeon framebuffer due to
    pci_driver attachment being exclusive.
2003-10-23 05:56:13 +00:00
Eric Anholt 06cb132e86 - Introduce a new ioctl, DRM_IOCTL_SET_VERSION. This ioctl allows the
server or client to notify the DRM that it expects a certain version of
    the device dependent or device independent interface. If the major
    doesn't match or minor is too large, EINVAL is returned. A major of -1
    means that the requestor doesn't care about that portion of the
    interface. The ioctl returns the actual versions in the same struct.
- Introduce DRM DI interface version 1.1. If the server requests version
    1.1, then the DRM sets the unique itself according to the busid of the
    device it probed, which may then be accessed as normal using getunique.
- Request version 1.1 in libdrm's drmOpenByBusID, allowing the X Server to
    request based on a BusID. Introduce a wrapper for DRM_IOCTL_SET_VERSION
    and bump libdrm minor version.
- Pass the busid in DRIScreenInit if libdrm can handle both a busid and
    name. This allows drmOpenByBusID to be used to find the DRM instead of
    just the driver name, which allows us in the future to tie a DRM more
    strongly to the device it probed to. Introduce a function
    DRICreatePCIBusID which creates a busid in the form pci:oooo:bb:dd.f
    similar to linux's pci_name() function. This matches the format used by
    the DRM in version 1.1. libdrm knows how to match both this format and
    the old PCI🅱️d:f format.
- Use the new DRICreatePCIBusID function in the *_dri.c to request the new,
    more exact busid format.
2003-10-23 02:23:31 +00:00
Eric Anholt 86e6325e5a - Add DRM_GET_PRIV_WITH_RETURN macro. This can be used in shared code to
get the drm_file_t * based on the filp passed in ioctl handlers.
- Use this macro on BSD for simplification and improve its error reporting.
    Make failure to find the drm_file_t * print as an error, not debug.
    This failure may be part of the problem with KDE.
- Make debug and error print macros include the pid on BSD.
2003-10-22 22:08:53 +00:00
Eric Anholt 63ce8af555 Fix probing on 2.5+ kernels, which require that drivers have .id_table set.
We use PCI_ANY_ID to ask that our probe is called for every available
    device.
Submitted by: jonsmirl
2003-10-19 20:06:03 +00:00
Eric Anholt 2950f9e682 - Move IRQ functions from drm_dma.h to new drm_irq.h and disentangle them
from __HAVE_DMA. This will be useful for adding vblank sync support to
    sis and tdfx. Rename dma_service to irq_handler, which is more
    accurately what it is.
- Fix the #if _HAVE_DMA_IRQ in radeon, r128, mga, i810, i830, gamma to have
    the right number of underscores. This may have been a problem in the
    case that the server died without doing its DRM_IOCTL_CONTROL to
    uninit.
2003-10-17 05:13:48 +00:00
Eric Anholt ff58476011 - Converted Linux drivers to initialize DRM instances based on PCI IDs, not
just a single instance. Moved the PCI ID lists from <card>_drv.c in BSD
    to <card>.h. The PCI ID lists include a driver private field, which may
    be used by drivers for chip family or other information. Based on work
    by jonsmirl.
- Make tdfx_drv.c and tdfx.h match other drivers.
- Fixed up linking of sis shared files.
Tested with Radeon and SiS on Linux and FreeBSD, including a Linux setup
    with
2 SiS cards in a machine, but only one head being used (with DRI)
2003-10-17 03:14:39 +00:00
Leif Delgass 5d4b137076 Fix typo in SiS help message (and testing cvs commit to
dri.freedesktop.org)
2003-09-28 21:27:09 +00:00
Eric Anholt 28aee7fb1c Whitespace cleanup (spaces before tabs or instead of tabs). 2003-09-25 23:04:10 +00:00
Eric Anholt a0a38f8bd6 Fix Kconfig for SiS DRM now that it doesn't require sisfb.
Submitted by: Linus Torvalds <torvalds@osdl.org>
2003-09-25 19:08:11 +00:00
Alan Hourihane c5168016cc linux drm fixes 2003-09-12 20:00:59 +00:00
Eric Anholt a7aebb6dac Add DRM(calloc), which is convenient, used by the new sis code, and takes
advantage of M_ZERO on BSDs.
2003-08-29 19:16:13 +00:00
Michel Daenzer ba804e7864 Remove superfluous TLB flush 2003-08-28 12:14:17 +00:00
Michel Daenzer 9d7b01ebbe Merge from 2.6 kernel (Linus Torvalds) 2003-08-15 10:31:54 +00:00
Dave Airlie a073ff7dc7 DA: loads of whitespace .. some from Linus, some from me 2003-08-15 01:05:24 +00:00
Dave Airlie 428cbe0b91 DA: patch from Matthew upgraded to latest DRI head to solve issue with i810
compatibility
2003-08-13 23:35:40 +00:00
Dave Airlie 447d8c56bb DA: code cleanups for i810_dma.c from 2.4 kernel 2003-08-11 01:46:02 +00:00
Michel Daenzer e7944efc45 build fix for kernels >= 2.6 2003-08-07 10:13:50 +00:00
Michel Daenzer da16867c84 Fix maplist entries being used after they were freed; thanks to Benjamin
Herrenschmidt for tracking this down
2003-08-06 11:46:21 +00:00
Michel Daenzer 4b60cae90e IRQ code cleanup suggested by Linus Torvalds
i830 build fix
2003-07-29 10:11:48 +00:00
Michel Daenzer bef7017749 Compile fixes for recent 2.5/2.6 Linux kernels. I hope this doesn't break
the i830 driver or the BSDs. :)
2003-07-25 10:50:39 +00:00
Michel Daenzer 32ef0f59a8 Fail in DRM(agp_acquire) if the AGP aperture can't be used, such that the X
server falls back to PCI GART or disables the DRI gracefully
2003-07-25 10:31:37 +00:00
Keith Whitwell 3669639b21 Restore __HAVE_KERNEL_CTX_SWITCH, required for the sparc drm module in the
kernel tree. Added comments to that effect.
2003-07-11 15:27:55 +00:00
Dave Airlie 1654bc5752 DA: fix for bug 484 in Bugzilla, originally from me, reworked by David
Dawes to avoid backword incompatibilities...
2003-07-09 23:21:15 +00:00
Keith Whitwell 2daf147652 Removed unused __HAVE_KERNEL_CTX_SWITCH, whatever that was. 2003-07-08 17:10:13 +00:00
Leif Delgass 39e1c534c0 Don't need to include linux/wrapper.h - we only use Set/ClearPageReserved
from linux/mm.h now and wrapper.h has been removed in 2.5.69 and later.
2003-07-04 18:31:42 +00:00
Jose Fonseca 93522f6d3a Revert the janitorial - that works is now on the new branch
newdrm-0-0-1-branch.
2003-06-19 00:09:52 +00:00
Jose Fonseca fdf320a1b8 Move the linux AGP includes into drm_agp.h and only define the AGP data
structures if AGP support is enabled in the kernel (__REALLY_HAVE_AGP).
    This fixes the compile errors on kernels without AGP support.
2003-06-14 15:18:49 +00:00
Dave Airlie f723f743c5 fix pitch compile error 2003-06-07 01:44:15 +00:00
Dave Airlie 8eaa2d2450 add page flipping support to the DRM, up version number to 1.3.0... 2003-06-05 23:31:40 +00:00
Jose Fonseca 8e7cd92f35 Added the Doxygen configuration file. Minor documentation fixes. 2003-06-03 23:50:23 +00:00
Jose Fonseca 6611a5fb7f Split declarations/definitions in drm_scatter.h into drm_sg.h/drm_sg_tmp.h
respectively. Splited the work out of the ioctls and renamed (with the
    _ioctl prefix). Added some more documentation. Did the same for
    drm_sgpsupport.h.
2003-06-03 23:27:01 +00:00
Leif Delgass ccf6d6a513 Restore DRM_*MEMORYBARRIER change reverted with documentation merge 2003-05-28 01:44:49 +00:00
Jose Fonseca d2443b2186 Merged DRM documentation. 2003-05-27 00:37:33 +00:00
Michel Daenzer b942999b59 do allow reading from read only mappings... 2003-05-17 00:37:34 +00:00
Michel Daenzer e5d3c7f260 Support AGP bridges where the AGP aperture can't be accessed directly by
the CPU (David Mosberger, Benjamin Herrenschmidt, myself, Paul
    Mackerras, Jeff Wiedemeier)
2003-05-16 23:41:27 +00:00
Leif Delgass 7e1a4bfab3 remove unused variables 2003-04-29 16:59:00 +00:00
Leif Delgass 5f1e2399eb Restore Eric Anholt's DRM_*MEMORYBARRIER changes from rev 1.11 2003-04-28 17:49:26 +00:00
Leif Delgass a57d320461 Only free original pagelist in addbufs_pci if one already exists (fixes
oops).
2003-04-28 16:20:31 +00:00
Alan Hourihane 6eb5364eb8 DRM_READ/WRITEMEMORYBARRIER was given an argument in the bsd tree, fix for
linux
2003-04-28 15:29:46 +00:00
Keith Whitwell c584292e30 Put back __HAVE_KERNEL_CTX_SWITCH for David Miller's sparc drm driver
(which doesn't live in our cvs).
2003-04-27 09:53:58 +00:00
Eric Anholt 766a1da2e5 Remove the map argument from DRM_*MEMORYBARRIER. Not all of the uses of
DRM_*MEMORYBARRIER we had were related to an MMIO space. This means
    arch-specific code on the BSDs, unfortunately. Also add
    DRM_MEMORYBARRIER() and change the DRM_READMEMORYBARRIER()s that used
    to be read/write barriers to it.
2003-04-26 23:32:00 +00:00
Leif Delgass f2a0c5438d Ensure driver has been initialized (dev_private != NULL) before installing
irq handler in DRM(irq_install). Modify all drivers to ensure irq
    handler is removed before cleanup and cleanup is called at takedown.
    Remove unused buffer private struct fields in i810, i830. Check for
    lock on init/cleanup in all drivers except i810/i830. The current DDX
    for i810 and i830 doesn't hold the lock on kernel init (FIXME?).
2003-04-26 22:28:56 +00:00
Keith Whitwell f5844cea13 2.5.x sync patch from Linus Torvalds 2003-04-26 21:33:44 +00:00
Keith Whitwell 2c40a56393 move prototypes for gamma functions to gamma_drv.h 2003-04-26 21:22:08 +00:00
Keith Whitwell 2142b7840a Remove #if 0'd code 2003-04-26 21:21:36 +00:00
Leif Delgass cb32dde3be Fix potential oops and memory leaks when allocations fail in
addbufs_agp/pci. Add support for buffer private structs with PCI DMA
    buffers. Also some debug format string fixes.
2003-04-25 19:42:47 +00:00
Leif Delgass 16fda821eb Pass dma handle from pci_alloc_consistent to the card for status page,
rather than using virt_to_bus() on the virtual address.
2003-04-24 23:18:33 +00:00
Leif Delgass d6a82ff9c1 Remove unused dev->map_count. We always iterate the maplist with
list_for_each() and the count is not updated or used for stats.
2003-04-24 16:55:22 +00:00
Leif Delgass cd3d6090b7 Remove unused variables 2003-04-24 15:29:30 +00:00