summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2006-10-17Useful output on a FIFO error interrupt.Ben Skeggs
2006-10-17typoBen Skeggs
2006-10-17Remove the memory manager parameter from the put_block function, as thisThomas Hellstrom
2006-10-17Extend generality for more memory types.Thomas Hellstrom
2006-10-16dev->agp_buffer_map is not initialized for AGP DMA on savagesMichael Karcher
2006-10-17NV40: *Now* fifo ctx switching works for me..Ben Skeggs
2006-10-17NV40: FIFO context switching now WorksForMe(tm)Ben Skeggs
2006-10-17Setup NV40 RAMFC (in wrong location.. but anyway), rearrange the RAMFC setup ...Ben Skeggs
2006-10-17Some info on NV40's RAMFCBen Skeggs
2006-10-16Change Intel AGP memory type numbers.Thomas Hellstrom
2006-10-15Merge branch 'master' of git://anongit.freedesktop.org/git/mesa/drm into nouv...Stephane Marchesin
2006-10-14Again more work on context switches. They work, sometimes. And when they do t...Stephane Marchesin
2006-10-14remove config.h from build no longer exists kbuild does itDave Airlie
2006-10-14Add the missing breaks.Stephane Marchesin
2006-10-13Fix the fifo context size on nv10, nv20 and nv30.Stephane Marchesin
2006-10-14Fix some randomness in activating a second channel on NV40 (odd GET/PUT vals)...Ben Skeggs
2006-10-12Oops.Stephane Marchesin
2006-10-12Still more work on the context switching code.Stephane Marchesin
2006-10-12Bugfixes.Thomas Hellstrom
2006-10-12Simplify the AGP backend interface somewhat.Thomas Hellstrom
2006-10-12More work on the context switch code. Still doesn't work. I'm mostly convince...Stephane Marchesin
2006-10-11Compatibility code for 2.6.15-2.6.18. It is ugly but a little comfort is thatThomas Hellstrom
2006-10-11Big update:Thomas Hellstrom
2006-10-11Context switching work.Stephane Marchesin
2006-10-10Use a nopage-based approach to fault in pfns.Thomas Hellstrom
2006-10-10only allow specific type-3 packets to pass the verifier instead of all for r1...Roland Scheidegger
2006-10-03Get rid of all ugly PTE hacks.Thomas Hellstrom
2006-10-02Bug 6242: [mach64] Use private DMA buffers, part #4.George Sapountzis
2006-10-02Bug 6242: [mach64] Use private DMA buffers, part #3.George Sapountzis
2006-10-02Bug 6242: [mach64] Use private DMA buffers, part #2.George Sapountzis
2006-10-02Bug 6242: [mach64] Use private DMA buffers, part #1.George Sapountzis
2006-10-02Bug 6209: [mach64] AGP DMA buffers not mapped correctly.George Sapountzis
2006-10-02Fix type of second argument to spin_lock_irqsave().Michel Dänzer
2006-10-02Fix type of second argument to spin_lock_irqsave().Michel Dänzer
2006-10-02Make the user_token 44-bit for TTMs, and have them occupy a unique file spaceThomas Hellstrom
2006-10-02Add a buffer object manager for TTM maps.Thomas Hellstrom
2006-10-02Allow for 44 bit user-tokens (or drm_file offsets)Thomas Hellstrom
2006-10-02Add a comment to previos commit.Thomas Hellstrom
2006-10-02Trap and be verbose about a deadlock that occurs with AIGLX and drivers thatThomas Hellstrom
2006-10-02drm_rmdraw: Declare id and idx as signed so testing for < 0 works as intended.Felix Kühling
2006-10-02Make locked tasklet handling more robust.Michel Dänzer
2006-10-02drm_rmdraw: Declare id and idx as signed so testing for < 0 works as intended.Felix Kühling
2006-09-29Bump driver date.Thomas Hellstrom
2006-09-29i915: Only schedule vblank tasklet if there are scheduled swaps pending.Michel Dänzer
2006-09-29i915: Only initialize IRQ fields in postinstall, not the PIPE_SET ioctl.Michel Dänzer
2006-09-29i915: Bump minor again to differentiate from vsync changes.Michel Dänzer
2006-09-29i915: Avoid mis-counting vblank interrupts when they're only enabled for pipe A.Michel Dänzer
2006-09-29i915: Bump minor for swap scheduling ioctl and secondary vblank support.Michel Dänzer
2006-09-29i915_vblank_swap: Add support for DRM_VBLANK_NEXTONMISS.Michel Dänzer
2006-09-29Only return EBUSY after we've established we need to schedule a new swap.Michel Dänzer
h <faith@valinux.com> * \author Gareth Hughes <gareth@valinux.com> */ /* * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ #include "drmP.h" typedef struct drm_mem_stats { const char *name; int succeed_count; int free_count; int fail_count; unsigned long bytes_allocated; unsigned long bytes_freed; } drm_mem_stats_t; static spinlock_t drm_mem_lock = SPIN_LOCK_UNLOCKED; static unsigned long drm_ram_available = 0; /* In pages */ static unsigned long drm_ram_used = 0; static drm_mem_stats_t drm_mem_stats[] = { [DRM_MEM_DMA] = {"dmabufs"}, [DRM_MEM_SAREA] = {"sareas"}, [DRM_MEM_DRIVER] = {"driver"}, [DRM_MEM_MAGIC] = {"magic"}, [DRM_MEM_IOCTLS] = {"ioctltab"}, [DRM_MEM_MAPS] = {"maplist"}, [DRM_MEM_VMAS] = {"vmalist"}, [DRM_MEM_BUFS] = {"buflist"}, [DRM_MEM_SEGS] = {"seglist"}, [DRM_MEM_PAGES] = {"pagelist"}, [DRM_MEM_FILES] = {"files"}, [DRM_MEM_QUEUES] = {"queues"}, [DRM_MEM_CMDS] = {"commands"}, [DRM_MEM_MAPPINGS] = {"mappings"}, [DRM_MEM_BUFLISTS] = {"buflists"}, [DRM_MEM_AGPLISTS] = {"agplist"}, [DRM_MEM_SGLISTS] = {"sglist"}, [DRM_MEM_TOTALAGP] = {"totalagp"}, [DRM_MEM_BOUNDAGP] = {"boundagp"}, [DRM_MEM_CTXBITMAP] = {"ctxbitmap"}, [DRM_MEM_CTXLIST] = {"ctxlist"}, [DRM_MEM_STUB] = {"stub"}, {NULL, 0,} /* Last entry must be null */ }; void drm_mem_init (void) { drm_mem_stats_t *mem; struct sysinfo si; for (mem = drm_mem_stats; mem->name; ++mem) { mem->succeed_count = 0; mem->free_count = 0; mem->fail_count = 0; mem->bytes_allocated = 0; mem->bytes_freed = 0; } si_meminfo(&si); drm_ram_available = si.totalram; drm_ram_used = 0; } /* drm_mem_info is called whenever a process reads /dev/drm/mem. */ static int drm__mem_info (char *buf, char **start, off_t offset, int request, int *eof, void *data) { drm_mem_stats_t *pt; int len = 0; if (offset > DRM_PROC_LIMIT) { *eof = 1; return 0; } *eof = 0; *start = &buf[offset]; DRM_PROC_PRINT(" total counts " " | outstanding \n"); DRM_PROC_PRINT("type alloc freed fail bytes freed" " | allocs bytes\n\n"); DRM_PROC_PRINT("%-9.9s %5d %5d %4d %10lu kB |\n", "system", 0, 0, 0, drm_ram_available << (PAGE_SHIFT - 10)); DRM_PROC_PRINT("%-9.9s %5d %5d %4d %10lu kB |\n", "locked", 0, 0, 0, drm_ram_used >> 10); DRM_PROC_PRINT("\n"); for (pt = drm_mem_stats; pt->name; pt++) { DRM_PROC_PRINT("%-9.9s %5d %5d %4d %10lu %10lu | %6d %10ld\n", pt->name, pt->succeed_count, pt->free_count, pt->fail_count, pt->bytes_allocated, pt->bytes_freed, pt->succeed_count - pt->free_count, (long)pt->bytes_allocated - (long)pt->bytes_freed); } if (len > request + offset) return request; *eof = 1; return len - offset; } int drm_mem_info (char *buf, char **start, off_t offset, int len, int *eof, void *data) { int ret; spin_lock(&drm_mem_lock); ret = drm__mem_info (buf, start, offset, len, eof, data); spin_unlock(&drm_mem_lock); return ret; } void *drm_alloc (size_t size, int area) { void *pt; if (!size) { DRM_MEM_ERROR(area, "Allocating 0 bytes\n"); return NULL; } if (!(pt = kmalloc(size, GFP_KERNEL))) { spin_lock(&drm_mem_lock); ++drm_mem_stats[area].fail_count; spin_unlock(&drm_mem_lock); return NULL; } spin_lock(&drm_mem_lock); ++drm_mem_stats[area].succeed_count; drm_mem_stats[area].bytes_allocated += size; spin_unlock(&drm_mem_lock); return pt; } void *drm_calloc (size_t nmemb, size_t size, int area) { void *addr; addr = drm_alloc (nmemb * size, area); if (addr != NULL) memset((void *)addr, 0, size * nmemb); return addr; } void *drm_realloc (void *oldpt, size_t oldsize, size_t size, int area) { void *pt; if (!(pt = drm_alloc (size, area))) return NULL; if (oldpt && oldsize) { memcpy(pt, oldpt, oldsize); drm_free (oldpt, oldsize, area); } return pt; } void drm_free (void *pt, size_t size, int area) { int alloc_count; int free_count;