From patchwork Mon Jun 17 11:34:09 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: 10998815 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 A4F1076 for ; Mon, 17 Jun 2019 11:34:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95938285E8 for ; Mon, 17 Jun 2019 11:34:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A524288C5; Mon, 17 Jun 2019 11:34:19 +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 3D75B288CE for ; Mon, 17 Jun 2019 11:34:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 88BA78919D; Mon, 17 Jun 2019 11:34:18 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6A5E589187; Mon, 17 Jun 2019 11:34:17 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id h19so4314885wme.0; Mon, 17 Jun 2019 04:34:17 -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=2IpMzv21zi/i5aOswxazxdECS2gQzcyfmft+Y6vYyCk=; b=Xx5GBkccz6v6YyuMWYW70FgPPmAJnxePLG62lACITlvmgTQCnXhQpUbdI4PzzWUqd3 NelIqhKhwsVqbIFEyvOsUjQdflvvQ2CO3yZcDJ+v7AlSB1cMBu3aGpSzFujNcCXp73J/ Kr4sgtDBMLgg+Xc+0eoXzVdMVheqPPnRjWkVto2bx2v9tALZwEzG8fPffs4jkt8kZD7B 2EBJt+QrfAbUw5ah1EVSxa5x/wQeN8A9Y3yPWuAR3mjzio8P9mIz9n52BFZavHeXrx5c xsVlpLLmz3Iut+6ea6suviGcU6wAhRWjCsEyY0bdsHPLHY/5SCCQulaB+Bun1eHPw/Kf AtyQ== X-Gm-Message-State: APjAAAX9JY97gsgZ/mENsDnJ3J/qLi/hx453sR+OtSVKbcIdqNVWo9xf MEifx1+gtLOb+ejU53tokOw2DRps X-Google-Smtp-Source: APXvYqxOgF2f4mdIggllw24hjGwGkw/+hol/PFvXKlXFVN3tMFInoj78tEP8recAhkdMcCQInDe8jQ== X-Received: by 2002:a1c:2e0a:: with SMTP id u10mr19613638wmu.92.1560771255826; Mon, 17 Jun 2019 04:34:15 -0700 (PDT) Received: from abel.fritz.box ([2a02:908:1252:fb60:ad86:6268:1a78:d4c]) by smtp.gmail.com with ESMTPSA id s188sm12062110wmf.40.2019.06.17.04.34.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jun 2019 04:34:15 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Date: Mon, 17 Jun 2019 13:34:09 +0200 Message-Id: <20190617113413.1869-2-christian.koenig@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190617113413.1869-1-christian.koenig@amd.com> References: <20190617113413.1869-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=2IpMzv21zi/i5aOswxazxdECS2gQzcyfmft+Y6vYyCk=; b=WlVYh4DzLWMqrEKixUmzBjOGjRAW1iEzj5suLnYUXfuO9/ZmMxcDohklq2k29/+kgv QkitA5eVjO5EZqpcTnNxCCUc9N5Ouqzv+0Lfw0DcsXmz9UgpCQFXwFJID7nfbUjgVRPd Td0mcSiDDotAyiQy33P+hwjuEFq+qKVWgjt5glqo9A0jPAIs38oUzHe80FGu4cOzye0E 6OBnLw4dYoUzoC/je+r7VJNhGmOcMq3BIrv9aiful45GBphDGwFrF+YWUrrOp33SMw7t v5WMqo3NDGHVopnVcpKZ8UTou4o5fj5X9n61mZiDy96zwdHq3/9tqKNj9x4MyiuhL+1l yJyA== Subject: [Intel-gfx] [PATCH 2/6] drm/ttm: remove the backing store if no placement is given X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Pipeline removal of the BOs backing store when no placement is given during validation. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index c7de667d482a..682a1a035b35 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1240,6 +1240,18 @@ int ttm_bo_validate(struct ttm_buffer_object *bo, uint32_t new_flags; reservation_object_assert_held(bo->resv); + + /* + * Remove the backing store if no placement is given. + */ + if (!placement->num_placement && !placement->num_busy_placement) { + ret = ttm_bo_pipeline_gutting(bo); + if (ret) + return ret; + + return ttm_tt_create(bo, false); + } + /* * Check whether we need to move buffer. */