summaryrefslogtreecommitdiff
path: root/drivers/char/drm/drm_drv.c
AgeCommit message (Collapse)Author
2008-07-14drm: reorganise drm tree to be more future proof.Dave Airlie
With the coming of kernel based modesetting and the memory manager stuff, the everything in one directory approach was getting very ugly and starting to be unmanageable. This restructures the drm along the lines of other kernel components. It creates a drivers/gpu/drm directory and moves the hw drivers into subdirectores. It moves the includes into an include/drm, and sets up the unifdef for the userspace headers we should be exporting. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-06-20drm: only trust core drm ioctls - driver ioctls are a mess.Dave Airlie
So driver ioctls need a full auditing before we can make this change. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-06-13drm: use drms ioctl cmd not what we get passed from userspace.Johannes Weiner
This enforces us to use the drm ioctl types so read/write works correctly and not believe what userspace tells us. It does this hopefully without breaking the drm api. Fixes bug from thread: BUG: unable to handle kernel NULL pointer dereference (drm_getunique) Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-04-26drm: reorganise minor number handling using backported modesetting code.Dave Airlie
rips out the head crap and replaces it with an idr and drm_minor structure Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-02-07drm: fixup some of the ioctl function exit pathsDave Airlie
Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07drm: add _DRM_DRIVER flag, and re-order unload.Dave Airlie
Allow drivers to addmaps that won't be removed by lastclose or unload. The unload needs to be re-ordered to avoid removing the hashs before the driver has removed the final maps. Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07drm: move drm_mem_init to proper place in startup sequenceDave Airlie
For TTM this needs to be called later. Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07drm: update DRM sysfs supportJesse Barnes
Make DRM devices use real Linux devices instead of class devices, which are going away. While we're at it, clean up some of the interfaces to take struct drm_device * or struct device * and use the global drm_class where needed instead of passing it around. Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-10-19Use helpers to obtain task pid in printksPavel Emelyanov
The task_struct->pid member is going to be deprecated, so start using the helpers (task_pid_nr/task_pid_vnr/task_pid_nr_ns) in the kernel. The first thing to start with is the pid, printed to dmesg - in this case we may safely use task_pid_nr(). Besides, printks produce more (much more) than a half of all the explicit pid usage. [akpm@linux-foundation.org: git-drm went and changed lots of stuff] Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Cc: Dave Airlie <airlied@linux.ie> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-15drm: Replace DRM_IOCTL_ARGS with (dev, data, file_priv) and remove DRM_DEVICE.Eric Anholt
The data is now in kernel space, copied in/out as appropriate according to t This results in DRM_COPY_{TO,FROM}_USER going away, and error paths to deal with those failures. This also means that XFree86 4.2.0 support for i810 DR is lost. Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-10-15drm: Replace filp in ioctl arguments with drm_file *file_priv.Eric Anholt
As a fallout, replace filp storage with file_priv storage for "unique identifier of a client" all over the DRM. There is a 1:1 mapping, so this should be a noop. This could be a minor performance improvement, as everyth on Linux dereferenced filp to get file_priv anyway, while only the mmap ioct went the other direction. Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-07-17drm: convert drawable code to using idrDave Airlie
This converts the code for allocating drawables to the Linux idr, Fixes from: Michel Dänzer <michel@tungstengraphics.com>, Kristian Høgsberg <krh@redhat.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-07-11drm: detypedeffing continues...Dave Airlie
Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-07-11drm: drop drm_vma_entry_t, drm_magic_entry_tDave Airlie
Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-07-11drm: remove drm_file_t, drm_device_t and drm_head_t typedefsDave Airlie
some drivers still todo. Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-07-11drm: remove a bunch of typedefs on the userspace interfaceDave Airlie
This moves a bunch of typedefs into a !defined __KERNEL__ to keep userspace API compatiblity, it changes all internal usages to structs/enum/unions. Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-07-11drm: fix typo on code drm getsareaDave Airlie
Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-07-11drm: remove DRM_GETSAREA and replace with drm_getsarea functionDave Airlie
Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-07-11drm: cleanup use of Linux list handling macrosDave Airlie
This makes the drms use of the list handling macros a lot cleaner and more along the lines of how they should be used and uses them in some more places. Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-05-08drm: rename badly named define and cleanup ioctl code spacingDave Airlie
Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-03-19drm: allow for more generic drm ioctlsThomas Hellstrom
Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-02-12[PATCH] mark struct file_operations const 3Arjan van de Ven
Many struct file_operations in the kernel can be "const". Marking them const moves these to the .rodata section, which avoids false sharing with potential dirty data. In addition it'll catch accidental writes at compile time to these shared resources. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2006-12-07drm: Change first valid DRM drawable ID to be 1 instead of 0.=?utf-8?q?Michel_D=C3=A4nzer?=
This makes it easier for userspace to know when it needs to allocate an ID. Also free drawable information memory when it's no longer needed. Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-12-07drm: Add support for tracking drawable information to core=?utf-8?q?Michel_D=C3=A4nzer?=
Actually make the existing ioctls for adding and removing drawables do something useful, and add another ioctl for the X server to update drawable information. The only kind of drawable information tracked so far is cliprects. Only reallocate cliprect memory if the number of cliprects changes. Also improve diagnostic output. hook up drm ioctl update draw export drm_get_drawable_info symbol Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-09-22drm: remove hash tables on drm exitThomas Hellstrom
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-09-22drm: avoid kernel oops in some error paths calling drm_lastcloseThomas Hellstrom
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-09-22drm: move drm authentication to new generic hash table.Thomas Hellstrom
Fix drm_remove_magic potential memory leak / corruption. Move drm authentication token hashing to new generic hash table implementation. Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-09-22drm: cleanup old compat code and DRM fns from Linux only codeDave Airlie
This patch removes some of the old compatibility macros from the DRM, and removes use of DRM wrappers from Linux specific code. Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-04-05drm: remove master setting from add/remove contextDave Airlie
Clients can do this in the miniglx setups. Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-02-02sem2mutex: drivers/char/drm/Dave Airlie
From: Arjan van de Ven <arjan@infradead.org> Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-01-11drm: cleanup properly on drm module unloadDave Airlie
Cleanup multiple cards properly Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-01-02drm: move ioctl flags to a bit field of flagsDave Airlie
From: Dave Airlie Signed-off-by: Dave Airlie <airlied@linux.ie>
2005-11-11drm: add in-kernel entry points for rest of AGP ioctlsDave Airlie
Allow DRM modules to call AGP internally in the kernel. From: Ian Romanick <idr@us.ibm.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
2005-11-10drm: rename driver hooks more understandablyDave Airlie
Rename the driver hooks in the DRM to something a little more understandable: preinit -> load postinit -> (removed) presetup -> firstopen postsetup -> (removed) open_helper -> open prerelease -> preclose free_filp_priv -> postclose pretakedown -> lastclose postcleanup -> unload release -> reclaim_buffers_locked version -> (removed) postinit and version were replaced with generic code in the Linux DRM (drivers now set their version numbers and description in the driver structure, like on BSD). postsetup wasn't used at all. Fixes the savage hooks for initializing and tearing down mappings at the right times. Testing involved at least starting X, running glxgears, killing glxgears, exiting X, and repeating. Tested on: FreeBSD (g200, g400, r200, r128) Linux (r200, savage4) From: Eric Anholt <anholt@freebsd.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
2005-10-20merge Linus head tree into my drm tree and fix up conflictsDave Airlie
2005-09-29[PATCH] proc_mkdir() should be used to create procfs directoriesAl Viro
A bunch of create_proc_dir_entry() calls creating directories had crept in since the last sweep; converted to proc_mkdir(). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-25drm: lindent the drm directory.Dave Airlie
I've been threatening this for a while, so no point hanging around. This lindents the DRM code which was always really bad in tabbing department. I've also fixed some misnamed files in comments and removed some trailing whitespace. Signed-off-by: Dave Airlie <airlied@linux.ie>
2005-07-10drm: cleanup buffer/map codeDave Airlie
This is a patch from DRM CVS that cleans up some code that was in CVS that I never moved to the kernel, this patch produces the result of the cleanups and puts it into the kernel drm. From: Eric Anholt <anholt@freebsd.org>, Jon Smirl, Dave Airlie Signed-off-by: Dave Airlie <airlied@linux.ie>
2005-07-10drm: fix minor function header issueDave Airlie
From: Ian Romanick <idr@us.ibm.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
2005-07-10drm: update some function so a driver can call themDave Airlie
This patch splits some ioctl functions so that they can be called in-kernel by a DRM driver. The driver will use them later. From: Ian Romanick <idr@us.ibm.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
2005-07-10drm: update support for drm pci buffersDave Airlie
The DRM needs to change the drm_pci interface for FreeBSD compatiblity, this patch introduces the drm_dma_handle_t and uses it in the Linux code. From: Tonnerre Lombard, Eric Anholt, and Sergey Vlasov Signed-off-by: David Airlie <airlied@linux.ie>
2005-07-10drm: add _DRM_CONSISTENT map typeDave Airlie
Added a new DRM map type _DRM_CONSISTENT for consistent PCI memory. It uses drm_pci_alloc/free for allocating/freeing the memory. From: Felix Kuhling <fxkuehl@gmx.de> Signed-off-by: David Airlie <airlied@linux.ie>
2005-07-07drm: misc cleanupDave Airlie
This patch contains the following cleanups: - make needlessly global functions static - remove the following unused global functions: - drm_fops.c: drm_read - i915_dma.c: i915_do_cleanup_pageflip Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Dave Airlie <airlied@linux.ie>
2005-04-16Linux-2.6.12-rc2v2.6.12-rc2Linus Torvalds
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!