From patchwork Thu Jun 27 11:48:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 2792181 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EDA319F245 for ; Thu, 27 Jun 2013 12:03:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 41EAB201BC for ; Thu, 27 Jun 2013 12:03:48 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 89213201DA for ; Thu, 27 Jun 2013 12:03:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C696E63BD for ; Thu, 27 Jun 2013 05:03:43 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-we0-f174.google.com (mail-we0-f174.google.com [74.125.82.174]) by gabe.freedesktop.org (Postfix) with ESMTP id 2ECE7E5D29 for ; Thu, 27 Jun 2013 04:49:06 -0700 (PDT) Received: by mail-we0-f174.google.com with SMTP id q58so484332wes.33 for ; Thu, 27 Jun 2013 04:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=imQras4tdgoR69NhIdVkjV1gbW/qG8bSV+KVi+V84iE=; b=Y7p5f+1Z8ZHQZWhjcvSGUoY3pdlqN8W2ZVQK2CH4IauVp7Qd49LfrBcKWUY5Xz12eP P6oVvmpQk2h6749ONitW725EIPqsvfAgjKNUm+83nLRNZEMoONW7HpRctg8AzloGQtpO 5yNdSa8CSUai+G6OViOCU9KPMj7BWfoh2jA9duVY7tRQCBWiuyz15/1UKvjF50qbbzpC 1L5M9h0xzUAnvuSCVhoHH4DV80xnyNCxbGyQqeq0yIJesNnDip4ius/SxMLbOyOnVVny 5kuzty8BrIQHaHzKi2mSow/MjpVFkmS1WCWnXTUMaR2M/kQhCjyia9ptrvRxkmxv8mp8 IdVA== X-Received: by 10.194.123.199 with SMTP id mc7mr5943465wjb.35.1372333745417; Thu, 27 Jun 2013 04:49:05 -0700 (PDT) Received: from localhost (5ED49945.cm-7-5c.dynamic.ziggo.nl. [94.212.153.69]) by mx.google.com with ESMTPSA id fd3sm16803853wic.10.2013.06.27.04.49.03 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 27 Jun 2013 04:49:05 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Thu, 27 Jun 2013 13:49:03 +0200 From: Maarten Lankhorst To: Dave Airlie Subject: [PATCH WW 10/13] drm/ttm: get rid of ttm_bo_is_reserved usage Date: Thu, 27 Jun 2013 13:48:25 +0200 Message-Id: <1372333708-29884-11-git-send-email-maarten.lankhorst@canonical.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1372333708-29884-1-git-send-email-maarten.lankhorst@canonical.com> References: <1372333708-29884-1-git-send-email-maarten.lankhorst@canonical.com> Cc: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use lockdep_assert_held instead. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/ttm/ttm_bo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index a8a27f5..6e6975c 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -166,7 +166,7 @@ void ttm_bo_add_to_lru(struct ttm_buffer_object *bo) struct ttm_bo_device *bdev = bo->bdev; struct ttm_mem_type_manager *man; - BUG_ON(!ttm_bo_is_reserved(bo)); + lockdep_assert_held(&bo->resv->lock.base); if (!(bo->mem.placement & TTM_PL_FLAG_NO_EVICT)) { @@ -671,7 +671,7 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo, bool interruptible, goto out; } - BUG_ON(!ttm_bo_is_reserved(bo)); + lockdep_assert_held(&bo->resv->lock.base); evict_mem = bo->mem; evict_mem.mm_node = NULL; @@ -961,7 +961,7 @@ int ttm_bo_move_buffer(struct ttm_buffer_object *bo, struct ttm_mem_reg mem; struct ttm_bo_device *bdev = bo->bdev; - BUG_ON(!ttm_bo_is_reserved(bo)); + lockdep_assert_held(&bo->resv->lock.base); /* * FIXME: It's possible to pipeline buffer moves. @@ -1020,7 +1020,7 @@ int ttm_bo_validate(struct ttm_buffer_object *bo, { int ret; - BUG_ON(!ttm_bo_is_reserved(bo)); + lockdep_assert_held(&bo->resv->lock.base); /* Check that range is valid */ if (placement->lpfn || placement->fpfn) if (placement->fpfn > placement->lpfn ||