summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2008-02-29drm: change fb api to take a bo handle not the bo pointer.Dave Airlie
2008-02-29agp: export the correct symbolDave Airlie
2008-02-28Add a compat kmap_atomic_prot_pfn to do quick kernel map / unmaps ofThomas Hellstrom
PCI- or high memory. This is substantially more efficient than drm_bo_kmap, since the mapping only lives on a single processor. Unmapping is done use kunmap_atomic(). Flushes only a single tlb() entry. Add a support utility int drm_bo_pfn_prot() that returns the pfn and desired page protection for a given bo offset. This is all intended for relocations in bound TTMS or vram. Mapping-accessing-unmapping must be atomic, either using preempt_xx() macros or a spinlock.
2008-02-28Initial commit.Thomas Hellstrom
2008-02-28Add a compat kmap_atomic_prot_pfn to do quick kernel map / unmaps ofThomas Hellstrom
PCI- or high memory. This is substantially more efficient than drm_bo_kmap, since the mapping only lives on a single processor. Unmapping is done use kunmap_atomic(). Flushes only a single tlb() entry. Add a support utility int drm_bo_pfn_prot() that returns the pfn and desired page protection for a given bo offset. This is all intended for relocations in bound TTMS or vram. Mapping-accessing-unmapping must be atomic, either using preempt_xx() macros or a spinlock.
2008-02-28drm: add modesetting as a driver feature.Dave Airlie
This change adds a driver feature that for i915 is controlled by a module parameter. You now need to do insmod i915.ko modeset=1 to enable it the modesetting paths. It also fixes up lots of X paths. I can run my new DDX driver on this code with and without modesetting enabled
2008-02-28drm: add a check for if modesetting is supported.Dave Airlie
This is Linux only code, it just uses sysfs to see if a control device has been registered on the requested PCI ID
2008-02-27Reinstate buffer idle before applying relocations.Thomas Hellstrom
2008-02-27Don't wait for buffer idle before applying relocations.Thomas Hellstrom
2008-02-26radeon: remove TTM from an earlier mergeJerome Glisse
2008-02-26Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into ↵Alan Hourihane
modesetting-101 Conflicts: shared-core/i915_dma.c
2008-02-26DRM_INFO -> DRM_DEBUGAlan Hourihane
2008-02-26DRM_INFO -> DRM_DEBUGAlan Hourihane
2008-02-26define PRETHAWAlan Hourihane
2008-02-26Implement short circuit for base change onlyAlan Hourihane
Allow mode to be set with fb_id set to -1, meaning set the mode with the current fb (if we have one bound). Allow intelfb to hook back up it's fb if modesetting clears it (maybe temporary). Move any crtc->fb related register changes to set_base in intel_fb. General intelfb cleanups.
2008-02-26[i915] Relocation fixes.Thomas Hellstrom
2008-02-26i915: fix typosDave Airlie
2008-02-26i915_mmio: add overlay regsDave Airlie
2008-02-26drm: fix pick crtcs mode selection codeDave Airlie
2008-02-26Make the execbuffer code reasonably safe against errors.Thomas Hellstrom
In particular -EAGAINs, which should be common during Xserver operation. Also handle the fence creation failure case.
2008-02-23fix texture uploads with large 3d textures (bug 13980)Roland Scheidegger
Texture uploads could hit the blitter coordinate limit, adjust the texture offset when uploading the pieces. Make sure to check the end address of the upload too.
2008-02-22i915: put ARX back into index mode before doing restoreJesse Barnes
Fixes resume from hibernate in some configurations.
2008-02-22nouveau: Remove some random (french) comment.Maarten Maathuis
2008-02-22nouveau: A single define of dma skips is more than enough.Maarten Maathuis
2008-02-22Fix one last occurance of struct _drm_i915_batchbuffer.Kristian Høgsberg
Thanks to Todd Merrill for pointing it out.
2008-02-22silence warningAlan Hourihane
2008-02-22i915: Remove leading underscore from struct tags.Kristian Høgsberg
This matches the changes in mesa to use the system drm includes for the definitions of the drm ioctl structs.
2008-02-22modesetting: fix memory leak and misallocationDave Airlie
2008-02-22add ioctl to get back memory managed area sized - used for kernel inited areasDave Airlie
2008-02-22hopefully shit works now without this...Dave Airlie
2008-02-21Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into ↵Alan Hourihane
modesetting-101
2008-02-21Don't free irq resources until after we've unregistered the handler.Kristian Høgsberg
2008-02-21Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into ↵Alan Hourihane
modesetting-101 Conflicts: linux-core/drm_sysfs.c
2008-02-21linux: Clean up vblank related resources from drm_irq_uninstall().Michel Dänzer
This fixes at least two problems: * The vblank_disable_fn timer callback could get called after the DRM was de-initialized, e.g. on X server shutdown. * Leak of vblank related resources when disabling and re-enabling the IRQ, e.g. on an X server reset.
2008-02-20fix SAREAAlan Hourihane
2008-02-20fix SAREAAlan Hourihane
2008-02-20minor test fixesAlan Hourihane
2008-02-20compatibility code for pci_get_bus_and_slot()Alan Hourihane
2008-02-20remove more offsetDave Airlie
2008-02-20drm/fb: get rid of offset from structure use bo offsetDave Airlie
2008-02-20ttm: make sure userspace can't destroy kernel create memory managersDave Airlie
2008-02-20drm: add support for passing state into the suspend hooks.Dave Airlie
fix i915 driver to use state for hibernate save avoidance. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-02-19Fix up conflicts for DRI2 (untested)Alan Hourihane
2008-02-18Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into ↵Alan Hourihane
modesetting-101 Conflicts: linux-core/i915_fence.c linux-core/via_fence.c shared-core/i915_dma.c shared-core/i915_drv.h shared-core/i915_irq.c
2008-02-16[915]: more registers for S3 (DSPCLK_GATE_D, CACHE_MODE_0, MI_ARB_STATE)Keith Packard
Failing to preserve the MI_ARB_STATE register was causing FIFO underruns on the VGA output on my HP 2510p after resume.
2008-02-16nouveau: no GART on ia64 either.Stephane Marchesin
2008-02-15i915: initial (and untested) TV out supportJesse Barnes
Ported from xf86-video-intel. Still need to tie in TV modes somehow, though preferably w/o using the properties mechanism.
2008-02-16nv40: actually init all tile regs.Ben Skeggs
2008-02-15fb: fixup the offset by getting it from the right placeDave Airlie
2008-02-15various fixes from trying to get userspace startedDave Airlie
span class="hl ppc">#define HASH_ALLOC drmMalloc #define HASH_FREE drmFree #define HASH_RANDOM_DECL void *state #define HASH_RANDOM_INIT(seed) state = drmRandomCreate(seed) #define HASH_RANDOM drmRandom(state) #define HASH_RANDOM_DESTROY drmRandomDestroy(state) #endif typedef struct HashBucket { unsigned long key; void *value; struct HashBucket *next; } HashBucket, *HashBucketPtr; typedef struct HashTable { unsigned long magic; unsigned long entries; unsigned long hits; /* At top of linked list */ unsigned long partials; /* Not at top of linked list */ unsigned long misses; /* Not in table */ HashBucketPtr buckets[HASH_SIZE]; int p0; HashBucketPtr p1; } HashTable, *HashTablePtr; #if HASH_MAIN extern void *drmHashCreate(void); extern int drmHashDestroy(void *t); extern int drmHashLookup(void *t, unsigned long key, unsigned long *value); extern int drmHashInsert(void *t, unsigned long key, unsigned long value); extern int drmHashDelete(void *t, unsigned long key); #endif static unsigned long HashHash(unsigned long key) { unsigned long hash = 0; unsigned long tmp = key; static int init = 0; static unsigned long scatter[256]; int i; if (!init) { HASH_RANDOM_DECL; HASH_RANDOM_INIT(37); for (i = 0; i < 256; i++) scatter[i] = HASH_RANDOM; HASH_RANDOM_DESTROY; ++init; } while (tmp) { hash = (hash << 1) + scatter[tmp & 0xff]; tmp >>= 8; } hash %= HASH_SIZE; #if HASH_DEBUG printf( "Hash(%d) = %d\n", key, hash); #endif return hash; } void *drmHashCreate(void) { HashTablePtr table; int i; table = HASH_ALLOC(sizeof(*table)); if (!table) return NULL; table->magic = HASH_MAGIC; table->entries = 0; table->hits = 0; table->partials = 0; table->misses = 0; for (i = 0; i < HASH_SIZE; i++) table->buckets[i] = NULL; return table; } int drmHashDestroy(void *t) { HashTablePtr table = (HashTablePtr)t; HashBucketPtr bucket; HashBucketPtr next; int i; if (table->magic != HASH_MAGIC) return -1; /* Bad magic */ for (i = 0; i < HASH_SIZE; i++) { for (bucket = table->buckets[i]; bucket;) { next = bucket->next; HASH_FREE(bucket); bucket = next; } } HASH_FREE(table); return 0; } /* Find the bucket and organize the list so that this bucket is at the top. */ static HashBucketPtr HashFind(HashTablePtr table, unsigned long key, unsigned long *h) { unsigned long hash = HashHash(key); HashBucketPtr prev = NULL; HashBucketPtr bucket; if (h) *h = hash; for (bucket = table->buckets[hash]; bucket; bucket = bucket->next) { if (bucket->key == key) { if (prev) { /* Organize */ prev->next = bucket->next; bucket->next = table->buckets[hash]; table->buckets[hash] = bucket; ++table->partials; } else { ++table->hits; } return bucket; } prev = bucket; } ++table->misses; return NULL; } int drmHashLookup(void *t, unsigned long key, void **value) { HashTablePtr table = (HashTablePtr)t; HashBucketPtr bucket; if (!table || table->magic != HASH_MAGIC) return -1; /* Bad magic */ bucket = HashFind(table, key, NULL); if (!bucket) return 1; /* Not found */ *value = bucket->value; return 0; /* Found */ } int drmHashInsert(void *t, unsigned long key, void *value) { HashTablePtr table = (HashTablePtr)t; HashBucketPtr bucket; unsigned long hash; if (table->magic != HASH_MAGIC) return -1; /* Bad magic */ if (HashFind(table, key, &hash)) return 1; /* Already in table */ bucket = HASH_ALLOC(sizeof(*bucket)); if (!bucket) return -1; /* Error */ bucket->key = key; bucket->value = value; bucket->next = table->buckets[hash]; table->buckets[hash] = bucket; #if HASH_DEBUG printf("Inserted %d at %d/%p\n", key, hash, bucket); #endif return 0; /* Added to table */ } int drmHashDelete(void *t, unsigned long key) { HashTablePtr table = (HashTablePtr)t; unsigned long hash; HashBucketPtr bucket; if (table->magic != HASH_MAGIC) return -1; /* Bad magic */ bucket = HashFind(table, key, &hash); if (!bucket) return 1; /* Not found */ table->buckets[hash] = bucket->next; HASH_FREE(bucket); return 0; } int drmHashNext(void *t, unsigned long *key, void **value) { HashTablePtr table = (HashTablePtr)t; while (table->p0 < HASH_SIZE) { if (table->p1) { *key = table->p1->key; *value = table->p1->value; table->p1 = table->p1->next; return 1; } table->p1 = table->buckets[table->p0]; ++table->p0; } return 0; } int drmHashFirst(void *t, unsigned long *key, void **value) { HashTablePtr table = (HashTablePtr)t; if (table->magic != HASH_MAGIC) return -1; /* Bad magic */ table->p0 = 0; table->p1 = table->buckets[0]; return drmHashNext(table, key, value); } #if HASH_MAIN #define DIST_LIMIT 10 static int dist[DIST_LIMIT]; static void clear_dist(void) { int i; for (i = 0; i < DIST_LIMIT; i++) dist[i] = 0; } static int count_entries(HashBucketPtr bucket) { int count = 0; for (; bucket; bucket = bucket->next) ++count; return count; } static void update_dist(int count) { if (count >= DIST_LIMIT) ++dist[DIST_LIMIT-1]; else ++dist[count]; } static void compute_dist(HashTablePtr table) { int i; HashBucketPtr bucket; printf("Entries = %ld, hits = %ld, partials = %ld, misses = %ld\n", table->entries, table->hits, table->partials, table->misses); clear_dist(); for (i = 0; i < HASH_SIZE; i++) { bucket = table->buckets[i]; update_dist(count_entries(bucket)); } for (i = 0; i < DIST_LIMIT; i++) { if (i != DIST_LIMIT-1) printf("%5d %10d\n", i, dist[i]); else printf("other %10d\n", dist[i]); } } static void check_table(HashTablePtr table, unsigned long key, unsigned long value) { unsigned long retval = 0; int retcode = drmHashLookup(table, key, &retval); switch (retcode) { case -1: printf("Bad magic = 0x%08lx:" " key = %lu, expected = %lu, returned = %lu\n", table->magic, key, value, retval); break; case 1: printf("Not found: key = %lu, expected = %lu returned = %lu\n", key, value, retval); break; case 0: if (value != retval) printf("Bad value: key = %lu, expected = %lu, returned = %lu\n", key, value, retval); break; default: printf("Bad retcode = %d: key = %lu, expected = %lu, returned = %lu\n", retcode, key, value, retval); break; } } int main(void) { HashTablePtr table; int i; printf("\n***** 256 consecutive integers ****\n"); table = drmHashCreate(); for (i = 0; i < 256; i++) drmHashInsert(table, i, i); for (i = 0; i < 256; i++) check_table(table, i, i); for (i = 256; i >= 0; i--) check_table(table, i, i); compute_dist(table); drmHashDestroy(table); printf("\n***** 1024 consecutive integers ****\n"); table = drmHashCreate(); for (i = 0; i < 1024; i++) drmHashInsert(table, i, i); for (i = 0; i < 1024; i++) check_table(table, i, i); for (i = 1024; i >= 0; i--) check_table(table, i, i); compute_dist(table); drmHashDestroy(table); printf("\n***** 1024 consecutive page addresses (4k pages) ****\n"); table = drmHashCreate(); for (i = 0; i < 1024; i++) drmHashInsert(table, i*4096, i); for (i = 0; i < 1024; i++) check_table(table, i*4096, i); for (i = 1024; i >= 0; i--) check_table(table, i*4096, i); compute_dist(table); drmHashDestroy(table); printf("\n***** 1024 random integers ****\n"); table = drmHashCreate(); srandom(0xbeefbeef);