various cleanups and dead coode removals in drm core
Subsystems (6)
cover various cleanups and dead coode removals in drm core
Hi all,
[Dave, this is the patch series I've talked about on irc a few days ago.]
This patch series kills various things I've stumbled over while reading through the drm core code. It mostly removes unnecessary stuff on the drm core <-> driver interface.
Tested on my i845, i945 and agp rv570. All drm drivers compile-tested.
Please review and merge what you like for -next. Save patch 9 which depends upon patch 8 (mucks around in the same place), they should be all independent. So you can mix&match what you like.
Thanks, Daniel
Daniel Vetter (11):
drm: don't export drm_sg_alloc
drm: kill kernel_context_switch callbacks
drm: kill dma_ready callbacks
drm: kill procfs callbacks
drm: kill drm_map_ofs callbacks
drm: kill get_reg_ofs callback
drm: kill context_ctor callback
drm: don't export drm_get_drawable_info
drm: replace drawable ioctl by noops
drm: kill dev->timer
drm: kill gem_free_object_unlocked driver callback
drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/drm_context.c | 8 -- drivers/gpu/drm/drm_drawable.c | 198 --------------------------------- drivers/gpu/drm/drm_drv.c | 10 +- drivers/gpu/drm/drm_gem.c | 4 +- drivers/gpu/drm/drm_lock.c | 21 ---- drivers/gpu/drm/drm_proc.c | 13 -- drivers/gpu/drm/drm_scatter.c | 2 - drivers/gpu/drm/drm_stub.c | 4 - drivers/gpu/drm/drm_vm.c | 13 +-- drivers/gpu/drm/i810/i810_drv.c | 2 - drivers/gpu/drm/i830/i830_drv.c | 2 - drivers/gpu/drm/i915/i915_drv.c | 2 - drivers/gpu/drm/mga/mga_drv.c | 2 - drivers/gpu/drm/nouveau/nouveau_drv.c | 2 - drivers/gpu/drm/r128/r128_drv.c | 2 - drivers/gpu/drm/radeon/radeon_drv.c | 4 - drivers/gpu/drm/savage/savage_drv.c | 2 - drivers/gpu/drm/sis/sis_drv.c | 3 - drivers/gpu/drm/tdfx/tdfx_drv.c | 2 - drivers/gpu/drm/via/via_drv.c | 2 - drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 - include/drm/drmP.h | 30 ----- 23 files changed, 7 insertions(+), 325 deletions(-) delete mode 100644 drivers/gpu/drm/drm_drawable.c
PATCH 1/11 drm: don't export drm_sg_alloc
It's not used internally by any driver, only by some generic ioctls. So don't export it.
--- drivers/gpu/drm/drm_scatter.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_scatter.c +0 -2
@@ -184,8 +184,6 @@ int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request)drm_sg_cleanup (entry);return -ENOMEM ; } -EXPORT_SYMBOL (drm_sg_alloc); -int drm_sg_alloc_ioctl (struct drm_device *dev,void *data,struct drm_file *file_priv)
Signature · 1 line
1.7.1
PATCH 2/11 drm: kill kernel_context_switch callbacks
In reply to Daniel VetterNot used by any in-kernel driver. So drop it.
--- drivers/gpu/drm/drm_lock.c | 18 ------------------ include/drm/drmP.h | 3 --- 2 files changed, 0 insertions(+), 21 deletions(-)
drivers/gpu/drm/drm_lock.c +0 -18
@@ -134,12 +134,6 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) } } -if (dev->driver->kernel_context_switch && - dev->last_context != lock->context) { - dev->driver->kernel_context_switch (dev, dev->last_context, - lock->context); - } -return 0 ; }
@@ -157,7 +151,6 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)int drm_unlock (struct drm_device *dev,void *data,struct drm_file *file_priv) {struct drm_lock *lock = data; -struct drm_master *master = file_priv->master;if (lock->context ==DRM_KERNEL_CONTEXT ) { DRM_ERROR("Process %d using kernel context %d\n",
@@ -167,17 +160,6 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv)atomic_inc (&dev->counts[_DRM_STAT_UNLOCKS]); -/* kernel_context_switch isn't used by any of the x86 drm -* modules but is required by the Sparc driver. -*/ -if (dev->driver->kernel_context_switch_unlock) - dev->driver->kernel_context_switch_unlock (dev); -else { -if (drm_lock_free (&master->lock, lock->context)) { -/* FIXME: Should really bail out here. */ - } - } -unblock_all_signals ();return 0 ; }
include/drm/drmP.h +0 -3
@@ -697,9 +697,6 @@ struct drm_driver {int (*dma_quiescent) (struct drm_device *);int (*context_ctor) (struct drm_device *dev,int context);int (*context_dtor) (struct drm_device *dev,int context); -int (*kernel_context_switch) (struct drm_device *dev,int old, -int new); -void (*kernel_context_switch_unlock) (struct drm_device *dev);/** * get_vblank_counter - get raw hardware vblank counter
Signature · 1 line
1.7.1
PATCH 3/11 drm: kill dma_ready callbacks
In reply to Daniel VetterNot used by any driver. So drop it.
--- drivers/gpu/drm/drm_lock.c | 3 --- include/drm/drmP.h | 1 - 2 files changed, 0 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_lock.c +0 -3
@@ -122,9 +122,6 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)block_all_signals (drm_notifier, &dev->sigdata, &dev->sigmask); } -if (dev->driver->dma_ready && (lock->flags & _DRM_LOCK_READY)) - dev->driver->dma_ready (dev); -if (dev->driver->dma_quiescent && (lock->flags & _DRM_LOCK_QUIESCENT)) {if (dev->driver->dma_quiescent (dev)) {
include/drm/drmP.h +0 -1
@@ -693,7 +693,6 @@ struct drm_driver {int (*suspend) (struct drm_device *,pm_message_t state);int (*resume) (struct drm_device *);int (*dma_ioctl) (struct drm_device *dev,void *data,struct drm_file *file_priv); -void (*dma_ready) (struct drm_device *);int (*dma_quiescent) (struct drm_device *);int (*context_ctor) (struct drm_device *dev,int context);int (*context_dtor) (struct drm_device *dev,int context);
Signature · 1 line
1.7.1
PATCH 4/11 drm: kill procfs callbacks
In reply to Daniel VetterNot used by any driver (rightly so!). Kill them.
--- drivers/gpu/drm/drm_proc.c | 13 ------------- include/drm/drmP.h | 2 -- 2 files changed, 0 insertions(+), 15 deletions(-)
drivers/gpu/drm/drm_proc.c +0 -13
@@ -151,7 +151,6 @@ fail:int drm_proc_init (struct drm_minor *minor,int minor_id,struct proc_dir_entry *root) { -struct drm_device *dev = minor->dev;char name[64 ];int ret;
@@ -172,14 +171,6 @@ int drm_proc_init(struct drm_minor *minor, int minor_id,return ret; } -if (dev->driver->proc_init) { - ret = dev->driver->proc_init (minor); -if (ret) { -DRM_ERROR ("DRM: Driver failed to initialize " -"/proc/dri.\n" ); -return ret; - } - }return 0 ; }
@@ -216,15 +207,11 @@ int drm_proc_remove_files(struct drm_info_list *files, int count,*/ int drm_proc_cleanup (struct drm_minor *minor,struct proc_dir_entry *root) { -struct drm_device *dev = minor->dev;char name[64 ];if (!root || !minor->proc_root)return 0 ; -if (dev->driver->proc_cleanup) - dev->driver->proc_cleanup (minor); -drm_proc_remove_files (drm_proc_list,DRM_PROC_ENTRIES , minor);sprintf (name,"%d" , minor->index);
include/drm/drmP.h +0 -2
@@ -785,8 +785,6 @@ struct drm_driver {void (*master_drop)(struct drm_device *dev,struct drm_file *file_priv,bool from_release); -int (*proc_init)(struct drm_minor *minor); -void (*proc_cleanup)(struct drm_minor *minor);int (*debugfs_init)(struct drm_minor *minor);void (*debugfs_cleanup)(struct drm_minor *minor);
Signature · 1 line
1.7.1
PATCH 5/11 drm: kill drm_map_ofs callbacks
In reply to Daniel VetterAll drivers happily copy&pasted the default implementation without checking whether this callback is used at all. It's not. Sigh.
Kill it.
--- drivers/gpu/drm/drm_vm.c | 7 ------- drivers/gpu/drm/i810/i810_drv.c | 1 - drivers/gpu/drm/i830/i830_drv.c | 1 - drivers/gpu/drm/i915/i915_drv.c | 1 - drivers/gpu/drm/mga/mga_drv.c | 1 - drivers/gpu/drm/nouveau/nouveau_drv.c | 1 - drivers/gpu/drm/r128/r128_drv.c | 1 - drivers/gpu/drm/radeon/radeon_drv.c | 2 -- drivers/gpu/drm/savage/savage_drv.c | 1 - drivers/gpu/drm/sis/sis_drv.c | 1 - drivers/gpu/drm/tdfx/tdfx_drv.c | 1 - drivers/gpu/drm/via/via_drv.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 1 - include/drm/drmP.h | 2 -- 14 files changed, 0 insertions(+), 22 deletions(-)
drivers/gpu/drm/drm_vm.c +0 -7
@@ -515,13 +515,6 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)return 0 ; } -resource_size_t drm_core_get_map_ofs (struct drm_local_map * map) -{ -return map->offset; -} - -EXPORT_SYMBOL (drm_core_get_map_ofs); -resource_size_t drm_core_get_reg_ofs (struct drm_device *dev) {#ifdef __alpha__
drivers/gpu/drm/i810/i810_drv.c +0 -1
@@ -52,7 +52,6 @@ static struct drm_driver driver = { .device_is_agp = i810_driver_device_is_agp, .reclaim_buffers_locked = i810_driver_reclaim_buffers_locked, .dma_quiescent = i810_driver_dma_quiescent, - .get_map_ofs = drm_core_get_map_ofs, .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = i810_ioctls, .fops = {
drivers/gpu/drm/i830/i830_drv.c +0 -1
@@ -57,7 +57,6 @@ static struct drm_driver driver = { .device_is_agp = i830_driver_device_is_agp, .reclaim_buffers_locked = i830_driver_reclaim_buffers_locked, .dma_quiescent = i830_driver_dma_quiescent, - .get_map_ofs = drm_core_get_map_ofs, .get_reg_ofs = drm_core_get_reg_ofs, #if USE_IRQS .irq_preinstall = i830_driver_irq_preinstall,
drivers/gpu/drm/i915/i915_drv.c +0 -1
@@ -544,7 +544,6 @@ static struct drm_driver driver = { .irq_uninstall = i915_driver_irq_uninstall, .irq_handler = i915_driver_irq_handler, .reclaim_buffers = drm_core_reclaim_buffers, - .get_map_ofs = drm_core_get_map_ofs, .get_reg_ofs = drm_core_get_reg_ofs, .master_create = i915_master_create, .master_destroy = i915_master_destroy,
drivers/gpu/drm/mga/mga_drv.c +0 -1
@@ -60,7 +60,6 @@ static struct drm_driver driver = { .irq_uninstall = mga_driver_irq_uninstall, .irq_handler = mga_driver_irq_handler, .reclaim_buffers = drm_core_reclaim_buffers, - .get_map_ofs = drm_core_get_map_ofs, .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = mga_ioctls, .dma_ioctl = mga_dma_buffers,
drivers/gpu/drm/nouveau/nouveau_drv.c +0 -1
@@ -357,7 +357,6 @@ static struct drm_driver driver = { .irq_uninstall = nouveau_irq_uninstall, .irq_handler = nouveau_irq_handler, .reclaim_buffers = drm_core_reclaim_buffers, - .get_map_ofs = drm_core_get_map_ofs, .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = nouveau_ioctls, .fops = {
drivers/gpu/drm/r128/r128_drv.c +0 -1
@@ -56,7 +56,6 @@ static struct drm_driver driver = { .irq_uninstall = r128_driver_irq_uninstall, .irq_handler = r128_driver_irq_handler, .reclaim_buffers = drm_core_reclaim_buffers, - .get_map_ofs = drm_core_get_map_ofs, .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = r128_ioctls, .dma_ioctl = r128_cce_buffers,
drivers/gpu/drm/radeon/radeon_drv.c +0 -2
@@ -204,7 +204,6 @@ static struct drm_driver driver_old = { .irq_uninstall = radeon_driver_irq_uninstall, .irq_handler = radeon_driver_irq_handler, .reclaim_buffers = drm_core_reclaim_buffers, - .get_map_ofs = drm_core_get_map_ofs, .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = radeon_ioctls, .dma_ioctl = radeon_cp_buffers,
@@ -290,7 +289,6 @@ static struct drm_driver kms_driver = { .irq_uninstall = radeon_driver_irq_uninstall_kms, .irq_handler = radeon_driver_irq_handler_kms, .reclaim_buffers = drm_core_reclaim_buffers, - .get_map_ofs = drm_core_get_map_ofs, .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = radeon_ioctls_kms, .gem_init_object = radeon_gem_object_init,
drivers/gpu/drm/savage/savage_drv.c +0 -1
@@ -42,7 +42,6 @@ static struct drm_driver driver = { .lastclose = savage_driver_lastclose, .unload = savage_driver_unload, .reclaim_buffers = savage_reclaim_buffers, - .get_map_ofs = drm_core_get_map_ofs, .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = savage_ioctls, .dma_ioctl = savage_bci_buffers,
drivers/gpu/drm/sis/sis_drv.c +0 -1
@@ -73,7 +73,6 @@ static struct drm_driver driver = { .reclaim_buffers = NULL, .reclaim_buffers_idlelocked = sis_reclaim_buffers_locked, .lastclose = sis_lastclose, - .get_map_ofs = drm_core_get_map_ofs, .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = sis_ioctls, .fops = {
drivers/gpu/drm/tdfx/tdfx_drv.c +0 -1
@@ -42,7 +42,6 @@ static struct pci_device_id pciidlist[] = {static struct drm_driver driver = { .driver_features =DRIVER_USE_MTRR , .reclaim_buffers = drm_core_reclaim_buffers, - .get_map_ofs = drm_core_get_map_ofs, .get_reg_ofs = drm_core_get_reg_ofs, .fops = { .owner =THIS_MODULE ,
drivers/gpu/drm/via/via_drv.c +0 -1
@@ -51,7 +51,6 @@ static struct drm_driver driver = { .reclaim_buffers_locked = NULL, .reclaim_buffers_idlelocked = via_reclaim_buffers_locked, .lastclose = via_lastclose, - .get_map_ofs = drm_core_get_map_ofs, .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = via_ioctls, .fops = {
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +0 -1
@@ -717,7 +717,6 @@ static struct drm_driver driver = { .irq_uninstall = vmw_irq_uninstall, .irq_handler = vmw_irq_handler, .reclaim_buffers_locked = NULL, - .get_map_ofs = drm_core_get_map_ofs, .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = vmw_ioctls, .num_ioctls = DRM_ARRAY_SIZE(vmw_ioctls),
include/drm/drmP.h +0 -2
@@ -767,7 +767,6 @@ struct drm_driver { struct drm_file *file_priv);void (*reclaim_buffers_idlelocked) (struct drm_device *dev,struct drm_file *file_priv); -resource_size_t (*get_map_ofs) (struct drm_local_map * map);resource_size_t (*get_reg_ofs) (struct drm_device *dev);void (*set_version) (struct drm_device *dev,struct drm_set_version *sv);
@@ -1143,7 +1142,6 @@ extern int drm_release(struct inode *inode, struct file *filp);extern int drm_mmap (struct file *filp,struct vm_area_struct *vma);extern int drm_mmap_locked (struct file *filp,struct vm_area_struct *vma);extern void drm_vm_open_locked (struct vm_area_struct *vma); -extern resource_size_t drm_core_get_map_ofs (struct drm_local_map * map);extern resource_size_t drm_core_get_reg_ofs (struct drm_device *dev);extern unsigned int drm_poll (struct file *filp,struct poll_table_struct *wait);
Signature · 1 line
1.7.1
PATCH 6/11 drm: kill get_reg_ofs callback
In reply to Daniel VetterEvery driver used the default implementation. Fold that one into the only callsite and drop the callback.
--- drivers/gpu/drm/drm_vm.c | 6 ++---- drivers/gpu/drm/i810/i810_drv.c | 1 - drivers/gpu/drm/i830/i830_drv.c | 1 - drivers/gpu/drm/i915/i915_drv.c | 1 - drivers/gpu/drm/mga/mga_drv.c | 1 - drivers/gpu/drm/nouveau/nouveau_drv.c | 1 - drivers/gpu/drm/r128/r128_drv.c | 1 - drivers/gpu/drm/radeon/radeon_drv.c | 2 -- drivers/gpu/drm/savage/savage_drv.c | 1 - drivers/gpu/drm/sis/sis_drv.c | 1 - drivers/gpu/drm/tdfx/tdfx_drv.c | 1 - drivers/gpu/drm/via/via_drv.c | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 1 - include/drm/drmP.h | 2 -- 14 files changed, 2 insertions(+), 19 deletions(-)
drivers/gpu/drm/drm_vm.c +2 -4
@@ -515,7 +515,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)return 0 ; } -resource_size_t drm_core_get_reg_ofs (struct drm_device *dev) +static resource_size_t drm_core_get_reg_ofs (struct drm_device *dev) {#ifdef __alpha__return dev->hose->dense_mem_base - dev->hose->mem_space->start;
@@ -524,8 +524,6 @@ resource_size_t drm_core_get_reg_ofs(struct drm_device *dev)#endif } -EXPORT_SYMBOL (drm_core_get_reg_ofs); -/** * mmap DMA memory. *
@@ -610,7 +608,7 @@ int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)/* fall through to _DRM_FRAME_BUFFER... */ case _DRM_FRAME_BUFFER:case _DRM_REGISTERS: - offset = dev->driver->get_reg_ofs (dev); + offset =drm_core_get_reg_ofs (dev); vma->vm_flags |=VM_IO ;/* not in core dump */ vma->vm_page_prot =drm_io_prot (map->type, vma); if (io_remap_pfn_range(vma, vma->vm_start,
drivers/gpu/drm/i810/i810_drv.c +0 -1
@@ -52,7 +52,6 @@ static struct drm_driver driver = { .device_is_agp = i810_driver_device_is_agp, .reclaim_buffers_locked = i810_driver_reclaim_buffers_locked, .dma_quiescent = i810_driver_dma_quiescent, - .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = i810_ioctls, .fops = { .owner = THIS_MODULE,
drivers/gpu/drm/i830/i830_drv.c +0 -1
@@ -57,7 +57,6 @@ static struct drm_driver driver = { .device_is_agp = i830_driver_device_is_agp, .reclaim_buffers_locked = i830_driver_reclaim_buffers_locked, .dma_quiescent = i830_driver_dma_quiescent, - .get_reg_ofs = drm_core_get_reg_ofs, #if USE_IRQS .irq_preinstall = i830_driver_irq_preinstall, .irq_postinstall = i830_driver_irq_postinstall,
drivers/gpu/drm/i915/i915_drv.c +0 -1
@@ -544,7 +544,6 @@ static struct drm_driver driver = { .irq_uninstall = i915_driver_irq_uninstall, .irq_handler = i915_driver_irq_handler, .reclaim_buffers = drm_core_reclaim_buffers, - .get_reg_ofs = drm_core_get_reg_ofs, .master_create = i915_master_create, .master_destroy = i915_master_destroy,#if defined(CONFIG_DEBUG_FS )
drivers/gpu/drm/mga/mga_drv.c +0 -1
@@ -60,7 +60,6 @@ static struct drm_driver driver = { .irq_uninstall = mga_driver_irq_uninstall, .irq_handler = mga_driver_irq_handler, .reclaim_buffers = drm_core_reclaim_buffers, - .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = mga_ioctls, .dma_ioctl = mga_dma_buffers, .fops = {
drivers/gpu/drm/nouveau/nouveau_drv.c +0 -1
@@ -357,7 +357,6 @@ static struct drm_driver driver = { .irq_uninstall = nouveau_irq_uninstall, .irq_handler = nouveau_irq_handler, .reclaim_buffers = drm_core_reclaim_buffers, - .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = nouveau_ioctls, .fops = { .owner = THIS_MODULE,
drivers/gpu/drm/r128/r128_drv.c +0 -1
@@ -56,7 +56,6 @@ static struct drm_driver driver = { .irq_uninstall = r128_driver_irq_uninstall, .irq_handler = r128_driver_irq_handler, .reclaim_buffers = drm_core_reclaim_buffers, - .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = r128_ioctls, .dma_ioctl = r128_cce_buffers, .fops = {
drivers/gpu/drm/radeon/radeon_drv.c +0 -2
@@ -204,7 +204,6 @@ static struct drm_driver driver_old = { .irq_uninstall = radeon_driver_irq_uninstall, .irq_handler = radeon_driver_irq_handler, .reclaim_buffers = drm_core_reclaim_buffers, - .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = radeon_ioctls, .dma_ioctl = radeon_cp_buffers, .fops = {
@@ -289,7 +288,6 @@ static struct drm_driver kms_driver = { .irq_uninstall = radeon_driver_irq_uninstall_kms, .irq_handler = radeon_driver_irq_handler_kms, .reclaim_buffers = drm_core_reclaim_buffers, - .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = radeon_ioctls_kms, .gem_init_object = radeon_gem_object_init, .gem_free_object = radeon_gem_object_free,
drivers/gpu/drm/savage/savage_drv.c +0 -1
@@ -42,7 +42,6 @@ static struct drm_driver driver = { .lastclose = savage_driver_lastclose, .unload = savage_driver_unload, .reclaim_buffers = savage_reclaim_buffers, - .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = savage_ioctls, .dma_ioctl = savage_bci_buffers, .fops = {
drivers/gpu/drm/sis/sis_drv.c +0 -1
@@ -73,7 +73,6 @@ static struct drm_driver driver = { .reclaim_buffers = NULL, .reclaim_buffers_idlelocked = sis_reclaim_buffers_locked, .lastclose = sis_lastclose, - .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = sis_ioctls, .fops = { .owner = THIS_MODULE,
drivers/gpu/drm/tdfx/tdfx_drv.c +0 -1
@@ -42,7 +42,6 @@ static struct pci_device_id pciidlist[] = {static struct drm_driver driver = { .driver_features =DRIVER_USE_MTRR , .reclaim_buffers = drm_core_reclaim_buffers, - .get_reg_ofs = drm_core_get_reg_ofs, .fops = { .owner =THIS_MODULE , .open = drm_open,
drivers/gpu/drm/via/via_drv.c +0 -1
@@ -51,7 +51,6 @@ static struct drm_driver driver = { .reclaim_buffers_locked = NULL, .reclaim_buffers_idlelocked = via_reclaim_buffers_locked, .lastclose = via_lastclose, - .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = via_ioctls, .fops = { .owner = THIS_MODULE,
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +0 -1
@@ -717,7 +717,6 @@ static struct drm_driver driver = { .irq_uninstall = vmw_irq_uninstall, .irq_handler = vmw_irq_handler, .reclaim_buffers_locked = NULL, - .get_reg_ofs = drm_core_get_reg_ofs, .ioctls = vmw_ioctls, .num_ioctls = DRM_ARRAY_SIZE(vmw_ioctls), .dma_quiescent = NULL, /*vmw_dma_quiescent, */
include/drm/drmP.h +0 -2
@@ -767,7 +767,6 @@ struct drm_driver { struct drm_file *file_priv);void (*reclaim_buffers_idlelocked) (struct drm_device *dev,struct drm_file *file_priv); -resource_size_t (*get_reg_ofs) (struct drm_device *dev);void (*set_version) (struct drm_device *dev,struct drm_set_version *sv);
@@ -1142,7 +1141,6 @@ extern int drm_release(struct inode *inode, struct file *filp);extern int drm_mmap (struct file *filp,struct vm_area_struct *vma);extern int drm_mmap_locked (struct file *filp,struct vm_area_struct *vma);extern void drm_vm_open_locked (struct vm_area_struct *vma); -extern resource_size_t drm_core_get_reg_ofs (struct drm_device *dev);extern unsigned int drm_poll (struct file *filp,struct poll_table_struct *wait);/* Memory management support (drm_memory.h) */
Signature · 1 line
1.7.1
PATCH 7/11 drm: kill context_ctor callback
In reply to Daniel VetterIt's not used by any driver. The destructor callback is unfortunately used by the via driver in a rather convoluted piece of code used to reimplement something resembling broken futexes. I didn't dare to touch this code. But at least kill the needless NULL assignemt in the sis driver.
--- drivers/gpu/drm/drm_context.c | 8 -------- drivers/gpu/drm/sis/sis_drv.c | 1 - include/drm/drmP.h | 1 - 3 files changed, 0 insertions(+), 10 deletions(-)
drivers/gpu/drm/drm_context.c +0 -8
@@ -333,14 +333,6 @@ int drm_addctx(struct drm_device *dev, void *data,return -ENOMEM ; } -if (ctx->handle !=DRM_KERNEL_CONTEXT ) { -if (dev->driver->context_ctor) -if (!dev->driver->context_ctor (dev, ctx->handle)) { -DRM_DEBUG ("Running out of ctxs or memory.\n" ); -return -ENOMEM ; - } - } - ctx_entry =kmalloc (sizeof (*ctx_entry),GFP_KERNEL );if (!ctx_entry) {DRM_DEBUG ("out of memory\n" );
drivers/gpu/drm/sis/sis_drv.c +0 -1
@@ -68,7 +68,6 @@ static struct drm_driver driver = { .driver_features = DRIVER_USE_AGP | DRIVER_USE_MTRR, .load = sis_driver_load, .unload = sis_driver_unload, - .context_dtor = NULL, .dma_quiescent = sis_idle, .reclaim_buffers = NULL, .reclaim_buffers_idlelocked = sis_reclaim_buffers_locked,
include/drm/drmP.h +0 -1
@@ -694,7 +694,6 @@ struct drm_driver {int (*resume) (struct drm_device *);int (*dma_ioctl) (struct drm_device *dev,void *data,struct drm_file *file_priv);int (*dma_quiescent) (struct drm_device *); -int (*context_ctor) (struct drm_device *dev,int context);int (*context_dtor) (struct drm_device *dev,int context);/**
Signature · 1 line
1.7.1
PATCH 8/11 drm: don't export drm_get_drawable_info
In reply to Daniel VetterNot used by any in-tree user. So drop it.
--- drivers/gpu/drm/drm_drawable.c | 3 +-- include/drm/drmP.h | 2 -- 2 files changed, 1 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_drawable.c +1 -2
@@ -173,11 +173,10 @@ error:/** * Caller must hold the drawable spinlock! */ -struct drm_drawable_info *drm_get_drawable_info (struct drm_device *dev,drm_drawable_t id) +static struct drm_drawable_info *drm_get_drawable_info (struct drm_device *dev,drm_drawable_t id) {return idr_find (&dev->drw_idr, id); } -EXPORT_SYMBOL (drm_get_drawable_info);static int drm_drawable_free (int idr,void *p,void *data) {
include/drm/drmP.h +0 -2
@@ -1209,8 +1209,6 @@ extern int drm_rmdraw(struct drm_device *dev, void *data, struct drm_file *file_priv);extern int drm_update_drawable_info (struct drm_device *dev,void *data,struct drm_file *file_priv); -extern struct drm_drawable_info *drm_get_drawable_info (struct drm_device *dev, -drm_drawable_t id);extern void drm_drawable_free_all (struct drm_device *dev);/* Authentication IOCTL support (drm_auth.h) */
Signature · 1 line
1.7.1
PATCH 9/11 drm: replace drawable ioctl by noops
In reply to Daniel VetterThe information supplied by userspace through these ioctls is only accessible by dev->drw_idr. But there's no in-tree user of that. Information might also leak via the RM_DRAW ioctl (in the form of a negative return code in case the drawable doesn't exist). But the only user of these ioctls, mesas' miniglx, does not use the RM_DRAW ioctl.
Therefore it's safe to replace these three ioctls with noops and rip out the implementation.
--- drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/drm_drawable.c | 197 ---------------------------------------- drivers/gpu/drm/drm_drv.c | 8 +- drivers/gpu/drm/drm_stub.c | 3 - include/drm/drmP.h | 15 --- 5 files changed, 4 insertions(+), 221 deletions(-) delete mode 100644 drivers/gpu/drm/drm_drawable.c
drivers/gpu/drm/Makefile +1 -1
@@ -5,7 +5,7 @@ ccflags-y := -Iinclude/drm drm-y := drm_auth.o drm_buffer.o drm_bufs.o drm_cache.o \ - drm_context.o drm_dma.o drm_drawable.o \ + drm_context.o drm_dma.o \ drm_drv.o drm_fops.o drm_gem.o drm_ioctl.o drm_irq.o \ drm_lock.o drm_memory.o drm_proc.o drm_stub.o drm_vm.o \ drm_agpsupport.o drm_scatter.o ati_pcigart.o drm_pci.o \
drivers/gpu/drm/drm_drawable.c deleted +0 -197
197 lines not on this page · raw message
drivers/gpu/drm/drm_drv.c +3 -5
@@ -88,8 +88,8 @@ static struct drm_ioctl_desc drm_ioctls[] = {DRM_IOCTL_DEF (DRM_IOCTL_NEW_CTX , drm_newctx,DRM_AUTH |DRM_MASTER |DRM_ROOT_ONLY ),DRM_IOCTL_DEF (DRM_IOCTL_RES_CTX , drm_resctx,DRM_AUTH ), -DRM_IOCTL_DEF (DRM_IOCTL_ADD_DRAW , drm_adddraw,DRM_AUTH |DRM_MASTER |DRM_ROOT_ONLY ), -DRM_IOCTL_DEF (DRM_IOCTL_RM_DRAW , drm_rmdraw,DRM_AUTH |DRM_MASTER |DRM_ROOT_ONLY ), +DRM_IOCTL_DEF (DRM_IOCTL_ADD_DRAW , drm_noop,DRM_AUTH |DRM_MASTER |DRM_ROOT_ONLY ), +DRM_IOCTL_DEF (DRM_IOCTL_RM_DRAW , drm_noop,DRM_AUTH |DRM_MASTER |DRM_ROOT_ONLY ),DRM_IOCTL_DEF (DRM_IOCTL_LOCK , drm_lock,DRM_AUTH ), DRM_IOCTL_DEF(DRM_IOCTL_UNLOCK, drm_unlock, DRM_AUTH),
@@ -124,7 +124,7 @@ static struct drm_ioctl_desc drm_ioctls[] = {DRM_IOCTL_DEF (DRM_IOCTL_MODESET_CTL , drm_modeset_ctl,0 ), -DRM_IOCTL_DEF (DRM_IOCTL_UPDATE_DRAW , drm_update_drawable_info,DRM_AUTH |DRM_MASTER |DRM_ROOT_ONLY ), +DRM_IOCTL_DEF (DRM_IOCTL_UPDATE_DRAW , drm_noop,DRM_AUTH |DRM_MASTER |DRM_ROOT_ONLY ),DRM_IOCTL_DEF (DRM_IOCTL_GEM_CLOSE , drm_gem_close_ioctl,DRM_UNLOCKED ), DRM_IOCTL_DEF(DRM_IOCTL_GEM_FLINK, drm_gem_flink_ioctl, DRM_AUTH|DRM_UNLOCKED),
@@ -177,8 +177,6 @@ int drm_lastclose(struct drm_device * dev)mutex_lock (&dev->struct_mutex); -/* Free drawable information memory */ -drm_drawable_free_all (dev);del_timer (&dev->timer);/* Clear AGP information */
drivers/gpu/drm/drm_stub.c +0 -3
@@ -237,14 +237,11 @@ static int drm_fill_in_dev(struct drm_device * dev, struct pci_dev *pdev,INIT_LIST_HEAD (&dev->vblank_event_list);spin_lock_init (&dev->count_lock); -spin_lock_init (&dev->drw_lock);spin_lock_init (&dev->event_lock);init_timer (&dev->timer);mutex_init (&dev->struct_mutex);mutex_init (&dev->ctxlist_mutex); -idr_init (&dev->drw_idr); - dev->pdev = pdev; dev->pci_device = pdev->device; dev->pci_vendor = pdev->vendor;
include/drm/drmP.h +0 -15
@@ -1026,12 +1026,6 @@ struct drm_device {struct drm_minor *control;/**< Control node for card */ struct drm_minor *primary;/**< render type primary screen head */ -/** \name Drawable information */ -/*@{ */ -spinlock_t drw_lock; -struct idr drw_idr; -/*@} */ -struct drm_mode_config mode_config;/**< Current mode config */ /** \name GEM information */
@@ -1202,15 +1196,6 @@ extern int drm_setsareactx(struct drm_device *dev, void *data,extern int drm_getsareactx (struct drm_device *dev,void *data,struct drm_file *file_priv); -/* Drawable IOCTL support (drm_drawable.h) */ -extern int drm_adddraw (struct drm_device *dev,void *data, -struct drm_file *file_priv); -extern int drm_rmdraw (struct drm_device *dev,void *data, -struct drm_file *file_priv); -extern int drm_update_drawable_info (struct drm_device *dev,void *data, -struct drm_file *file_priv); -extern void drm_drawable_free_all (struct drm_device *dev); -/* Authentication IOCTL support (drm_auth.h) */ extern int drm_getmagic (struct drm_device *dev,void *data,struct drm_file *file_priv);
Signature · 1 line
1.7.1
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 09/11] drm: replace drawable ioctl by noops
Quoted 6 lines · Daniel Vetter
The information supplied by userspace through these ioctls is only accessible by
dev->drw_idr. But there's no in-tree user of that. Information might also leak via theRM_DRAWioctl (in the form of a negative return code in case the drawable doesn't exist). But the only user of these ioctls, mesas' miniglx, does not use theRM_DRAWioctl.
FYI, the X server DRI1 code also uses these ioctls, via the libdrm functions drmCreate/DestroyDrawable and drmUpdateDrawableInfo().
Quoted 2 lines
Therefore it's safe to replace these three ioctls with noops and rip out the implementation.
That should still true though, as none of the DRM drivers use the drawable cliprect information anymore. Might still be worth double-checking that this doesn't break DRI without KMS on your RV570.
Signature · 6 lines
Earthling Michel Dänzer | http://www.vmware.com Libre software enthusiast | Debian, X and DRI developer _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 09/11] drm: replace drawable ioctl by noops
Quoted 10 lines · Michel Dänzer
Quoted 6 lines · Daniel Vetter
The information supplied by userspace through these ioctls is only accessible by
dev->drw_idr. But there's no in-tree user of that. Information might also leak via theRM_DRAWioctl (in the form of a negative return code in case the drawable doesn't exist). But the only user of these ioctls, mesas' miniglx, does not use theRM_DRAWioctl.FYI, the X server DRI1 code also uses these ioctls, via the libdrm functions drmCreate/DestroyDrawable and
drmUpdateDrawableInfo().
Thanks, I've overlooked the DRI stuff in the xserver. There, drmDestroyDrawable is used (but the return code is ignored), so should be fine. The only place the return value is checked when creating a drawable for the first time (to free any allocations already made). Should be safe, too.
Quoted 6 lines
Quoted 2 lines
Therefore it's safe to replace these three ioctls with noops and rip out the implementation.
That should still true though, as none of the DRM drivers use the drawable cliprect information anymore. Might still be worth double-checking that this doesn't break DRI without KMS on your RV570.
I've tried to test DRI1, but that seems to be in a hilariously broken state on my box: Windows are smeared all over the screen (tiling parameters mismatch?) under certain circumstances. But glxinfo shows the correct render string, AIGLX seems to load correctly (according to Xorg.log) and kde's opengl cover switch looks all right. Also, after some time it hangs with the dmesg complaining that someone is monopolizing the heavyweight lock (in drm_lock_take). Results without these patches are similar.
I haven't used ums radeon since months, so I don't think you can count this as useful testing ;)
Yours, Daniel
Signature · 3 lines
Daniel Vetter Mail: [email protected] Mobile: +41 (0)79 365 57 48
Michel Dänzer
Reviewed-byRe: [PATCH 09/11] drm: replace drawable ioctl by noops
Quoted 34 lines · Daniel Vetter
Quoted 10 lines · Michel Dänzer
Quoted 6 lines · Daniel Vetter
The information supplied by userspace through these ioctls is only accessible by
dev->drw_idr. But there's no in-tree user of that. Information might also leak via theRM_DRAWioctl (in the form of a negative return code in case the drawable doesn't exist). But the only user of these ioctls, mesas' miniglx, does not use theRM_DRAWioctl.FYI, the X server DRI1 code also uses these ioctls, via the libdrm functions drmCreate/DestroyDrawable and
drmUpdateDrawableInfo().Thanks, I've overlooked the DRI stuff in the xserver. There, drmDestroyDrawable is used (but the return code is ignored), so should be fine. The only place the return value is checked when creating a drawable for the first time (to free any allocations already made). Should be safe, too.
Quoted 6 lines
Quoted 2 lines
Therefore it's safe to replace these three ioctls with noops and rip out the implementation.
That should still true though, as none of the DRM drivers use the drawable cliprect information anymore. Might still be worth double-checking that this doesn't break DRI without KMS on your RV570.
I've tried to test DRI1, but that seems to be in a hilariously broken state on my box: Windows are smeared all over the screen (tiling parameters mismatch?) under certain circumstances. But glxinfo shows the correct render string, AIGLX seems to load correctly (according to Xorg.log) and kde's opengl cover switch looks all right. Also, after some time it hangs with the dmesg complaining that someone is monopolizing the heavyweight lock (in
drm_lock_take). Results without these patches are similar.
Quoted 2 lines
I haven't used ums radeon since months, so I don't think you can count this as useful testing ;)
I think it's good enough for the purpose of this change, as I'd expect any problem caused by it to manifest when starting or quitting any 3D app (such as the one doing the OpenGL cover switch).
So, here's my
for it.
Signature · 6 lines
Earthling Michel Dänzer | http://www.vmware.com Libre software enthusiast | Debian, X and DRI developer _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 09/11] drm: replace drawable ioctl by noops
In reply to Daniel VetterQuoted 9 lines · Daniel Vetter
The information supplied by userspace through these ioctls is only accessible by
dev->drw_idr. But there's no in-tree user of that. Information might also leak via theRM_DRAWioctl (in the form of a negative return code in case the drawable doesn't exist). But the only user of these ioctls, mesas' miniglx, does not use theRM_DRAWioctl.Therefore it's safe to replace these three ioctls with noops and rip out the implementation.
Looks almost exactly like this one:
http://www.mail-archive.com/[email protected]/msg39176.html
Except I made adddraw a stub that always returns 1, but reading through the code (hw/xfree86/dri, glx/glxdri.c and the radeon dri driver) I don't see anything that fails if we just return zero (or a random number for that matter). The only difference is that if we return zero, hw/xfree86/dri/dri.c will keep trying to create a drm drawable (look for drmCreateDrawable) every time somebody creates a dri drawable, but since that's a noop, who cares.
Quoted 315 lines
Signed-off-by Daniel Vetter <[email protected]>---
drivers/gpu/drm/Makefile | 2 +-drivers/gpu/drm/drm_drawable.c| 197 ----------------------------------------drivers/gpu/drm/drm_drv.c| 8 +-drivers/gpu/drm/drm_stub.c| 3 -
include/drm/drmP.h | 15 ---5 files changed, 4 insertions(+), 221 deletions(-)delete mode 100644
drivers/gpu/drm/drm_drawable.cdrivers/gpu/drm/Makefile +0
-0@@ -5,7 +5,7 @@ccflags-y := -Iinclude/drm
drm-y := drm_auth.o drm_buffer.o drm_bufs.o drm_cache.o \
- drm_context.o drm_dma.o drm_drawable.o \
+ drm_context.o drm_dma.o \
drm_drv.o drm_fops.o drm_gem.o drm_ioctl.o drm_irq.o \
drm_lock.o drm_memory.o drm_proc.o drm_stub.o drm_vm.o \
drm_agpsupport.o drm_scatter.o ati_pcigart.o drm_pci.o \drivers/gpu/drm/drm_drawable.c deleted +0
-197@@ -1,197 +0,0 @@ -/** -* \file drm_drawable.c -* IOCTLs for drawables -* -* \author Rickard E. (Rik) Faith <[email protected]> -* \author Gareth Hughes <[email protected]> -* \author Michel Dänzer <[email protected]> -*/ - -/* -* Created: Tue Feb 2 08:37:54 1999 by [email protected] -* -* Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. -* Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. -* Copyright 2006 Tungsten Graphics, Inc., Bismarck, North Dakota. -* All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -* OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include "drmP.h" - -/** -* Allocate drawable ID and memory to store information about it. -*/ -int drm_adddraw (struct drm_device *dev,void *data,struct drm_file *file_priv) -{ - unsigned long irqflags; - struct drm_draw *draw = data; - int new_id = 0; - int ret; - -again: - if (idr_pre_get(&dev->drw_idr, GFP_KERNEL) == 0) { - DRM_ERROR("Out of memory expanding drawable idr\n"); - return -ENOMEM; - } - - spin_lock_irqsave(&dev->drw_lock, irqflags); - ret = idr_get_new_above(&dev->drw_idr, NULL, 1, &new_id); - if (ret == -EAGAIN) { - spin_unlock_irqrestore(&dev->drw_lock, irqflags); - goto again; - } - - spin_unlock_irqrestore(&dev->drw_lock, irqflags); - - draw->handle = new_id; - - DRM_DEBUG("%d\n", draw->handle); - - return 0; -} - -/** -* Free drawable ID and memory to store information about it. -*/ -int drm_rmdraw (struct drm_device *dev,void *data,struct drm_file *file_priv) -{ - struct drm_draw *draw = data; - unsigned long irqflags; - struct drm_drawable_info *info; - - spin_lock_irqsave(&dev->drw_lock, irqflags); - - info = drm_get_drawable_info(dev, draw->handle); - if (info == NULL) { - spin_unlock_irqrestore(&dev->drw_lock, irqflags); - return -EINVAL; - } - kfree(info->rects); - kfree(info); - - idr_remove(&dev->drw_idr, draw->handle); - - spin_unlock_irqrestore(&dev->drw_lock, irqflags); - DRM_DEBUG("%d\n", draw->handle); - return 0; -} - -int drm_update_drawable_info (struct drm_device *dev,void *data,struct drm_file *file_priv) -{ - struct drm_update_draw *update = data; - unsigned long irqflags; - struct drm_clip_rect *rects; - struct drm_drawable_info *info; - int err; - - info = idr_find(&dev->drw_idr, update->handle); - if (!info) { - info = kzalloc(sizeof(*info), GFP_KERNEL); - if (!info) - return -ENOMEM; - if (IS_ERR(idr_replace(&dev->drw_idr, info, update->handle))) { - DRM_ERROR("No such drawable %d\n", update->handle); - kfree(info); - return -EINVAL; - } - } - - switch (update->type) { - case DRM_DRAWABLE_CLIPRECTS: - if (update->num == 0) - rects = NULL; - else if (update->num != info->num_rects) { - rects = kmalloc(update->num * - sizeof(struct drm_clip_rect), - GFP_KERNEL); - } else - rects = info->rects; - - if (update->num && !rects) { - DRM_ERROR("Failed to allocate cliprect memory\n"); - err = -ENOMEM; - goto error; - } - - if (update->num && DRM_COPY_FROM_USER(rects, - (struct drm_clip_rect __user *) - (unsigned long)update->data, - update->num * - sizeof(*rects))) { - DRM_ERROR("Failed to copy cliprects from userspace\n"); - err = -EFAULT; - goto error; - } - - spin_lock_irqsave(&dev->drw_lock, irqflags); - - if (rects != info->rects) { - kfree(info->rects); - } - - info->rects = rects; - info->num_rects = update->num; - - spin_unlock_irqrestore(&dev->drw_lock, irqflags); - - DRM_DEBUG("Updated %d cliprects for drawable %d\n", - info->num_rects, update->handle); - break; - default: - DRM_ERROR("Invalid update type %d\n", update->type); - return -EINVAL; - } - - return 0; - -error: - if (rects != info->rects) - kfree(rects); - - return err; -} - -/** -* Caller must hold the drawable spinlock! -*/ -static struct drm_drawable_info *drm_get_drawable_info (struct drm_device *dev,drm_drawable_t id) -{ - return idr_find(&dev->drw_idr, id); -} - -static int drm_drawable_free (int idr,void *p,void *data) -{ - struct drm_drawable_info *info = p; - - if (info) { - kfree(info->rects); - kfree(info); - } - - return 0; -} - -void drm_drawable_free_all (struct drm_device *dev) -{ - idr_for_each(&dev->drw_idr, drm_drawable_free, NULL); - idr_remove_all(&dev->drw_idr); -}drivers/gpu/drm/drm_drv.c +3
-5@@ -88,8 +88,8 @@ static struct drm_ioctl_desc drm_ioctls[] = { DRM_IOCTL_DEF(DRM_IOCTL_NEW_CTX, drm_newctx, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), DRM_IOCTL_DEF(DRM_IOCTL_RES_CTX, drm_resctx, DRM_AUTH), - DRM_IOCTL_DEF(DRM_IOCTL_ADD_DRAW, drm_adddraw, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), - DRM_IOCTL_DEF(DRM_IOCTL_RM_DRAW, drm_rmdraw, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + DRM_IOCTL_DEF(DRM_IOCTL_ADD_DRAW, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + DRM_IOCTL_DEF(DRM_IOCTL_RM_DRAW, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), DRM_IOCTL_DEF(DRM_IOCTL_LOCK, drm_lock, DRM_AUTH), DRM_IOCTL_DEF(DRM_IOCTL_UNLOCK, drm_unlock, DRM_AUTH),@@ -124,7 +124,7 @@ static struct drm_ioctl_desc drm_ioctls[] = { DRM_IOCTL_DEF(DRM_IOCTL_MODESET_CTL, drm_modeset_ctl, 0), - DRM_IOCTL_DEF(DRM_IOCTL_UPDATE_DRAW, drm_update_drawable_info, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), + DRM_IOCTL_DEF(DRM_IOCTL_UPDATE_DRAW, drm_noop, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), DRM_IOCTL_DEF(DRM_IOCTL_GEM_CLOSE, drm_gem_close_ioctl, DRM_UNLOCKED), DRM_IOCTL_DEF(DRM_IOCTL_GEM_FLINK, drm_gem_flink_ioctl, DRM_AUTH|DRM_UNLOCKED),@@ -177,8 +177,6 @@ int drm_lastclose(struct drm_device * dev) mutex_lock(&dev->struct_mutex); - /* Free drawable information memory */ - drm_drawable_free_all(dev); del_timer(&dev->timer); /* Clear AGP information */drivers/gpu/drm/drm_stub.c +0
-3@@ -237,14 +237,11 @@ static int drm_fill_in_dev(struct drm_device * dev, struct pci_dev *pdev, INIT_LIST_HEAD(&dev->vblank_event_list); spin_lock_init(&dev->count_lock); - spin_lock_init(&dev->drw_lock); spin_lock_init(&dev->event_lock); init_timer(&dev->timer); mutex_init(&dev->struct_mutex); mutex_init(&dev->ctxlist_mutex); - idr_init(&dev->drw_idr); - dev->pdev = pdev; dev->pci_device = pdev->device; dev->pci_vendor = pdev->vendor;include/drm/drmP.h +0
-0@@ -1026,12 +1026,6 @@ struct drm_device {struct
drm_minor*control; /**< Control node for card */ structdrm_minor*primary; /**< render type primary screen head */- /** \name Drawable information */
- /*@{ */
-spinlock_tdrw_lock;
- struct idrdrw_idr;
- /*@} */
-
structdrm_mode_configmode_config; /**< Current mode config *//** \name GEM information */
include/drm/drmP.h +0
-10@@ -1202,15 +1196,6 @@ extern int drm_setsareactx(struct drm_device *dev, void *data, extern int drm_getsareactx(struct drm_device *dev, void *data, struct drm_file *file_priv); - /* Drawable IOCTL support (drm_drawable.h) */ -extern int drm_adddraw (struct drm_device *dev,void *data, - struct drm_file *file_priv); -extern int drm_rmdraw (struct drm_device *dev,void *data, - struct drm_file *file_priv); -extern int drm_update_drawable_info (struct drm_device *dev,void *data, - struct drm_file *file_priv); -extern void drm_drawable_free_all (struct drm_device *dev); - /* Authentication IOCTL support (drm_auth.h) */ extern int drm_getmagic(struct drm_device *dev, void *data, struct drm_file *file_priv); --1.7.1
Quoted 6 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 10/11 drm: kill dev->timer
In reply to Daniel VetterTotally unused.
--- drivers/gpu/drm/drm_drv.c | 2 -- drivers/gpu/drm/drm_stub.c | 1 - include/drm/drmP.h | 1 - 3 files changed, 0 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_drv.c +0 -2
@@ -177,8 +177,6 @@ int drm_lastclose(struct drm_device * dev)mutex_lock (&dev->struct_mutex); -del_timer (&dev->timer); -/* Clear AGP information */ if (drm_core_has_AGP (dev) && dev->agp && !drm_core_check_feature (dev,DRIVER_MODESET )) {
drivers/gpu/drm/drm_stub.c +0 -1
@@ -238,7 +238,6 @@ static int drm_fill_in_dev(struct drm_device * dev, struct pci_dev *pdev,spin_lock_init (&dev->count_lock);spin_lock_init (&dev->event_lock); -init_timer (&dev->timer);mutex_init (&dev->struct_mutex);mutex_init (&dev->ctxlist_mutex);
include/drm/drmP.h +0 -1
@@ -957,7 +957,6 @@ struct drm_device {__volatile__ long context_flag;/**< Context swapping flag */ __volatile__ long interrupt_flag;/**< Interruption handler flag */ __volatile__ long dma_flag;/**< DMA dispatch flag */ -struct timer_list timer;/**< Timer for delaying ctx switch */ wait_queue_head_t context_wait;/**< Processes waiting on ctx switch */ int last_checked;/**< Last context checked for DMA */ int last_context;/**< Last current context */
Signature · 1 line
1.7.1
PATCH 11/11 drm: kill gem_free_object_unlocked driver callback
In reply to Daniel VetterNot used by any current driver.
--- drivers/gpu/drm/drm_gem.c | 4 +--- include/drm/drmP.h | 1 - 2 files changed, 1 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_gem.c +1 -3
@@ -463,9 +463,7 @@ drm_gem_object_free_unlocked(struct kref *kref)struct drm_gem_object *obj = (struct drm_gem_object *) kref;struct drm_device *dev = obj->dev; -if (dev->driver->gem_free_object_unlocked !=NULL ) - dev->driver->gem_free_object_unlocked (obj); -else if (dev->driver->gem_free_object !=NULL ) { +if (dev->driver->gem_free_object !=NULL ) {mutex_lock (&dev->struct_mutex); dev->driver->gem_free_object (obj);mutex_unlock (&dev->struct_mutex);
include/drm/drmP.h +0 -1
@@ -793,7 +793,6 @@ struct drm_driver {*/ int (*gem_init_object) (struct drm_gem_object *obj);void (*gem_free_object) (struct drm_gem_object *obj); -void (*gem_free_object_unlocked) (struct drm_gem_object *obj);/* vga arb irq handler */ void (*vgaarb_irq)(struct drm_device *dev,bool state);
Signature · 1 line
1.7.1