summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm
AgeCommit message (Collapse)Author
2010-08-12Fix a ton of space and tab violations. No binary change.Marco Peereboom
ok oga
2010-08-12Fix a one character typo that broke interrupt handling on ironlake.Owain Ainsworth
we disable the interrupt while we are handling it (this is required according to intel) but instead of writing the version with the master enable bit back to the Interrupt Enable Register, we wrote it to the Interrupt Indication Register, so after the first interrupt we only got lucky due to shared interrupts when we were after anything. s/IIR/IMR/ on that one call and it works. tested by guenther@ and marco@ and myself. Fixes hangs when waiting for the chip which were unstuck by moving the mouse.
2010-08-08suspend/resume handler for radeondrmOwain Ainsworth
All the software state is in the xserver, so all we can do is save restore the interrupt enable bits (which are expected to persist). tested by sthen. ok deraadt@.
2010-08-06save/restore the *correct* clock gating registers on suspend/resumeOwain Ainsworth
instead of accidentally writing zeros to ones that may not even exist on the chipset we're running on. problem noted by damien@, fix by me. been in theo's tree a couple of days. ``commit'' deraadt@.
2010-08-03Save/restore BLC_HIST_CTL as well at suspend/resume time; which allowsTheo de Raadt
the x40 LCD to light up after unsuspend. https://bugzilla.kernel.org/attachment.cgi?id=23409 https://bugzilla.kernel.org/show_bug.cgi?id=10985 ok oga
2010-07-30The device table entry for HD3470 was incorrectly using a logical orJonathan Gray
instead of a binary or. Found via lint. ok oga@
2010-07-18Support from vblank events in drm.Owain Ainsworth
Previously, if userland wanted to wait on a certain vertical blank, it had to call an ioctl which slept. Now, they can ask for an even on the drm fd, which is then read off, and can be poll(4)ed on. For dri2 this fits better into the workflow since the fd gets added to the xserver main loop, and replies to the dri2 clients happen upon recieving the events. This functionality is only used with xserver 1.8 (and for the intel driver in our tree, this support is currently #if 0ed out due to bugs with vblanks on 945 that are still being chased) matthieu@ ok.
2010-07-18Kill inconsequential dead store.Owain Ainsworth
found by Clang static analyzer.
2010-07-18Radeon HD4670, from Henry Precheur; thanks!Owain Ainsworth
2010-07-18Radeon HD4200 (needs a newer radeon X driver than in tree though),Owain Ainsworth
tested by stsp@.
2010-07-01Mobility hd4870 works, add it.Owain Ainsworth
From jcr
2010-07-01Another radeon hd3200.Owain Ainsworth
from brad
2010-06-30Add mostly working support for ironlake (integrated graphics on core i5 and i3Owain Ainsworth
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.
2010-06-12add missing arg to a printf callJonathan Gray
ok oga@
2010-06-07Proper range check in radeon_emit_packets(); ok oga@Miod Vallat
2010-05-27Add missing license (amd, mit/x11)Owain Ainsworth
armani@ noticed that is was missing.
2010-05-26add a new getparam member to get the contents of scratch register 3 (theOwain Ainsworth
one we use to dump the software interrupt number). For some strange reason noticed upstream, writeback doesn't seem to be working for this value for use, so instad of using the get_scratch functions, we fallback to a direct register read (more bus traffic, but it actually works). This is to be used by new mesa on r100 and r200 since they reworked stuff for dri2, and we have local patches that prevent userland mapping the registers in dri clients. Tested by Josh Elsasser on a M9 (rv250), thanks very much to him.
2010-05-25The logic in this function is a little tricky (though correct).Owain Ainsworth
Explain how an invaviant is satisfied and add an assertion to check (never hit that one). As a side benefit clang doesn't bitch about a possible NULL deref now.
2010-05-25Having just calculated which sequence number we wish to wait for (soOwain Ainsworth
that in the reading-only case we need only wait for all gpu writes to be done and flushed), don't then wait for the full seqno anyway. Found by Clang's static analyser where it flagged a dead store to the seqno variable.
2010-05-25rename struct drm_i915_private to struct inteldrm_softc, to be more inOwain Ainsworth
line with everything in the tree. No functional change. I have wanted to do this for ages! More cleanup will be forthcoming.
2010-05-25Remove the DRI1 code paths from inteldrm as promised two weeks ago.Owain Ainsworth
We no longer support these paths, only memory managed mode is now allowed.
2010-05-24Remove the drm drivers that are not enabled (and have never been so).Owain Ainsworth
For now they are unmaintained, and work on kernel modesetting has very large inferface changes needing to be made. Also, when the radeon driver has been converted over, we will no longer support X with the DRI1 protocol, only DRI2. When the upheaval has finished, these drivers may be brought back after work to switch them to DRI2 style memory management and kernel modesetting has been done, but until then they are unsupported and probably broken (i know at least two of them have been reported broken before now). ragedrm will likely come back as a component of radeon (their interfaces are still fairly similar). The other drivers require rewriting. I have been threatening to do this for over a year. Discussed with deraadt@ and matthieu@ at various points since then.
2010-05-23fix another signed/unsigned slipt. no functional change. I hate thisOwain Ainsworth
header. Found by Clang static analyser.
2010-05-18oops. needs_fence should still be conditional on tiling due to the needsOwain Ainsworth
fence execbuffer logic.
2010-05-18Always invalidate fences in pin if they are invalid, not just if we needOwain Ainsworth
a fence. This will stop the case where a newly untiled buffer that has been reused will be execed as if it was tiled, causing havok. Solves the PTE errors on mlarkin's 945. He has another bug that he is currently bisecting for me which I am looking into.
2010-05-15Always check the tiling mode alignment on pin, even if we don't need aOwain Ainsworth
fence register. Stops some chipsets crapping out during rendering. Tested by Jan Stary; thanks!
2010-05-12Add Pineview M to intagp and inteldrm.Owain Ainsworth
Tested (and initial tweaked diff) from Erik Mugele; thanks!
2010-05-10unifdef INTELDRM_GEM.Owain Ainsworth
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 ;).
2010-05-10Remove the additional paranoia that I added compared to upstreamOwain Ainsworth
(reading back the relocation). It doesn't add any real security and when we actually need to map the buffer on demand to read/write it makes things cripplingly slow. The correct way to make this utterly incorruptible is a radeon-kms-like command checker to the command streams. This is on my todo list. Thanks to drahn@ for additional testing.
2010-05-10Use the new agp mapping api (introduced in previous commit) to allowOwain Ainsworth
this driver to work on machine with low kva and large apertures. tested by myself and drahn@
2010-05-09Attach pineview graphics in inteldrm.Owain Ainsworth
Tested by Jan Stary; thanks!
2010-05-08A little bit of a hack.Owain Ainsworth
If userland asks to allocate an object large enough that two that size could not fit around the pinned objects, disallow it with EFBIG. This prevents mmap of large objects that big and copying between them putting the machine into infinite thrashing. with a patch to the ddx (on my git branch) that allocates a non-accelerated pixmap when it gets that return code, matthieu@s test huge image works happily when before it DOSed the kernel. The correct fix would be to fall back to mmaping the backing pages for objects that big (radeondrm will need such ability anyway). This however is a lot more complicated and I am still working out how to do it correctly hence this commit for now.
2010-05-08Set the write combined bit on our newly created pages.Owain Ainsworth
We need a proper MI api for doing this (one which will fall back to mtrrs if PAT is not available would be best), but for now this allows inteldrm to use PAT if available. Big fat XXX mentioning the need for a real api. ok kettenis@, tedu@
2010-04-30Right now, if anything internal changes with a uvm object, diverseOwain Ainsworth
places in the tree need to be touched to update the object initialisation with respect to that. So, make a function (uvm_initobj) that takes the refcount, object and pager ops and does this initialisation for us. This should save on maintainance in the future. looked good to fgs@. Tedu complained about the British spelling but OKed it anyway.
2010-04-29add radeon hd2600 xtRobert Nagy
2010-04-29use BUS_SPACE_MAP_PREFETCHABLE on maps that should be WC (soon this willOwain Ainsworth
actually do so).
2010-04-29Finally fix the bit 17 swizzling code.Owain Ainsworth
- pmap_kremove takes a va and a size, not a va range (unlike pmap_remove, that gratuitious difference is nothing if not annoying). - fix a memory leak of the bit 17 bitstring. - fix the offset calculation when iterating through the dma segments. Tested by Brandon Mercer, his machine now seems to be rock solid. Remember kids, if a code path has not been tested fully, it does not work!
2010-04-29Test bit is used like a boolean, so it must actually be a boolean.Owain Ainsworth
This was causing swizzling on bit 17 swizzling intel IGDs when not needed. Thanks to Brandon Mercer for testing.
2010-04-29Fix the drm_atomic macros to use unsigned int like they should.Owain Ainsworth
pointed out by Clang static analyser.
2010-04-28*sigh* make the same change as previous commit to the sister function ofOwain Ainsworth
the one changed.
2010-04-28Deal with a non-incremented iterator by changing aOwain Ainsworth
while (condition) { do_stuff() increment_condition /* this was missing */ } To a for loop like it always should have been. I have no idea what I was smoking when I wrote this function. Fixes the crash on hardware that does bit 17 swizzling (turns out the three I know of are all 945s) as soon as we first unbind an object. Thank you very much to Brandon Mercer for actually managing to get me a crash dump so i could debug this, and also for testing the fix.
2010-04-25Argh, commited the wrong diff. This was the reversed test that found theOwain Ainsworth
libdrm bug recently. Correct to what was intended.
2010-04-25When querying if an object is busy, it is if it is marked active (beingOwain Ainsworth
accessed by the gpu or needing a flush). Since this implies that the object is wanted, emit the flush then to save time. Makes things a lot smoother than before in some GL applications, since before we were claiming that object needing a flush were unbusy so the next map stalled the gpu waiting on a flush. From daniel vetter on intel-gfx.
2010-04-25oops, kill unneeded write lock grabbing that got mixed in when resolvingOwain Ainsworth
conflicts.
2010-04-25A nice little performance speedup.Owain Ainsworth
If we just read access to some data that has been accessed by the gpu, only sleep until the end of the gpus last write (which we track). So instead of stalling the gpu until the last time accessed, both can read at the same time (which is allowed and coherent as long as the right invalidation happens). Since we check offsets from userland before we exec a batchbuffer, this helps 965 (with lots of read only relocations in the render path) quite a lot.
2010-04-25The locking rework/fix that I promised when I commited GEM.Owain Ainsworth
Before, as well as being kinda nasty there was a very definite race, if the last reference to an object was removed by uvm (a map going away), then the free path happened unlocked, this could cause all kinds of havoc. In order to deal with this, move to fine-grained locking. Since uvm object locks are spinlocks, and we need to sleep in operations that will wait on the gpu, provide a DRM_BUSY flag that is set on a locked object that then allows us to unlock and sleep (this is similar to several things done in uvm on pages and some object types). The rwlock stays around to ensure that execbuffer can have acces to the whole gtt, so ioctls that bind to the gtt need a read lock, and execuffer gets a write lock. otherwise most ioctls just need to busy the object that they operate on. Lists also have their own locks. Some cleanup could be done to make this a little prettier, but it is much more correct than previously. Tested very very vigorously on 855 (x40) and 965 (x61s), this found numerous bugs. Also, the I can no longer crash the kernel at will. A bunch of asserts hidden under DRMLOCKDEBUG have been left in the code for debugging purposes.
2010-04-25Don't bother binding the object in the gtt map ioctl.Owain Ainsworth
these maps tend to be fairly long lived so it buys us nothing other than code complexity.
2010-04-25Do not allow changing tiling mode on pinned objects.Owain Ainsworth
Since this means the necessary gtt alignment may change. Nothing did this already, so all it does it allows the code to be simpler. idea from Daniel Vetter.
2010-04-23Add a barrier before we submit the ringbuffer and before we do anythingOwain Ainsworth
that kills gtt mappings. In both of these case we want all writes to hit the bus before we do whatever we're about to do. Doesn't solve any problems that I know of but it may help.
2010-04-23Allow for lazy fence disable on tiling change.Owain Ainsworth
When we disable tiling (for example whenever we free an object to out userland cache), we stall the gpu so that we can get rid of the fence register covering its bit of the gtt. Instead, mark it as invalid and then free it on next use, leading to less of a gpu stall if any. Leads to some slight performance improvement on 8xx, 91x and 94x chipsets which are fence constrained.