From patchwork Tue Jun 18 11:54:51 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: 11001441 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 F140B14B6 for ; Tue, 18 Jun 2019 11:55:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEB1726247 for ; Tue, 18 Jun 2019 11:55:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1A80288C7; Tue, 18 Jun 2019 11:55: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 8DBE526247 for ; Tue, 18 Jun 2019 11:55:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5A5066E149; Tue, 18 Jun 2019 11:55:00 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@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 0DF0C6E149; Tue, 18 Jun 2019 11:54:59 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id u8so2941826wmm.1; Tue, 18 Jun 2019 04:54:58 -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=MgigXJGQ0GwLhXhwQSG+CIuZkPM0ksRSjm6aqRV356T/QW5cc64emmtCKDhzr+mfM9 njvFUt26kGRRqK7MhDgs7DAZVBulvdRBb2eR+RBZ1MONAT8MgY5tkYvnTY+bQ8c+f3DC PD1bYFvjLA2NE2rjFpR5RPjpGxUpyxQuphCNNJz2CVjRP3cVMjwcvZmP5PqlporVqAAF mRBi3fFGtKFJBw5HhT+GG2dqz8645EPH8zzcsXkKDmIx2e5Mc44JJEJIc8mk3Cpe5tnL 4S/6qVV8nDQl72hIBE3xT0wMcNZGzZLjKGyect2QyE6HTBA891XRagKEFIgf+U+A2QKc ERuw== X-Gm-Message-State: APjAAAUKvdQkql35Yhue8VZ6O/X/k9751fU46SAuMWysEpiL2KK/Nb19 ALi9PcLaMsc3Q+54HPSa9L0xeum+ X-Google-Smtp-Source: APXvYqxN2ET+KGmMQMS3DF0Ncs5179nIt5kgUiKwnE/hNgiiilhK+gjzRPDqBJ0sl7UV5T/bQGLr+w== X-Received: by 2002:a05:600c:c6:: with SMTP id u6mr3314904wmm.153.1560858897602; Tue, 18 Jun 2019 04:54:57 -0700 (PDT) Received: from abel.fritz.box ([2a02:908:1252:fb60:88da:f390:6b90:ca6c]) by smtp.gmail.com with ESMTPSA id l19sm1441963wmj.33.2019.06.18.04.54.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jun 2019 04:54: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, 18 Jun 2019 13:54:51 +0200 Message-Id: <20190618115455.1253-2-christian.koenig@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190618115455.1253-1-christian.koenig@amd.com> References: <20190618115455.1253-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=vI0pUALhAIg70bP4aHzPnlvEYBcuwIBmi8A+NKd5yK6/K0UxPa5BxZe2Q7/yfhIkqV XSW8BRFRjqqIOsQ52ux8p/R3u6wXuHx/8isiFbhsxPorXUSzJzDefaBA0jIRmXVecweD vCtHbr5hzFlxtRku6JhBYaxammMbRxNce7PBM1wnnDqGRBFDrcAByb7mB+o8Y+IBASOG 7hsb6OAK3htrEbm3kqSN47qIoooiGnVh45VN+BB8WaEr6132rRcjYU14KoZVlcIvfLN+ Vi4C9StpRi5gPSHmPnz3yTOupgrJeDfktoP3wsiP99dEOM8wxmPtyVK+NzN3e5pZMrwK PCSA== 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. */