From patchwork Tue Jun 25 12:46:50 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: 11015441 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 CA0F713AF for ; Tue, 25 Jun 2019 12:47:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC46728BDA for ; Tue, 25 Jun 2019 12:47:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0C7B28BEC; Tue, 25 Jun 2019 12:47:05 +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 6E08028BDA for ; Tue, 25 Jun 2019 12:47:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 04AB46E0F6; Tue, 25 Jun 2019 12:47:01 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id B16866E0F0; Tue, 25 Jun 2019 12:46:59 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id x4so17713468wrt.6; Tue, 25 Jun 2019 05:46:59 -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=PTEH18HqwxCVOJPNekwwrEjiIWFSot8RH14HI90iXdY3ljETDPLJG5kZ+lEvtVl/KQ RpwJhZjw5zx5stHW3u+lJxMrnFnkO/0V6wZyOAdUfo31MnouZ50DaHnTX1sNLtxtY4nd nuRxnXLPPpR7k25r9vS38c3EzILtwLgGELTpPq2b2TejI7T4hrwO4LpNq6LlzI6GehjM mvJcWJmlidhuKQXPQPRf3GAXEjG+/c3Tzt7dlhAYLjAal0b6djfdOQ1VXldF/d1LVdYO o8ubGnHom+5qdt+5hkq3wO9YJTBmuIB0w9WoRarZHrZ2HcS2oYMUQ9VOo/lFfQO914yE 5ekA== X-Gm-Message-State: APjAAAUdHt9zw9/Ou+zZpCgLccCi8vukjFY6Uig9H3HhAX+txHcpwTmA cMmWhwOIJwzVgm3J7XSSnfWheBy4 X-Google-Smtp-Source: APXvYqzZ9YlpwUUa67DDqcBWbmGHDy1z2G1uCxN/B9ttno3WG9uVuSL+GdCdR7B9XBmeH+pPQQE5wg== X-Received: by 2002:adf:f181:: with SMTP id h1mr19997033wro.18.1561466818347; Tue, 25 Jun 2019 05:46:58 -0700 (PDT) Received: from abel.fritz.box ([2a02:908:1252:fb60:2df2:5da:22f9:1506]) by smtp.gmail.com with ESMTPSA id y184sm2334231wmg.14.2019.06.25.05.46.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jun 2019 05:46:57 -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: Tue, 25 Jun 2019 14:46:50 +0200 Message-Id: <20190625124654.122364-2-christian.koenig@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190625124654.122364-1-christian.koenig@amd.com> References: <20190625124654.122364-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=mrqytE7e+Ggr/WCczdHIaGcH67Ti/wYOYYIaOshTCZxtM5ZZGbqbPEXOIQdPUGkcr9 Hc8JDWsKhkOpH0E4bsEH0yiIgtGWNAr2dhha2YyZsAQQ0C2ApBEdQ4//kehYLMhUGp9H xUAE1TCuK6v9EHf/b4Lw/L/LB2ws76J6KHPNIkf5YeGnGpC4Gqme/7Qfnq6TzgBYW46N Ap3DZJ+HvNon7i/u1vagMhsSNISvYRj+x2US7SKWpDEqvhYuMTHDYkA92MPHjAyZ+Ylo k+JtRHYTWkthPGxN1yQfY608kJQYPHw/HYaHKbChsix04iZSaAqms9f7XM6bxZTqVFhm 5dEA== 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. */