Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Aug 2013 22:46:22 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r255044 - head/sys/dev/drm2/ttm
Message-ID:  <201308292246.r7TMkMR6051858@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Thu Aug 29 22:46:21 2013
New Revision: 255044
URL: http://svnweb.freebsd.org/changeset/base/255044

Log:
  Partially revert r254880.  The bitmap operations actually use long type now.

Modified:
  head/sys/dev/drm2/ttm/ttm_bo.c
  head/sys/dev/drm2/ttm/ttm_bo_util.c
  head/sys/dev/drm2/ttm/ttm_bo_vm.c

Modified: head/sys/dev/drm2/ttm/ttm_bo.c
==============================================================================
--- head/sys/dev/drm2/ttm/ttm_bo.c	Thu Aug 29 21:25:27 2013	(r255043)
+++ head/sys/dev/drm2/ttm/ttm_bo.c	Thu Aug 29 22:46:21 2013	(r255044)
@@ -1723,8 +1723,7 @@ int ttm_bo_wait(struct ttm_buffer_object
 		if (driver->sync_obj_signaled(bo->sync_obj)) {
 			void *tmp_obj = bo->sync_obj;
 			bo->sync_obj = NULL;
-			atomic_clear_long(&bo->priv_flags,
-					  1UL << TTM_BO_PRIV_FLAG_MOVING);
+			clear_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags);
 			mtx_unlock(&bdev->fence_lock);
 			driver->sync_obj_unref(&tmp_obj);
 			mtx_lock(&bdev->fence_lock);
@@ -1747,8 +1746,8 @@ int ttm_bo_wait(struct ttm_buffer_object
 		if (likely(bo->sync_obj == sync_obj)) {
 			void *tmp_obj = bo->sync_obj;
 			bo->sync_obj = NULL;
-			atomic_clear_long(&bo->priv_flags,
-					  1UL << TTM_BO_PRIV_FLAG_MOVING);
+			clear_bit(TTM_BO_PRIV_FLAG_MOVING,
+				  &bo->priv_flags);
 			mtx_unlock(&bdev->fence_lock);
 			driver->sync_obj_unref(&sync_obj);
 			driver->sync_obj_unref(&tmp_obj);

Modified: head/sys/dev/drm2/ttm/ttm_bo_util.c
==============================================================================
--- head/sys/dev/drm2/ttm/ttm_bo_util.c	Thu Aug 29 21:25:27 2013	(r255043)
+++ head/sys/dev/drm2/ttm/ttm_bo_util.c	Thu Aug 29 22:46:21 2013	(r255044)
@@ -637,8 +637,7 @@ int ttm_bo_move_accel_cleanup(struct ttm
 		 * operation has completed.
 		 */
 
-		atomic_set_long(&bo->priv_flags,
-				1UL << TTM_BO_PRIV_FLAG_MOVING);
+		set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags);
 		mtx_unlock(&bdev->fence_lock);
 		if (tmp_obj)
 			driver->sync_obj_unref(&tmp_obj);

Modified: head/sys/dev/drm2/ttm/ttm_bo_vm.c
==============================================================================
--- head/sys/dev/drm2/ttm/ttm_bo_vm.c	Thu Aug 29 21:25:27 2013	(r255043)
+++ head/sys/dev/drm2/ttm/ttm_bo_vm.c	Thu Aug 29 22:46:21 2013	(r255044)
@@ -153,8 +153,7 @@ reserve:
 	 */
 
 	mtx_lock(&bdev->fence_lock);
-	if ((atomic_load_acq_long(&bo->priv_flags) &
-	    (1UL << TTM_BO_PRIV_FLAG_MOVING)) != 0) {
+	if (test_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags)) {
 		/*
 		 * Here, the behavior differs between Linux and FreeBSD.
 		 *



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