From owner-svn-src-all@FreeBSD.ORG Wed Mar 11 01:53:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64E3F1065672; Wed, 11 Mar 2009 01:53:22 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 512788FC17; Wed, 11 Mar 2009 01:53:22 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2B1rM4E080034; Wed, 11 Mar 2009 01:53:22 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2B1rLjQ080030; Wed, 11 Mar 2009 01:53:21 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903110153.n2B1rLjQ080030@svn.freebsd.org> From: Robert Noland Date: Wed, 11 Mar 2009 01:53:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r189664 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/drm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2009 01:53:23 -0000 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 #include #include -#include #include #include #include @@ -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();