svn commit: r189664 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm

Robert Noland rnoland at FreeBSD.org
Tue Mar 10 18:53:23 PDT 2009


Author: rnoland
Date: Wed Mar 11 01:53:21 2009
New Revision: 189664
URL: http://svn.freebsd.org/changeset/base/189664

Log:
  Merge 189048
  
  The i915 driver was the only consumer of locked task support.
  
  Now that it doesn't use it anymore, get right of the taskqueue
  and locked task support.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/drm/drmP.h
  stable/7/sys/dev/drm/drm_drv.c
  stable/7/sys/dev/drm/drm_irq.c
  stable/7/sys/dev/drm/drm_lock.c

Modified: stable/7/sys/dev/drm/drmP.h
==============================================================================
--- stable/7/sys/dev/drm/drmP.h	Wed Mar 11 01:50:53 2009	(r189663)
+++ stable/7/sys/dev/drm/drmP.h	Wed Mar 11 01:53:21 2009	(r189664)
@@ -63,7 +63,6 @@ struct drm_file;
 #include <sys/signalvar.h>
 #include <sys/poll.h>
 #include <sys/tree.h>
-#include <sys/taskqueue.h>
 #include <vm/vm.h>
 #include <vm/pmap.h>
 #include <vm/vm_extern.h>
@@ -628,7 +627,6 @@ struct drm_device {
 	struct mtx	  irq_lock;	/* protects irq condition checks */
 	struct mtx	  dev_lock;	/* protects everything else */
 	DRM_SPINTYPE	  drw_lock;
-	DRM_SPINTYPE	  tsk_lock;
 
 				/* Usage Counters */
 	int		  open_count;	/* Outstanding files open	   */
@@ -695,9 +693,6 @@ struct drm_device {
 	struct unrhdr	  *drw_unrhdr;
 	/* RB tree of drawable infos */
 	RB_HEAD(drawable_tree, bsd_drm_drawable_info) drw_head;
-
-	struct task	  locked_task;
-	void		  (*locked_task_call)(struct drm_device *dev);
 };
 
 static __inline__ int drm_core_check_feature(struct drm_device *dev,
@@ -918,8 +913,6 @@ int	drm_control(struct drm_device *dev, 
 		    struct drm_file *file_priv);
 int	drm_wait_vblank(struct drm_device *dev, void *data,
 			struct drm_file *file_priv);
-void	drm_locked_tasklet(struct drm_device *dev,
-			   void (*tasklet)(struct drm_device *dev));
 
 /* AGP/GART support (drm_agpsupport.c) */
 int	drm_agp_acquire_ioctl(struct drm_device *dev, void *data,

Modified: stable/7/sys/dev/drm/drm_drv.c
==============================================================================
--- stable/7/sys/dev/drm/drm_drv.c	Wed Mar 11 01:50:53 2009	(r189663)
+++ stable/7/sys/dev/drm/drm_drv.c	Wed Mar 11 01:53:21 2009	(r189664)
@@ -193,7 +193,6 @@ int drm_attach(device_t nbdev, drm_pci_i
 	mtx_init(&dev->irq_lock, "drmirq", NULL, MTX_DEF);
 	mtx_init(&dev->vbl_lock, "drmvbl", NULL, MTX_DEF);
 	mtx_init(&dev->drw_lock, "drmdrw", NULL, MTX_DEF);
-	mtx_init(&dev->tsk_lock, "drmtsk", NULL, MTX_DEF);
 
 	id_entry = drm_find_description(pci_get_vendor(dev->device),
 	    pci_get_device(dev->device), idlist);
@@ -440,7 +439,6 @@ error:
 	DRM_UNLOCK();
 	destroy_dev(dev->devnode);
 
-	mtx_destroy(&dev->tsk_lock);
 	mtx_destroy(&dev->drw_lock);
 	mtx_destroy(&dev->vbl_lock);
 	mtx_destroy(&dev->irq_lock);
@@ -503,14 +501,12 @@ static void drm_unload(struct drm_device
 	if (pci_disable_busmaster(dev->device))
 		DRM_ERROR("Request to disable bus-master failed.\n");
 
-	mtx_destroy(&dev->tsk_lock);
 	mtx_destroy(&dev->drw_lock);
 	mtx_destroy(&dev->vbl_lock);
 	mtx_destroy(&dev->irq_lock);
 	mtx_destroy(&dev->dev_lock);
 }
 
-
 int drm_version(struct drm_device *dev, void *data, struct drm_file *file_priv)
 {
 	struct drm_version *version = data;

Modified: stable/7/sys/dev/drm/drm_irq.c
==============================================================================
--- stable/7/sys/dev/drm/drm_irq.c	Wed Mar 11 01:50:53 2009	(r189663)
+++ stable/7/sys/dev/drm/drm_irq.c	Wed Mar 11 01:53:21 2009	(r189664)
@@ -36,8 +36,6 @@ __FBSDID("$FreeBSD$");
 #include "dev/drm/drmP.h"
 #include "dev/drm/drm.h"
 
-static void drm_locked_task(void *context, int pending __unused);
-
 int drm_irq_by_busid(struct drm_device *dev, void *data,
 		     struct drm_file *file_priv)
 {
@@ -198,7 +196,6 @@ int drm_irq_install(struct drm_device *d
 	dev->driver->irq_postinstall(dev);
 	DRM_UNLOCK();
 
-	TASK_INIT(&dev->locked_task, 0, drm_locked_task, dev);
 	return 0;
 err:
 	DRM_LOCK();
@@ -507,46 +504,3 @@ void drm_handle_vblank(struct drm_device
 	drm_vbl_send_signals(dev, crtc);
 }
 
-static void drm_locked_task(void *context, int pending __unused)
-{
-	struct drm_device *dev = context;
-
-	DRM_SPINLOCK(&dev->tsk_lock);
-
-	DRM_LOCK(); /* XXX drm_lock_take() should do it's own locking */
-	if (dev->locked_task_call == NULL ||
-	    drm_lock_take(&dev->lock, DRM_KERNEL_CONTEXT) == 0) {
-		DRM_UNLOCK();
-		DRM_SPINUNLOCK(&dev->tsk_lock);
-		return;
-	}
-
-	dev->lock.file_priv = NULL; /* kernel owned */
-	dev->lock.lock_time = jiffies;
-	atomic_inc(&dev->counts[_DRM_STAT_LOCKS]);
-
-	DRM_UNLOCK();
-
-	dev->locked_task_call(dev);
-
-	drm_lock_free(&dev->lock, DRM_KERNEL_CONTEXT);
-
-	dev->locked_task_call = NULL;
-
-	DRM_SPINUNLOCK(&dev->tsk_lock);
-}
-
-void
-drm_locked_tasklet(struct drm_device *dev,
-		   void (*tasklet)(struct drm_device *dev))
-{
-	DRM_SPINLOCK(&dev->tsk_lock);
-	if (dev->locked_task_call != NULL) {
-		DRM_SPINUNLOCK(&dev->tsk_lock);
-		return;
-	}
-
-	dev->locked_task_call = tasklet;
-	DRM_SPINUNLOCK(&dev->tsk_lock);
-	taskqueue_enqueue(taskqueue_swi, &dev->locked_task);
-}

Modified: stable/7/sys/dev/drm/drm_lock.c
==============================================================================
--- stable/7/sys/dev/drm/drm_lock.c	Wed Mar 11 01:50:53 2009	(r189663)
+++ stable/7/sys/dev/drm/drm_lock.c	Wed Mar 11 01:53:21 2009	(r189664)
@@ -115,13 +115,6 @@ int drm_unlock(struct drm_device *dev, v
 		return EINVAL;
 	}
 
-	DRM_SPINLOCK(&dev->tsk_lock);
-	if (dev->locked_task_call != NULL) {
-		dev->locked_task_call(dev);
-		dev->locked_task_call = NULL;
-	}
-	DRM_SPINUNLOCK(&dev->tsk_lock);
-
 	atomic_inc(&dev->counts[_DRM_STAT_UNLOCKS]);
 
 	DRM_LOCK();


More information about the svn-src-all mailing list