Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Feb 2009 18:25:47 +0000 (UTC)
From:      Robert Noland <rnoland@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r189048 - head/sys/dev/drm
Message-ID:  <200902251825.n1PIPlYb004510@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rnoland
Date: Wed Feb 25 18:25:47 2009
New Revision: 189048
URL: http://svn.freebsd.org/changeset/base/189048

Log:
  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.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/drm/drmP.h
  head/sys/dev/drm/drm_drv.c
  head/sys/dev/drm/drm_irq.c
  head/sys/dev/drm/drm_lock.c

Modified: head/sys/dev/drm/drmP.h
==============================================================================
--- head/sys/dev/drm/drmP.h	Wed Feb 25 18:22:57 2009	(r189047)
+++ head/sys/dev/drm/drmP.h	Wed Feb 25 18:25:47 2009	(r189048)
@@ -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: head/sys/dev/drm/drm_drv.c
==============================================================================
--- head/sys/dev/drm/drm_drv.c	Wed Feb 25 18:22:57 2009	(r189047)
+++ head/sys/dev/drm/drm_drv.c	Wed Feb 25 18:25:47 2009	(r189048)
@@ -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: head/sys/dev/drm/drm_irq.c
==============================================================================
--- head/sys/dev/drm/drm_irq.c	Wed Feb 25 18:22:57 2009	(r189047)
+++ head/sys/dev/drm/drm_irq.c	Wed Feb 25 18:25:47 2009	(r189048)
@@ -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: head/sys/dev/drm/drm_lock.c
==============================================================================
--- head/sys/dev/drm/drm_lock.c	Wed Feb 25 18:22:57 2009	(r189047)
+++ head/sys/dev/drm/drm_lock.c	Wed Feb 25 18:25:47 2009	(r189048)
@@ -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();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902251825.n1PIPlYb004510>