summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2004-05-18add R200_EMIT_RB3D_BLENDCOLOR state packet to support GL_EXT_blend_color,Roland Scheidegger
2004-05-18another 2.4 fixDave Airlie
2004-05-182.4 compat fixDave Airlie
2004-05-14Add PCI id entry for VIA CN400 (UnichromePro) chip. XFree86 bug: ReportedErdi Chen
2004-05-11Merge from FreeBSD-current. Mostly 64-bit cleanliness fixes, but a fewEric Anholt
2004-05-11Add missing DRM_ERR()s.Eric Anholt
2004-05-10do some real testing and fix the DRM initialising and unloadingDave Airlie
2004-05-09Add mach64 DRM module for BSD (untested, but compiles).Eric Anholt
2004-05-09Add .cvsignore files.Eric Anholt
2004-05-09Warning fixes.Eric Anholt
2004-05-09- Link in shared files as necessary and clean them up.Eric Anholt
2004-05-09Catch up with sis's DRM tag change.Eric Anholt
2004-05-09Remove after repocopy to Makefile, now that we don't have to worry aboutEric Anholt
2004-05-09No /bin/bash on BSD.Eric Anholt
2004-05-09drm_hw_lock_t is now defined in drm.h, remove from here.Eric Anholt
2004-05-09Commit sysfs and drm PCI changes for 2.6 kernelDave Airlie
2004-05-09make drm pciidsDave Airlie
2004-05-03use drm.. not dri for class...Dave Airlie
2004-05-02fix 2.4 buildDave Airlie
2004-05-02better device class support from Jon Smirls patches..Dave Airlie
2004-04-26add another tdfxDave Airlie
2004-04-22Add __user annotations from kernelDave Airlie
2004-04-22add sparc ffb files from kernel just to keep things in syncDave Airlie
2004-04-21add new files to generate pci idsDave Airlie
2004-04-21bug from Linux kernel list caught by checkerDave Airlie
2004-04-21centralise pci ids into one place and use scripts to generate files forDave Airlie
2004-04-18Move Makefile.linux to Makefile.Michel Daenzer
2004-04-121. Added a PCI ID.Thomas Hellstrom
2004-04-12more files for mach64Dave Airlie
2004-04-12Add mach64 to the trunkDave Airlie
2004-04-10Have CVS ignore some files produced by the build.Michel Daenzer
2004-04-10white space changes to align with kernelDave Airlie
2004-04-10include highmem.hDave Airlie
2004-04-10update gamma_dma with patch from davej in 2.6Dave Airlie
2004-04-10patch from Andrew Morton tree from Arjan van de Ven fixes some oopses seenDave Airlie
2004-04-10align code with Linux kernel.Dave Airlie
2004-04-10remove unused codeDave Airlie
2004-04-10update from linux kernel for ia64Dave Airlie
2004-04-09remove ImakefileAlan Hourihane
2004-04-08fix build problemAlan Hourihane
2004-04-08disable PCI DMA ioctls as they are not used currently until SAVAGE_CMD_DMAAlan Hourihane
2004-04-08big whitespace .. this aligns all the whitespace in this file with the bkDave Airlie
2004-04-082.6 sysfs patches + stubs in drmP.h for 2.4 compatibilityDave Airlie
2004-04-08long dev_t patches from 2.6 treeDave Airlie
2004-04-082.6 patches for larger dev_tDave Airlie
2004-04-08more 2.4 compat fnsDave Airlie
2004-04-08patch from Linux kernel 2.6.5Dave Airlie
2004-04-08fixes from Linux kernelDave Airlie
2004-04-08patch from lkDave Airlie
2004-03-31VIA module fixes:Thomas Hellstrom
t">("Out of memory for hash table\n"); return -ENOMEM; } for (i = 0; i < ht->size; ++i) { INIT_HLIST_HEAD(&ht->table[i]); } return 0; } void drm_ht_verbose_list(struct drm_open_hash *ht, unsigned long key) { struct drm_hash_item *entry; struct hlist_head *h_list; struct hlist_node *list; unsigned int hashed_key; int count = 0; hashed_key = hash_long(key, ht->order); DRM_DEBUG("Key is 0x%08lx, Hashed key is 0x%08x\n", key, hashed_key); h_list = &ht->table[hashed_key]; hlist_for_each(list, h_list) { entry = hlist_entry(list, struct drm_hash_item, head); DRM_DEBUG("count %d, key: 0x%08lx\n", count++, entry->key); } } static struct hlist_node *drm_ht_find_key(struct drm_open_hash *ht, unsigned long key) { struct drm_hash_item *entry; struct hlist_head *h_list; struct hlist_node *list; unsigned int hashed_key; hashed_key = hash_long(key, ht->order); h_list = &ht->table[hashed_key]; hlist_for_each(list, h_list) { entry = hlist_entry(list, struct drm_hash_item, head); if (entry->key == key) return list; if (entry->key > key) break; } return NULL; } int drm_ht_insert_item(struct drm_open_hash *ht, struct drm_hash_item *item) { struct drm_hash_item *entry; struct hlist_head *h_list; struct hlist_node *list, *parent; unsigned int hashed_key; unsigned long key = item->key; hashed_key = hash_long(key, ht->order); h_list = &ht->table[hashed_key]; parent = NULL; hlist_for_each(list, h_list) { entry = hlist_entry(list, struct drm_hash_item, head); if (entry->key == key) return -EINVAL; if (entry->key > key) break; parent = list; } if (parent) { hlist_add_after(parent, &item->head); } else { hlist_add_head(&item->head, h_list); } return 0; } /* * Just insert an item and return any "bits" bit key that hasn't been * used before. */ int drm_ht_just_insert_please(struct drm_open_hash *ht, struct drm_hash_item *item, unsigned long seed, int bits, int shift, unsigned long add) { int ret; unsigned long mask = (1 << bits) - 1; unsigned long first, unshifted_key; unshifted_key = hash_long(seed, bits); first = unshifted_key; do { item->key = (unshifted_key << shift) + add; ret = drm_ht_insert_item(ht, item); if (ret) unshifted_key = (unshifted_key + 1) & mask; } while (ret && (unshifted_key != first)); if (ret) { DRM_ERROR("Available key bit space exhausted\n"); return -EINVAL; } return 0; } int drm_ht_find_item(struct drm_open_hash *ht, unsigned long key, struct drm_hash_item **item) { struct hlist_node *list; list = drm_ht_find_key(ht, key); if (!list) return -EINVAL; *item = hlist_entry(list, struct drm_hash_item, head); return 0; } int drm_ht_remove_key(struct drm_open_hash *ht, unsigned long key) { struct hlist_node *list; list = drm_ht_find_key(ht, key); if (list) { hlist_del_init(list); ht->fill--; return 0; } return -EINVAL; } int drm_ht_remove_item(struct drm_open_hash *ht, struct drm_hash_item *item) { hlist_del_init(&item->head); ht->fill--; return 0; } void drm_ht_remove(struct drm_open_hash *ht) { if (ht->table) { if (ht->use_vmalloc) vfree(ht->table); else drm_free(ht->table, ht->size * sizeof(*ht->table), DRM_MEM_HASHTAB); ht->table = NULL; } }