From patchwork Thu Jun 27 11:48:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 2792201 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 B3EA49F245 for ; Thu, 27 Jun 2013 12:05:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 022322026B for ; Thu, 27 Jun 2013 12:05:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3BEBC20240 for ; Thu, 27 Jun 2013 12:05:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 31C09E653F for ; Thu, 27 Jun 2013 05:05:23 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-we0-f170.google.com (mail-we0-f170.google.com [74.125.82.170]) by gabe.freedesktop.org (Postfix) with ESMTP id 555CDE5C4E for ; Thu, 27 Jun 2013 04:49:10 -0700 (PDT) Received: by mail-we0-f170.google.com with SMTP id w57so484902wes.29 for ; Thu, 27 Jun 2013 04:49:09 -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=nC17ekAaxSJ1Q1JgaHE/R64ZEs4+iCEuo1ldLICOyVk=; b=pb8FnVeieoBRumbWX9kurBjBjbJialhgfglANA4UxATBZYhLa4b6oVxPCNX31fvspG pRckObnvuidXvEP8/P22vpLaDjloYQ/usjAT+QfwB8nhC7LjHtpimvH4OB1ZyBnT8kgj FJgTmc9A+iPch1Zy+QJDoABOC6gmgKeG0TQYZGQCXdue+8tCOWWKU31NeyPZkI0RjHd/ CBGaYH9VknZ+yT1iuDYNCNmFy6gQuukbfrcEMiosLLyeN5aEjGWutNAwYlqRr3PkiB+N +dKRbMo8x1ZazmartML6dsZPYme+feQiGIU9Cd9IklJ9niYTCAhaITG3eKgf2DqMFcEG +PqA== X-Received: by 10.180.85.195 with SMTP id j3mr5696872wiz.26.1372333749537; Thu, 27 Jun 2013 04:49:09 -0700 (PDT) Received: from localhost (5ED49945.cm-7-5c.dynamic.ziggo.nl. [94.212.153.69]) by mx.google.com with ESMTPSA id x13sm3106914wib.3.2013.06.27.04.49.07 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 27 Jun 2013 04:49:09 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Thu, 27 Jun 2013 13:49:07 +0200 From: Maarten Lankhorst To: Dave Airlie Subject: [PATCH WW 12/13] drm/vmwgfx: get rid of ttm_bo_is_reserved usage Date: Thu, 27 Jun 2013 13:48:27 +0200 Message-Id: <1372333708-29884-13-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/vmwgfx/vmwgfx_dmabuf.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c index 5fae06a..d4e54fc 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c @@ -302,7 +302,7 @@ void vmw_bo_pin(struct ttm_buffer_object *bo, bool pin) uint32_t old_mem_type = bo->mem.mem_type; int ret; - BUG_ON(!ttm_bo_is_reserved(bo)); + lockdep_assert_held(&bo->resv->lock.base); BUG_ON(old_mem_type != TTM_PL_VRAM && old_mem_type != VMW_PL_GMR); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c index ced7946..7953d1f 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c @@ -958,13 +958,13 @@ void vmw_resource_unreserve(struct vmw_resource *res, if (new_backup && new_backup != res->backup) { if (res->backup) { - BUG_ON(!ttm_bo_is_reserved(&res->backup->base)); + lockdep_assert_held(&res->backup->base.resv->lock.base); list_del_init(&res->mob_head); vmw_dmabuf_unreference(&res->backup); } res->backup = vmw_dmabuf_reference(new_backup); - BUG_ON(!ttm_bo_is_reserved(&new_backup->base)); + lockdep_assert_held(&new_backup->base.resv->lock.base); list_add_tail(&res->mob_head, &new_backup->res_list); } if (new_backup)