summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/drm/i915_irq.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Split out the suspend/resume code into its own file to make it possible tokettenis2012-05-191-16/+30
| | | | | | diff it against the Linux kernel sources. Fix a few bugs revealed by doing such a diff. Tested by myself and a few others on 915, 945, 965 and 6-series.
* Initial kernel support for sandybridge intel chipsets in intagp and inteldrm.oga2011-09-141-7/+19
| | | | | | | | | | Far from perfect. Extra (almost essential) features like the extra ringbuffers are not yet supported (I have half a diff), but this and the appropriate ddx patches allow modesetting and basic shadow acceleration. Initial work by jcs@, a few cleanups and bugfixes by me. Tested by many on all appropriate chipsets. ok kettenis@
* Add $OpenBSD$ after oga said 'go ahead and fix that'weerd2011-06-021-0/+1
| | | | 'go for it' oga@
* do not need that protoderaadt2011-04-241-1/+0
|
* Fix a ton of space and tab violations. No binary change.marco2010-08-121-5/+5
| | | | ok oga
* Add mostly working support for ironlake (integrated graphics on core i5 and i3oga2010-06-301-19/+140
| | | | | | | | | | | | | | | | | | cpus) to inteldrm. This mostly works, but the suspend/resume handler doesn't put the registers back 100% (this is being worked on) and with the X driver code that is in snapshots (and soon to be on tech) we don't do vt switch in a 100% sane way. Similarly there are some vblank issues that aren't solved yet, but for most usage this works with the correct Xorg DDX. tested on two x201's, a t510 and a t410 all work given the correct userland. Suspend works once (due to crazy crap done in the ddx) but doesn't come back the second time and text vts are screwed post suspend. this will be fixed shortly when a non-sucky solution has been found. for now, this allows non-vesa X on ironlake graphics and makes us the only accelerated but non-kms OS that works on ironlake.
* rename struct drm_i915_private to struct inteldrm_softc, to be more inoga2010-05-251-17/+17
| | | | | | line with everything in the tree. No functional change. I have wanted to do this for ages! More cleanup will be forthcoming.
* Remove the DRI1 code paths from inteldrm as promised two weeks ago.oga2010-05-251-102/+0
| | | | We no longer support these paths, only memory managed mode is now allowed.
* unifdef INTELDRM_GEM.oga2010-05-101-2/+0
| | | | | | | | | This enabled GEM for the intel driver unconditionally. The legacy codepaths will be removed in approximately one week since they are now completely unused. After discussion with matthieu@, drahn@, kettenis@ and marco@ (well, mostly nagging from marco ;).
* DRM memory management for inteldrm(4) using the Graphics Executionoga2010-04-081-92/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manager api. This is currently disabled by default under ifdef INTELDRM_GEM (option INTELDRM_GEM in a kernel config or a patch to i915_drv.h needed to enable), mostly because the intel X driver currently in tree does not always play well with GEM and needs to be switched to UXA accelmethod (which is the only option on later drivers). While based on the intel drm code in the linux kernel this has come cleanups and some obvious behaviour changes: 1) mmap through the GTT is entirely coherent with the gpu cache, removing mappings whenever the cache dirties so you can not race with userland to write to memory at the same time as the gpu. 2) pread/pwrite access is tiling-correct, so userland does not need to tile manually (mesa has already been fixed for this a while ago). The straw that broke the camels back here was the bit17 swizzling stuff on some mobile gpus meansing that while userland did the swizzle itself, the kernel had to do *extra* swizzling, this was frankly retarded so the option was dropped. 3) there is no option to map via the cpu from userland, again due to coherency issues. 4) additional integer overflow checking in some areas. 5) we only support the newer EXECBUFFER2 command submission ioctl. the old one is not supported at all (libdrm was fixed WRT over a week ago). now the TODOs: 1) the locking is funky and is only correct due to biglock. it does however work due to that. This will be fixed in tree, the design in formulating in my head as I type. 2) there are currently no memory limits on drm memory, this needs to be changed. 3) we really need PAT support for the machines where MTRRs are useless, else drm uses quite a lot of cpu (this is a bug that continues from the older code though, nothing new). 4) gpu resetting support on other than 965 is not written yet. 5) currently a lot of the code is in inteldrm, when memory management comes to other chipset common code will be factored out into the drm midlayer. Tested on: 855 (x40), GM965 and 915 by me. 945 by armani@ and jkmeuser@, gm45 by armani@ and marco@. More testing is needed before I enable this by default though. Others also provided testing by what they tested escapes me right now. In order to test this enable INTELDRM_GEM in a kernel and add the following line to the driver section in xorg.conf (I am working on a patch to autodetect the X stuff): Option "AccelMethod" "UXA"
* G4X chipsets actually have a slightly larger vblank counter register,oga2009-11-231-0/+2
| | | | | | so tell the vblank layer this. from upstream, ages ago.
* Make it so that instead of grabbing and ungrabbing the spinlock one line apart,oga2009-11-231-14/+16
| | | | | | we just grab it once and drop it when we're done. will reduce spl/splx wrangling. While here, clean it up a little bit.
* Suspend/resume goop for inteldrm, essentially a big pile of save/restoreoga2009-11-231-21/+2
| | | | | | registers (man these things have a lot of state!). ok pirofti@ (who did the activate function and tested).
* Something i should have commited months ago.oga2009-09-081-46/+5
| | | | | | | | | | | Instead of planes, use pipes for the vblank code (this matters with the newer drivers we're now using). originally from upstream (kinda, i adapted it a little). Much cleaner now, too. Helps with some vblank issues sthen@ has been seeing. Also seems to fix any issues i've seen with the x40, with suspend-on-lid disabled shutting hte lid no longer borks X on my x40, this issue pointed out (and reminded regularly until I found time :) by deraadt@
* Cleanup: knf, typos.oga2009-05-121-54/+54
|
* The G4X and GM45 just /had/ to have a different counter register.oga2009-04-191-0/+6
| | | | Been meaning to pull this in from upstream for ages.
* Fixed a few the-the misspellings in comments. Skipped a bunch in binutils,gcc and so on. ok jmc@jj2009-04-141-1/+1
|
* Don't bother to keep a count of irqs recieved, the os does that for us.oga2009-04-061-1/+0
|
* Rework the vblank subsystem so that instead of having various bits inoga2009-04-051-1/+1
| | | | | | | | | | | | the drm softc, we only have one pointer, with the rest in that struct. This is so that vblank-less drivers (yes, they exist) don't need to waste space on useless crud. While i'm reworking most of this code anyway, accept that on openbsd all of the #defined atomic functions are not atomic other than set and clear bit. Also, realise that the vb_lock is held whenever we manipulate these counts anyway. With those two facts in mind just remove the atomic_blah() and just use ++ and --.
* ${XORGNAME}_driver_irq_handler() is a stupid name for an interruptoga2009-04-031-3/+3
| | | | | handler anyway. replace it with ${OpenBSD_driver_name}_intr like most of the rest of the tree. No functional change.
* More compat crud bites the dust: Remove the IRQ_NONE and IRQ_HANDLEDoga2009-04-031-2/+2
| | | | | defines. 0 and 1 are fine for returning from irq handlers so why bother with the indirection?
* kill the stupid DRM_IRQ_ARGS macros and irqreturn_t typedef, switch tooga2009-04-031-3/+3
| | | | the unmacroed/typedefed version.
* Remove dev->irq_lock, the drm_irq_handler_wrap irq handler, and removeoga2009-04-031-0/+1
| | | | | the dev->driver irq_handler member since we now don't need to know. Shaves a few bytes, and makes me happy.
* Final irq_lock piece. Switch inteldrm over like radeomdrm and the rest.oga2009-04-031-16/+6
| | | | | | | | | We already have a lock protecting the irq registers, so extend it trivially so it protects user interrupts too. Switch irq handler to purely local handler. Finally remove an extra test in i915_wait_irq() since we won't sleep even without that if the test will pass. irq_lock and handler_wrap may now die. Coming soon.
* use i915_pipe_enabled() to test to see if the pipe is lit up, instead ofoga2009-04-031-4/+3
| | | | expanding the function in line here.
* Convert DRM_WAIT_ON to take additional parameters, the wmsg for msleep,oga2009-04-031-18/+18
| | | | | | | and the lock to manipulate. first step of removing drm_irq_handler_wrap which just grabs the irq_lock, and eventually irq_lock. drivers should manage their own.
* Remove a bunch of compat macros, just expand them to the openbsdoga2009-03-271-1/+1
| | | | equivalent.
* Demacro the inteldrm ring macros too, making them use bus_space_writeoga2009-03-051-2/+1
| | | | | | | instead of assuming BUS_SPACE_LINEAR + bus_space_vaddr while i'm at it. Cleans things up nicely, and shaves a little bit of space, too.
* Remove an unused define.oga2009-02-091-1/+0
|
* Don't enable vblank if the pipe is disabled.oga2009-02-091-0/+4
| | | | | | | Based on a patch from the intel driver maintainers (Jesse Barnes, specifically) Tested by several people on various hardware.
* Fixup wakeup pointers. interrupts work properly again.oga2008-11-241-1/+1
|
* Map device interrupts in the attach routine. and remove more need foroga2008-11-231-5/+8
| | | | | | | dev->pa by doing the pci_intr_establish/disestablish dance in the driver function, not in drm. This removes the need for interrupt_{pre,post}install callbacks, instead just provide a interrupt_install() callback.
* Move vblank data allocation to happening at attach, not at irq enable.oga2008-11-231-5/+0
| | | | | | | | | | | | just put a vblank_pipes argument to the driver structure which tells us how many to set up this means that intel doesn't lose all vblank count on vtswitch (it disables the interrupt there), i've heard of a few uvm_faults where this happens as well as things just going wrong. This was suggested by Keith Packard who provided a different diff for drm.git.
* using ``wait queues' for sleep is a linuxism. Kill them and just sleepoga2008-11-221-4/+2
| | | | on the softc.
* Slightly fix up previousoga2008-11-221-1/+1
|
* garbage collect i915_vblank_swap.oga2008-11-171-23/+0
|
* Manage vblank interrupts using the PIPESTAT register.oga2008-11-171-105/+87
| | | | | | | | The pipestat register needs tweaking when enabling vblanks, and doing this and playing with the IMR seems to lead to problems, so just leave them always unmasked and just tweak PIPESTAT. From Keith Packard at Intel.
* Conditionalise the use of the SAREA in inteldrm. In DRI2 setups (which we don'toga2008-11-171-5/+4
| | | | | | | support yet, but will) it won't exist, prepare for this by only writing to it if it's there. Bits of this came from Eric Anholt at intel.
* The i915 vblank swap ioctl is fundamentally racy.oga2008-11-061-314/+15
| | | | | | | | | | | | | using it allowed rendering to continue while waiting for a vblank swap, and often this lead to flickering and rendering a new scene before the swap. this broke a lot of things. With the removal of this swap, userland falls back to the old way of waiting for the vblank then doing the swap itself, this is smooth enough. I decided independantly to kill this, but the intel guys recently concurred. Comment change comes from Eric Anholt at intel.
* Enable IMR passthrough of vblank events before enabling it in theoga2008-11-041-36/+25
| | | | | | | | | | | pipestat register. Fixes a nasty race where the bit would get set without being reflected in the interrupt register, so we'd never get another vblank interrupt. Also, use the user_irq_lock to also protect vblank register writes, since it covers the same register. From Eric Anholt and Keith Packard at Intel.
* Hold the drm lock around all things that touch the ringbuffer.oga2008-11-041-0/+2
| | | | | | | Not strictly needed in the non-gem case, but it will be needed then, and doesn't hurt now. From Eric Anholt at intel.
* revert the pageflipping and vblank sync code to the older style thatoga2008-11-041-197/+86
| | | | | | | | | | | | doesn't handle triple buffering (which has been marked ``don't use this, it's unstable'' for ever anyway) While the code just removed is in drm git. it's not planned to go any further, due to being a horribly ugly hack. Instead a proper fix which will depend on memory management is planned. So revert this stuff here, since it's now dead. Testing shows no regressions.
* Remove the vblank_pipe member of the softc and noop the ioctl that setsoga2008-10-311-19/+1
| | | | | | it. Since the vblank handling got reworked this is very much unneeded.
* Bunch of cleanup. Kill some dead variables and some stupid code.oga2008-10-301-98/+63
| | | | Some ideas taken from upstream.
* Kill the linux-ready negative return codes in ``shared'' code. We handleoga2008-10-071-16/+16
| | | | | | | | | them wrong in several cases that i've noticed and Merging when needed is still fairly simple, anyway. This shaves another 500 bytes from an amd64 kernel due to not having to flip the sign on some things. It also stops my eyes bleeding. Tested by a few along with the last diff that went in.
* fix vblank interrupt mask. Unbreaks sync-to-vblank and anything thatoga2008-09-051-2/+2
| | | | needs the actual interrupts. Oops!
* Add Interrupt mitigation for the i9XX user_irq, should save a bit of power;oga2008-09-011-28/+71
| | | | from drm git.
* Kill the ifdefed out ttm interface stuff. The intel driver hasoga2008-08-281-3/+0
| | | | | | definitively gone for GEM so this will not be needed. No binary change.
* Update to DRM git.oga2008-07-291-72/+38
| | | | | | | | | | | Some stability fixes for radeon. The most part of this diff is related to fixing up the VBLANK (vertical blank interrupt) handling. Now, if the X driver supports the DRM_IOCTL_MODESET_CTL ioctl, (to be used when changing the video modes), then allow the vblank to be disabled once that ioctl has been called. Otherwise, keep the interrupt enabled at all time, since disabling it otherwise will lead to problems. Tested by a few. "no problem" on API/ABI deraadt@.
* Update the inteldrm driver to drm git.oga2008-07-031-55/+54
| | | | | | | | | | | changes: - Support for intel 4 series chipsets (i'll do any relavent agp bits for these as soon as i grab the datasheet and find a testcase) - fix scheduled buffer swaps on non 965 chipsets - major reorder, dedup and general cleanup of register definition and the header file Tested by a few, no regressions