From patchwork Thu Oct 4 13:12:49 2018 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: 10626153 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 18F8815E8 for ; Thu, 4 Oct 2018 13:13:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 089CE28BC6 for ; Thu, 4 Oct 2018 13:13:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EFAAE28BCB; Thu, 4 Oct 2018 13:13:18 +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 A26B028BC6 for ; Thu, 4 Oct 2018 13:13:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0CDC26E5E4; Thu, 4 Oct 2018 13:13:02 +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 60B5B6E5E3; Thu, 4 Oct 2018 13:13:00 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id z204-v6so8171763wmc.5; Thu, 04 Oct 2018 06:13:00 -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=LSJvRqqu6D4DzSe/HGGDYGYslOLX9wQ7lg6E5rBmTNM=; b=aYyM5ceciCIzhrFnhBluDeFejOBg+SSuDiyQW5iinNlTNZLODkHpluQiLmpQfDS1a8 LDe2YEfWbgRQOFgZ+uWdfoWRaJwcydOkVH7u97uRBUSskgaU5oP4RutFWMLZag7AZTrI p/toCrkRVb/ZsfguIzp3oPuaydkqb82XsSvU1D8xPXAis0YHMN1QYw16mfwnV/TLPARo 3UbmbjDgpDDKhGvsJV+pBuW494BQIZ2PTsBya0BP8xvOf3RiP0IqUG+pyyzPnf+oa7BR ajprkjNkh+7xjwBx9KvvzhceSnepm32m9Lm6sh+aEfV2n98iDk1ZEpeeKwYeThLTE/SX d/zQ== X-Gm-Message-State: ABuFfogQdXiIkqGqVs6ajjLVS7J2CatUww2+xheeW4LXtkf5HZzVX+dN e6NwUeTaC4/OmfaqH5/x2ImOBZIz X-Google-Smtp-Source: ACcGV61ArnVNkDsAbszTVrdDdNgbFBnGtDBfrMLwdveY0qcrpOBpYjZVmvKqI9apCGyBAeTAGtK5pw== X-Received: by 2002:a1c:a683:: with SMTP id p125-v6mr4905814wme.24.1538658778674; Thu, 04 Oct 2018 06:12:58 -0700 (PDT) Received: from baker.fritz.box ([2a02:908:1257:4460:2d2f:ac8e:6b85:b5e9]) by smtp.gmail.com with ESMTPSA id b139-v6sm9755457wmd.36.2018.10.04.06.12.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Oct 2018 06:12:57 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 7/8] drm/amdgpu: always reserve one more shared slot for pipelined BO moves Date: Thu, 4 Oct 2018 15:12:49 +0200 Message-Id: <20181004131250.2373-7-christian.koenig@amd.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20181004131250.2373-1-christian.koenig@amd.com> References: <20181004131250.2373-1-christian.koenig@amd.com> MIME-Version: 1.0 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 allows us to drop the extra reserve in TTM. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index ba406bd1b08f..8edf75c76475 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -50,7 +50,8 @@ static int amdgpu_cs_user_fence_chunk(struct amdgpu_cs_parser *p, bo = amdgpu_bo_ref(gem_to_amdgpu_bo(gobj)); p->uf_entry.priority = 0; p->uf_entry.tv.bo = &bo->tbo; - p->uf_entry.tv.num_shared = 1; + /* One for TTM and one for the CS job */ + p->uf_entry.tv.num_shared = 2; p->uf_entry.user_pages = NULL; drm_gem_object_put_unlocked(gobj); @@ -598,8 +599,9 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p, return r; } + /* One for TTM and one for the CS job */ amdgpu_bo_list_for_each_entry(e, p->bo_list) - e->tv.num_shared = 1; + e->tv.num_shared = 2; amdgpu_bo_list_get_list(p->bo_list, &p->validated); if (p->bo_list->first_userptr != p->bo_list->num_entries) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 1b39b0144698..8c46acf893cc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -616,8 +616,8 @@ void amdgpu_vm_get_pd_bo(struct amdgpu_vm *vm, { entry->priority = 0; entry->tv.bo = &vm->root.base.bo->tbo; - /* One for the VM updates and one for the CS job */ - entry->tv.num_shared = 2; + /* One for the VM updates, one for TTM and one for the CS job */ + entry->tv.num_shared = 3; entry->user_pages = NULL; list_add(&entry->tv.head, validated); }