From: <da...@ke...> - 2006-07-19 16:34:44
|
.cvsignore | 17 ------- .gitignore | 99 +++++++++++++++++++++++++++++++++++++++++++++ bsd-core/.cvsignore | 1 bsd-core/drm/.cvsignore | 8 --- bsd-core/i915/.cvsignore | 8 --- bsd-core/mach64/.cvsignore | 8 --- bsd-core/mga/.cvsignore | 8 --- bsd-core/r128/.cvsignore | 8 --- bsd-core/radeon/.cvsignore | 8 --- bsd-core/savage/.cvsignore | 8 --- bsd-core/sis/.cvsignore | 8 --- bsd-core/tdfx/.cvsignore | 8 --- bsd-core/via/.cvsignore | 8 --- libdrm/.cvsignore | 8 --- linux-core/.cvsignore | 6 -- linux/.cvsignore | 6 -- shared-core/.cvsignore | 2 17 files changed, 99 insertions(+), 120 deletions(-) New commits: diff-tree b9243ce3d5ed6bd70851a132871387d4d2e886bc (from 126673d62afad6da84e833daa644a352d88a5e37) Author: Michel Dänzer <mi...@tu...> Date: Wed Jul 19 18:31:43 2006 +0200 .cvsignore -> .gitignore Sort the merged file, remove the redundant explicit .ko lines and add some generated symlinks. diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index 7f5efb6..0000000 --- a/.cvsignore +++ /dev/null @@ -1,17 +0,0 @@ -Makefile -Makefile.in -aclocal.m4 -autom4te.cache -compile -config.guess -config.log -config.status -config.sub -configure -depcomp -install-sh -libtool -ltmain.sh -missing -mkinstalldirs -libdrm.pc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..333bbad --- /dev/null +++ b/.gitignore @@ -0,0 +1,99 @@ +*-core/linux +*-core/drm.h +*-core/drm_sarea.h +*-core/i915_dma.c +*-core/i915_drm.h +*-core/i915_drv.h +*-core/i915_irq.c +*-core/i915_mem.c +*-core/mach64_dma.c +*-core/mach64_drm.h +*-core/mach64_drv.h +*-core/mach64_irq.c +*-core/mach64_state.c +*-core/mga_dma.c +*-core/mga_drm.h +*-core/mga_drv.h +*-core/mga_irq.c +*-core/mga_state.c +*-core/mga_ucode.h +*-core/mga_warp.c +*-core/nv_drv.h +*-core/r128_cce.c +*-core/r128_drm.h +*-core/r128_drv.h +*-core/r128_irq.c +*-core/r128_state.c +*-core/r300_cmdbuf.c +*-core/r300_reg.h +*-core/radeon_cp.c +*-core/radeon_drm.h +*-core/radeon_drv.h +*-core/radeon_irq.c +*-core/radeon_mem.c +*-core/radeon_state.c +*-core/savage_bci.c +*-core/savage_drm.h +*-core/savage_drv.h +*-core/savage_state.c +*-core/sis_drm.h +*-core/sis_drv.h +*-core/tdfx_drv.h +*-core/via_3d_reg.h +*-core/via_dma.c +*-core/via_drm.h +*-core/via_drv.c +*-core/via_drv.h +*-core/via_irq.c +*-core/via_map.c +*-core/via_verifier.c +*-core/via_verifier.h +*-core/via_video.c +*.flags +*.ko +*.ko.cmd +*.la +*.lo +*.mod.c +*.mod.o +*.o +*.o.cmd +.depend +.deps +.libs +.tmp_versions +Makefile +Makefile.in +aclocal.m4 +autom4te.cache +bus_if.h +compile +config.guess +config.h +config.log +config.status +config.sub +configure +depcomp +device_if.h +drm.kld +drm_pciids.h +export_syms +i915.kld +install-sh +libdrm.pc +libtool +ltmain.sh +mach64.kld +mga.kld +missing +mkinstalldirs +opt_drm.h +pci_if.h +r128.kld +radeon.kld +savage.kld +sis.kld +stamp-h1 +tdfx.kld +via.kld diff --git a/bsd-core/.cvsignore b/bsd-core/.cvsignore deleted file mode 100644 index c196cbc..0000000 --- a/bsd-core/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -drm_pciids.h diff --git a/bsd-core/drm/.cvsignore b/bsd-core/drm/.cvsignore deleted file mode 100644 index 806f346..0000000 --- a/bsd-core/drm/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -.depend -bus_if.h -device_if.h -export_syms -opt_drm.h -pci_if.h -drm.kld -drm.ko diff --git a/bsd-core/i915/.cvsignore b/bsd-core/i915/.cvsignore deleted file mode 100644 index 350f6c6..0000000 --- a/bsd-core/i915/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -.depend -bus_if.h -device_if.h -export_syms -opt_drm.h -pci_if.h -i915.kld -i915.ko diff --git a/bsd-core/mach64/.cvsignore b/bsd-core/mach64/.cvsignore deleted file mode 100644 index b9a7055..0000000 --- a/bsd-core/mach64/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -.depend -bus_if.h -device_if.h -export_syms -opt_drm.h -pci_if.h -mach64.kld -mach64.ko diff --git a/bsd-core/mga/.cvsignore b/bsd-core/mga/.cvsignore deleted file mode 100644 index 0da9b11..0000000 --- a/bsd-core/mga/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -.depend -bus_if.h -device_if.h -export_syms -opt_drm.h -pci_if.h -mga.kld -mga.ko diff --git a/bsd-core/r128/.cvsignore b/bsd-core/r128/.cvsignore deleted file mode 100644 index 0ee047d..0000000 --- a/bsd-core/r128/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -.depend -bus_if.h -device_if.h -export_syms -opt_drm.h -pci_if.h -r128.kld -r128.ko diff --git a/bsd-core/radeon/.cvsignore b/bsd-core/radeon/.cvsignore deleted file mode 100644 index 83df81d..0000000 --- a/bsd-core/radeon/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -.depend -bus_if.h -device_if.h -export_syms -opt_drm.h -pci_if.h -radeon.kld -radeon.ko diff --git a/bsd-core/savage/.cvsignore b/bsd-core/savage/.cvsignore deleted file mode 100644 index 67e39f6..0000000 --- a/bsd-core/savage/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -.depend -bus_if.h -device_if.h -export_syms -opt_drm.h -pci_if.h -savage.kld -savage.ko diff --git a/bsd-core/sis/.cvsignore b/bsd-core/sis/.cvsignore deleted file mode 100644 index 7495508..0000000 --- a/bsd-core/sis/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -.depend -bus_if.h -device_if.h -export_syms -opt_drm.h -pci_if.h -sis.kld -sis.ko diff --git a/bsd-core/tdfx/.cvsignore b/bsd-core/tdfx/.cvsignore deleted file mode 100644 index bf7cb76..0000000 --- a/bsd-core/tdfx/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -.depend -bus_if.h -device_if.h -export_syms -opt_drm.h -pci_if.h -tdfx.kld -tdfx.ko diff --git a/bsd-core/via/.cvsignore b/bsd-core/via/.cvsignore deleted file mode 100644 index 7a23987..0000000 --- a/bsd-core/via/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -.depend -bus_if.h -device_if.h -export_syms -opt_drm.h -pci_if.h -via.kld -via.ko diff --git a/libdrm/.cvsignore b/libdrm/.cvsignore deleted file mode 100644 index a979bc4..0000000 --- a/libdrm/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -config.h -*.la -*.lo -stamp-h1 diff --git a/linux-core/.cvsignore b/linux-core/.cvsignore deleted file mode 100644 index c68a92a..0000000 --- a/linux-core/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -*.ko -*.mod.c -*.o.cmd -*.ko.cmd -.tmp_versions -drm_pciids.h diff --git a/linux/.cvsignore b/linux/.cvsignore deleted file mode 100644 index fb0ce5d..0000000 --- a/linux/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -*.ko -*.ko.cmd -*.o.cmd -*.mod.c -*.flags -drm_pciids.h diff --git a/shared-core/.cvsignore b/shared-core/.cvsignore deleted file mode 100644 index 282522d..0000000 --- a/shared-core/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in |
From: <aj...@ke...> - 2006-07-19 20:37:43
|
shared-core/radeon_cp.c | 5 +++++ 1 files changed, 5 insertions(+) New commits: diff-tree af7b89d7246efbed7d05c38fcaa6a13c4b89db90 (from d5e0f8bdaf8769642950b8219f0e80f6b523817d) Author: Adam Jackson <aj...@th...> Date: Wed Jul 19 15:35:31 2006 -0400 Make sure busmastering gets disabled on module unload. diff --git a/shared-core/radeon_cp.c b/shared-core/radeon_cp.c index 695b5ec..299ec6a 100644 --- a/shared-core/radeon_cp.c +++ b/shared-core/radeon_cp.c @@ -1719,6 +1719,11 @@ static int radeon_do_cleanup_cp(drm_devi dev_priv->gart_info.addr = 0; } } + + /* Disable busmastering */ + RADEON_WRITE(RADEON_BUS_CNTL, RADEON_READ(RADEON_BUS_CNTL) | + RADEON_BUS_MASTER_DIS); + /* only clear to the start of flags */ memset(dev_priv, 0, offsetof(drm_radeon_private_t, flags)); |
From: <ai...@ke...> - 2006-07-24 00:51:13
|
linux-core/drmP.h | 7 ++-- linux-core/drm_auth.c | 14 ++++---- linux-core/drm_bufs.c | 82 +++++++++++++++++++++++------------------------ linux-core/drm_compat.h | 10 +++++ linux-core/drm_context.c | 44 ++++++++++++------------- linux-core/drm_drv.c | 4 +- linux-core/drm_fops.c | 12 +++--- linux-core/drm_ioctl.c | 18 +++++----- linux-core/drm_irq.c | 16 ++++----- linux-core/drm_proc.c | 20 +++++------ linux-core/drm_stub.c | 4 +- linux-core/drm_vm.c | 12 +++--- linux-core/sis_mm.c | 30 ++++++++--------- linux-core/via_mm.c | 32 +++++++++--------- 14 files changed, 159 insertions(+), 146 deletions(-) New commits: diff-tree 5cfbd5dbab4fe9668771377cb22da04c6103459e (from 6677e2a10b820a5ccfd375cc627b8e41453a71da) Author: Dave Airlie <ai...@li...> Date: Mon Jul 24 10:51:27 2006 +1000 switch drm to use Linux mutexes instead of semaphore. I hope the fallback compat code works if not shout at me. diff --git a/linux-core/drmP.h b/linux-core/drmP.h index fb0ba48..6cbb810 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -55,6 +55,9 @@ #include <linux/smp_lock.h> /* For (un)lock_kernel */ #include <linux/mm.h> #include <linux/pagemap.h> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) +#include <linux/mutex.h> +#endif #if defined(__alpha__) || defined(__powerpc__) #include <asm/pgtable.h> /* For pte_wrprotect */ #endif @@ -650,7 +653,7 @@ typedef struct drm_device { /** \name Locks */ /*@{ */ spinlock_t count_lock; /**< For inuse, drm_device::open_count, drm_device::buf_use */ - struct semaphore struct_sem; /**< For others */ + struct mutex struct_mutex; /**< For others */ /*@} */ /** \name Usage Counters */ @@ -687,7 +690,7 @@ typedef struct drm_device { /*@{ */ drm_ctx_list_t *ctxlist; /**< Linked list of context handles */ int ctx_count; /**< Number of context handles */ - struct semaphore ctxlist_sem; /**< For ctxlist */ + struct mutex ctxlist_mutex; /**< For ctxlist */ drm_map_t **context_sareas; /**< per-context SAREA's */ int max_context; diff --git a/linux-core/drm_auth.c b/linux-core/drm_auth.c index a6f7420..9c8db64 100644 --- a/linux-core/drm_auth.c +++ b/linux-core/drm_auth.c @@ -51,12 +51,12 @@ static drm_file_t *drm_find_file(drm_dev drm_magic_entry_t *pt; drm_hash_item_t *hash; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); if (!drm_ht_find_item(&dev->magiclist, (unsigned long) magic, &hash)) { pt = drm_hash_entry(hash, drm_magic_entry_t, hash_item); retval = pt->priv; } - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return retval; } @@ -84,10 +84,10 @@ static int drm_add_magic(drm_device_t *d memset(entry, 0, sizeof(*entry)); entry->priv = priv; entry->hash_item.key = (unsigned long) magic; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); drm_ht_insert_item(&dev->magiclist, &entry->hash_item); list_add_tail(&entry->head, &dev->magicfree); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return 0; } @@ -108,15 +108,15 @@ static int drm_remove_magic(drm_device_t DRM_DEBUG("%d\n", magic); - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); if (drm_ht_find_item(&dev->magiclist, (unsigned long) magic, &hash)) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return -EINVAL; } pt = drm_hash_entry(hash, drm_magic_entry_t, hash_item); drm_ht_remove_item(&dev->magiclist, hash); list_del(&pt->head); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC); diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c index 7dd46b6..a977b5b 100644 --- a/linux-core/drm_bufs.c +++ b/linux-core/drm_bufs.c @@ -283,7 +283,7 @@ static int drm_addmap_core(drm_device_t memset(list, 0, sizeof(*list)); list->map = map; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); list_add(&list->head, &dev->maplist->head); /* Assign a 32-bit handle */ @@ -295,12 +295,12 @@ static int drm_addmap_core(drm_device_t if (ret) { drm_free(map, sizeof(*map), DRM_MEM_MAPS); drm_free(list, sizeof(*list), DRM_MEM_MAPS); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return ret; } list->user_token = list->hash.key; - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); *maplist = list; return 0; @@ -431,9 +431,9 @@ int drm_rmmap(drm_device_t *dev, drm_loc { int ret; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); ret = drm_rmmap_locked(dev, map); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return ret; } @@ -462,7 +462,7 @@ int drm_rmmap_ioctl(struct inode *inode, return -EFAULT; } - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); list_for_each(list, &dev->maplist->head) { drm_map_list_t *r_list = list_entry(list, drm_map_list_t, head); @@ -478,24 +478,24 @@ int drm_rmmap_ioctl(struct inode *inode, * find anything. */ if (list == (&dev->maplist->head)) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return -EINVAL; } if (!map) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return -EINVAL; } /* Register and framebuffer maps are permanent */ if ((map->type == _DRM_REGISTERS) || (map->type == _DRM_FRAME_BUFFER)) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return 0; } ret = drm_rmmap_locked(dev, map); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return ret; } @@ -620,16 +620,16 @@ int drm_addbufs_agp(drm_device_t * dev, atomic_inc(&dev->buf_alloc); spin_unlock(&dev->count_lock); - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); entry = &dma->bufs[order]; if (entry->buf_count) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; /* May only call once for each order */ } if (count < 0 || count > 4096) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -EINVAL; } @@ -637,7 +637,7 @@ int drm_addbufs_agp(drm_device_t * dev, entry->buflist = drm_alloc(count * sizeof(*entry->buflist), DRM_MEM_BUFS); if (!entry->buflist) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; } @@ -670,7 +670,7 @@ int drm_addbufs_agp(drm_device_t * dev, /* Set count correctly so we free the proper amount. */ entry->buf_count = count; drm_cleanup_buf_error(dev, entry); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; } @@ -692,7 +692,7 @@ int drm_addbufs_agp(drm_device_t * dev, if (!temp_buflist) { /* Free the entry because it isn't valid */ drm_cleanup_buf_error(dev, entry); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; } @@ -710,7 +710,7 @@ int drm_addbufs_agp(drm_device_t * dev, DRM_DEBUG("dma->buf_count : %d\n", dma->buf_count); DRM_DEBUG("entry->buf_count : %d\n", entry->buf_count); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); request->count = entry->buf_count; request->size = size; @@ -776,16 +776,16 @@ int drm_addbufs_pci(drm_device_t * dev, atomic_inc(&dev->buf_alloc); spin_unlock(&dev->count_lock); - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); entry = &dma->bufs[order]; if (entry->buf_count) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; /* May only call once for each order */ } if (count < 0 || count > 4096) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -EINVAL; } @@ -793,7 +793,7 @@ int drm_addbufs_pci(drm_device_t * dev, entry->buflist = drm_alloc(count * sizeof(*entry->buflist), DRM_MEM_BUFS); if (!entry->buflist) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; } @@ -804,7 +804,7 @@ int drm_addbufs_pci(drm_device_t * dev, if (!entry->seglist) { drm_free(entry->buflist, count * sizeof(*entry->buflist), DRM_MEM_BUFS); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; } @@ -820,7 +820,7 @@ int drm_addbufs_pci(drm_device_t * dev, count * sizeof(*entry->buflist), DRM_MEM_BUFS); drm_free(entry->seglist, count * sizeof(*entry->seglist), DRM_MEM_SEGS); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; } @@ -846,7 +846,7 @@ int drm_addbufs_pci(drm_device_t * dev, drm_free(temp_pagelist, (dma->page_count + (count << page_order)) * sizeof(*dma->pagelist), DRM_MEM_PAGES); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; } @@ -888,7 +888,7 @@ int drm_addbufs_pci(drm_device_t * dev, (count << page_order)) * sizeof(*dma->pagelist), DRM_MEM_PAGES); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; } @@ -910,7 +910,7 @@ int drm_addbufs_pci(drm_device_t * dev, drm_free(temp_pagelist, (dma->page_count + (count << page_order)) * sizeof(*dma->pagelist), DRM_MEM_PAGES); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; } @@ -935,7 +935,7 @@ int drm_addbufs_pci(drm_device_t * dev, dma->page_count += entry->seg_count << page_order; dma->byte_count += PAGE_SIZE * (entry->seg_count << page_order); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); request->count = entry->buf_count; request->size = size; @@ -1005,16 +1005,16 @@ static int drm_addbufs_sg(drm_device_t * atomic_inc(&dev->buf_alloc); spin_unlock(&dev->count_lock); - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); entry = &dma->bufs[order]; if (entry->buf_count) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; /* May only call once for each order */ } if (count < 0 || count > 4096) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -EINVAL; } @@ -1022,7 +1022,7 @@ static int drm_addbufs_sg(drm_device_t * entry->buflist = drm_alloc(count * sizeof(*entry->buflist), DRM_MEM_BUFS); if (!entry->buflist) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; } @@ -1056,7 +1056,7 @@ static int drm_addbufs_sg(drm_device_t * /* Set count correctly so we free the proper amount. */ entry->buf_count = count; drm_cleanup_buf_error(dev, entry); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; } @@ -1079,7 +1079,7 @@ static int drm_addbufs_sg(drm_device_t * if (!temp_buflist) { /* Free the entry because it isn't valid */ drm_cleanup_buf_error(dev, entry); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; } @@ -1097,7 +1097,7 @@ static int drm_addbufs_sg(drm_device_t * DRM_DEBUG("dma->buf_count : %d\n", dma->buf_count); DRM_DEBUG("entry->buf_count : %d\n", entry->buf_count); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); request->count = entry->buf_count; request->size = size; @@ -1167,16 +1167,16 @@ int drm_addbufs_fb(drm_device_t * dev, d atomic_inc(&dev->buf_alloc); spin_unlock(&dev->count_lock); - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); entry = &dma->bufs[order]; if (entry->buf_count) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; /* May only call once for each order */ } if (count < 0 || count > 4096) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -EINVAL; } @@ -1184,7 +1184,7 @@ int drm_addbufs_fb(drm_device_t * dev, d entry->buflist = drm_alloc(count * sizeof(*entry->buflist), DRM_MEM_BUFS); if (!entry->buflist) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; } @@ -1217,7 +1217,7 @@ int drm_addbufs_fb(drm_device_t * dev, d /* Set count correctly so we free the proper amount. */ entry->buf_count = count; drm_cleanup_buf_error(dev, entry); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; } @@ -1239,7 +1239,7 @@ int drm_addbufs_fb(drm_device_t * dev, d if (!temp_buflist) { /* Free the entry because it isn't valid */ drm_cleanup_buf_error(dev, entry); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); atomic_dec(&dev->buf_alloc); return -ENOMEM; } @@ -1257,7 +1257,7 @@ int drm_addbufs_fb(drm_device_t * dev, d DRM_DEBUG("dma->buf_count : %d\n", dma->buf_count); DRM_DEBUG("entry->buf_count : %d\n", entry->buf_count); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); request->count = entry->buf_count; request->size = size; diff --git a/linux-core/drm_compat.h b/linux-core/drm_compat.h index 03749d1..4f3a668 100644 --- a/linux-core/drm_compat.h +++ b/linux-core/drm_compat.h @@ -195,6 +195,16 @@ static inline int remap_pfn_range(struct } #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16) +#define mutex_lock down +#define mutex_unlock up + +#define mutex semaphore + +#define mutex_init(a) sema_init((a), 1) + +#endif + /* old architectures */ #ifdef __AMD64__ #define __x86_64__ diff --git a/linux-core/drm_context.c b/linux-core/drm_context.c index 748a2a6..95581b5 100644 --- a/linux-core/drm_context.c +++ b/linux-core/drm_context.c @@ -64,10 +64,10 @@ void drm_ctxbitmap_free(drm_device_t * d goto failed; if (ctx_handle < DRM_MAX_CTXBITMAP) { - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); clear_bit(ctx_handle, dev->ctx_bitmap); dev->context_sareas[ctx_handle] = NULL; - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return; } failed: @@ -92,7 +92,7 @@ static int drm_ctxbitmap_next(drm_device if (!dev->ctx_bitmap) return -1; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); bit = find_first_zero_bit(dev->ctx_bitmap, DRM_MAX_CTXBITMAP); if (bit < DRM_MAX_CTXBITMAP) { set_bit(bit, dev->ctx_bitmap); @@ -113,7 +113,7 @@ static int drm_ctxbitmap_next(drm_device DRM_MEM_MAPS); if (!ctx_sareas) { clear_bit(bit, dev->ctx_bitmap); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return -1; } dev->context_sareas = ctx_sareas; @@ -126,16 +126,16 @@ static int drm_ctxbitmap_next(drm_device DRM_MEM_MAPS); if (!dev->context_sareas) { clear_bit(bit, dev->ctx_bitmap); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return -1; } dev->context_sareas[bit] = NULL; } } - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return bit; } - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return -1; } @@ -152,17 +152,17 @@ int drm_ctxbitmap_init(drm_device_t * de int i; int temp; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); dev->ctx_bitmap = (unsigned long *)drm_alloc(PAGE_SIZE, DRM_MEM_CTXBITMAP); if (dev->ctx_bitmap == NULL) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return -ENOMEM; } memset((void *)dev->ctx_bitmap, 0, PAGE_SIZE); dev->context_sareas = NULL; dev->max_context = -1; - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); for (i = 0; i < DRM_RESERVED_CONTEXTS; i++) { temp = drm_ctxbitmap_next(dev); @@ -182,13 +182,13 @@ int drm_ctxbitmap_init(drm_device_t * de */ void drm_ctxbitmap_cleanup(drm_device_t * dev) { - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); if (dev->context_sareas) drm_free(dev->context_sareas, sizeof(*dev->context_sareas) * dev->max_context, DRM_MEM_MAPS); drm_free((void *)dev->ctx_bitmap, PAGE_SIZE, DRM_MEM_CTXBITMAP); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); } /*@}*/ @@ -222,15 +222,15 @@ int drm_getsareactx(struct inode *inode, if (copy_from_user(&request, argp, sizeof(request))) return -EFAULT; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); if (dev->max_context < 0 || request.ctx_id >= (unsigned)dev->max_context) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return -EINVAL; } map = dev->context_sareas[request.ctx_id]; - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); request.handle = NULL; list_for_each_entry(_entry, &dev->maplist->head,head) { @@ -274,7 +274,7 @@ int drm_setsareactx(struct inode *inode, (drm_ctx_priv_map_t __user *) arg, sizeof(request))) return -EFAULT; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); list_for_each(list, &dev->maplist->head) { r_list = list_entry(list, drm_map_list_t, head); if (r_list->map @@ -282,7 +282,7 @@ int drm_setsareactx(struct inode *inode, goto found; } bad: - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return -EINVAL; found: @@ -294,7 +294,7 @@ int drm_setsareactx(struct inode *inode, if (request.ctx_id >= (unsigned)dev->max_context) goto bad; dev->context_sareas[request.ctx_id] = map; - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return 0; } @@ -448,10 +448,10 @@ int drm_addctx(struct inode *inode, stru ctx_entry->handle = ctx.handle; ctx_entry->tag = priv; - down(&dev->ctxlist_sem); + mutex_lock(&dev->ctxlist_mutex); list_add(&ctx_entry->head, &dev->ctxlist->head); ++dev->ctx_count; - up(&dev->ctxlist_sem); + mutex_unlock(&dev->ctxlist_mutex); if (copy_to_user(argp, &ctx, sizeof(ctx))) return -EFAULT; @@ -574,7 +574,7 @@ int drm_rmctx(struct inode *inode, struc drm_ctxbitmap_free(dev, ctx.handle); } - down(&dev->ctxlist_sem); + mutex_lock(&dev->ctxlist_mutex); if (!list_empty(&dev->ctxlist->head)) { drm_ctx_list_t *pos, *n; @@ -586,7 +586,7 @@ int drm_rmctx(struct inode *inode, struc } } } - up(&dev->ctxlist_sem); + mutex_unlock(&dev->ctxlist_mutex); return 0; } diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index 07f9952..c3ea9b5 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -154,7 +154,7 @@ int drm_lastclose(drm_device_t * dev) if (dev->irq_enabled) drm_irq_uninstall(dev); - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); del_timer(&dev->timer); if (dev->unique) { @@ -239,7 +239,7 @@ int drm_lastclose(drm_device_t * dev) dev->lock.filp = NULL; wake_up_interruptible(&dev->lock.lock_queue); } - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); DRM_DEBUG("lastclose completed\n"); return 0; diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c index 632108d..a58f3ae 100644 --- a/linux-core/drm_fops.c +++ b/linux-core/drm_fops.c @@ -260,7 +260,7 @@ static int drm_open_helper(struct inode goto out_free; } - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); if (!dev->file_last) { priv->next = NULL; priv->prev = NULL; @@ -274,7 +274,7 @@ static int drm_open_helper(struct inode dev->file_last->next = priv; dev->file_last = priv; } - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); #ifdef __alpha__ /* @@ -411,7 +411,7 @@ int drm_release(struct inode *inode, str drm_fasync(-1, filp, 0); - down(&dev->ctxlist_sem); + mutex_lock(&dev->ctxlist_mutex); if (dev->ctxlist && (!list_empty(&dev->ctxlist->head))) { drm_ctx_list_t *pos, *n; @@ -430,9 +430,9 @@ int drm_release(struct inode *inode, str } } } - up(&dev->ctxlist_sem); + mutex_unlock(&dev->ctxlist_mutex); - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); if (priv->remove_auth_on_close == 1) { drm_file_t *temp = dev->file_first; while (temp) { @@ -450,7 +450,7 @@ int drm_release(struct inode *inode, str } else { dev->file_last = priv->prev; } - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); if (dev->driver->postclose) dev->driver->postclose(dev, priv); diff --git a/linux-core/drm_ioctl.c b/linux-core/drm_ioctl.c index e0998d5..54024e1 100644 --- a/linux-core/drm_ioctl.c +++ b/linux-core/drm_ioctl.c @@ -188,9 +188,9 @@ int drm_getmap(struct inode *inode, stru return -EFAULT; idx = map.offset; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); if (idx < 0) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return -EINVAL; } @@ -203,7 +203,7 @@ int drm_getmap(struct inode *inode, stru i++; } if (!r_list || !r_list->map) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return -EINVAL; } @@ -213,7 +213,7 @@ int drm_getmap(struct inode *inode, stru map.flags = r_list->map->flags; map.handle = (void *)(unsigned long) r_list->user_token; map.mtrr = r_list->map->mtrr; - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); if (copy_to_user(argp, &map, sizeof(map))) return -EFAULT; @@ -247,11 +247,11 @@ int drm_getclient(struct inode *inode, s if (copy_from_user(&client, argp, sizeof(client))) return -EFAULT; idx = client.idx; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); for (i = 0, pt = dev->file_first; i < idx && pt; i++, pt = pt->next) ; if (!pt) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return -EINVAL; } client.auth = pt->authenticated; @@ -259,7 +259,7 @@ int drm_getclient(struct inode *inode, s client.uid = pt->uid; client.magic = pt->magic; client.iocs = pt->ioctl_count; - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); if (copy_to_user(argp, &client, sizeof(client))) return -EFAULT; @@ -286,7 +286,7 @@ int drm_getstats(struct inode *inode, st memset(&stats, 0, sizeof(stats)); - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); for (i = 0; i < dev->counters; i++) { if (dev->types[i] == _DRM_STAT_LOCK) @@ -299,7 +299,7 @@ int drm_getstats(struct inode *inode, st stats.count = dev->counters; - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); if (copy_to_user((drm_stats_t __user *) arg, &stats, sizeof(stats))) return -EFAULT; diff --git a/linux-core/drm_irq.c b/linux-core/drm_irq.c index 7f21205..d76fd51 100644 --- a/linux-core/drm_irq.c +++ b/linux-core/drm_irq.c @@ -97,20 +97,20 @@ static int drm_irq_install(drm_device_t if (dev->irq == 0) return -EINVAL; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); /* Driver must have been initialized */ if (!dev->dev_private) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return -EINVAL; } if (dev->irq_enabled) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return -EBUSY; } dev->irq_enabled = 1; - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); DRM_DEBUG("%s: irq=%d\n", __FUNCTION__, dev->irq); @@ -134,9 +134,9 @@ static int drm_irq_install(drm_device_t ret = request_irq(dev->irq, dev->driver->irq_handler, sh_flags, dev->devname, dev); if (ret < 0) { - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); dev->irq_enabled = 0; - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return ret; } @@ -160,10 +160,10 @@ int drm_irq_uninstall(drm_device_t * dev if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) return -EINVAL; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); irq_enabled = dev->irq_enabled; dev->irq_enabled = 0; - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); if (!irq_enabled) return -EINVAL; diff --git a/linux-core/drm_proc.c b/linux-core/drm_proc.c index 52241bd..014486c 100644 --- a/linux-core/drm_proc.c +++ b/linux-core/drm_proc.c @@ -266,9 +266,9 @@ static int drm_vm_info(char *buf, char * drm_device_t *dev = (drm_device_t *) data; int ret; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); ret = drm__vm_info(buf, start, offset, request, eof, data); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return ret; } @@ -339,9 +339,9 @@ static int drm_queues_info(char *buf, ch drm_device_t *dev = (drm_device_t *) data; int ret; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); ret = drm__queues_info(buf, start, offset, request, eof, data); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return ret; } @@ -411,9 +411,9 @@ static int drm_bufs_info(char *buf, char drm_device_t *dev = (drm_device_t *) data; int ret; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); ret = drm__bufs_info(buf, start, offset, request, eof, data); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return ret; } @@ -467,9 +467,9 @@ static int drm_clients_info(char *buf, c drm_device_t *dev = (drm_device_t *) data; int ret; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); ret = drm__clients_info(buf, start, offset, request, eof, data); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return ret; } @@ -540,9 +540,9 @@ static int drm_vma_info(char *buf, char drm_device_t *dev = (drm_device_t *) data; int ret; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); ret = drm__vma_info(buf, start, offset, request, eof, data); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return ret; } #endif diff --git a/linux-core/drm_stub.c b/linux-core/drm_stub.c index 2495563..25bb5f3 100644 --- a/linux-core/drm_stub.c +++ b/linux-core/drm_stub.c @@ -62,8 +62,8 @@ static int drm_fill_in_dev(drm_device_t spin_lock_init(&dev->count_lock); init_timer(&dev->timer); - sema_init(&dev->struct_sem, 1); - sema_init(&dev->ctxlist_sem, 1); + mutex_init(&dev->struct_mutex); + mutex_init(&dev->ctxlist_mutex); dev->pdev = pdev; diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c index 19866dc..cf3bc3c 100644 --- a/linux-core/drm_vm.c +++ b/linux-core/drm_vm.c @@ -187,7 +187,7 @@ static void drm_vm_shm_close(struct vm_a map = vma->vm_private_data; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); for (pt = dev->vmalist, prev = NULL; pt; pt = next) { next = pt->next; if (pt->vma->vm_private_data == map) @@ -247,7 +247,7 @@ static void drm_vm_shm_close(struct vm_a drm_free(map, sizeof(*map), DRM_MEM_MAPS); } } - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); } /** @@ -434,12 +434,12 @@ static void drm_vm_open(struct vm_area_s vma_entry = drm_alloc(sizeof(*vma_entry), DRM_MEM_VMAS); if (vma_entry) { - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); vma_entry->vma = vma; vma_entry->next = dev->vmalist; vma_entry->pid = current->pid; dev->vmalist = vma_entry; - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); } } @@ -461,7 +461,7 @@ static void drm_vm_close(struct vm_area_ vma->vm_start, vma->vm_end - vma->vm_start); atomic_dec(&dev->vma_count); - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); for (pt = dev->vmalist, prev = NULL; pt; prev = pt, pt = pt->next) { if (pt->vma == vma) { if (prev) { @@ -473,7 +473,7 @@ static void drm_vm_close(struct vm_area_ break; } } - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); } /** diff --git a/linux-core/sis_mm.c b/linux-core/sis_mm.c index 70e2fac..b7ce18c 100644 --- a/linux-core/sis_mm.c +++ b/linux-core/sis_mm.c @@ -94,7 +94,7 @@ static int sis_fb_init(DRM_IOCTL_ARGS) DRM_COPY_FROM_USER_IOCTL(fb, (drm_sis_fb_t __user *) data, sizeof(fb)); - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); #if defined(__linux__) && defined(CONFIG_FB_SIS) { drm_sman_mm_t sman_mm; @@ -113,14 +113,14 @@ static int sis_fb_init(DRM_IOCTL_ARGS) if (ret) { DRM_ERROR("VRAM memory manager initialisation error\n"); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return ret; } dev_priv->vram_initialized = TRUE; dev_priv->vram_offset = fb.offset; - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); DRM_DEBUG("offset = %u, size = %u", fb.offset, fb.size); return 0; @@ -137,7 +137,7 @@ static int sis_drm_alloc(drm_device_t * DRM_COPY_FROM_USER_IOCTL(mem, argp, sizeof(mem)); - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); if (FALSE == ((pool == 0) ? dev_priv->vram_initialized : dev_priv->agp_initialized)) { @@ -150,7 +150,7 @@ static int sis_drm_alloc(drm_device_t * item = drm_sman_alloc(&dev_priv->sman, pool, mem.size, 0, (unsigned long)priv); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); if (item) { mem.offset = ((pool == 0) ? dev_priv->vram_offset : dev_priv->agp_offset) + @@ -183,9 +183,9 @@ static int sis_drm_free(DRM_IOCTL_ARGS) DRM_COPY_FROM_USER_IOCTL(mem, (drm_sis_mem_t __user *) data, sizeof(mem)); - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); ret = drm_sman_free_key(&dev_priv->sman, mem.free); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); DRM_DEBUG("free = 0x%lx\n", mem.free); return ret; @@ -207,19 +207,19 @@ static int sis_ioctl_agp_init(DRM_IOCTL_ DRM_COPY_FROM_USER_IOCTL(agp, (drm_sis_agp_t __user *) data, sizeof(agp)); - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); ret = drm_sman_set_range(&dev_priv->sman, AGP_TYPE, 0, agp.size >> SIS_MM_ALIGN_SHIFT); if (ret) { DRM_ERROR("AGP memory manager initialisation error\n"); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return ret; } dev_priv->agp_initialized = TRUE; dev_priv->agp_offset = agp.offset; - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); DRM_DEBUG("offset = %u, size = %u", agp.offset, agp.size); return 0; @@ -310,12 +310,12 @@ void sis_lastclose(struct drm_device *de if (!dev_priv) return; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); drm_sman_cleanup(&dev_priv->sman); dev_priv->vram_initialized = FALSE; dev_priv->agp_initialized = FALSE; dev_priv->mmio = NULL; - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); } void sis_reclaim_buffers_locked(drm_device_t * dev, struct file *filp) @@ -323,9 +323,9 @@ void sis_reclaim_buffers_locked(drm_devi drm_sis_private_t *dev_priv = dev->dev_private; drm_file_t *priv = filp->private_data; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); if (drm_sman_owner_clean(&dev_priv->sman, (unsigned long)priv)) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return; } @@ -334,7 +334,7 @@ void sis_reclaim_buffers_locked(drm_devi } drm_sman_owner_cleanup(&dev_priv->sman, (unsigned long)priv); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return; } diff --git a/linux-core/via_mm.c b/linux-core/via_mm.c index 71762b7..366a018 100644 --- a/linux-core/via_mm.c +++ b/linux-core/via_mm.c @@ -42,19 +42,19 @@ int via_agp_init(DRM_IOCTL_ARGS) DRM_COPY_FROM_USER_IOCTL(agp, (drm_via_agp_t __user *) data, sizeof(agp)); - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); ret = drm_sman_set_range(&dev_priv->sman, VIA_MEM_AGP, 0, agp.size >> VIA_MM_ALIGN_SHIFT); if (ret) { DRM_ERROR("AGP memory manager initialisation error\n"); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return ret; } dev_priv->agp_initialized = TRUE; dev_priv->agp_offset = agp.offset; - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); DRM_DEBUG("offset = %u, size = %u", agp.offset, agp.size); return 0; @@ -69,20 +69,20 @@ int via_fb_init(DRM_IOCTL_ARGS) DRM_COPY_FROM_USER_IOCTL(fb, (drm_via_fb_t __user *) data, sizeof(fb)); - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); ret = drm_sman_set_range(&dev_priv->sman, VIA_MEM_VIDEO, 0, fb.size >> VIA_MM_ALIGN_SHIFT); if (ret) { DRM_ERROR("VRAM memory manager initialisation error\n"); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return ret; } dev_priv->vram_initialized = TRUE; dev_priv->vram_offset = fb.offset; - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); DRM_DEBUG("offset = %u, size = %u", fb.offset, fb.size); return 0; @@ -116,11 +116,11 @@ void via_lastclose(struct drm_device *de if (!dev_priv) return; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); drm_sman_cleanup(&dev_priv->sman); dev_priv->vram_initialized = FALSE; dev_priv->agp_initialized = FALSE; - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); } @@ -141,19 +141,19 @@ int via_mem_alloc(DRM_IOCTL_ARGS) DRM_ERROR("Unknown memory type allocation\n"); return DRM_ERR(EINVAL); } - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); if (FALSE == ((mem.type == VIA_MEM_VIDEO) ? dev_priv->vram_initialized : dev_priv->agp_initialized)) { DRM_ERROR ("Attempt to allocate from uninitialized memory manager.\n"); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return DRM_ERR(EINVAL); } tmpSize = (mem.size + VIA_MM_ALIGN_MASK) >> VIA_MM_ALIGN_SHIFT; item = drm_sman_alloc(&dev_priv->sman, mem.type, tmpSize, 0, (unsigned long)priv); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); if (item) { mem.offset = ((mem.type == VIA_MEM_VIDEO) ? dev_priv->vram_offset : dev_priv->agp_offset) + @@ -182,9 +182,9 @@ int via_mem_free(DRM_IOCTL_ARGS) DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t __user *) data, sizeof(mem)); - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); ret = drm_sman_free_key(&dev_priv->sman, mem.index); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); DRM_DEBUG("free = 0x%lx\n", mem.index); return ret; @@ -198,9 +198,9 @@ void via_reclaim_buffers_locked(drm_devi drm_via_private_t *dev_priv = dev->dev_private; drm_file_t *priv = filp->private_data; - down(&dev->struct_sem); + mutex_lock(&dev->struct_mutex); if (drm_sman_owner_clean(&dev_priv->sman, (unsigned long)priv)) { - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return; } @@ -209,6 +209,6 @@ void via_reclaim_buffers_locked(drm_devi } drm_sman_owner_cleanup(&dev_priv->sman, (unsigned long)priv); - up(&dev->struct_sem); + mutex_unlock(&dev->struct_mutex); return; } |
From: <ai...@ke...> - 2006-07-24 01:08:48
|
linux-core/drm_drv.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) New commits: diff-tree 09c901e4bdf2bd18110f963ef3759f6759f15317 (from 5cfbd5dbab4fe9668771377cb22da04c6103459e) Author: Dave Airlie <ai...@li...> Date: Mon Jul 24 11:09:41 2006 +1000 remove incorrect exit marking on cleanup pci as this is called from other paths diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index c3ea9b5..0281178 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -245,7 +245,7 @@ int drm_lastclose(drm_device_t * dev) return 0; } -void __exit drm_cleanup_pci(struct pci_dev *pdev) +void drm_cleanup_pci(struct pci_dev *pdev) { drm_device_t *dev = pci_get_drvdata(pdev); |
From: <da...@ke...> - 2006-07-26 16:22:16
|
shared-core/radeon_cp.c | 5 ----- 1 files changed, 5 deletions(-) New commits: diff-tree 35066b51efeb0d2ae9b4ba7fba066f80f798539d (from 645453ce11f819c4e9dd9be95ce9d621dc7d466b) Author: Michel Dänzer <mi...@tu...> Date: Wed Jul 26 18:21:32 2006 +0200 Revert "Make sure busmastering gets disabled on module unload." This reverts af7b89d7246efbed7d05c38fcaa6a13c4b89db90 commit. It causes an oops on X server shutdown here, and for the reporter of bug #7629 as well. diff --git a/shared-core/radeon_cp.c b/shared-core/radeon_cp.c index 12ba7ba..4e7b282 100644 --- a/shared-core/radeon_cp.c +++ b/shared-core/radeon_cp.c @@ -1720,11 +1720,6 @@ static int radeon_do_cleanup_cp(drm_devi dev_priv->gart_info.addr = 0; } } - - /* Disable busmastering */ - RADEON_WRITE(RADEON_BUS_CNTL, RADEON_READ(RADEON_BUS_CNTL) | - RADEON_BUS_MASTER_DIS); - /* only clear to the start of flags */ memset(dev_priv, 0, offsetof(drm_radeon_private_t, flags)); |
From: <da...@ke...> - 2006-07-28 19:31:58
|
shared-core/radeon_cp.c | 8 +++++--- shared-core/radeon_drv.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) New commits: diff-tree 645453ce11f819c4e9dd9be95ce9d621dc7d466b (from 09c901e4bdf2bd18110f963ef3759f6759f15317) Author: Michel Dänzer <mi...@tu...> Date: Wed Jul 26 18:14:20 2006 +0200 Bug #7629: Fix for CHIP_IS_AGP getting 'restored' with non-AGP cards Commit 2a47f6bfecea5dabcbf79d5e1aaf271f50070b89 caused the CHIP_IS_AGP flag to get 'restored' with PCI(e) cards. I can't think of a way to fix this without introducing a (otherwise redundant) CHIP_IS_PCI flag. diff --git a/shared-core/radeon_cp.c b/shared-core/radeon_cp.c index 299ec6a..12ba7ba 100644 --- a/shared-core/radeon_cp.c +++ b/shared-core/radeon_cp.c @@ -1351,7 +1351,8 @@ static int radeon_do_init_cp(drm_device_ DRM_DEBUG("Forcing AGP card to PCI mode\n"); dev_priv->flags &= ~CHIP_IS_AGP; } - else if (!(dev_priv->flags & CHIP_IS_AGP)) + else if (!(dev_priv->flags & (CHIP_IS_AGP | CHIP_IS_PCI | CHIP_IS_PCIE)) + && !init->is_pci) { DRM_DEBUG("Restoring AGP flag\n"); dev_priv->flags |= CHIP_IS_AGP; @@ -2215,9 +2216,10 @@ int radeon_driver_load(struct drm_device if (drm_device_is_agp(dev)) dev_priv->flags |= CHIP_IS_AGP; - - if (drm_device_is_pcie(dev)) + else if (drm_device_is_pcie(dev)) dev_priv->flags |= CHIP_IS_PCIE; + else + dev_priv->flags |= CHIP_IS_PCI; DRM_DEBUG("%s card detected\n", ((dev_priv->flags & CHIP_IS_AGP) ? "AGP" : (((dev_priv->flags & CHIP_IS_PCIE) ? "PCIE" : "PCI")))); diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h index 63b5ace..ff75480 100644 --- a/shared-core/radeon_drv.h +++ b/shared-core/radeon_drv.h @@ -143,6 +143,7 @@ enum radeon_chip_flags { CHIP_HAS_HIERZ = 0x00100000UL, CHIP_IS_PCIE = 0x00200000UL, CHIP_NEW_MEMMAP = 0x00400000UL, + CHIP_IS_PCI = 0x00800000UL, }; #define GET_RING_HEAD(dev_priv) (dev_priv->writeback_works ? \ |
From: <ai...@ke...> - 2006-08-07 10:57:14
|
linux-core/drm_hashtab.c | 302 +++++++++++++++++++++++------------------------ linux-core/drm_hashtab.h | 30 ++-- linux-core/drm_sman.c | 58 ++++----- linux-core/drm_sman.h | 44 +++--- 4 files changed, 214 insertions(+), 220 deletions(-) New commits: diff-tree 248d1a32a2462904bcaf040320b490570b4b0be6 (from 35066b51efeb0d2ae9b4ba7fba066f80f798539d) Author: Dave Airlie <ai...@li...> Date: Mon Aug 7 20:56:38 2006 +1000 drm: fixup whitespace and style for Linux kernel import diff --git a/linux-core/drm_hashtab.c b/linux-core/drm_hashtab.c index d8c4549..4806113 100644 --- a/linux-core/drm_hashtab.c +++ b/linux-core/drm_hashtab.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND. USA. * 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 @@ -10,20 +10,20 @@ * distribute, sub license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS 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 + * THE COPYRIGHT HOLDERS, AUTHORS 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. * - * + * **************************************************************************/ /* * Simple open hash tab implementation. @@ -36,161 +36,155 @@ #include "drm_hashtab.h" #include <linux/hash.h> -int -drm_ht_create(drm_open_hash_t *ht, unsigned int order) +int drm_ht_create(drm_open_hash_t *ht, unsigned int order) { - unsigned int i; + unsigned int i; - ht->size = 1 << order; - ht->order = order; - ht->fill = 0; - ht->table = vmalloc(ht->size*sizeof(*ht->table)); - if (!ht->table) { - DRM_ERROR("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(drm_open_hash_t *ht, unsigned long key) -{ - drm_hash_item_t *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, drm_hash_item_t, head); - DRM_DEBUG("count %d, key: 0x%08lx\n", count++, entry->key); - } -} - -static struct hlist_node -*drm_ht_find_key(drm_open_hash_t *ht, unsigned long key) -{ - drm_hash_item_t *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, drm_hash_item_t, head); - if (entry->key == key) - return list; - if (entry->key > key) - break; - } - return NULL; -} - - -int -drm_ht_insert_item(drm_open_hash_t *ht, drm_hash_item_t *item) -{ - drm_hash_item_t *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, drm_hash_item_t, head); - if (entry->key == key) - return -1; - 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; + ht->size = 1 << order; + ht->order = order; + ht->fill = 0; + ht->table = vmalloc(ht->size*sizeof(*ht->table)); + if (!ht->table) { + DRM_ERROR("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(drm_open_hash_t *ht, unsigned long key) +{ + drm_hash_item_t *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, drm_hash_item_t, head); + DRM_DEBUG("count %d, key: 0x%08lx\n", count++, entry->key); + } +} + +static struct hlist_node *drm_ht_find_key(drm_open_hash_t *ht, + unsigned long key) +{ + drm_hash_item_t *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, drm_hash_item_t, head); + if (entry->key == key) + return list; + if (entry->key > key) + break; + } + return NULL; +} + + +int drm_ht_insert_item(drm_open_hash_t *ht, drm_hash_item_t *item) +{ + drm_hash_item_t *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, drm_hash_item_t, head); + if (entry->key == key) + return -1; + 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. + * Just insert an item and return any "bits" bit key that hasn't been + * used before. */ +int drm_ht_just_insert_please(drm_open_hash_t *ht, drm_hash_item_t *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(drm_open_hash_t *ht, unsigned long key, + drm_hash_item_t **item) +{ + struct hlist_node *list; + + list = drm_ht_find_key(ht, key); + if (!list) + return -1; + + *item = hlist_entry(list, drm_hash_item_t, head); + return 0; +} + +int drm_ht_remove_key(drm_open_hash_t *ht, unsigned long key) +{ + struct hlist_node *list; -int -drm_ht_just_insert_please(drm_open_hash_t *ht, drm_hash_item_t *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(drm_open_hash_t *ht, unsigned long key, drm_hash_item_t **item) -{ - struct hlist_node *list; - - list = drm_ht_find_key(ht, key); - if (!list) - return -1; - - *item = hlist_entry(list, drm_hash_item_t, head); - return 0; -} - -int -drm_ht_remove_key(drm_open_hash_t *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 -1; -} - -int -drm_ht_remove_item(drm_open_hash_t *ht, drm_hash_item_t *item) -{ - hlist_del_init(&item->head); - ht->fill--; - return 0; + list = drm_ht_find_key(ht, key); + if (list) { + hlist_del_init(list); + ht->fill--; + return 0; + } + return -1; +} + +int drm_ht_remove_item(drm_open_hash_t *ht, drm_hash_item_t *item) +{ + hlist_del_init(&item->head); + ht->fill--; + return 0; } void drm_ht_remove(drm_open_hash_t *ht) { - if (ht->table) { - vfree(ht->table); - ht->table = NULL; - } -} + if (ht->table) { + vfree(ht->table); + ht->table = NULL; + } +} diff --git a/linux-core/drm_hashtab.h b/linux-core/drm_hashtab.h index 157353d..40afec0 100644 --- a/linux-core/drm_hashtab.h +++ b/linux-core/drm_hashtab.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Bismack, ND. USA. * 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 @@ -10,20 +10,20 @@ * distribute, sub license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS 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 + * THE COPYRIGHT HOLDERS, AUTHORS 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. * - * + * **************************************************************************/ /* * Simple open hash tab implementation. @@ -38,22 +38,22 @@ #define drm_hash_entry(_ptr, _type, _member) container_of(_ptr, _type, _member) typedef struct drm_hash_item{ - struct hlist_node head; - unsigned long key; + struct hlist_node head; + unsigned long key; } drm_hash_item_t; typedef struct drm_open_hash{ - unsigned int size; - unsigned int order; - unsigned int fill; - struct hlist_head *table; + unsigned int size; + unsigned int order; + unsigned int fill; + struct hlist_head *table; } drm_open_hash_t; extern int drm_ht_create(drm_open_hash_t *ht, unsigned int order); extern int drm_ht_insert_item(drm_open_hash_t *ht, drm_hash_item_t *item); extern int drm_ht_just_insert_please(drm_open_hash_t *ht, drm_hash_item_t *item, - unsigned long seed, int bits, int shift, + unsigned long seed, int bits, int shift, unsigned long add); extern int drm_ht_find_item(drm_open_hash_t *ht, unsigned long key, drm_hash_item_t **item); diff --git a/linux-core/drm_sman.c b/linux-core/drm_sman.c index d894e82..baba913 100644 --- a/linux-core/drm_sman.c +++ b/linux-core/drm_sman.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Bismarck., ND., USA. * 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 @@ -10,25 +10,25 @@ * distribute, sub license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS 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 + * THE COPYRIGHT HOLDERS, AUTHORS 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. * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * - * + * + * **************************************************************************/ /* * Simple memory manager interface that keeps track on allocate regions on a * per "owner" basis. All regions associated with an "owner" can be released - * with a simple call. Typically if the "owner" exists. The owner is any + * with a simple call. Typically if the "owner" exists. The owner is any * "unsigned long" identifier. Can typically be a pointer to a file private * struct or a context identifier. * @@ -77,9 +77,9 @@ drm_sman_init(drm_sman_t * sman, unsigne goto out; drm_ht_remove(&sman->owner_hash_tab); - out1: +out1: drm_free(sman->mm, num_managers * sizeof(*sman->mm), DRM_MEM_MM); - out: +out: return ret; } @@ -163,8 +163,8 @@ drm_sman_set_manager(drm_sman_t * sman, return 0; } -static drm_owner_item_t - * drm_sman_get_owner_item(drm_sman_t * sman, unsigned long owner) +static drm_owner_item_t *drm_sman_get_owner_item(drm_sman_t * sman, + unsigned long owner) { int ret; drm_hash_item_t *owner_hash_item; @@ -173,7 +173,7 @@ static drm_owner_item_t ret = drm_ht_find_item(&sman->owner_hash_tab, owner, &owner_hash_item); if (!ret) { return drm_hash_entry(owner_hash_item, drm_owner_item_t, - owner_hash); + owner_hash); } owner_item = drm_calloc(1, sizeof(*owner_item), DRM_MEM_MM); @@ -188,13 +188,13 @@ static drm_owner_item_t list_add_tail(&owner_item->sman_list, &sman->owner_items); return owner_item; - out1: +out1: drm_free(owner_item, sizeof(*owner_item), DRM_MEM_MM); - out: +out: return NULL; } -drm_memblock_item_t *drm_sman_alloc(drm_sman_t * sman, unsigned int manager, +drm_memblock_item_t *drm_sman_alloc(drm_sman_t *sman, unsigned int manager, unsigned long size, unsigned alignment, unsigned long owner) { @@ -234,11 +234,11 @@ drm_memblock_item_t *drm_sman_alloc(drm_ return memblock; - out2: +out2: drm_ht_remove_item(&sman->user_hash_tab, &memblock->user_hash); - out1: +out1: drm_free(memblock, sizeof(*memblock), DRM_MEM_MM); - out: +out: sman_mm->free(sman_mm->private, tmp); return NULL; @@ -246,7 +246,7 @@ drm_memblock_item_t *drm_sman_alloc(drm_ EXPORT_SYMBOL(drm_sman_alloc); -static void drm_sman_free(drm_memblock_item_t * item) +static void drm_sman_free(drm_memblock_item_t *item) { drm_sman_t *sman = item->sman; @@ -256,7 +256,7 @@ static void drm_sman_free(drm_memblock_i drm_free(item, sizeof(*item), DRM_MEM_MM); } -int drm_sman_free_key(drm_sman_t * sman, unsigned int key) +int drm_sman_free_key(drm_sman_t *sman, unsigned int key) { drm_hash_item_t *hash_item; drm_memblock_item_t *memblock_item; @@ -271,15 +271,15 @@ int drm_sman_free_key(drm_sman_t * sman, EXPORT_SYMBOL(drm_sman_free_key); -static void -drm_sman_remove_owner(drm_sman_t * sman, drm_owner_item_t * owner_item) +static void drm_sman_remove_owner(drm_sman_t *sman, + drm_owner_item_t *owner_item) { list_del(&owner_item->sman_list); drm_ht_remove_item(&sman->owner_hash_tab, &owner_item->owner_hash); drm_free(owner_item, sizeof(*owner_item), DRM_MEM_MM); } -int drm_sman_owner_clean(drm_sman_t * sman, unsigned long owner) +int drm_sman_owner_clean(drm_sman_t *sman, unsigned long owner) { drm_hash_item_t *hash_item; @@ -300,8 +300,8 @@ int drm_sman_owner_clean(drm_sman_t * sm EXPORT_SYMBOL(drm_sman_owner_clean); -static void -drm_sman_do_owner_cleanup(drm_sman_t * sman, drm_owner_item_t * owner_item) +static void drm_sman_do_owner_cleanup(drm_sman_t *sman, + drm_owner_item_t *owner_item) { drm_memblock_item_t *entry, *next; @@ -312,7 +312,7 @@ drm_sman_do_owner_cleanup(drm_sman_t * s drm_sman_remove_owner(sman, owner_item); } -void drm_sman_owner_cleanup(drm_sman_t * sman, unsigned long owner) +void drm_sman_owner_cleanup(drm_sman_t *sman, unsigned long owner) { drm_hash_item_t *hash_item; @@ -329,7 +329,7 @@ void drm_sman_owner_cleanup(drm_sman_t * EXPORT_SYMBOL(drm_sman_owner_cleanup); -void drm_sman_cleanup(drm_sman_t * sman) +void drm_sman_cleanup(drm_sman_t *sman) { drm_owner_item_t *entry, *next; unsigned int i; diff --git a/linux-core/drm_sman.h b/linux-core/drm_sman.h index 7e537d9..7c48360 100644 --- a/linux-core/drm_sman.h +++ b/linux-core/drm_sman.h @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA. * 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 @@ -10,25 +10,25 @@ * distribute, sub license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS 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 + * THE COPYRIGHT HOLDERS, AUTHORS 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. * - * + * **************************************************************************/ /* * Simple memory MANager interface that keeps track on allocate regions on a * per "owner" basis. All regions associated with an "owner" can be released - * with a simple call. Typically if the "owner" exists. The owner is any + * with a simple call. Typically if the "owner" exists. The owner is any * "unsigned long" identifier. Can typically be a pointer to a file private * struct or a context identifier. * @@ -44,18 +44,18 @@ /* * A class that is an abstration of a simple memory allocator. - * The sman implementation provides a default such allocator + * The sman implementation provides a default such allocator * using the drm_mm.c implementation. But the user can replace it. * See the SiS implementation, which may use the SiS FB kernel module * for memory management. */ typedef struct drm_sman_mm { - /* private info. If allocated, needs to be destroyed by the destroy + /* private info. If allocated, needs to be destroyed by the destroy function */ void *private; - /* Allocate a memory block with given size and alignment. + /* Allocate a memory block with given size and alignment. Return an opaque reference to the memory block */ void *(*allocate) (void *private, unsigned long size, @@ -100,15 +100,15 @@ typedef struct drm_sman { extern void drm_sman_takedown(drm_sman_t * sman); /* - * Allocate structures for a manager. - * num_managers are the number of memory pools to manage. (VRAM, AGP, ....) + * Allocate structures for a manager. + * num_managers are the number of memory pools to manage. (VRAM, AGP, ....) * user_order is the log2 of the number of buckets in the user hash table. - * set this to approximately log2 of the max number of memory regions - * that will be allocated for _all_ pools together. + * set this to approximately log2 of the max number of memory regions + * that will be allocated for _all_ pools together. * owner_order is the log2 of the number of buckets in the owner hash table. - * set this to approximately log2 of - * the number of client file connections that will - * be using the manager. + * set this to approximately log2 of + * the number of client file connections that will + * be using the manager. * */ @@ -150,16 +150,16 @@ extern int drm_sman_free_key(drm_sman_t /* * returns TRUE iff there are no stale memory blocks associated with this owner. * Typically called to determine if we need to idle the hardware and call - * drm_sman_owner_cleanup. If there are no stale memory blocks, it removes all + * drm_sman_owner_cleanup. If there are no stale memory blocks, it removes all * resources associated with owner. */ extern int drm_sman_owner_clean(drm_sman_t * sman, unsigned long owner); /* - * Frees all stale memory blocks associated with this owner. Note that this + * Frees all stale memory blocks associated with this owner. Note that this * requires that the hardware is finished with all blocks, so the graphics engine - * should be idled before this call is made. This function also frees + * should be idled before this call is made. This function also frees * any resources associated with "owner" and should be called when owner * is not going to be referenced anymore. */ |
From: <ai...@ke...> - 2006-08-07 11:00:26
|
linux-core/drm_mm.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) New commits: diff-tree 4b3ea90bc4ceeae440c64e0af8b59cf77ea7b622 (from 248d1a32a2462904bcaf040320b490570b4b0be6) Author: Dave Airlie <ai...@li...> Date: Mon Aug 7 21:00:13 2006 +1000 drm: remove extra whitespace from drm_mm.c diff --git a/linux-core/drm_mm.c b/linux-core/drm_mm.c index a93760f..c55ed45 100644 --- a/linux-core/drm_mm.c +++ b/linux-core/drm_mm.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA. * 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 @@ -10,25 +10,25 @@ * distribute, sub license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS 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 + * THE COPYRIGHT HOLDERS, AUTHORS 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. * - * + * **************************************************************************/ /* * Generic simple memory manager implementation. Intended to be used as a base - * class implementation for more advanced memory managers. + * class implementation for more advanced memory managers. * * Note that the algorithm used is quite simple and there might be substantial * performance gains if a smarter free list is implemented. Currently it is just an |
From: <ai...@ke...> - 2006-08-07 11:34:59
|
linux-core/sis_mm.c | 127 ++++++++++++++++++++++++---------------------------- linux-core/via_mm.c | 5 -- 2 files changed, 62 insertions(+), 70 deletions(-) New commits: diff-tree e524028630013bb0f436bcdca0396289745843cf (from 4b3ea90bc4ceeae440c64e0af8b59cf77ea7b622) Author: Dave Airlie <ai...@li...> Date: Mon Aug 7 21:34:40 2006 +1000 drm: whitespace cleanup in new files diff --git a/linux-core/sis_mm.c b/linux-core/sis_mm.c index b7ce18c..10e4a9a 100644 --- a/linux-core/sis_mm.c +++ b/linux-core/sis_mm.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA. * 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 @@ -10,20 +10,20 @@ * distribute, sub license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS 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 + * THE COPYRIGHT HOLDERS, AUTHORS 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. * - * + * **************************************************************************/ /* @@ -252,54 +252,54 @@ int sis_idle(drm_device_t *dev) { drm_sis_private_t *dev_priv = dev->dev_private; - uint32_t idle_reg; - unsigned long end; - int i; - - if (dev_priv->idle_fault) - return 0; - - if (dev_priv->mmio == NULL) { - dev_priv->mmio = sis_reg_init(dev); - if (dev_priv->mmio == NULL) { - DRM_ERROR("Could not find register map.\n"); - return 0; - } - } - - /* - * Implement a device switch here if needed - */ - - if (dev_priv->chipset != SIS_CHIP_315) - return 0; - - /* - * Timeout after 3 seconds. We cannot use DRM_WAIT_ON here - * because its polling frequency is too low. - */ - - end = jiffies + (DRM_HZ * 3); - - for (i=0; i<4; ++i) { - do { - idle_reg = SIS_READ(0x85cc); - } while ( !time_after_eq(jiffies, end) && - ((idle_reg & 0x80000000) != 0x80000000)); - } - - if (time_after_eq(jiffies, end)) { - DRM_ERROR("Graphics engine idle timeout. " - "Disabling idle check\n"); - dev_priv->idle_fault = TRUE; - } - - /* - * The caller never sees an error code. It gets trapped - * in libdrm. - */ + uint32_t idle_reg; + unsigned long end; + int i; + + if (dev_priv->idle_fault) + return 0; + + if (dev_priv->mmio == NULL) { + dev_priv->mmio = sis_reg_init(dev); + if (dev_priv->mmio == NULL) { + DRM_ERROR("Could not find register map.\n"); + return 0; + } + } + + /* + * Implement a device switch here if needed + */ + + if (dev_priv->chipset != SIS_CHIP_315) + return 0; + + /* + * Timeout after 3 seconds. We cannot use DRM_WAIT_ON here + * because its polling frequency is too low. + */ + + end = jiffies + (DRM_HZ * 3); + + for (i=0; i<4; ++i) { + do { + idle_reg = SIS_READ(0x85cc); + } while ( !time_after_eq(jiffies, end) && + ((idle_reg & 0x80000000) != 0x80000000)); + } + + if (time_after_eq(jiffies, end)) { + DRM_ERROR("Graphics engine idle timeout. " + "Disabling idle check\n"); + dev_priv->idle_fault = TRUE; + } + + /* + * The caller never sees an error code. It gets trapped + * in libdrm. + */ - return 0; + return 0; } @@ -314,7 +314,7 @@ void sis_lastclose(struct drm_device *de drm_sman_cleanup(&dev_priv->sman); dev_priv->vram_initialized = FALSE; dev_priv->agp_initialized = FALSE; - dev_priv->mmio = NULL; + dev_priv->mmio = NULL; mutex_unlock(&dev->struct_mutex); } @@ -339,17 +339,12 @@ void sis_reclaim_buffers_locked(drm_devi } drm_ioctl_desc_t sis_ioctls[] = { - [DRM_IOCTL_NR(DRM_SIS_FB_ALLOC)] = {sis_fb_alloc, DRM_AUTH} - , - [DRM_IOCTL_NR(DRM_SIS_FB_FREE)] = {sis_drm_free, DRM_AUTH} - , + [DRM_IOCTL_NR(DRM_SIS_FB_ALLOC)] = {sis_fb_alloc, DRM_AUTH}, + [DRM_IOCTL_NR(DRM_SIS_FB_FREE)] = {sis_drm_free, DRM_AUTH}, [DRM_IOCTL_NR(DRM_SIS_AGP_INIT)] = - {sis_ioctl_agp_init, DRM_AUTH | DRM_MASTER | DRM_ROOT_ONLY} - , - [DRM_IOCTL_NR(DRM_SIS_AGP_ALLOC)] = {sis_ioctl_agp_alloc, DRM_AUTH} - , - [DRM_IOCTL_NR(DRM_SIS_AGP_FREE)] = {sis_drm_free, DRM_AUTH} - , + {sis_ioctl_agp_init, DRM_AUTH | DRM_MASTER | DRM_ROOT_ONLY}, + [DRM_IOCTL_NR(DRM_SIS_AGP_ALLOC)] = {sis_ioctl_agp_alloc, DRM_AUTH}, + [DRM_IOCTL_NR(DRM_SIS_AGP_FREE)] = {sis_drm_free, DRM_AUTH}, [DRM_IOCTL_NR(DRM_SIS_FB_INIT)] = {sis_fb_init, DRM_AUTH | DRM_MASTER | DRM_ROOT_ONLY} }; diff --git a/linux-core/via_mm.c b/linux-core/via_mm.c index 366a018..f4d147e 100644 --- a/linux-core/via_mm.c +++ b/linux-core/via_mm.c @@ -16,7 +16,7 @@ * 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * THE AUTHORS OR COPYRIGHT HOLDERS AND/OR THEIR 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. @@ -123,7 +123,6 @@ void via_lastclose(struct drm_device *de mutex_unlock(&dev->struct_mutex); } - int via_mem_alloc(DRM_IOCTL_ARGS) { DRM_DEVICE; @@ -190,8 +189,6 @@ int via_mem_free(DRM_IOCTL_ARGS) return ret; } - - void via_reclaim_buffers_locked(drm_device_t * dev, struct file *filp) { |
From: <an...@ke...> - 2006-08-09 19:06:27
|
shared-core/drm_pciids.txt | 4 +++ shared-core/i915_dma.c | 46 +++++++++++++++++++++++++++++++++------------ shared-core/i915_drm.h | 6 +++++ shared-core/i915_drv.h | 10 +++++---- shared-core/i915_irq.c | 32 ++++++++++++++++++++----------- 5 files changed, 71 insertions(+), 27 deletions(-) New commits: diff-tree 48cb9aceed782a4e9c557f30429e65f845dd777d (from e524028630013bb0f436bcdca0396289745843cf) Author: Alan Hourihane <al...@tu...> Date: Tue Aug 8 15:05:54 2006 -0700 Add support for Intel i965G chipsets. This is a patch prepared by Guangdeng Liao based off of Tungsten Graphics's final code drop. diff --git a/shared-core/drm_pciids.txt b/shared-core/drm_pciids.txt index e4415c1..9ef2c00 100644 --- a/shared-core/drm_pciids.txt +++ b/shared-core/drm_pciids.txt @@ -271,6 +271,10 @@ 0x8086 0x2592 0 "Intel i915GM" 0x8086 0x2772 0 "Intel i945G" 0x8086 0x27A2 0 "Intel i945GM" +0x8086 0x2972 0 "Intel i946GZ" +0x8086 0x2982 0 "Intel i965G" +0x8086 0x2992 0 "Intel i965Q" +0x8086 0x29A2 0 "Intel i965G" [imagine] 0x105d 0x2309 IMAGINE_128 "Imagine 128" diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c index ae0f55a..39f7b40 100644 --- a/shared-core/i915_dma.c +++ b/shared-core/i915_dma.c @@ -31,6 +31,12 @@ #include "i915_drm.h" #include "i915_drv.h" +#define IS_I965G(dev) (dev->pdev->device == 0x2972 || \ + dev->pdev->device == 0x2982 || \ + dev->pdev->device == 0x2992 || \ + dev->pdev->device == 0x29A2) + + /* Really want an OS-independent resettable timer. Would like to have * this loop run for (eg) 3 sec, but have the timer reset every time * the head pointer changes, so that EBUSY only happens if the ring @@ -347,14 +353,15 @@ static int i915_emit_cmds(drm_device_t * if ((dwords+1) * sizeof(int) >= dev_priv->ring.Size - 8) return DRM_ERR(EINVAL); - BEGIN_LP_RING(((dwords+1)&~1)); + BEGIN_LP_RING((dwords+1)&~1); for (i = 0; i < dwords;) { int cmd, sz; - if (DRM_COPY_FROM_USER_UNCHECKED(&cmd, &buffer[i], sizeof(cmd))) - return DRM_ERR(EINVAL); + if (DRM_COPY_FROM_USER_UNCHECKED(&cmd, &buffer[i], sizeof(cmd))) { + return DRM_ERR(EINVAL); + } if ((sz = validate_cmd(cmd)) == 0 || i + sz > dwords) return DRM_ERR(EINVAL); @@ -395,25 +402,40 @@ static int i915_emit_box(drm_device_t * return DRM_ERR(EINVAL); } - BEGIN_LP_RING(6); - OUT_RING(GFX_OP_DRAWRECT_INFO); - OUT_RING(DR1); - OUT_RING((box.x1 & 0xffff) | (box.y1 << 16)); - OUT_RING(((box.x2 - 1) & 0xffff) | ((box.y2 - 1) << 16)); - OUT_RING(DR4); - OUT_RING(0); - ADVANCE_LP_RING(); + if (IS_I965G(dev)) { + BEGIN_LP_RING(4); + OUT_RING(GFX_OP_DRAWRECT_INFO_I965); + OUT_RING((box.x1 & 0xffff) | (box.y1 << 16)); + OUT_RING(((box.x2 - 1) & 0xffff) | ((box.y2 - 1) << 16)); + OUT_RING(DR4); + ADVANCE_LP_RING(); + } else { + BEGIN_LP_RING(6); + OUT_RING(GFX_OP_DRAWRECT_INFO); + OUT_RING(DR1); + OUT_RING((box.x1 & 0xffff) | (box.y1 << 16)); + OUT_RING(((box.x2 - 1) & 0xffff) | ((box.y2 - 1) << 16)); + OUT_RING(DR4); + OUT_RING(0); + ADVANCE_LP_RING(); + } return 0; } +/* XXX: Emitting the counter should really be moved to part of the IRQ + * emit. For now, do it in both places: + */ static void i915_emit_breadcrumb(drm_device_t *dev) { drm_i915_private_t *dev_priv = dev->dev_private; RING_LOCALS; - dev_priv->sarea_priv->last_enqueue = dev_priv->counter++; + dev_priv->sarea_priv->last_enqueue = ++dev_priv->counter; + + if (dev_priv->counter > 0x7FFFFFFFUL) + dev_priv->sarea_priv->last_enqueue = dev_priv->counter = 1; BEGIN_LP_RING(4); OUT_RING(CMD_STORE_DWORD_IDX); diff --git a/shared-core/i915_drm.h b/shared-core/i915_drm.h index 999b567..41acd4e 100644 --- a/shared-core/i915_drm.h +++ b/shared-core/i915_drm.h @@ -98,6 +98,12 @@ typedef struct _drm_i915_sarea { int rotated_size; int rotated_pitch; int virtualX, virtualY; + + unsigned int front_tiled; + unsigned int back_tiled; + unsigned int depth_tiled; + unsigned int rotated_tiled; + unsigned int rotated2_tiled; } drm_i915_sarea_t; /* Flags for perf_boxes diff --git a/shared-core/i915_drv.h b/shared-core/i915_drv.h index 0c3281d..550e386 100644 --- a/shared-core/i915_drv.h +++ b/shared-core/i915_drv.h @@ -146,9 +146,9 @@ extern void i915_mem_release(drm_device_ #define BEGIN_LP_RING(n) do { \ if (I915_VERBOSE) \ DRM_DEBUG("BEGIN_LP_RING(%d) in %s\n", \ - n, __FUNCTION__); \ - if (dev_priv->ring.space < n*4) \ - i915_wait_ring(dev, n*4, __FUNCTION__); \ + (n), __FUNCTION__); \ + if (dev_priv->ring.space < (n)*4) \ + i915_wait_ring(dev, (n)*4, __FUNCTION__); \ outcount = 0; \ outring = dev_priv->ring.tail; \ ringmask = dev_priv->ring.tail_mask; \ @@ -157,7 +157,7 @@ extern void i915_mem_release(drm_device_ #define OUT_RING(n) do { \ if (I915_VERBOSE) DRM_DEBUG(" OUT_RING %x\n", (int)(n)); \ - *(volatile unsigned int *)(virt + outring) = n; \ + *(volatile unsigned int *)(virt + outring) = (n); \ outcount++; \ outring += 4; \ outring &= ringmask; \ @@ -254,6 +254,8 @@ extern int i915_wait_ring(drm_device_t * #define GFX_OP_DESTBUFFER_VARS ((0x3<<29)|(0x1d<<24)|(0x85<<16)|0x0) #define GFX_OP_DRAWRECT_INFO ((0x3<<29)|(0x1d<<24)|(0x80<<16)|(0x3)) +#define GFX_OP_DRAWRECT_INFO_I965 ((0x7900<<16)|0x2) + #define MI_BATCH_BUFFER ((0x30<<23)|1) #define MI_BATCH_BUFFER_START (0x31<<23) #define MI_BATCH_BUFFER_END (0xA<<23) diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c index df4ce4e..64d89a7 100644 --- a/shared-core/i915_irq.c +++ b/shared-core/i915_irq.c @@ -70,22 +70,32 @@ irqreturn_t i915_driver_irq_handler(DRM_ static int i915_emit_irq(drm_device_t * dev) { - drm_i915_private_t *dev_priv = dev->dev_private; - u32 ret; - RING_LOCALS; + + drm_i915_private_t *dev_priv = dev->dev_private; + RING_LOCALS; - i915_kernel_lost_context(dev); + i915_kernel_lost_context(dev); - DRM_DEBUG("%s\n", __FUNCTION__); + DRM_DEBUG("%s\n", __FUNCTION__); - ret = dev_priv->counter; + dev_priv->sarea_priv->last_enqueue = ++dev_priv->counter; + + if (dev_priv->counter > 0x7FFFFFFFUL) + dev_priv->sarea_priv->last_enqueue = dev_priv->counter = 1; + + BEGIN_LP_RING(6); + OUT_RING(CMD_STORE_DWORD_IDX); + OUT_RING(20); + OUT_RING(dev_priv->counter); + + OUT_RING(0); + OUT_RING(0); + OUT_RING(GFX_OP_USER_INTERRUPT); + ADVANCE_LP_RING(); + + return dev_priv->counter; - BEGIN_LP_RING(2); - OUT_RING(0); - OUT_RING(GFX_OP_USER_INTERRUPT); - ADVANCE_LP_RING(); - return ret; } static int i915_wait_irq(drm_device_t * dev, int irq_nr) |
From: <ai...@ke...> - 2006-08-14 01:50:29
|
linux-core/drm_bufs.c | 2 +- linux-core/drm_mm.c | 6 +++--- linux-core/sis_mm.c | 6 +++--- linux-core/via_mm.c | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) New commits: diff-tree 18a48a9267826a3c81e87a5fa9bba79ea0cd295c (from 7a46d4139982cc82559ccf9a1bc09a52bdf12223) Author: Dave Airlie <ai...@li...> Date: Mon Aug 14 11:49:52 2006 +1000 remove all TRUE/FALSE no need for this in the drm, use 0 or 1 diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c index a977b5b..2eeb401 100644 --- a/linux-core/drm_bufs.c +++ b/linux-core/drm_bufs.c @@ -290,7 +290,7 @@ static int drm_addmap_core(drm_device_t user_token = (map->type == _DRM_SHM) ? (unsigned long) map->handle : map->offset; - ret = drm_map_handle(dev, &list->hash, user_token, FALSE); + ret = drm_map_handle(dev, &list->hash, user_token, 0); if (ret) { drm_free(map, sizeof(*map), DRM_MEM_MAPS); diff --git a/linux-core/drm_mm.c b/linux-core/drm_mm.c index c55ed45..8d95cd4 100644 --- a/linux-core/drm_mm.c +++ b/linux-core/drm_mm.c @@ -54,7 +54,7 @@ drm_mm_node_t *drm_mm_get_block(drm_mm_n if (parent->size == size) { list_del_init(&parent->fl_entry); - parent->free = FALSE; + parent->free = 0; return parent; } else { child = (drm_mm_node_t *) drm_alloc(sizeof(*child), DRM_MEM_MM); @@ -64,7 +64,7 @@ drm_mm_node_t *drm_mm_get_block(drm_mm_n INIT_LIST_HEAD(&child->ml_entry); INIT_LIST_HEAD(&child->fl_entry); - child->free = FALSE; + child->free = 0; child->size = size; child->start = parent->start; @@ -89,7 +89,7 @@ void drm_mm_put_block(drm_mm_t * mm, drm drm_mm_node_t *prev_node = NULL; drm_mm_node_t *next_node; - int merged = FALSE; + int merged = 0; if (cur_head->prev != root_head) { prev_node = list_entry(cur_head->prev, drm_mm_node_t, ml_entry); diff --git a/linux-core/sis_mm.c b/linux-core/sis_mm.c index 10e4a9a..c321c09 100644 --- a/linux-core/sis_mm.c +++ b/linux-core/sis_mm.c @@ -139,7 +139,7 @@ static int sis_drm_alloc(drm_device_t * mutex_lock(&dev->struct_mutex); - if (FALSE == ((pool == 0) ? dev_priv->vram_initialized : + if (0 == ((pool == 0) ? dev_priv->vram_initialized : dev_priv->agp_initialized)) { DRM_ERROR ("Attempt to allocate from uninitialized memory manager.\n"); @@ -312,8 +312,8 @@ void sis_lastclose(struct drm_device *de mutex_lock(&dev->struct_mutex); drm_sman_cleanup(&dev_priv->sman); - dev_priv->vram_initialized = FALSE; - dev_priv->agp_initialized = FALSE; + dev_priv->vram_initialized = 0; + dev_priv->agp_initialized = 0; dev_priv->mmio = NULL; mutex_unlock(&dev->struct_mutex); } diff --git a/linux-core/via_mm.c b/linux-core/via_mm.c index f4d147e..3195c06 100644 --- a/linux-core/via_mm.c +++ b/linux-core/via_mm.c @@ -118,8 +118,8 @@ void via_lastclose(struct drm_device *de mutex_lock(&dev->struct_mutex); drm_sman_cleanup(&dev_priv->sman); - dev_priv->vram_initialized = FALSE; - dev_priv->agp_initialized = FALSE; + dev_priv->vram_initialized = 0; + dev_priv->agp_initialized = 0; mutex_unlock(&dev->struct_mutex); } @@ -141,7 +141,7 @@ int via_mem_alloc(DRM_IOCTL_ARGS) return DRM_ERR(EINVAL); } mutex_lock(&dev->struct_mutex); - if (FALSE == ((mem.type == VIA_MEM_VIDEO) ? dev_priv->vram_initialized : + if (0 == ((mem.type == VIA_MEM_VIDEO) ? dev_priv->vram_initialized : dev_priv->agp_initialized)) { DRM_ERROR ("Attempt to allocate from uninitialized memory manager.\n"); |
From: <ai...@ke...> - 2006-08-14 01:52:47
|
linux-core/drm_mm.c | 8 ++++---- linux-core/drm_sman.c | 2 +- linux-core/drm_sman.h | 2 +- linux-core/sis_mm.c | 6 +++--- linux-core/via_mm.c | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) New commits: diff-tree 0d60cd0036c6bc5383cdc1dad719950afd68cbbf (from 18a48a9267826a3c81e87a5fa9bba79ea0cd295c) Author: Dave Airlie <ai...@li...> Date: Mon Aug 14 11:52:34 2006 +1000 remove all TRUE instances as well diff --git a/linux-core/drm_mm.c b/linux-core/drm_mm.c index 8d95cd4..617526b 100644 --- a/linux-core/drm_mm.c +++ b/linux-core/drm_mm.c @@ -95,7 +95,7 @@ void drm_mm_put_block(drm_mm_t * mm, drm prev_node = list_entry(cur_head->prev, drm_mm_node_t, ml_entry); if (prev_node->free) { prev_node->size += cur->size; - merged = TRUE; + merged = 1; } } if (cur_head->next != root_head) { @@ -110,12 +110,12 @@ void drm_mm_put_block(drm_mm_t * mm, drm } else { next_node->size += cur->size; next_node->start = cur->start; - merged = TRUE; + merged = 1; } } } if (!merged) { - cur->free = TRUE; + cur->free = 1; list_add(&cur->fl_entry, &list_root->fl_entry); } else { list_del(&cur->ml_entry); @@ -169,7 +169,7 @@ int drm_mm_init(drm_mm_t * mm, unsigned child->start = start; child->size = size; - child->free = TRUE; + child->free = 1; list_add(&child->fl_entry, &mm->root_node.fl_entry); list_add(&child->ml_entry, &mm->root_node.ml_entry); diff --git a/linux-core/drm_sman.c b/linux-core/drm_sman.c index baba913..b92f0ee 100644 --- a/linux-core/drm_sman.c +++ b/linux-core/drm_sman.c @@ -91,7 +91,7 @@ static void *drm_sman_mm_allocate(void * drm_mm_t *mm = (drm_mm_t *) private; drm_mm_node_t *tmp; - tmp = drm_mm_search_free(mm, size, alignment, TRUE); + tmp = drm_mm_search_free(mm, size, alignment, 1); if (!tmp) { return NULL; } diff --git a/linux-core/drm_sman.h b/linux-core/drm_sman.h index 7c48360..ddc732a 100644 --- a/linux-core/drm_sman.h +++ b/linux-core/drm_sman.h @@ -148,7 +148,7 @@ extern drm_memblock_item_t *drm_sman_all extern int drm_sman_free_key(drm_sman_t * sman, unsigned int key); /* - * returns TRUE iff there are no stale memory blocks associated with this owner. + * returns 1 iff there are no stale memory blocks associated with this owner. * Typically called to determine if we need to idle the hardware and call * drm_sman_owner_cleanup. If there are no stale memory blocks, it removes all * resources associated with owner. diff --git a/linux-core/sis_mm.c b/linux-core/sis_mm.c index c321c09..eca535f 100644 --- a/linux-core/sis_mm.c +++ b/linux-core/sis_mm.c @@ -117,7 +117,7 @@ static int sis_fb_init(DRM_IOCTL_ARGS) return ret; } - dev_priv->vram_initialized = TRUE; + dev_priv->vram_initialized = 1; dev_priv->vram_offset = fb.offset; mutex_unlock(&dev->struct_mutex); @@ -217,7 +217,7 @@ static int sis_ioctl_agp_init(DRM_IOCTL_ return ret; } - dev_priv->agp_initialized = TRUE; + dev_priv->agp_initialized = 1; dev_priv->agp_offset = agp.offset; mutex_unlock(&dev->struct_mutex); @@ -291,7 +291,7 @@ sis_idle(drm_device_t *dev) if (time_after_eq(jiffies, end)) { DRM_ERROR("Graphics engine idle timeout. " "Disabling idle check\n"); - dev_priv->idle_fault = TRUE; + dev_priv->idle_fault = 1; } /* diff --git a/linux-core/via_mm.c b/linux-core/via_mm.c index 3195c06..d97269f 100644 --- a/linux-core/via_mm.c +++ b/linux-core/via_mm.c @@ -52,7 +52,7 @@ int via_agp_init(DRM_IOCTL_ARGS) return ret; } - dev_priv->agp_initialized = TRUE; + dev_priv->agp_initialized = 1; dev_priv->agp_offset = agp.offset; mutex_unlock(&dev->struct_mutex); @@ -79,7 +79,7 @@ int via_fb_init(DRM_IOCTL_ARGS) return ret; } - dev_priv->vram_initialized = TRUE; + dev_priv->vram_initialized = 1; dev_priv->vram_offset = fb.offset; mutex_unlock(&dev->struct_mutex); |
From: <th...@ke...> - 2006-08-14 15:12:42
|
linux-core/drm_drv.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) New commits: diff-tree 4daa024918d461ab8d173631fa5187dc50253b67 (from 0d60cd0036c6bc5383cdc1dad719950afd68cbbf) Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> Date: Mon Aug 14 17:11:14 2006 +0200 Avoid kernel oops in some error paths calling drm_lastclose(). diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index 0281178..79209db 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -163,11 +163,13 @@ int drm_lastclose(drm_device_t * dev) dev->unique_len = 0; } - list_for_each_entry_safe(pt, next, &dev->magicfree, head) { - list_del(&pt->head); - drm_ht_remove_item(&dev->magiclist, &pt->hash_item); - drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC); - } + if (dev->magicfree.next) { + list_for_each_entry_safe(pt, next, &dev->magicfree, head) { + list_del(&pt->head); + drm_ht_remove_item(&dev->magiclist, &pt->hash_item); + drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC); + } + } /* Clear AGP information */ |
From: <th...@ke...> - 2006-08-16 14:37:52
|
linux-core/drm_drv.c | 2 ++ linux-core/drm_fops.c | 2 ++ 2 files changed, 4 insertions(+) New commits: diff-tree 0316f93d51abc52b816e936e0ece304ac47799c3 (from 4daa024918d461ab8d173631fa5187dc50253b67) Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> Date: Wed Aug 16 16:36:56 2006 +0200 Remove hash tables on DRM exit. diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index 79209db..9712170 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -169,6 +169,7 @@ int drm_lastclose(drm_device_t * dev) drm_ht_remove_item(&dev->magiclist, &pt->hash_item); drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC); } + drm_ht_remove(&dev->magiclist); } @@ -349,6 +350,7 @@ static void __exit drm_cleanup(drm_devic if (dev->maplist) { drm_free(dev->maplist, sizeof(*dev->maplist), DRM_MEM_MAPS); dev->maplist = NULL; + drm_ht_remove(&dev->map_hash); } if (!drm_fb_loaded) diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c index a58f3ae..691edff 100644 --- a/linux-core/drm_fops.c +++ b/linux-core/drm_fops.c @@ -53,6 +53,8 @@ static int drm_setup(drm_device_t * dev) return ret; } + dev->magicfree.next = NULL; + /* prebuild the SAREA */ i = drm_addmap(dev, 0, SAREA_MAX, _DRM_SHM, _DRM_CONTAINS_LOCK, &map); if (i != 0) |
From: <th...@ke...> - 2006-08-23 09:35:06
|
linux-core/drm_hashtab.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) New commits: diff-tree 8dfe917cb26bbeddda0e1b52060d8dce188468f3 (from 0316f93d51abc52b816e936e0ece304ac47799c3) Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> Date: Wed Aug 23 11:21:33 2006 +0200 Fix hashtab implementation leaking illegal error codes to user space. (Reported by Dave Airlie) diff --git a/linux-core/drm_hashtab.c b/linux-core/drm_hashtab.c index 4806113..a0b2d68 100644 --- a/linux-core/drm_hashtab.c +++ b/linux-core/drm_hashtab.c @@ -106,7 +106,7 @@ int drm_ht_insert_item(drm_open_hash_t * hlist_for_each(list, h_list) { entry = hlist_entry(list, drm_hash_item_t, head); if (entry->key == key) - return -1; + return -EINVAL; if (entry->key > key) break; parent = list; @@ -154,7 +154,7 @@ int drm_ht_find_item(drm_open_hash_t *ht list = drm_ht_find_key(ht, key); if (!list) - return -1; + return -EINVAL; *item = hlist_entry(list, drm_hash_item_t, head); return 0; @@ -170,7 +170,7 @@ int drm_ht_remove_key(drm_open_hash_t *h ht->fill--; return 0; } - return -1; + return -EINVAL; } int drm_ht_remove_item(drm_open_hash_t *ht, drm_hash_item_t *item) |
From: <th...@ke...> - 2006-08-23 16:10:52
|
linux-core/drm_bufs.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) New commits: diff-tree ea5709997329a6c425261dcc454cf7dd97a81167 (from 459b234d79daaa8a003da9ea48775a5587d5ba2a) Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> Date: Wed Aug 23 13:49:13 2006 +0200 Fix previous commit: Only fall back to hashed handles when there is a duplicate handle error. Not for other errors. diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c index 13b0b17..1d9c038 100644 --- a/linux-core/drm_bufs.c +++ b/linux-core/drm_bufs.c @@ -82,8 +82,8 @@ int drm_map_handle(drm_device_t *dev, dr int ret; hash->key = user_token; ret = drm_ht_insert_item(&dev->map_hash, hash); - if (!ret) - return 0; + if (ret != -EINVAL) + return ret; } return drm_ht_just_insert_please(&dev->map_hash, hash, user_token, 32 - PAGE_SHIFT - 3, |
From: <th...@ke...> - 2006-08-23 16:11:35
|
linux-core/drm_bufs.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) New commits: diff-tree 459b234d79daaa8a003da9ea48775a5587d5ba2a (from 8dfe917cb26bbeddda0e1b52060d8dce188468f3) Author: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> Date: Wed Aug 23 11:31:10 2006 +0200 Allow multiple addMaps with the same 32-bit map offset. (Reported by Dave Airlie) diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c index 2eeb401..13b0b17 100644 --- a/linux-core/drm_bufs.c +++ b/linux-core/drm_bufs.c @@ -78,14 +78,16 @@ int drm_map_handle(drm_device_t *dev, dr #error Unsupported long size. Neither 64 nor 32 bits. #endif - if (use_hashed_handle) { - return drm_ht_just_insert_please(&dev->map_hash, hash, - user_token, 32 - PAGE_SHIFT - 3, - PAGE_SHIFT, DRM_MAP_HASH_OFFSET); - } else { + if (!use_hashed_handle) { + int ret; hash->key = user_token; - return drm_ht_insert_item(&dev->map_hash, hash); + ret = drm_ht_insert_item(&dev->map_hash, hash); + if (!ret) + return 0; } + return drm_ht_just_insert_please(&dev->map_hash, hash, + user_token, 32 - PAGE_SHIFT - 3, + PAGE_SHIFT, DRM_MAP_HASH_OFFSET); } /** |
From: <da...@ke...> - 2006-08-26 10:25:43
|
shared-core/radeon_state.c | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-) New commits: diff-tree b99e332236ca5fcc11e8d7c89566bbf3bcf959ee (from ea5709997329a6c425261dcc454cf7dd97a81167) Author: Michel Dänzer <mi...@tu...> Date: Sat Aug 26 12:21:11 2006 +0200 Bug #7595: Avoid u32 overflows in radeon_check_and_fixup_offset(). The overflows could cause valid offsets to get rejected under some circumstances, e.g. when the framebuffer resides at the very end of the card's address space. diff --git a/shared-core/radeon_state.c b/shared-core/radeon_state.c index 58251dd..38b8714 100644 --- a/shared-core/radeon_state.c +++ b/shared-core/radeon_state.c @@ -42,7 +42,11 @@ static __inline__ int radeon_check_and_f drm_file_t * filp_priv, u32 * offset) { - u32 off = *offset; + u64 off = *offset; + u32 fb_start = dev_priv->fb_location; + u32 fb_end = fb_start + dev_priv->fb_size - 1; + u32 gart_start = dev_priv->gart_vm_start; + u32 gart_end = gart_start + dev_priv->gart_size - 1; struct drm_radeon_driver_file_fields *radeon_priv; /* Hrm ... the story of the offset ... So this function converts @@ -62,10 +66,8 @@ static __inline__ int radeon_check_and_f /* First, the best case, the offset already lands in either the * framebuffer or the GART mapped space */ - if ((off >= dev_priv->fb_location && - off < (dev_priv->fb_location + dev_priv->fb_size)) || - (off >= dev_priv->gart_vm_start && - off < (dev_priv->gart_vm_start + dev_priv->gart_size))) + if ((off >= fb_start && off <= fb_end) || + (off >= gart_start && off <= gart_end)) return 0; /* Ok, that didn't happen... now check if we have a zero based @@ -78,16 +80,13 @@ static __inline__ int radeon_check_and_f } /* Finally, assume we aimed at a GART offset if beyond the fb */ - if (off > (dev_priv->fb_location + dev_priv->fb_size)) - off = off - (dev_priv->fb_location + dev_priv->fb_size) + - dev_priv->gart_vm_start; + if (off > fb_end) + off = off - fb_end - 1 + gart_start; /* Now recheck and fail if out of bounds */ - if ((off >= dev_priv->fb_location && - off < (dev_priv->fb_location + dev_priv->fb_size)) || - (off >= dev_priv->gart_vm_start && - off < (dev_priv->gart_vm_start + dev_priv->gart_size))) { - DRM_DEBUG("offset fixed up to 0x%x\n", off); + if ((off >= fb_start && off <= fb_end) || + (off >= gart_start && off <= gart_end)) { + DRM_DEBUG("offset fixed up to 0x%x\n", (unsigned int)off); *offset = off; return 0; } |
From: <ai...@ke...> - 2006-09-12 06:13:44
|
linux-core/radeon_drv.c | 2 shared-core/drm_pciids.txt | 176 ++++++++++++++++++++++----------------------- shared-core/radeon_cp.c | 46 +++++------ shared-core/radeon_drv.h | 20 ++--- shared-core/radeon_state.c | 10 +- 5 files changed, 127 insertions(+), 127 deletions(-) New commits: diff-tree 3cc64a943a7240c73c92ab103ba0502b9ec07fee (from dddacd7a3a4bd0c453b346cee70d1d36a401e539) Author: Dave Airlie <airlied@starflyer-ubuntu.(none)> Date: Tue Sep 12 06:13:14 2006 +1000 drm: use radeon specific names for radeon flags diff --git a/linux-core/radeon_drv.c b/linux-core/radeon_drv.c index fca2d4e..b15e983 100644 --- a/linux-core/radeon_drv.c +++ b/linux-core/radeon_drv.c @@ -45,7 +45,7 @@ module_param_named(no_wb, radeon_no_wb, static int dri_library_name(struct drm_device * dev, char * buf) { drm_radeon_private_t *dev_priv = dev->dev_private; - int family = dev_priv->flags & CHIP_FAMILY_MASK; + int family = dev_priv->flags & RADEON_FAMILY_MASK; return snprintf(buf, PAGE_SIZE, "%s\n", (family < CHIP_R200) ? "radeon" : diff --git a/shared-core/drm_pciids.txt b/shared-core/drm_pciids.txt index 9ef2c00..9e0c099 100644 --- a/shared-core/drm_pciids.txt +++ b/shared-core/drm_pciids.txt @@ -1,11 +1,11 @@ [radeon] -0x1002 0x3150 CHIP_RV380|CHIP_IS_MOBILITY "ATI Radeon Mobility X600 M24" -0x1002 0x3152 CHIP_RV380|CHIP_IS_MOBILITY|CHIP_NEW_MEMMAP "ATI Radeon Mobility X300 M24" -0x1002 0x3154 CHIP_RV380|CHIP_IS_MOBILITY|CHIP_NEW_MEMMAP "ATI FireGL M24 GL" -0x1002 0x3E50 CHIP_RV380|CHIP_NEW_MEMMAP "ATI Radeon RV380 X600" -0x1002 0x3E54 CHIP_RV380|CHIP_NEW_MEMMAP "ATI FireGL V3200 RV380" -0x1002 0x4136 CHIP_RS100|CHIP_IS_IGP "ATI Radeon RS100 IGP 320" -0x1002 0x4137 CHIP_RS200|CHIP_IS_IGP "ATI Radeon RS200 IGP 340" +0x1002 0x3150 CHIP_RV380|RADEON_IS_MOBILITY "ATI Radeon Mobility X600 M24" +0x1002 0x3152 CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP "ATI Radeon Mobility X300 M24" +0x1002 0x3154 CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP "ATI FireGL M24 GL" +0x1002 0x3E50 CHIP_RV380|RADEON_NEW_MEMMAP "ATI Radeon RV380 X600" +0x1002 0x3E54 CHIP_RV380|RADEON_NEW_MEMMAP "ATI FireGL V3200 RV380" +0x1002 0x4136 CHIP_RS100|RADEON_IS_IGP "ATI Radeon RS100 IGP 320" +0x1002 0x4137 CHIP_RS200|RADEON_IS_IGP "ATI Radeon RS200 IGP 340" 0x1002 0x4144 CHIP_R300 "ATI Radeon AD 9500" 0x1002 0x4145 CHIP_R300 "ATI Radeon AE 9700 Pro" 0x1002 0x4146 CHIP_R300 "ATI Radeon AF R300 9600TX" @@ -21,35 +21,35 @@ 0x1002 0x4154 CHIP_RV350 "ATI FireGL AT T2" 0x1002 0x4155 CHIP_RV350 "ATI Radeon 9650" 0x1002 0x4156 CHIP_RV350 "ATI FireGL AV RV360 T2" -0x1002 0x4237 CHIP_RS200|CHIP_IS_IGP "ATI Radeon RS250 IGP" +0x1002 0x4237 CHIP_RS200|RADEON_IS_IGP "ATI Radeon RS250 IGP" 0x1002 0x4242 CHIP_R200 "ATI Radeon BB R200 AIW 8500DV" 0x1002 0x4243 CHIP_R200 "ATI Radeon BC R200" -0x1002 0x4336 CHIP_RS100|CHIP_IS_IGP|CHIP_IS_MOBILITY "ATI Radeon RS100 Mobility U1" -0x1002 0x4337 CHIP_RS200|CHIP_IS_IGP|CHIP_IS_MOBILITY "ATI Radeon RS200 Mobility IGP 340M" -0x1002 0x4437 CHIP_RS200|CHIP_IS_IGP|CHIP_IS_MOBILITY "ATI Radeon RS250 Mobility IGP" +0x1002 0x4336 CHIP_RS100|RADEON_IS_IGP|RADEON_IS_MOBILITY "ATI Radeon RS100 Mobility U1" +0x1002 0x4337 CHIP_RS200|RADEON_IS_IGP|RADEON_IS_MOBILITY "ATI Radeon RS200 Mobility IGP 340M" +0x1002 0x4437 CHIP_RS200|RADEON_IS_IGP|RADEON_IS_MOBILITY "ATI Radeon RS250 Mobility IGP" 0x1002 0x4966 CHIP_RV250 "ATI Radeon If RV250 9000" 0x1002 0x4967 CHIP_RV250 "ATI Radeon Ig RV250 9000" -0x1002 0x4A48 CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon JH R420 X800" -0x1002 0x4A49 CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon JI R420 X800 Pro" -0x1002 0x4A4A CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon JJ R420 X800 SE" -0x1002 0x4A4B CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon JK R420 X800 XT" -0x1002 0x4A4C CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon JL R420 X800" -0x1002 0x4A4D CHIP_R420|CHIP_NEW_MEMMAP "ATI FireGL JM X3-256" -0x1002 0x4A4E CHIP_R420|CHIP_IS_MOBILITY|CHIP_NEW_MEMMAP "ATI Radeon JN R420 Mobility M18" -0x1002 0x4A4F CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon JO R420 X800 SE" -0x1002 0x4A50 CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon JP R420 X800 XT PE" -0x1002 0x4A54 CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon JT R420 AIW X800 VE" -0x1002 0x4B49 CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon R481 X850 XT" -0x1002 0x4B4A CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon R481 X850 SE" -0x1002 0x4B4B CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon R481 X850 Pro" -0x1002 0x4B4C CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon R481 X850 XT PE" -0x1002 0x4C57 CHIP_RV200|CHIP_IS_MOBILITY "ATI Radeon LW RV200 Mobility 7500 M7" -0x1002 0x4C58 CHIP_RV200|CHIP_IS_MOBILITY "ATI Radeon LX RV200 Mobility FireGL 7800 M7" -0x1002 0x4C59 CHIP_RV100|CHIP_IS_MOBILITY "ATI Radeon LY RV100 Mobility M6" -0x1002 0x4C5A CHIP_RV100|CHIP_IS_MOBILITY "ATI Radeon LZ RV100 Mobility M6" -0x1002 0x4C64 CHIP_RV250|CHIP_IS_MOBILITY "ATI Radeon Ld RV250 Mobility 9000 M9" +0x1002 0x4A48 CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon JH R420 X800" +0x1002 0x4A49 CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon JI R420 X800 Pro" +0x1002 0x4A4A CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon JJ R420 X800 SE" +0x1002 0x4A4B CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon JK R420 X800 XT" +0x1002 0x4A4C CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon JL R420 X800" +0x1002 0x4A4D CHIP_R420|RADEON_NEW_MEMMAP "ATI FireGL JM X3-256" +0x1002 0x4A4E CHIP_R420|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP "ATI Radeon JN R420 Mobility M18" +0x1002 0x4A4F CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon JO R420 X800 SE" +0x1002 0x4A50 CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon JP R420 X800 XT PE" +0x1002 0x4A54 CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon JT R420 AIW X800 VE" +0x1002 0x4B49 CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon R481 X850 XT" +0x1002 0x4B4A CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon R481 X850 SE" +0x1002 0x4B4B CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon R481 X850 Pro" +0x1002 0x4B4C CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon R481 X850 XT PE" +0x1002 0x4C57 CHIP_RV200|RADEON_IS_MOBILITY "ATI Radeon LW RV200 Mobility 7500 M7" +0x1002 0x4C58 CHIP_RV200|RADEON_IS_MOBILITY "ATI Radeon LX RV200 Mobility FireGL 7800 M7" +0x1002 0x4C59 CHIP_RV100|RADEON_IS_MOBILITY "ATI Radeon LY RV100 Mobility M6" +0x1002 0x4C5A CHIP_RV100|RADEON_IS_MOBILITY "ATI Radeon LZ RV100 Mobility M6" +0x1002 0x4C64 CHIP_RV250|RADEON_IS_MOBILITY "ATI Radeon Ld RV250 Mobility 9000 M9" 0x1002 0x4C66 CHIP_RV250 "ATI Radeon Lf RV250 Mobility 9000 M9 / FireMV 2400 PCI" -0x1002 0x4C67 CHIP_RV250|CHIP_IS_MOBILITY "ATI Radeon Lg RV250 Mobility 9000 M9" +0x1002 0x4C67 CHIP_RV250|RADEON_IS_MOBILITY "ATI Radeon Lg RV250 Mobility 9000 M9" 0x1002 0x4E44 CHIP_R300 "ATI Radeon ND R300 9700 Pro" 0x1002 0x4E45 CHIP_R300 "ATI Radeon NE R300 9500 Pro / 9700" 0x1002 0x4E46 CHIP_R300 "ATI Radeon NF R300 9600TX" @@ -58,16 +58,16 @@ 0x1002 0x4E49 CHIP_R350 "ATI Radeon NI R350 9800" 0x1002 0x4E4A CHIP_R350 "ATI Radeon NJ R360 9800 XT" 0x1002 0x4E4B CHIP_R350 "ATI FireGL NK X2" -0x1002 0x4E50 CHIP_RV350|CHIP_IS_MOBILITY "ATI Radeon RV350 Mobility 9600 M10 NP" -0x1002 0x4E51 CHIP_RV350|CHIP_IS_MOBILITY "ATI Radeon RV350 Mobility 9600 M10 NQ" -0x1002 0x4E52 CHIP_RV350|CHIP_IS_MOBILITY "ATI Radeon RV350 Mobility 9600 M11 NR" -0x1002 0x4E53 CHIP_RV350|CHIP_IS_MOBILITY "ATI Radeon RV350 Mobility 9600 M10 NS" -0x1002 0x4E54 CHIP_RV350|CHIP_IS_MOBILITY "ATI FireGL T2/T2e" -0x1002 0x4E56 CHIP_RV350|CHIP_IS_MOBILITY "ATI Radeon Mobility 9550" -0x1002 0x5144 CHIP_R100|CHIP_SINGLE_CRTC "ATI Radeon QD R100" -0x1002 0x5145 CHIP_R100|CHIP_SINGLE_CRTC "ATI Radeon QE R100" -0x1002 0x5146 CHIP_R100|CHIP_SINGLE_CRTC "ATI Radeon QF R100" -0x1002 0x5147 CHIP_R100|CHIP_SINGLE_CRTC "ATI Radeon QG R100" +0x1002 0x4E50 CHIP_RV350|RADEON_IS_MOBILITY "ATI Radeon RV350 Mobility 9600 M10 NP" +0x1002 0x4E51 CHIP_RV350|RADEON_IS_MOBILITY "ATI Radeon RV350 Mobility 9600 M10 NQ" +0x1002 0x4E52 CHIP_RV350|RADEON_IS_MOBILITY "ATI Radeon RV350 Mobility 9600 M11 NR" +0x1002 0x4E53 CHIP_RV350|RADEON_IS_MOBILITY "ATI Radeon RV350 Mobility 9600 M10 NS" +0x1002 0x4E54 CHIP_RV350|RADEON_IS_MOBILITY "ATI FireGL T2/T2e" +0x1002 0x4E56 CHIP_RV350|RADEON_IS_MOBILITY "ATI Radeon Mobility 9550" +0x1002 0x5144 CHIP_R100|RADEON_SINGLE_CRTC "ATI Radeon QD R100" +0x1002 0x5145 CHIP_R100|RADEON_SINGLE_CRTC "ATI Radeon QE R100" +0x1002 0x5146 CHIP_R100|RADEON_SINGLE_CRTC "ATI Radeon QF R100" +0x1002 0x5147 CHIP_R100|RADEON_SINGLE_CRTC "ATI Radeon QG R100" 0x1002 0x5148 CHIP_R200 "ATI Radeon QH R200 8500" 0x1002 0x514C CHIP_R200 "ATI Radeon QL R200 8500 LE" 0x1002 0x514D CHIP_R200 "ATI Radeon QM R200 9100" @@ -76,59 +76,59 @@ 0x1002 0x5159 CHIP_RV100 "ATI Radeon QY RV100 7000/VE" 0x1002 0x515A CHIP_RV100 "ATI Radeon QZ RV100 7000/VE" 0x1002 0x515E CHIP_RV100 "ATI ES1000 RN50" -0x1002 0x5460 CHIP_RV380|CHIP_IS_MOBILITY "ATI Radeon Mobility X300 M22" -0x1002 0x5462 CHIP_RV380|CHIP_IS_MOBILITY "ATI Radeon Mobility X600 SE M24C" -0x1002 0x5464 CHIP_RV380|CHIP_IS_MOBILITY "ATI FireGL M22 GL 5464" -0x1002 0x5548 CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon R423 X800" -0x1002 0x5549 CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon R423 X800 Pro" -0x1002 0x554A CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon R423 X800 XT PE" -0x1002 0x554B CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon R423 X800 SE" -0x1002 0x554C CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon R430 X800 XTP" -0x1002 0x554D CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon R430 X800 XL" -0x1002 0x554E CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon R430 X800 SE" -0x1002 0x554F CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon R430 X800" -0x1002 0x5550 CHIP_R420|CHIP_NEW_MEMMAP "ATI FireGL V7100 R423" -0x1002 0x5551 CHIP_R420|CHIP_NEW_MEMMAP "ATI FireGL V5100 R423 UQ" -0x1002 0x5552 CHIP_R420|CHIP_NEW_MEMMAP "ATI FireGL unknown R423 UR" -0x1002 0x5554 CHIP_R420|CHIP_NEW_MEMMAP "ATI FireGL unknown R423 UT" -0x1002 0x564A CHIP_RV410|CHIP_IS_MOBILITY|CHIP_NEW_MEMMAP "ATI Mobility FireGL V5000 M26" -0x1002 0x564B CHIP_RV410|CHIP_IS_MOBILITY|CHIP_NEW_MEMMAP "ATI Mobility FireGL V5000 M26" -0x1002 0x564F CHIP_RV410|CHIP_IS_MOBILITY|CHIP_NEW_MEMMAP "ATI Radeon Mobility X700 XL M26" -0x1002 0x5652 CHIP_RV410|CHIP_IS_MOBILITY|CHIP_NEW_MEMMAP "ATI Radeon Mobility X700 M26" -0x1002 0x5653 CHIP_RV410|CHIP_IS_MOBILITY|CHIP_NEW_MEMMAP "ATI Radeon Mobility X700 M26" -0x1002 0x5834 CHIP_RS300|CHIP_IS_IGP "ATI Radeon RS300 9100 IGP" -0x1002 0x5835 CHIP_RS300|CHIP_IS_IGP|CHIP_IS_MOBILITY "ATI Radeon RS300 Mobility IGP" +0x1002 0x5460 CHIP_RV380|RADEON_IS_MOBILITY "ATI Radeon Mobility X300 M22" +0x1002 0x5462 CHIP_RV380|RADEON_IS_MOBILITY "ATI Radeon Mobility X600 SE M24C" +0x1002 0x5464 CHIP_RV380|RADEON_IS_MOBILITY "ATI FireGL M22 GL 5464" +0x1002 0x5548 CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon R423 X800" +0x1002 0x5549 CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon R423 X800 Pro" +0x1002 0x554A CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon R423 X800 XT PE" +0x1002 0x554B CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon R423 X800 SE" +0x1002 0x554C CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon R430 X800 XTP" +0x1002 0x554D CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon R430 X800 XL" +0x1002 0x554E CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon R430 X800 SE" +0x1002 0x554F CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon R430 X800" +0x1002 0x5550 CHIP_R420|RADEON_NEW_MEMMAP "ATI FireGL V7100 R423" +0x1002 0x5551 CHIP_R420|RADEON_NEW_MEMMAP "ATI FireGL V5100 R423 UQ" +0x1002 0x5552 CHIP_R420|RADEON_NEW_MEMMAP "ATI FireGL unknown R423 UR" +0x1002 0x5554 CHIP_R420|RADEON_NEW_MEMMAP "ATI FireGL unknown R423 UT" +0x1002 0x564A CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP "ATI Mobility FireGL V5000 M26" +0x1002 0x564B CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP "ATI Mobility FireGL V5000 M26" +0x1002 0x564F CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP "ATI Radeon Mobility X700 XL M26" +0x1002 0x5652 CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP "ATI Radeon Mobility X700 M26" +0x1002 0x5653 CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP "ATI Radeon Mobility X700 M26" +0x1002 0x5834 CHIP_RS300|RADEON_IS_IGP "ATI Radeon RS300 9100 IGP" +0x1002 0x5835 CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY "ATI Radeon RS300 Mobility IGP" 0x1002 0x5960 CHIP_RV280 "ATI Radeon RV280 9250" 0x1002 0x5961 CHIP_RV280 "ATI Radeon RV280 9200" 0x1002 0x5962 CHIP_RV280 "ATI Radeon RV280 9200" 0x1002 0x5964 CHIP_RV280 "ATI Radeon RV280 9200 SE" 0x1002 0x5965 CHIP_RV280 "ATI FireMV 2200 PCI" 0x1002 0x5969 CHIP_RV100 "ATI ES1000 RN50" -0x1002 0x5b60 CHIP_RV380|CHIP_NEW_MEMMAP "ATI Radeon RV370 X300 SE" -0x1002 0x5b62 CHIP_RV380|CHIP_NEW_MEMMAP "ATI Radeon RV370 X600 Pro" -0x1002 0x5b63 CHIP_RV380|CHIP_NEW_MEMMAP "ATI Radeon RV370 X550" -0x1002 0x5b64 CHIP_RV380|CHIP_NEW_MEMMAP "ATI FireGL V3100 (RV370) 5B64" -0x1002 0x5b65 CHIP_RV380|CHIP_NEW_MEMMAP "ATI FireMV 2200 PCIE (RV370) 5B65" -0x1002 0x5c61 CHIP_RV280|CHIP_IS_MOBILITY "ATI Radeon RV280 Mobility" -0x1002 0x5c63 CHIP_RV280|CHIP_IS_MOBILITY "ATI Radeon RV280 Mobility" -0x1002 0x5d48 CHIP_R420|CHIP_IS_MOBILITY|CHIP_NEW_MEMMAP "ATI Mobility Radeon X800 XT M28" -0x1002 0x5d49 CHIP_R420|CHIP_IS_MOBILITY|CHIP_NEW_MEMMAP "ATI Mobility FireGL V5100 M28" -0x1002 0x5d4a CHIP_R420|CHIP_IS_MOBILITY|CHIP_NEW_MEMMAP "ATI Mobility Radeon X800 M28" -0x1002 0x5d4c CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon R480 X850" -0x1002 0x5d4d CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon R480 X850 XT PE" -0x1002 0x5d4e CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon R480 X850 SE" -0x1002 0x5d4f CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon R480 X850 Pro" -0x1002 0x5d50 CHIP_R420|CHIP_NEW_MEMMAP "ATI unknown Radeon / FireGL R480" -0x1002 0x5d52 CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon R480 X850 XT" -0x1002 0x5d57 CHIP_R420|CHIP_NEW_MEMMAP "ATI Radeon R423 X800 XT" -0x1002 0x5e48 CHIP_RV410|CHIP_NEW_MEMMAP "ATI FireGL V5000 RV410" -0x1002 0x5e4a CHIP_RV410|CHIP_NEW_MEMMAP "ATI Radeon RV410 X700 XT" -0x1002 0x5e4b CHIP_RV410|CHIP_NEW_MEMMAP "ATI Radeon RV410 X700 Pro" -0x1002 0x5e4c CHIP_RV410|CHIP_NEW_MEMMAP "ATI Radeon RV410 X700 SE" -0x1002 0x5e4d CHIP_RV410|CHIP_NEW_MEMMAP "ATI Radeon RV410 X700" -0x1002 0x5e4f CHIP_RV410|CHIP_NEW_MEMMAP "ATI Radeon RV410 X700 SE" -0x1002 0x7834 CHIP_RS300|CHIP_IS_IGP|CHIP_NEW_MEMMAP "ATI Radeon RS350 9000/9100 IGP" -0x1002 0x7835 CHIP_RS300|CHIP_IS_IGP|CHIP_IS_MOBILITY|CHIP_NEW_MEMMAP "ATI Radeon RS350 Mobility IGP" +0x1002 0x5b60 CHIP_RV380|RADEON_NEW_MEMMAP "ATI Radeon RV370 X300 SE" +0x1002 0x5b62 CHIP_RV380|RADEON_NEW_MEMMAP "ATI Radeon RV370 X600 Pro" +0x1002 0x5b63 CHIP_RV380|RADEON_NEW_MEMMAP "ATI Radeon RV370 X550" +0x1002 0x5b64 CHIP_RV380|RADEON_NEW_MEMMAP "ATI FireGL V3100 (RV370) 5B64" +0x1002 0x5b65 CHIP_RV380|RADEON_NEW_MEMMAP "ATI FireMV 2200 PCIE (RV370) 5B65" +0x1002 0x5c61 CHIP_RV280|RADEON_IS_MOBILITY "ATI Radeon RV280 Mobility" +0x1002 0x5c63 CHIP_RV280|RADEON_IS_MOBILITY "ATI Radeon RV280 Mobility" +0x1002 0x5d48 CHIP_R420|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP "ATI Mobility Radeon X800 XT M28" +0x1002 0x5d49 CHIP_R420|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP "ATI Mobility FireGL V5100 M28" +0x1002 0x5d4a CHIP_R420|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP "ATI Mobility Radeon X800 M28" +0x1002 0x5d4c CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon R480 X850" +0x1002 0x5d4d CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon R480 X850 XT PE" +0x1002 0x5d4e CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon R480 X850 SE" +0x1002 0x5d4f CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon R480 X850 Pro" +0x1002 0x5d50 CHIP_R420|RADEON_NEW_MEMMAP "ATI unknown Radeon / FireGL R480" +0x1002 0x5d52 CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon R480 X850 XT" +0x1002 0x5d57 CHIP_R420|RADEON_NEW_MEMMAP "ATI Radeon R423 X800 XT" +0x1002 0x5e48 CHIP_RV410|RADEON_NEW_MEMMAP "ATI FireGL V5000 RV410" +0x1002 0x5e4a CHIP_RV410|RADEON_NEW_MEMMAP "ATI Radeon RV410 X700 XT" +0x1002 0x5e4b CHIP_RV410|RADEON_NEW_MEMMAP "ATI Radeon RV410 X700 Pro" +0x1002 0x5e4c CHIP_RV410|RADEON_NEW_MEMMAP "ATI Radeon RV410 X700 SE" +0x1002 0x5e4d CHIP_RV410|RADEON_NEW_MEMMAP "ATI Radeon RV410 X700" +0x1002 0x5e4f CHIP_RV410|RADEON_NEW_MEMMAP "ATI Radeon RV410 X700 SE" +0x1002 0x7834 CHIP_RS300|RADEON_IS_IGP|RADEON_NEW_MEMMAP "ATI Radeon RS350 9000/9100 IGP" +0x1002 0x7835 CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP "ATI Radeon RS350 Mobility IGP" [r128] 0x1002 0x4c45 0 "ATI Rage 128 Mobility LE (PCI)" diff --git a/shared-core/radeon_cp.c b/shared-core/radeon_cp.c index 4e7b282..4135f4d 100644 --- a/shared-core/radeon_cp.c +++ b/shared-core/radeon_cp.c @@ -1130,7 +1130,7 @@ static void radeon_cp_init_ring_buffer(d | (dev_priv->fb_location >> 16)); #if __OS_HAS_AGP - if (dev_priv->flags & CHIP_IS_AGP) { + if (dev_priv->flags & RADEON_IS_AGP) { RADEON_WRITE(RADEON_AGP_BASE, (unsigned int)dev->agp->base); RADEON_WRITE(RADEON_MC_AGP_LOCATION, (((dev_priv->gart_vm_start - 1 + @@ -1158,7 +1158,7 @@ static void radeon_cp_init_ring_buffer(d dev_priv->ring.tail = cur_read_ptr; #if __OS_HAS_AGP - if (dev_priv->flags & CHIP_IS_AGP) { + if (dev_priv->flags & RADEON_IS_AGP) { RADEON_WRITE(RADEON_CP_RB_RPTR_ADDR, dev_priv->ring_rptr->offset - dev->agp->base + dev_priv->gart_vm_start); @@ -1301,7 +1301,7 @@ static void radeon_set_pcigart(drm_radeo { u32 tmp; - if (dev_priv->flags & CHIP_IS_PCIE) { + if (dev_priv->flags & RADEON_IS_PCIE) { radeon_set_pciegart(dev_priv, on); return; } @@ -1339,26 +1339,26 @@ static int radeon_do_init_cp(drm_device_ DRM_DEBUG("\n"); /* if we require new memory map but we don't have it fail */ - if ((dev_priv->flags & CHIP_NEW_MEMMAP) && !dev_priv->new_memmap) + if ((dev_priv->flags & RADEON_NEW_MEMMAP) && !dev_priv->new_memmap) { DRM_ERROR("Cannot initialise DRM on this card\nThis card requires a new X.org DDX for 3D\n"); radeon_do_cleanup_cp(dev); return DRM_ERR(EINVAL); } - if (init->is_pci && (dev_priv->flags & CHIP_IS_AGP)) + if (init->is_pci && (dev_priv->flags & RADEON_IS_AGP)) { DRM_DEBUG("Forcing AGP card to PCI mode\n"); - dev_priv->flags &= ~CHIP_IS_AGP; + dev_priv->flags &= ~RADEON_IS_AGP; } - else if (!(dev_priv->flags & (CHIP_IS_AGP | CHIP_IS_PCI | CHIP_IS_PCIE)) + else if (!(dev_priv->flags & (RADEON_IS_AGP | RADEON_IS_PCI | RADEON_IS_PCIE)) && !init->is_pci) { DRM_DEBUG("Restoring AGP flag\n"); - dev_priv->flags |= CHIP_IS_AGP; + dev_priv->flags |= RADEON_IS_AGP; } - if ((!(dev_priv->flags & CHIP_IS_AGP)) && !dev->sg) { + if ((!(dev_priv->flags & RADEON_IS_AGP)) && !dev->sg) { DRM_ERROR("PCI GART memory not allocated!\n"); radeon_do_cleanup_cp(dev); return DRM_ERR(EINVAL); @@ -1501,7 +1501,7 @@ static int radeon_do_init_cp(drm_device_ init->sarea_priv_offset); #if __OS_HAS_AGP - if (dev_priv->flags & CHIP_IS_AGP) { + if (dev_priv->flags & RADEON_IS_AGP) { drm_core_ioremap(dev_priv->cp_ring, dev); drm_core_ioremap(dev_priv->ring_rptr, dev); drm_core_ioremap(dev->agp_buffer_map, dev); @@ -1560,7 +1560,7 @@ static int radeon_do_init_cp(drm_device_ * align it down. */ #if __OS_HAS_AGP - if (dev_priv->flags & CHIP_IS_AGP) { + if (dev_priv->flags & RADEON_IS_AGP) { base = dev->agp->base; /* Check if valid */ if ((base + dev_priv->gart_size) > dev_priv->fb_location && @@ -1590,7 +1590,7 @@ static int radeon_do_init_cp(drm_device_ } #if __OS_HAS_AGP - if (dev_priv->flags & CHIP_IS_AGP) + if (dev_priv->flags & RADEON_IS_AGP) dev_priv->gart_buffers_offset = (dev->agp_buffer_map->offset - dev->agp->base + dev_priv->gart_vm_start); @@ -1616,7 +1616,7 @@ static int radeon_do_init_cp(drm_device_ dev_priv->ring.high_mark = RADEON_RING_HIGH_MARK; #if __OS_HAS_AGP - if (dev_priv->flags & CHIP_IS_AGP) { + if (dev_priv->flags & RADEON_IS_AGP) { /* Turn off PCI GART */ radeon_set_pcigart(dev_priv, 0); } else @@ -1636,7 +1636,7 @@ static int radeon_do_init_cp(drm_device_ dev_priv->gart_info.mapping.handle; dev_priv->gart_info.is_pcie = - !!(dev_priv->flags & CHIP_IS_PCIE); + !!(dev_priv->flags & RADEON_IS_PCIE); dev_priv->gart_info.gart_table_location = DRM_ATI_GART_FB; @@ -1648,7 +1648,7 @@ static int radeon_do_init_cp(drm_device_ DRM_ATI_GART_MAIN; dev_priv->gart_info.addr = NULL; dev_priv->gart_info.bus_addr = 0; - if (dev_priv->flags & CHIP_IS_PCIE) { + if (dev_priv->flags & RADEON_IS_PCIE) { DRM_ERROR ("Cannot use PCI Express without GART in FB memory\n"); radeon_do_cleanup_cp(dev); @@ -1690,7 +1690,7 @@ static int radeon_do_cleanup_cp(drm_devi drm_irq_uninstall(dev); #if __OS_HAS_AGP - if (dev_priv->flags & CHIP_IS_AGP) { + if (dev_priv->flags & RADEON_IS_AGP) { if (dev_priv->cp_ring != NULL) { drm_core_ioremapfree(dev_priv->cp_ring, dev); dev_priv->cp_ring = NULL; @@ -1745,7 +1745,7 @@ static int radeon_do_resume_cp(drm_devic DRM_DEBUG("Starting radeon_do_resume_cp()\n"); #if __OS_HAS_AGP - if (dev_priv->flags & CHIP_IS_AGP) { + if (dev_priv->flags & RADEON_IS_AGP) { /* Turn off PCI GART */ radeon_set_pcigart(dev_priv, 0); } else @@ -2194,7 +2194,7 @@ int radeon_driver_load(struct drm_device dev->dev_private = (void *)dev_priv; dev_priv->flags = flags; - switch (flags & CHIP_FAMILY_MASK) { + switch (flags & RADEON_FAMILY_MASK) { case CHIP_R100: case CHIP_RV200: case CHIP_R200: @@ -2202,7 +2202,7 @@ int radeon_driver_load(struct drm_device case CHIP_R350: case CHIP_R420: case CHIP_RV410: - dev_priv->flags |= CHIP_HAS_HIERZ; + dev_priv->flags |= RADEON_HAS_HIERZ; break; default: /* all other chips have no hierarchical z buffer */ @@ -2210,14 +2210,14 @@ int radeon_driver_load(struct drm_device } if (drm_device_is_agp(dev)) - dev_priv->flags |= CHIP_IS_AGP; + dev_priv->flags |= RADEON_IS_AGP; else if (drm_device_is_pcie(dev)) - dev_priv->flags |= CHIP_IS_PCIE; + dev_priv->flags |= RADEON_IS_PCIE; else - dev_priv->flags |= CHIP_IS_PCI; + dev_priv->flags |= RADEON_IS_PCI; DRM_DEBUG("%s card detected\n", - ((dev_priv->flags & CHIP_IS_AGP) ? "AGP" : (((dev_priv->flags & CHIP_IS_PCIE) ? "PCIE" : "PCI")))); + ((dev_priv->flags & RADEON_IS_AGP) ? "AGP" : (((dev_priv->flags & RADEON_IS_PCIE) ? "PCIE" : "PCI")))); return ret; } diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h index 5fa8254..5fc9331 100644 --- a/shared-core/radeon_drv.h +++ b/shared-core/radeon_drv.h @@ -134,16 +134,16 @@ enum radeon_cp_microcode_version { * Chip flags */ enum radeon_chip_flags { - CHIP_FAMILY_MASK = 0x0000ffffUL, - CHIP_FLAGS_MASK = 0xffff0000UL, - CHIP_IS_MOBILITY = 0x00010000UL, - CHIP_IS_IGP = 0x00020000UL, - CHIP_SINGLE_CRTC = 0x00040000UL, - CHIP_IS_AGP = 0x00080000UL, - CHIP_HAS_HIERZ = 0x00100000UL, - CHIP_IS_PCIE = 0x00200000UL, - CHIP_NEW_MEMMAP = 0x00400000UL, - CHIP_IS_PCI = 0x00800000UL, + RADEON_FAMILY_MASK = 0x0000ffffUL, + RADEON_FLAGS_MASK = 0xffff0000UL, + RADEON_IS_MOBILITY = 0x00010000UL, + RADEON_IS_IGP = 0x00020000UL, + RADEON_SINGLE_CRTC = 0x00040000UL, + RADEON_IS_AGP = 0x00080000UL, + RADEON_HAS_HIERZ = 0x00100000UL, + RADEON_IS_PCIE = 0x00200000UL, + RADEON_NEW_MEMMAP = 0x00400000UL, + RADEON_IS_PCI = 0x00800000UL, }; #define GET_RING_HEAD(dev_priv) (dev_priv->writeback_works ? \ diff --git a/shared-core/radeon_state.c b/shared-core/radeon_state.c index 8c1a406..0a196c0 100644 --- a/shared-core/radeon_state.c +++ b/shared-core/radeon_state.c @@ -861,7 +861,7 @@ static void radeon_cp_dispatch_clear(drm */ dev_priv->sarea_priv->ctx_owner = 0; - if ((dev_priv->flags & CHIP_HAS_HIERZ) + if ((dev_priv->flags & RADEON_HAS_HIERZ) && (flags & RADEON_USE_HIERZ)) { /* FIXME : reverse engineer that for Rx00 cards */ /* FIXME : the mask supposedly contains low-res z values. So can't set @@ -906,7 +906,7 @@ static void radeon_cp_dispatch_clear(drm for (i = 0; i < nbox; i++) { int tileoffset, nrtilesx, nrtilesy, j; /* it looks like r200 needs rv-style clears, at least if hierz is not enabled? */ - if ((dev_priv->flags & CHIP_HAS_HIERZ) + if ((dev_priv->flags & RADEON_HAS_HIERZ) && !(dev_priv->microcode_version == UCODE_R200)) { /* FIXME : figure this out for r200 (when hierz is enabled). Or maybe r200 actually doesn't need to put the low-res z value into @@ -990,7 +990,7 @@ static void radeon_cp_dispatch_clear(drm } /* TODO don't always clear all hi-level z tiles */ - if ((dev_priv->flags & CHIP_HAS_HIERZ) + if ((dev_priv->flags & RADEON_HAS_HIERZ) && (dev_priv->microcode_version == UCODE_R200) && (flags & RADEON_USE_HIERZ)) /* r100 and cards without hierarchical z-buffer have no high-level z-buffer */ @@ -3031,9 +3031,9 @@ static int radeon_cp_getparam(DRM_IOCTL_ break; case RADEON_PARAM_CARD_TYPE: - if (dev_priv->flags & CHIP_IS_PCIE) + if (dev_priv->flags & RADEON_IS_PCIE) value = RADEON_CARD_PCIE; - else if (dev_priv->flags & CHIP_IS_AGP) + else if (dev_priv->flags & RADEON_IS_AGP) value = RADEON_CARD_AGP; else value = RADEON_CARD_PCI; |
From: <da...@ke...> - 2006-09-15 14:58:07
|
shared-core/radeon_drv.h | 3 +++ shared-core/radeon_state.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) New commits: diff-tree 6ba9127753eff7615ba553fbc567aec98ecf8104 (from 3cc64a943a7240c73c92ab103ba0502b9ec07fee) Author: Michel Dänzer <mi...@tu...> Date: Fri Sep 15 16:37:47 2006 +0200 Use register writes instead of BITBLT_MULTI packets for buffer swap blits. This takes up two more ring buffer entries per rectangle blitted but makes sure the blit is performed top to bottom, reducing the likelyhood of tearing. diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h index 5fc9331..6ea2a17 100644 --- a/shared-core/radeon_drv.h +++ b/shared-core/radeon_drv.h @@ -423,6 +423,8 @@ extern int r300_do_cp_cmdbuf(drm_device_ #define RADEON_RB3D_COLOROFFSET 0x1c40 #define RADEON_RB3D_COLORPITCH 0x1c48 +#define RADEON_SRC_X_Y 0x1590 + #define RADEON_DP_GUI_MASTER_CNTL 0x146c # define RADEON_GMC_SRC_PITCH_OFFSET_CNTL (1 << 0) # define RADEON_GMC_DST_PITCH_OFFSET_CNTL (1 << 1) @@ -440,6 +442,7 @@ extern int r300_do_cp_cmdbuf(drm_device_ # define RADEON_ROP3_S 0x00cc0000 # define RADEON_ROP3_P 0x00f00000 #define RADEON_DP_WRITE_MASK 0x16cc +#define RADEON_SRC_PITCH_OFFSET 0x1428 #define RADEON_DST_PITCH_OFFSET 0x142c #define RADEON_DST_PITCH_OFFSET_C 0x1c80 # define RADEON_DST_TILE_LINEAR (0 << 30) diff --git a/shared-core/radeon_state.c b/shared-core/radeon_state.c index 0a196c0..5b1ca53 100644 --- a/shared-core/radeon_state.c +++ b/shared-core/radeon_state.c @@ -1262,9 +1262,9 @@ static void radeon_cp_dispatch_swap(drm_ DRM_DEBUG("dispatch swap %d,%d-%d,%d\n", x, y, w, h); - BEGIN_RING(7); + BEGIN_RING(9); - OUT_RING(CP_PACKET3(RADEON_CNTL_BITBLT_MULTI, 5)); + OUT_RING(CP_PACKET0(RADEON_DP_GUI_MASTER_CNTL, 0)); OUT_RING(RADEON_GMC_SRC_PITCH_OFFSET_CNTL | RADEON_GMC_DST_PITCH_OFFSET_CNTL | RADEON_GMC_BRUSH_NONE | @@ -1276,6 +1276,7 @@ static void radeon_cp_dispatch_swap(drm_ /* Make this work even if front & back are flipped: */ + OUT_RING(CP_PACKET0(RADEON_SRC_PITCH_OFFSET, 1)); if (dev_priv->current_page == 0) { OUT_RING(dev_priv->back_pitch_offset); OUT_RING(dev_priv->front_pitch_offset); @@ -1284,6 +1285,7 @@ static void radeon_cp_dispatch_swap(drm_ OUT_RING(dev_priv->back_pitch_offset); } + OUT_RING(CP_PACKET0(RADEON_SRC_X_Y, 2)); OUT_RING((x << 16) | y); OUT_RING((x << 16) | y); OUT_RING((w << 16) | h); |
From: <ai...@ke...> - 2006-09-18 21:24:15
|
linux-core/drmP.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) New commits: diff-tree ef98a8e20dad8ae7e38f397d63c13bd24105ce53 (from 6ba9127753eff7615ba553fbc567aec98ecf8104) Author: Dave Airlie <airlied@starflyer-ubuntu.(none)> Date: Mon Sep 18 21:22:12 2006 +1000 drm: put domain number back to 0, domain support is seriously fubar.. diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 70bf349..a955c3d 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -777,7 +777,7 @@ static __inline__ int drm_core_check_fea #ifdef __alpha__ #define drm_get_pci_domain(dev) dev->hose->bus->number #else -#define drm_get_pci_domain(dev) pci_domain_nr(dev->pdev->bus) +#define drm_get_pci_domain(dev) 0 #endif #if __OS_HAS_AGP |
From: <sr...@ke...> - 2006-09-20 17:47:33
|
shared-core/radeon_state.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletion(-) New commits: diff-tree 1f71b8d7a456fe3ec4bfc2fed70b7420cdd0d55a (from ef98a8e20dad8ae7e38f397d63c13bd24105ce53) Author: Roland Scheidegger <zak@ZakTower.(none)> Date: Wed Sep 20 19:44:57 2006 +0200 do a TCL state flush before accessing VAP_CNTL to prevent lockups on r200 when enabling/disabling vertex programs diff --git a/shared-core/radeon_state.c b/shared-core/radeon_state.c index 5b1ca53..b447801 100644 --- a/shared-core/radeon_state.c +++ b/shared-core/radeon_state.c @@ -174,6 +174,14 @@ static __inline__ int radeon_check_and_f } break; + case R200_EMIT_VAP_CTL: { + RING_LOCALS; + BEGIN_RING(2); + OUT_RING_REG(RADEON_SE_TCL_STATE_FLUSH, 0); + ADVANCE_RING(); + } + break; + case RADEON_EMIT_RB3D_COLORPITCH: case RADEON_EMIT_RE_LINE_PATTERN: case RADEON_EMIT_SE_LINE_WIDTH: @@ -201,7 +209,6 @@ static __inline__ int radeon_check_and_f case R200_EMIT_TCL_LIGHT_MODEL_CTL_0: case R200_EMIT_TFACTOR_0: case R200_EMIT_VTX_FMT_0: - case R200_EMIT_VAP_CTL: case R200_EMIT_MATRIX_SELECT_0: case R200_EMIT_TEX_PROC_CTL_2: case R200_EMIT_TCL_UCP_VERT_BLEND_CTL: |
From: <ai...@ke...> - 2006-09-22 03:44:50
|
shared-core/drm_pciids.txt | 1 + 1 files changed, 1 insertion(+) New commits: diff-tree 255f3e6f76dfd267a14765dd1293229184298d89 (from 1f71b8d7a456fe3ec4bfc2fed70b7420cdd0d55a) Author: Anish Mistry <mis...@os...> Date: Fri Sep 22 03:43:34 2006 +1000 bug 7092 : add pci ids for mach64 in Dell poweredge 4200 diff --git a/shared-core/drm_pciids.txt b/shared-core/drm_pciids.txt index 9e0c099..c597708 100644 --- a/shared-core/drm_pciids.txt +++ b/shared-core/drm_pciids.txt @@ -186,6 +186,7 @@ 0x1002 0x4c51 0 "3D Rage LT Pro" 0x1002 0x4c42 0 "3D Rage LT Pro AGP-133" 0x1002 0x4c44 0 "3D Rage LT Pro AGP-66" +0x1002 0x4759 0 "Rage 3D IICATI 3D RAGE IIC AGP(A12/A13) 0x1002 0x474c 0 "Rage XC" 0x1002 0x474f 0 "Rage XL" 0x1002 0x4752 0 "Rage XL" |
From: <ai...@ke...> - 2006-09-22 03:56:02
|
linux-core/drmP.h | 12 ++++++++++++ 1 files changed, 12 insertions(+) New commits: diff-tree 62f6ea225615392098dedee47d4ccdd69e126a43 (from 255f3e6f76dfd267a14765dd1293229184298d89) Author: Felix Kuhling <fx...@gm...> Date: Fri Sep 22 03:46:54 2006 +1000 bug 5942: add stubs for drm_mtrr_add/del for non-MTRR configured linux diff --git a/linux-core/drmP.h b/linux-core/drmP.h index a955c3d..fd48059 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -810,6 +810,18 @@ static inline int drm_mtrr_del(int handl } #else +static inline int drm_mtrr_add(unsigned long offset, unsigned long size, + unsigned int flags) +{ + return -ENODEV; +} + +static inline int drm_mtrr_del(int handle, unsigned long offset, + unsigned long size, unsigned int flags) +{ + return -ENODEV; +} + #define drm_core_has_MTRR(dev) (0) #endif |
From: <da...@ke...> - 2006-09-29 08:28:14
|
shared-core/i915_irq.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) New commits: diff-tree 7af93dd9849442270ec89cb4bbeef5bfd4f9e424 (from 881ba569929ceafd42e3c86228b0172099083d1d) Author: Michel Dänzer <mi...@tu...> Date: Fri Sep 29 10:27:29 2006 +0200 i915: Only schedule vblank tasklet if there are scheduled swaps pending. This fixes issues on X server startup with versions of xf86-video-intel that enable the IRQ before they have a context ID. diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c index fbc6674..76c3a81 100644 --- a/shared-core/i915_irq.c +++ b/shared-core/i915_irq.c @@ -171,7 +171,8 @@ irqreturn_t i915_driver_irq_handler(DRM_ DRM_WAKEUP(&dev->vbl_queue); drm_vbl_send_signals(dev); - drm_locked_tasklet(dev, i915_vblank_tasklet); + if (dev_priv->swaps_pending > 0) + drm_locked_tasklet(dev, i915_vblank_tasklet); } return IRQ_HANDLED; |