From: Maarten Maathuis Subject: Re: [PATCH 1/2] drm/ttm: remove some bo->mutex remains Date: Fri, 12 Mar 2010 09:30:47 +0100 Message-ID: <6d4bc9fc1003120030t6bf5fc40o3f04578cfccae3aa@mail.gmail.com> References: <1267468480-3430-1-git-send-email-madman2003@gmail.com> <20100301205536.GJ2027@barney.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20100301205536.GJ2027@barney.localdomain> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.sourceforge.net To: Jerome Glisse Cc: Dave Airlie , dri-devel@lists.sf.net List-Id: dri-devel@lists.freedesktop.org Ping? On Mon, Mar 1, 2010 at 9:55 PM, Jerome Glisse wrot= e: > On Mon, Mar 01, 2010 at 07:34:39PM +0100, Maarten Maathuis wrote: >> - A few comments existed here and there that referred to a bo->mutex. >> >> Signed-off-by: Maarten Maathuis > > Reviewed-by: Jerome Glisse > >> --- >> =A0drivers/gpu/drm/ttm/ttm_bo.c =A0 =A0| =A0 =A06 +----- >> =A0drivers/gpu/drm/ttm/ttm_bo_vm.c | =A0 =A02 +- >> =A0include/drm/ttm/ttm_bo_api.h =A0 =A0| =A0 =A03 +-- >> =A0include/drm/ttm/ttm_bo_driver.h | =A0 =A01 + >> =A04 files changed, 4 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c >> index 2920f9a..f5333d9 100644 >> --- a/drivers/gpu/drm/ttm/ttm_bo.c >> +++ b/drivers/gpu/drm/ttm/ttm_bo.c >> @@ -46,7 +46,6 @@ >> =A0#include >> =A0#include >> >> -#define TTM_ASSERT_LOCKED(param) >> =A0#define TTM_DEBUG(fmt, arg...) >> =A0#define TTM_BO_HASH_ORDER 13 >> >> @@ -306,9 +305,6 @@ void ttm_bo_unreserve(struct ttm_buffer_object *bo) >> =A0} >> =A0EXPORT_SYMBOL(ttm_bo_unreserve); >> >> -/* >> - * Call bo->mutex locked. >> - */ >> =A0static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_all= oc) >> =A0{ >> =A0 =A0 =A0 struct ttm_bo_device *bdev =3D bo->bdev; >> @@ -316,7 +312,7 @@ static int ttm_bo_add_ttm(struct ttm_buffer_object *= bo, bool zero_alloc) >> =A0 =A0 =A0 int ret =3D 0; >> =A0 =A0 =A0 uint32_t page_flags =3D 0; >> >> - =A0 =A0 TTM_ASSERT_LOCKED(&bo->mutex); >> + =A0 =A0 BUG_ON(!atomic_read(&bo->reserved)); >> =A0 =A0 =A0 bo->ttm =3D NULL; >> >> =A0 =A0 =A0 if (bdev->need_dma32) >> diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_b= o_vm.c >> index 668dbe8..41b0c1e 100644 >> --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c >> +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c >> @@ -146,7 +146,7 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vm= a, struct vm_fault *vmf) >> =A0 =A0 =A0 =A0* since the mmap_sem is only held in read mode. However, = we >> =A0 =A0 =A0 =A0* modify only the caching bits of vma->vm_page_prot and >> =A0 =A0 =A0 =A0* consider those bits protected by >> - =A0 =A0 =A0* the bo->mutex, as we should be the only writers. >> + =A0 =A0 =A0* bo->reserved, as we should be the only writers. >> =A0 =A0 =A0 =A0* There shouldn't really be any readers of these bits exc= ept >> =A0 =A0 =A0 =A0* within vm_insert_mixed()? fork? >> =A0 =A0 =A0 =A0* >> diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h >> index 81eb9f4..c1093ae 100644 >> --- a/include/drm/ttm/ttm_bo_api.h >> +++ b/include/drm/ttm/ttm_bo_api.h >> @@ -35,7 +35,6 @@ >> =A0#include >> =A0#include >> =A0#include >> -#include >> =A0#include >> =A0#include >> =A0#include >> @@ -298,7 +297,7 @@ ttm_bo_reference(struct ttm_buffer_object *bo) >> =A0 * @interruptible: =A0Use interruptible wait. >> =A0 * @no_wait: =A0Return immediately if buffer is busy. >> =A0 * >> - * This function must be called with the bo::mutex held, and makes >> + * This function must be called with bo->reserved held, and makes >> =A0 * sure any previous rendering to the buffer is completed. >> =A0 * Note: It might be necessary to block validations before the >> =A0 * wait by reserving the buffer. >> diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_dr= iver.h >> index ff7664e..d3fc5f8 100644 >> --- a/include/drm/ttm/ttm_bo_driver.h >> +++ b/include/drm/ttm/ttm_bo_driver.h >> @@ -37,6 +37,7 @@ >> =A0#include "linux/workqueue.h" >> =A0#include "linux/fs.h" >> =A0#include "linux/spinlock.h" >> +#include >> >> =A0struct ttm_backend; >> >> -- >> 1.7.0 >> >> >> ------------------------------------------------------------------------= ------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> -- >> _______________________________________________ >> Dri-devel mailing list >> Dri-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/dri-devel >> > ---------------------------------------------------------------------------= --- Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev --