From patchwork Fri Apr 26 12:36:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 10919089 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7A59F1398 for ; Fri, 26 Apr 2019 12:37:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68FCD28E22 for ; Fri, 26 Apr 2019 12:37:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D9B728E26; Fri, 26 Apr 2019 12:37:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 118ED28E22 for ; Fri, 26 Apr 2019 12:37:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CA8AE89291; Fri, 26 Apr 2019 12:36:56 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id 15B2F89272 for ; Fri, 26 Apr 2019 12:36:49 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id n25so4184809wmk.4 for ; Fri, 26 Apr 2019 05:36:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/Q+iJ6rJZ2HsKCGJQjBe3G9bfJhGCGmYeQPjdB6XZUQ=; b=CiwLF+Ocr85yXtYFVewTZvn6j4YK2qyox5q/joZmmXofpdaRq0fxXwmomJtoOtCVCS 3RXGpgnz4SgHbQr8W+rpuAAHc57jw6R6idvZGVHMG6UcuEFpT+bSPsz/9sY5HG8vlUvu Z0Tmp60py43kioII7hGfR3G1KV+L7Rjg/GFDcbI6IEl95Mxq78Fn23MI942aekDAZ8e7 HskFf2Op5KnzZpeKF+bD8kriU8St8DiXlMJ8cXJS0z4olyyCjadDViSTDw1u7DafqCc6 OnGotZPzKhOl39/0lj/j67wWjejn4APpJsRusSslA5rbSiF+W3Xx4oJPIIzzuN3iuaVH Ct0g== X-Gm-Message-State: APjAAAU0wHlCxPp1UMgtQ0FpaoYdGOumn6J5rdtooYG0G9F8pEuajt7L xgfXmEB6PEWPShhgJGqxWTsYNz6J X-Google-Smtp-Source: APXvYqylnBBnBblIJKC9dQYSv3szpnAr6BHl5sKyISdBNy22ysi2z3jem4r+awTukU+qWSFS/8vSlQ== X-Received: by 2002:a1c:a184:: with SMTP id k126mr7522583wme.71.1556282207309; Fri, 26 Apr 2019 05:36:47 -0700 (PDT) Received: from abel.fritz.box ([2a02:908:1252:fb60:5545:e552:48cc:b52f]) by smtp.gmail.com with ESMTPSA id y125sm37196159wmc.39.2019.04.26.05.36.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Apr 2019 05:36:46 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 09/12] drm/ttm: use the parent resv for ghost objects Date: Fri, 26 Apr 2019 14:36:35 +0200 Message-Id: <20190426123638.40221-9-christian.koenig@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190426123638.40221-1-christian.koenig@amd.com> References: <20190426123638.40221-1-christian.koenig@amd.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=/Q+iJ6rJZ2HsKCGJQjBe3G9bfJhGCGmYeQPjdB6XZUQ=; b=sbg6r+WjRGkJ6RuagNNgODYJRnIZR9lcjmCdHwdCiPoZJM+Re2KtdALCdoR4hwg6wW e3YJeFwH94YJWyiSq1jHNZOqjrsRDR1MNw888q7kWX75j5+Nm+dc3Dfi19+FHOw3+0Aa HOXhTM5rfdas5vEL5SfJDCPM/0rZvytUsm2pdzAMQ+XBjjna/umIVkGBDxTqOb3N/mJw iL46WI2+m8tdOKfWLxQ4hn5GTi/RWd76C9vv+x4mMNOrYWxInZYXYO2MFJkeddW8ewLF dDkXgSjjv6TcJWNCRpzPGSJ4+9F9eCsSV74OeiCdOckB08eal+WQ0F1bSF/xddz0OumS CE2Q== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This way we can even pipeline imported BO evictions. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo_util.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 895d77d799e4..97f35c4bda35 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -486,7 +486,6 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, struct ttm_buffer_object **new_obj) { struct ttm_transfer_obj *fbo; - int ret; fbo = kmalloc(sizeof(*fbo), GFP_KERNEL); if (!fbo) @@ -517,10 +516,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, kref_init(&fbo->base.kref); fbo->base.destroy = &ttm_transfered_destroy; fbo->base.acc_size = 0; - fbo->base.resv = &fbo->base.ttm_resv; - reservation_object_init(fbo->base.resv); - ret = reservation_object_trylock(fbo->base.resv); - WARN_ON(!ret); + reservation_object_init(&fbo->base.ttm_resv); *new_obj = &fbo->base; return 0; @@ -716,8 +712,6 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, if (ret) return ret; - reservation_object_add_excl_fence(ghost_obj->resv, fence); - /** * If we're not moving to fixed memory, the TTM object * needs to stay alive. Otherwhise hang it on the ghost @@ -729,7 +723,6 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, else bo->ttm = NULL; - ttm_bo_unreserve(ghost_obj); ttm_bo_put(ghost_obj); } @@ -772,8 +765,6 @@ int ttm_bo_pipeline_move(struct ttm_buffer_object *bo, if (ret) return ret; - reservation_object_add_excl_fence(ghost_obj->resv, fence); - /** * If we're not moving to fixed memory, the TTM object * needs to stay alive. Otherwhise hang it on the ghost @@ -785,7 +776,6 @@ int ttm_bo_pipeline_move(struct ttm_buffer_object *bo, else bo->ttm = NULL; - ttm_bo_unreserve(ghost_obj); ttm_bo_put(ghost_obj); } else if (from->flags & TTM_MEMTYPE_FLAG_FIXED) { @@ -841,16 +831,10 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo) if (ret) return ret; - ret = reservation_object_copy_fences(ghost->resv, bo->resv); - /* Last resort, wait for the BO to be idle when we are OOM */ - if (ret) - ttm_bo_wait(bo, false, false); - memset(&bo->mem, 0, sizeof(bo->mem)); bo->mem.mem_type = TTM_PL_SYSTEM; bo->ttm = NULL; - ttm_bo_unreserve(ghost); ttm_bo_put(ghost); return 0;