summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/drm_drv.c
AgeCommit message (Collapse)Author
2009-04-03detypedef drm_local_map.Owain Ainsworth
2009-04-03detypedef drm_device_dma_t.Owain Ainsworth
2009-04-03detypedef drm_pci_id_list_t.Owain Ainsworth
2009-04-03Sprinkle some const correctness for the pciid lists. From mickey agesOwain Ainsworth
ago.
2009-03-30Zap a superfluous newline in the drmprint function, it messes up outputOwain Ainsworth
if you disable the device. noticed by deraadt@.
2009-03-29Remove the lock_time member from the hardware lock. It's not thatOwain Ainsworth
useful, and driver shouldn't need to know about ``ticks''.
2009-03-27Rework the dma buffer api a bit to make it smaller and to have lessOwain Ainsworth
duplicated code. Also, switch the dma_lock to a rwlock (it never should have been a spinlock) and move it and some other accounting data into the dma structure, not the main softc. Finally, the funcitons in drm_dma are tiny, move them in with the rest of the dma_bufs api in drm_bufs and remove the file.
2009-03-27Remove a bunch of compat macros, just expand them to the openbsdOwain Ainsworth
equivalent.
2009-03-26Rework how we deal with the list of per-open datastructures, and theOwain Ainsworth
auth list. now we only need the one tree. Makes things a little neater, and smaller.
2009-03-26The drm_* allocation functions have been #defined to not use most ofOwain Ainsworth
their arguments for a while. Actually go through the code and remove the extraneous arguments. Makes things easier to read.
2009-02-15convert drm_scatter code over to using the new dmamem api.Owain Ainsworth
removes the custom code in there, so shrinks the kernel by a few bytes. Convert other code to deal with data structure changes.
2009-02-15Convert CONSISTENT maps over to dmamem api.Owain Ainsworth
2009-02-15introduce drm_dmamem_alloc() to allocate dma memory with bus_dma.Owain Ainsworth
The next few commits will convert calls to drm_pci_alloc (which I hate) over to this new api, and convert other handrolled stuff over too. First part of my cleaning up bus_dma useage in drm.
2009-02-08fix potential null dereferences.Charles Longeau
Found by LLVM/Clang Static Analyzer. ok oga@
2009-01-29Similar to my last commit, it's stupid to have a file with two veryOwain Ainsworth
small functions in it. Move them to main driver file.
2009-01-29Move drmmmap to the main driver file. It's stupid to have a file withOwain Ainsworth
one (not particlarly large) function in it.
2009-01-29drm_getmap and interface can die too.Owain Ainsworth
2009-01-29Rip out the drm_drawable support. There is no need for the xserver toOwain Ainsworth
push cliprects into the kernel anymore so no op the ioctls. The only consumer of this information died a couple of months ago. When i've got removal of these calls from userland upstream i'm going to remove them from the interface entirely.
2008-12-08Make the various drm drivers print the interrupt they're using.Mark Kettenis
ok oga@
2008-11-24Make sure we do not DRM_UNLOCK() twice.David Hill
ok oga@
2008-11-24don't free extent on lastclose, it's static data now.Owain Ainsworth
2008-11-24do the same for struct drm_file (file_priv) as previously done forOwain Ainsworth
dma_bufs; allow the driver to provide the size and not have the private data pointer. only radeon only needs this so far, but intel with GEM also needs it. Postclose was only used for freeing said private data, so this allows me to remove the postclose callback and rename preclose to close.
2008-11-24actually set the bus_space_tagOwain Ainsworth
2008-11-24change drm_attach_mi to drm_attach_pci. we take the pci_attach_args, andOwain Ainsworth
setup the drm_attach_args with the needed information. require interface version 1.1 libdrm has been requesting it for ages), which means that we can set the busid string at attach time. (generated in drm_attach_pci), also pass in the interrupt line and bst. Now we don't need dev->pa at all, so remove it, finally.
2008-11-24make device works out if it's agp and tells the drm driver, not theOwain Ainsworth
other way round. More dev->pa reduction
2008-11-24instead of functions that just return an error, just inline them intoOwain Ainsworth
the ioctl handler.
2008-11-23pass in the dmat when we attach the drm driver. reduces pci dependancy.Owain Ainsworth
2008-11-23#define away unused arguments for the drm_alloc functions. to save someOwain Ainsworth
size. kill (empty) drm_mem_{un,}init() while here.
2008-11-23Move vblank data allocation to happening at attach, not at irq enable.Owain Ainsworth
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.
2008-11-22Make all drm drivers map their mmio register space on attach instead ofOwain Ainsworth
using the drm_maps interface (this was done for inteldrm a few days ago). All drivers now ignore the mmio_offset argument that the init ioctl takes. This clears up the code and makes sure that drm_ioremap_core() doesn't need the vga_pci_map inteface anymore, so we don't have to pass in the vga softc anymore. We also get to kill the drm_resource_{start,length} linux-alike functions since we just calculate all the requisite offsets at startup and cache those we need. This now means that technically the only driver that needs the vga_pci_map api is inteldrm (due to sharing with intagp issues), though this diff doesn't convert them over.
2008-11-22drm_device_is_pcie is only needed in one place: radeondrm_attachOwain Ainsworth
so just inline it there. also remove dev->pci_vendor and dev->pci_device, and insert pci_device into the one place any of them are needed (inteldrm's interface can give this info to the X driver. to remove that you'd need to fix X too).
2008-11-22Move the drm drivers over from:Owain Ainsworth
vga1 at pci0 inteldrm0 at vga1 to vga1 at pci0 inteldrm0 at vga1 drm0 at inteldrm0 i.e. a similar scheme to audio(4) where the interface attaches on top of the wildly different drivers. This helps to clean up the code a lot (more is coming) and help me start to move drm to being essentially bus independent, which will help in the future.
2008-11-22Remove the driver->load callback and just do all the initialization inOwain Ainsworth
the attach function. First step towards splitting drm off as it's own (bus independant) device, as it should be.
2008-11-22Remove dev->id_entry, it is no longer needed.Owain Ainsworth
2008-11-17drm advertises a read and poll method. this was there to prevent errrorsOwain Ainsworth
on rather old xservers. Said old xservers haven't been around in quite a long time so just remove them. Since the only function left in drm_fops.c is a small helper function, just move it to drm_drv.c and nuke the redundant file. no one objected when I said I was going to do this.
2008-11-17Instead of using a width-1 bitfield for storing the driver capabilitiesOwain Ainsworth
in the callback structure, just use a bunch of ORed together bits. This has been annoying me for ages.
2008-11-17rework how we handle ioctls.Owain Ainsworth
Before it was based on a static array with flags. Instead, let the driver provide an ioctl callback, which deals with things appropriately. Makes the code a bit easier to read, and also drops just over 5k on an amd64 kernel build with all drm drivers enabled. Tested by a few.
2008-11-06Remove the drm_locked_tasklet interface. The only consumer that used itOwain Ainsworth
was the i915 vblank swap ioctl, which just went kaput.
2008-11-04The drawable spinlock is no longer ever held in interrupt context (andOwain Ainsworth
won't be). It doesn't need to block interrupts anymore so switch to IPL_NONE.
2008-10-23Don't print redundant information in dmesg.Owain Ainsworth
Prompted by deraadt, kettenis@.
2008-10-11Fix various printf constructs either missing arguments or format specifiers.Miod Vallat
2008-10-07Kill the linux-ready negative return codes in ``shared'' code. We handleOwain Ainsworth
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.
2008-10-07Move dev->driver over to being a pointer to a const struct, instead of stupidlyOwain Ainsworth
filling in a pre-allocated one on each attach. Makes the code a bunch nicer, shrinks a kernel by about 1.5k on amd64, helps with my sanity, and paves way for later changes. Tested by a few for a couple of weeks now.
2008-09-18Rework the drm locking to be at least halfway sane. The freebsd codeOwain Ainsworth
held a lock over all driver ioctls in order to be ``mpsafe''. Stop lying to ourselves for a start. This code is not fully mpsafe, and should not pretend to be so. Put the locking around where it should, and rely on biglock for the rest. This will need to be fixed, but avoids some of the horrible that we have right now. Tested by many over a long time and several iterations.
2008-09-09Kill some stupid agp api wrapper functions, just use the agp apiOwain Ainsworth
directly. While i'm here, factor out some common functionality into a separate function, and kill some typedefs (man this code is full of them...). Shaves another 450 bytes off the kernel. Tested by ckuethe and Paul de Weerd, thanks.
2008-09-07Kill some unneeded defines and struct members.Owain Ainsworth
2008-09-06Kill the stats data structures and noop some other parts. Nothing inOwain Ainsworth
userland asks for these stats, and we stopped recording anything interesting a while back.
2008-09-02detypedef some more. No functional change.Owain Ainsworth
2008-08-28replace usage of drm_memrange with extent(9). No functional change, butOwain Ainsworth
should shrink the kernel somewhat. For some strange reason I was unaware of this api when I pulled in these changes. tested by myself and Paul de Weerd, thanks!
2008-08-17Kill the infobufs and markbufs calls. Nothing uses them.Owain Ainsworth