summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/drmP.h
AgeCommit message (Collapse)Author
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-11Fix prototype for drm_addmap(), okay oga@.Pedro Martelletto
2008-11-06Oops. Forgot to commit this chunk with the last commit.Owain Ainsworth
Remove softc members and prototypes related to the tasklet system.
2008-10-28make DRM_INFO() a bit less gross, though getting all the grossness out at ↵Theo de Raadt
once is impossible; ok oga
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-29Put back the ``address'' field to struct drm_buf, this allows machdrm toOwain Ainsworth
actually compile again (no one's tested it yet, still and I don't have one).
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-10Kill the max_context member of the softc, it does nothing useful.Owain Ainsworth
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 some more unused struct fields and the cases for them.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-05The code for cleaning up errored buffers and for cleaning up at the endOwain Ainsworth
is the same. Factor them into one function. Saves another 450 bytes on amd64.
2008-09-02detypedef some more. No functional change.Owain Ainsworth
2008-08-29Build with mtrr support on amd64. This really should have gone in inOwain Ainsworth
edmonton, but I forgot. ok and extra testing phessler@.
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-21Rip out the remnants of the vblank signal stuff. Nothing uses it, andOwain Ainsworth
it's stupid anyway. Most of this was ifdefed out.
2008-08-21Instead of having a number of malloced arrays for vblank handling, justOwain Ainsworth
put them in a structure and malloc free an array of those, it is nicer that way and They're all needed at the same time, anyway. Idea taken from a suggestion on the dri-devel mailing list.
2008-08-18Another dead struct member.Owain Ainsworth
2008-08-17kill struct drm_freelist, after removing markbufs and infobufs nothingOwain Ainsworth
touches it.
2008-08-17Kill a dead function and a dead struct member.Owain Ainsworth
2008-08-17Kill the infobufs and markbufs calls. Nothing uses them.Owain Ainsworth
2008-08-17kill the stupid pci capability defines, we have our own. Don't wrapOwain Ainsworth
pci_read_capability while i'm at it.
2008-08-16Apply a light paddling with the knf stick. No binary change.Owain Ainsworth
2008-08-13Kill file_priv->refs, it is always 1. Also move two things from theOwain Ainsworth
softc into file_priv since otherwise the wrong value could rarely be used.
2008-08-13Change the drm_lock*() api to take a pointer to the struct as aOwain Ainsworth
parameter, this makes things a little cleaner and removes the need to pass in the softc for some functions.
2008-08-13idgen32 wasn't really right here. Change back to how it was, butOwain Ainsworth
done a little nicer. Advice from deraadt@.
2008-08-13Generate the magic id using idgen32(). While i'm here fix the locking aOwain Ainsworth
bit so we don't sleep with a spinlock. ok djm@.
2008-08-13Kill a bunch of the drm context code that nothing uses anymore, theOwain Ainsworth
xserver only actually uses a small part of it nowadays. Kill a few other dead bits from the drmP.h while i'm here.
2008-07-29Update to DRM git.Owain Ainsworth
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@.
2008-07-29Switch all instances of malloc/free in the DRM to drm_alloc, drm_freeOwain Ainsworth
and drm_calloc. With the recent change to check overflow in drm_calloc, this means that all allocations that require multiplication are now checked. Also use drm_calloc() when zeroing is needed and drop the bzero/memset afterwards. Finally, make drm_free() check for NULL, so we don't need to do so every time. ok miod@, deraadt@
2008-07-10the DRM_{READ,WRITE}$NUMBER() macros currently useOwain Ainsworth
bus_space_{read,write}(). A bug in the code this was based on means that this is also used for scatter gather maps, which are bus_dma memory, not pci memory. This obviously fails. Pull them out into a function and Special case scatter gather to use the mapped virtual address to write instead. Makes writeback test pass on pci and pci express radeon cards. Tested by, among others ckuethe@ and sthen@.
2008-07-07The current drm_locked_task*() code sometimes tries to sleep in anOwain Ainsworth
interrupt handler. This is bad and wrong. So change it so that if we can't immediately grab the hardware lock, to just leave the task flagged so that we can run it when we release the lock. The linux implementation uses a similar scheme. Tested by guenther@, landry@ and bernd@. Also tested by many a while ago as part of a larger diff.
2008-06-26Kill the silly ``drm_device_t'' and ``drm_file_t'' typedefs. just useOwain Ainsworth
``struct drm_device'' and ``struct drm_file'' respectively. Since i'm changing a lot of prototypes anyway, remove all parameter names from prototypes, in accordance with style(9) (and sanity).
2008-06-26Kill the device_t and vm_offset_t typedefs.Owain Ainsworth
2008-06-26Since we're not ifdefed anymore, changeOwain Ainsworth
drm_{open,close,poll,read,mmap,ioctl} into the form that cdev_decl() likes, and nuke the #defines.
2008-06-26Kill the ifdefs in drmP.h too, it's meant to be os specific.Owain Ainsworth
While i'm here cleanup some duplicated #includes and reorder slightly.
2008-06-26Kill drm_sysctl.c and all references to it.Owain Ainsworth
All the code was ifdefed out anyway and it wasn't really useful.
2008-06-12The mmap offsets for memory buffers currently are the kernel virtualOwain Ainsworth
address. This is just plain wrong. scatter/gather on amd64 didn't work here, since char device mmap doesn't take negative offsets so higher kvas fail. Instead, prematurely import drm_memrange which is needed for the memory managers (GEM or TTM), and is used to manage GART space. Then, horribly abuse it to allocate mmap offsets, fixes up the issues. "just commit it" art@.
2008-06-11Update to DRM git as of a few days ago. This mostly affects theOwain Ainsworth
card-specific files with a few minor changes elsewhere. The main change to the OpenBSD specific stuff is the change to the irq api due to the vblank rework. 4 more large bugs known, I have a fix for one. Tested by many. prompted by deraadt@.
2008-06-03Make *drm(4) use D_CLONE so that the per-open data actually works. SinceOwain Ainsworth
i'm modifying this code anyway, prepare for privsep by making it so that "master" openers must be root, and remove some spurious suser() checks. For example, every DRM_ROOT_ONLY ioctl is also DRM_MASTER. Without this change, privsep wouldn't work since the fd is no longer root owned. With this, X privsep should work as soon as the userland bits are done (currently unwritten). Looked over by kettenis@, ok thib@.
2008-05-27return 1 when an irq's been handled, not 0.Owain Ainsworth
2008-05-27Since the vtophys stuff was nuked, drm now works on amd64 too. Add theOwain Ainsworth
relavent config goo. DRM_NO_MTRR is still needed on amd64 since the mtrr apis differ between it and i386. ok kettenis@.
2008-05-27When i first ported the drm, i completely misunderstood the FreeBSD taskqueueOwain Ainsworth
api. So drm_locked_tasklet() is wrong. Fix this up to be at least mostly correct.
2008-05-27Fix jiffies.Owain Ainsworth
2008-05-06Kill vtophys in drm.Owain Ainsworth
The code we inherited from FreeBSD used vtophys is a fair few places, nuke that and replace with bus_dma. technically _DRM_SHM should be managed with uao_create(), but until we move away from mmap and into an ioctl to map, this will do. This also paves the way for amd64 support (it lacks vtophys). ok kettenis, miod looked at it a while back too.
2008-05-06currently agp_i810 needs to map the same BAR as inteldrm, this obviouslyOwain Ainsworth
fails. In order to allow this, implement an API so that drm and agp can share mappings for the BARs. Now it works as it should. tested by many. ok kettenis, miod said he'd look at it when it's in tree.
2008-04-16Replace handrolled hashes with a splay tree, while there plug a memleakPierre-Yves Ritschard
inherited from the original drm driver. input and ok oga@.