Commit Graph

156 Commits (d41af11ee30413f90064cfffb5687be92a28021c)

Author SHA1 Message Date
Jon Smirl 5e7e41819e Add a hotplug event to DRM. Parameters match the ones from the general PCI
hotplug event plus the addition of one requesting RESET. Put your
    scripts in /etc/hotplug.d/drm to run. kernel class_simple generates the
    ADD/REMOVE events. No cards currently request RESET, the flag is there
    to stop you from resetting your boot display.
2004-07-31 15:45:00 +00:00
Dave Airlie 02df04d71d sync up with current 2.6 kernel bk tree - mostly __user annotations 2004-07-25 08:47:38 +00:00
Dave Airlie a776c5ec04 first set of __user annotations from kernel (Al Viro) 2004-07-20 12:43:12 +00:00
Dave Airlie 6c16cbd404 split out backwards compat into a separate file makes it easier for merging
to 2.6
2004-07-11 10:17:34 +00:00
Dave Airlie f9e2fe8470 fix issue in 2.4 kernels with returning NULL from this function 2004-07-11 09:58:49 +00:00
Dave Airlie 024fd4b150 2.4 compat 2004-05-30 23:38:08 +00:00
Dave Airlie 8350382cb1 another 2.4 fix 2004-05-18 09:46:31 +00:00
Dave Airlie df6c37fc88 2.4 compat fix 2004-05-18 09:42:22 +00:00
Dave Airlie a2f7a9fa5f Commit sysfs and drm PCI changes for 2.6 kernel 2004-05-09 06:45:17 +00:00
Dave Airlie a9d2438999 fix 2.4 build 2004-05-02 13:03:51 +00:00
Dave Airlie d40443534c Add __user annotations from kernel 2004-04-22 12:41:43 +00:00
Dave Airlie 93bd67ef62 centralise pci ids into one place and use scripts to generate files for
kernel
2004-04-21 12:13:31 +00:00
Dave Airlie 873e1c4d38 Add mach64 to the trunk 2004-04-12 05:27:40 +00:00
Dave Airlie 13724f032e 2.6 sysfs patches + stubs in drmP.h for 2.4 compatibility 2004-04-08 13:11:04 +00:00
Dave Airlie 3e0f3c1fbb more 2.4 compat fns 2004-04-08 12:20:39 +00:00
Jon Smirl 24115068e4 Fixes need to clean up the mess I made with the mesa merge. This code
allows the mesa drivers to use a single definition of the DRM
    sarea/IOCTLS located in the drm driver directory. Adjustments were made
    to the 2D drivers to not include these changes. Changes to the mesa
    copy of DRM were copied to the DRI copy. XFree86 bug: Reported by:
    Submitted by: Reviewed by: Obtained from:
2004-03-12 21:22:52 +00:00
Michel Daenzer f47ed99143 Remove extraneous code accidentally added with revision 1.86 2004-02-28 14:29:44 +00:00
Felix Kuehling d0031f22cf Conditionally add definition of list_for_each_entry_safe for kernel
versions that don't have it.
2004-02-21 19:54:51 +00:00
Keith Whitwell 82157579b5 drm_ctx_dtor.patch Submitted by: Erdi Chen 2004-02-20 22:55:12 +00:00
Michel Daenzer 2b9c12ef83 Adapt to nopage() prototype change in Linux 2.6.1.
Reviewed by: Arjan van de Ven <arjanv@redhat.com>, additional feedback from
    William Lee Irwin III and Linus Torvalds.
2004-01-11 00:14:28 +00:00
Eric Anholt 66c9e3053f - Tie the DRM to a specific device: setunique no longer succeeds when given
a busid that doesn't correspond to the device the DRM is attached to.
    This is a breaking of backwards-compatibility only for the
    multiple-DRI-head case with X Servers that don't use interface 1.1.
- Move irq_busid to drm_irq.h and make it only return the IRQ for the
    current device. Retains compatibility with previous X Servers, cleans
    up unnecessary code. This means no irq_busid on !__HAVE_IRQ, but can be
    changed if necessary.
- Bump interface version to 1.2. This version when set signifies that the
    control ioctl should ignore the irq number passed in and enable the
    interrupt handler for the attached device. Otherwise it errors out when
    the passed-in irq is not equal to the device's.
- Store the highest version the interface has been set to in the device.
- Fix a recursion on DRM_LOCK in irq_uninstall on FreeBSD. This leaves
    irq_uninstall being done without the lock in some cases, but it was
    racey anyways.
2003-11-05 08:13:52 +00:00
Michel Daenzer 2655ccddf4 Memory layout transition:
the 2D driver initializes MC_FB_LOCATION and related registers sanely
the DRM deduces the layout from these registers
clients use the new SETPARAM ioctl to tell the DRM where they think the
    framebuffer is located in the card's address space
the DRM uses all this information to check client state and fix it up if
    necessary
This is a prerequisite for things like direct rendering with IGP chips and
    video capturing.
2003-11-04 00:46:05 +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 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
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 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
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
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
Jose Fonseca d2443b2186 Merged DRM documentation. 2003-05-27 00:37:33 +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
Keith Whitwell 2c40a56393 move prototypes for gamma functions to gamma_drv.h 2003-04-26 21:22:08 +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
Keith Whitwell a41594e8df Remove #if 0'd code and some unused string functions 2003-04-24 09:41:33 +00:00
Keith Whitwell e15b0b6a1b Install dummy/noop read & poll fops unless the driver has replacements. 2003-04-23 23:42:29 +00:00
Keith Whitwell 73e20998b4 Rename drm_lists.h to gamma_lists.h 2003-04-22 12:14:59 +00:00
Keith Whitwell 928c25d14f Move the excitingly named DRM(flush_block_and_flush) and friends to
gamma-specific code.
Fix templates so i8x0 drivers don't have to define __HAVE_DMA_WAITLIST.
2003-04-22 12:07:24 +00:00
Keith Whitwell a1780925fb Move a chunk of gamma-specific code out of drm_dma.h. Remove unused
'DRM_FLAG_NOCTX' option.
2003-04-22 11:31:55 +00:00
Keith Whitwell 056762a910 remove unused dma histogram code 2003-04-22 10:18:29 +00:00
Keith Whitwell fc4fb6b51b remove DRM read, poll and write_string 2003-04-22 08:06:14 +00:00
David Dawes c2d7ff1bf9 Bring some drm module changes over from the XFree86 trunk:
- Reset 'bound' flag for an agp entry after undbind succeeded in
    drm_agpsupport.h (Egbert Eich).
- Ignore hw_lock for drm device if lock was set by a different instance (ie
    Xserver) to prevent second server from spinning in driver release
    function (currently only relevant for i8xx drm drivers) (David Dawes).
- Use the agpgart "key" for the unique handle for bindings rather than the
    memory address (the key is guaranteed to be unique) (David Dawes).
2003-04-17 18:41:28 +00:00
David Dawes d1b7f551e6 Fix DRM module build on 2.5.41 and later kernels (tqueue -> workqueue). 2003-04-17 15:27:34 +00:00
Leif Delgass 10444e06d4 Use list_entry() to get container struct from struct list_head pointers.
Build fix for RedHat 9 kernel (5 args to remap_page_range()).
2003-04-08 01:30:43 +00:00
Keith Whitwell 1728bc637d merged drm-filp-0-1-branch 2003-03-28 14:27:37 +00:00
Alan Hourihane b3eb34e0ea linux merge for drm 2003-03-25 11:36:43 +00:00
Eric Anholt cfa778af9c Merge from bsd-4-0-0-branch. 2003-02-21 23:23:09 +00:00
Michel Daenzer 826aad0aba limit number of pending vblank signals to 100 to prevent DoS, and minor
cleanups
2003-01-11 20:58:20 +00:00
Keith Whitwell fd621fd4a0 remove agpgart informational 2002-12-11 13:40:27 +00:00
Michel Daenzer 4acba63bb7 vertical blank interrupt cleanups: use spinlock instead of semaphore, send
signal directly from interrupt handler instead of using a taskqueue
    (based on feedback by Linus Torvalds)
2002-12-03 00:43:47 +00:00
Michel Daenzer 40891ac190 vertical blank ioctl can send signal instead of blocking 2002-11-30 14:24:07 +00:00
Michel Daenzer 55acd0d5a6 common ioctl to wait for vertical blank IRQs 2002-09-25 17:18:19 +00:00
David Dawes c4318a5c64 - Fix various bugs in the DRI support for the i830 and i845G (Keith
Whitwell).
- Major rework of the 2D i830/i845G support, including:
- Improve VESA mode selection, and fix refresh rate selection.
- Don't duplicate functions provided in the vbe modules.
- Don't duplicate functions provided in the vgahw module.
- Rewrite memory allocation.
- Rewrite initialisation and save/restore state handling.
- Decouple the i810 support from i830 and later.
- Remove various unnecessary hacks and workarounds.
- Fix an 845G problem with the ring buffer not in pre-allocated memory.
- Fix screen blanking.
- Fix some HW cursor glitches, and turn HW cursor off at VT switch and
    exit.
- Don't attempt to use the i830's function 1 entity.
- Fix problems with option handling. (David Dawes).
- Add mode VBE-aware mode handling functions to the vbe module (David
    Dawes).
2002-09-11 00:57:49 +00:00
Keith Whitwell 4fcde1efc1 standardize use of __FUNCTION__ (Linus) 2002-08-29 07:34:49 +00:00
Leif Delgass a697941d4c Don't (re)define vmalloc_to_page for kernel >= 2.4.19, as it has been
backported from 2.5.x. Also fix a couple of incorrect
    LINUX_VERSION_CODE tests and fix header dependency for r128, radeon
    when building without AGP.
2002-08-22 19:35:31 +00:00
Alan Hourihane 74ef13fd00 merged bsd-3-0-0-branch 2002-07-05 08:31:11 +00:00
Keith Whitwell 9e67da5626 Allow drm to build under 2.4 and 2.5(.14) 2002-05-16 23:47:15 +00:00
Michel Daenzer 65d25572de wrapper for ioremap_nocache() like for ioremap() (Paul Mundt) 2002-02-02 17:03:51 +00:00
Alan Hourihane 92ad1b60e1 merge kernel 2.4.13-pre6. 2001-10-22 19:15:04 +00:00
Alan Hourihane ca820fca87 merge with 2.4.10 kernel 2001-09-25 09:32:16 +00:00
Alan Hourihane 390440c939 remove Linux 2.3.x cruft. 2001-09-18 11:00:23 +00:00
Alan Hourihane f4c2f14002 No one's maintaining 2.2.x support - so remove all the cruft. 2001-08-19 15:20:08 +00:00
Jeff Hartmann 8aaf82d45c A few warning fixes when actually building under 2.4.9-pre2 + some
reformating
2001-08-14 00:35:07 +00:00
Jeff Hartmann aa09e36114 Sync with Linus 2.4.9-pre2 + make all nopage routines more alike 2001-08-13 23:23:47 +00:00
Jeff Hartmann 97b8aa52bb Commit Keith Owens kernel Makefile changes, merge and commit alpha patch
set from Jay Estabrook (sans some mga modifications which broke other
    arch's.)
2001-08-10 16:29:21 +00:00
Jeff Hartmann b6923b3953 Update to the code I sent Linus and Alan this morning. Added some missing
agp chipsets to drm_agpsupport.h, redid the card detection common code
    to use a structure (avoids endian porting issues), changed the tdfx
    driver to use the kernel pci id '#defines'
2001-08-08 16:10:47 +00:00
Kevin E Martin df76f81292 - PCIGART patches for Alpha from Compaq 2001-04-30 15:07:18 +00:00
Alan Hourihane 2bd9bf98c7 Handle drivers that don't have __HAVE_SG defined. 2001-04-06 08:39:02 +00:00
Kevin E Martin 5d6ddbca26 Merged ati-pcigart-1-0-0 2001-04-05 22:16:12 +00:00
Gareth Hughes 9914f4cf60 Remove PRIMPTR completely. 2001-03-19 12:04:12 +00:00
Kevin E Martin 74e19a4018 Merged sarea-1-0-0 2001-03-14 22:22:50 +00:00
Gareth Hughes 01a14789ed - Clean up the way customization of the templates is done.
- Fix old-style DMA for gamma driver (please test).
- Pull out IRQ handling into drm_dma.h (please test on i810, gamma).
- Lots of general cleanups, remove compiler warnings etc.
2001-02-16 05:24:06 +00:00
Gareth Hughes 360475376c Merge mga-1-0-0-branch into trunk. 2001-02-15 08:12:14 +00:00
Gareth Hughes 4d2a4455b4 - Misc cleanups.
- Fix drmR128Clear parameters (Radeon to follow).
- Add some helper macros to r128/radeon kernel modules.
2001-01-24 15:34:46 +00:00
Rik Faith 679531e166 Sync with Linux 2.4.0-test11-pre5 Provide backward compatibility tested
against 2.2.18pre21
As usual, since all 2.4.0-test* kernels set LINUX_VERSION_CODE to the same
    value, if you are running a 2.4.0-test kernel, you MUST be running
    2.4.0-test11-pre4 or later (although anything after 2.4.0-test11-pre1
    should work fine -- I tested with pre4/pre5). I expect 2.2.x support to
    continue to work for all recent kernels, but I tested with 2.2.18pre21
    -- we use the old intermodule symbol communication for 2.2.x kernels,
    so they should all continue to work.
2000-11-15 15:47:51 +00:00
David Dawes 94071289a4 merge with 4.0.1d 2000-11-08 00:07:17 +00:00
Rik Faith 52f0bc3c9e More changes for sync with Linux 2.4.0-test9-pre7 2000-09-29 02:05:41 +00:00
Rik Faith 39a659e877 Audit calls to schedule() Remove tags from files shared with Linux kernel
tree Remove debugging statements to make debugging more useful Other
    minor cleanups in preparation for sync with Linux 2.4.0-test9-pre7
2000-09-29 01:47:11 +00:00
Jeff Hartmann 550dff98b0 Merged the mga-lock-debug-0-2-0-branch with the trunk. This includes
several fixes including: (Jeff) Really disable multitexture (Broken
    since Mesa 3.4 integration.)
(Jeff) Various changes in mga_state.c in the kernel module, which includes
    a fix to the bug where the first OGL application hangs the machine
    w/out rendering anything. This also includes defines for the warp
    registers so they are easily human readable.
(Rik and Jeff) Fixed all the schedule loops in the kernel to look like they
    are supposed too.
(Jeff) Configurable agp modes: Add the option "AGPMode2x" or "AGPMode4x" to
    your XF86Config file.
(Rik) Various cleanups to the mga kernel driver to make it easier to read
    and debug.
(Rik) Removed alot of DRM_DEBUG statements from the kernel driver.
2000-09-27 21:32:19 +00:00
Alan Hourihane c7558d8fa4 commit xfree86 4.0.1d-pre update 2000-09-24 09:34:10 +00:00
Alan Hourihane f1bb3c5f5f Merged tdfx-2-1-branch 2000-09-07 12:40:41 +00:00
Rik Faith 32cebaf750 Add compatibility header file to make Linux 2.4.0 kernel patches cleaner. 2000-08-28 19:50:52 +00:00
Rik Faith 6f07e1ff6b Sync with Linux 2.4.0-test7 Add signal blocking support to all drivers
(using control-z on a running direct-rendering client should work now)
2000-08-26 10:36:44 +00:00
Rik Faith 364d44a24c Fix ABA problem in drm_freelist_{put,try} 2000-08-18 18:57:56 +00:00
Rik Faith f0f6509a72 Sync with Linux 2.4.0-test7/pre4 2000-08-18 13:55:23 +00:00
Rik Faith 8b9363d1b1 Sync with Linux 2.4.0-test6-pre8 2000-08-08 16:04:21 +00:00
Jeff Hartmann 9199075a6a Fix for multiple sarea bug + agp built into kernel segfault 2000-08-07 16:55:10 +00:00
Rik Faith f3ae6786f8 Sync with Linux 2.4.0-test6-pre2 2000-08-04 10:04:55 +00:00
Rik Faith 6dd96a15ed Revert some changes and try alternative way to clean up AGP handling. 2000-07-21 16:57:00 +00:00
Rik Faith 81da79d1ed Changes to make AGP optional for in-kernel builds 2000-07-21 14:20:57 +00:00
Rik Faith b4722ec943 More fixups for kernel build: EXPORT_SYMTAB warning removal
put_module_symbol clean up of tdfx tdfx_cleanup routine Makefile.kernel
    fix
2000-07-20 05:17:49 +00:00
Rik Faith 0bd1fa795a Fixes for building in the kernel tree 2000-07-20 01:52:00 +00:00
Rik Faith e8c9ed03f8 Fixed for monolithic kernel build 2000-07-20 01:14:58 +00:00
Rik Faith c459c9ead3 Added support for building as modules or as part of monolithic kernel 2000-07-20 00:48:12 +00:00
Rik Faith 2fbd4bf018 Unify code with kernel: Change some spacing in comments Add #include
<linux/config.h> to all *_drv.c files
2000-06-13 14:34:13 +00:00
Brian Paul 569da5a42e Merged glxmisc-3-0-0 2000-06-08 14:38:22 +00:00
Kevin E Martin 99efe3c247 Merged ati-4-0-1 2000-05-18 06:14:27 +00:00
Jeff Hartmann ba1b1ae380 Merged mga branch with trunk 2000-04-04 22:08:14 +00:00