summaryrefslogtreecommitdiff
path: root/sys/dev/pci
AgeCommit message (Collapse)Author
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-27Update oxsemi (now plxtech) datasheet URL.Stuart Henderson
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-24This code is only called during autoconf, and never ever from anMark Kettenis
interrupt handler.  So the locking and spl manipulation can simply go away. ok deraadt@, oga@
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.
2010-04-21let this compile on RAMDISKS, which have no ioctlTheo de Raadt
2010-04-21Directly comparing pcitag_t's doesn't work on all platforms so decompose theMark Kettenis
tag and compare the individual components.
2010-04-21First stab at a VGA arbiter. The VGA arbiter makes sure that only a singleMark Kettenis
VGA device can be active, and is responsible for routing IO to the active VGA device. Processes can use the new PCIOC_GETVGA and PCIOC_SETVGA ioctls to manipulate the VGA arbiter. ok deraadt@, oga@
2010-04-21Add support for PLX I/O 9016 based 8 port serial cardBob Beck
ok deraadt@
2010-04-20remove proc.h include from uvm_map.h. This has far reaching effects, asTed Unangst
sysctl.h was reliant on this particular include, and many drivers included sysctl.h unnecessarily. remove sysctl.h or add proc.h as needed. ok deraadt
2010-04-20Nuke a few dead stores and one newly created unused variable.Owain Ainsworth
found by clang static analyser
2010-04-20A few more uninitialised variables (mostly in incredibly uncommon cases).Owain Ainsworth
found by clang static analyser.
2010-04-20Don't ask for ipv6 checksum offloading as we aren't ready for it.Jonathan Gray
Due to the messy context setup code this was breaking ipv6 forwarding when ipv4 offloading was enabled. All checksum offloading remains disabled for now. Debugged with and ok claudio@
2010-04-20Don't write garbage to the config space for phison,Jonathan Gray
we shouldn't be touching the config space at all here. Found by the clang static analyser. ok deraadt
2010-04-20- an unsolicited response contains the codec address, not the codecJacob Meuser
index - we only care about unsolicited responses from the codec we're using - no need to enable unsolicited responses until we know which codec we're using fixes crash reported by jacekm@
2010-04-19Enable VS timer dispatch, from Eric Anholt upstream.Owain Ainsworth
The spec says this bit should always be set. It can help resolve hardware deadlocks where a unit downstream of the VS is waiting for more input, the VS has one vertex queueed up but not dispatched because it hope to get one more vertex so it can dispatch a 2x4 block, and software isn't handing any more vertices due to waiting on rendering.
2010-04-19Fix use of uninitialised variable.Owain Ainsworth
found by Clang static analyser.
2010-04-19Add flags for chipset generation in with the other chipset type flagsOwain Ainsworth
prevent the horrible constructs we use to determine generation otherwise.
2010-04-19Correct fence pitch checking code and fence register writing on 9{1,4}x.Owain Ainsworth
The tiling check was insufficient and allowing too large pitches, which in some cases could cause graphical corruption, strengthen the check so that only valid values are used. Solved and patch ported from one by Daniel Vetter on intel-gfx. tested by Dorian Buettner (first dot last @ gmx dot de); thanks!
2010-04-17regenMiod Vallat
2010-04-17A few more devices found on sgi hardware.Miod Vallat
2010-04-16Remove Intel RAID IDs for now. They can be added back when code has beenMark Kettenis
written to detect the Intel RAID metadata format such that we no longer risk overwriting it. If this makes you lose your disks, you'll need to change the controller type from RAID to AHCI in the BIOS to get them back. ok marco@, deraadt@
2010-04-16Additional gtt alignment paranoia:Owain Ainsworth
when we go to pin, additionally check alignment against that required for tiling and unbind/rebind if needed. We shouldn't hit this case, but it is a good to check (would have found the bug in the last commit). tested by mlarkin and matthieu (and myself, of course)
2010-04-16Correct reversed test in set_tiling. this should deal with the fenceOwain Ainsworth
alignment errors that matthieu and mlarkin saw. Tested by both of them, and by me.
2010-04-16Correct some comments and cleanup some whitespace.Owain Ainsworth
2010-04-16paranoia: NULL check before free.Owain Ainsworth
2010-04-16If we fail to idle the chip in leavvt don't disable the interrupt,Owain Ainsworth
retrying that will hurt.
2010-04-16fix types in two error printfs. one of these also had a %d bug no varargOwain Ainsworth
for it, oops.
2010-04-15- fix bunch of use-after-free bugs found by splint;Marco Peereboom
- support sharing a phy port by devices (should work fine with sas expanders that share phy port number if such exist); - remove dead timeout_xs stuff; - make mpii_push_reply take a struct mpii_rcb argument instead of an address (like mpi does); - use SLIST instead of TAILQ to manage ccbs (ala mpi); - rototil openfirmware attachment code as it was copied verbatim (but with an error) from mpi and clearly wasn't tested; - increase reset delay to 240ms for stability purposes; - sprinkle some 'default' cases in a bunch of switch statements; - remove several splbio's from the code that runs on boot; - clarify/simplify the code that deals with sc_vd_id_low; - some slight cleanup.
2010-04-15Use IPL_TTY instead of IPB_BIO as suggested by oga.Marco Peereboom
Tested by me and mlarkin on amd64 and i386 ok oga
2010-04-12Radeon HD3200 works; from kili@.Owain Ainsworth
2010-04-12Some of the line disciplines want to check for suser. Better to pass themTed Unangst
a process instead of using curproc. ok deraadt
2010-04-11Send "STANDBY IMMEDIATE" command to ATA disks upon suspend. For this to work,Mark Kettenis
pciide(4) needs to formward DVACT_SUSPEND and DVACT_RESUME events to its children, so do that. Gets rid of the nasty "click" sound from the disk on many laptops. ok marco@, jsg@
2010-04-10Add radeon 4850; from Sviatoslav Chagaev (slava at zb dot lv), ta.Owain Ainsworth
2010-04-10some frees that were forgottenMarco Peereboom
2010-04-10Intel Centrino Advanced-N 6200 G2 adapters have their own hardwareDamien Bergamini
revision type.
2010-04-10regenDamien Bergamini
2010-04-10new Intel Centrino Advanced-N 6200 G2 idDamien Bergamini
2010-04-09oopsie, misplaced {Marco Peereboom
2010-04-09- event handling rewrite (while preserving original logic);Marco Peereboom
- support additional volume events; - track volume rebuild progress; - support for drive hotplug; - log when volume state changes and when we start to resync; - mpii_device handling rewrite (r/b tree is no more); - improvements in mpii_ioctl_* functions; - use internal disk_phys_num again as phy port number based scheme was proven to be unreliable; - fixup ioc_status check in mpii_scsi_cmd_done; - change Offline state to Invalid when drive is gone; - fixup recognition of the rebuilding state; - don't leak ccb if poll fails; - make use of the MPII_F_RAID flag and register with bio only if there are RAID capabilities (idea from mpi); - EVENT_UNMASK macro improvement from Kai Doernemann; - use proper endianness when setting ccb_dev_handle; - lower a polling delay in the mpii_complete; - improve readability and debugging output in several places; - change semantics of the SAS discovery event handler; - start of the event cleanup; - start of the whitespace cleanup; - start of the KNF cleanup; from Mike Belopuhov <mkb@crypt.org.ru>
2010-04-08DRM memory management for inteldrm(4) using the Graphics ExecutionOwain Ainsworth
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"
2010-04-08Fill in the bus_dma_sync for intagp to use clflush instead of wbinvd()Owain Ainsworth
if supported. When we do memory management on intel this would lead to a LOT of wbinvd() to deal with gpu->cpu incoherency. no one wants that. Needed for sanity of inteldrm memory management which is coming up next.