From patchwork Wed Aug 8 14:36:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 1296011 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 37285DF223 for ; Wed, 8 Aug 2012 14:12:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3354AA08EF for ; Wed, 8 Aug 2012 07:12:10 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yx0-f177.google.com (mail-yx0-f177.google.com [209.85.213.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 14F229E943 for ; Wed, 8 Aug 2012 07:12:00 -0700 (PDT) Received: by yenr9 with SMTP id r9so864373yen.36 for ; Wed, 08 Aug 2012 07:11:59 -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; bh=iLBPHocZp+Rgyls4cYpweu7+6sxUihiRI2cBFTlv1K8=; b=0673hiTPeLM+B4ruQwGSK+e6OOTRuwQ5v52qSSKFot7a5YoO6IrKOp71wTZWeg0cIT E/02MmD/KskygMhWWUlGrbSi1aYItLtE3GVW4dSTxbe9OorC9WmwItsB8/QApvhvf+lH +IEpry8MjYZ3VrNXqDEKGO7Q82y6X45NgG9t1AS0xyw/uVhfmI0Cfmz5Uws+cUSSLzYB RxLfkZK+7HbwiGfiCcFvt0/m7nplhVS9X4EWciUIe9eDjVepGnti6Uhv7D6hJZLZe3Ct lZ69QmEDAFTbDpJTG/wmqW9rI30Zjyv8O+Gav05TKZBjv0BqaZogzEkCjJY1Ta3GUqGx U7Lw== Received: by 10.42.163.4 with SMTP id a4mr14278789icy.27.1344435119248; Wed, 08 Aug 2012 07:11:59 -0700 (PDT) Received: from homer.localdomain.com ([66.187.233.206]) by mx.google.com with ESMTPS id d4sm5025998iga.14.2012.08.08.07.11.58 (version=SSLv3 cipher=OTHER); Wed, 08 Aug 2012 07:11:58 -0700 (PDT) From: j.glisse@gmail.com To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon: delay virtual address destruction to bo destruction Date: Wed, 8 Aug 2012 10:36:09 -0400 Message-Id: <1344436569-955-1-git-send-email-j.glisse@gmail.com> X-Mailer: git-send-email 1.7.10.4 Cc: Jerome Glisse 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 From: Jerome Glisse Use the ttm bo delayed destruction queue so that we don't block userspace when destroying bo. The virtual address destruction will happen at same time as the real bo destruction when everythings using the bo is done. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/radeon/radeon_drv.c | 2 +- drivers/gpu/drm/radeon/radeon_gem.c | 20 -------------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index dcea6f0..38443e7 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -368,7 +368,7 @@ static struct drm_driver kms_driver = { .gem_init_object = radeon_gem_object_init, .gem_free_object = radeon_gem_object_free, .gem_open_object = radeon_gem_object_open, - .gem_close_object = radeon_gem_object_close, + .gem_close_object = NULL, .dma_ioctl = radeon_dma_ioctl_kms, .dumb_create = radeon_mode_dumb_create, .dumb_map_offset = radeon_mode_dumb_mmap, diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index 1b57b00..b5835c8 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c @@ -127,26 +127,6 @@ int radeon_gem_object_open(struct drm_gem_object *obj, struct drm_file *file_pri return 0; } -void radeon_gem_object_close(struct drm_gem_object *obj, - struct drm_file *file_priv) -{ - struct radeon_bo *rbo = gem_to_radeon_bo(obj); - struct radeon_device *rdev = rbo->rdev; - struct radeon_fpriv *fpriv = file_priv->driver_priv; - struct radeon_vm *vm = &fpriv->vm; - - if (rdev->family < CHIP_CAYMAN) { - return; - } - - if (radeon_bo_reserve(rbo, false)) { - dev_err(rdev->dev, "leaking bo va because we fail to reserve bo\n"); - return; - } - radeon_vm_bo_rmv(rdev, vm, rbo); - radeon_bo_unreserve(rbo); -} - static int radeon_gem_handle_lockup(struct radeon_device *rdev, int r) { if (r == -EDEADLK) {