From patchwork Mon Jun 24 13:58: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: 11013219 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 C326676 for ; Mon, 24 Jun 2019 13:58:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B468C2870F for ; Mon, 24 Jun 2019 13:58:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A8CEA28856; Mon, 24 Jun 2019 13:58:51 +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 6FE502870F for ; Mon, 24 Jun 2019 13:58:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0AECA89B70; Mon, 24 Jun 2019 13:58:45 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 286A089B60; Mon, 24 Jun 2019 13:58:43 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id p11so14026271wre.7; Mon, 24 Jun 2019 06:58:43 -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=hHt9TE4icgfoh7j5uLnyKTVoCC1W5MX6izzTvoT2OaHtamTHKn1dqrSb9GklY/y0T6 HPiDuTVvDyL+XHt50VTlZ8czTv2nQv44unq/qxsuyIOILniU9QRmp5aMG1KUbpWWU2J8 aomrn/owG1B6nRvTJGbBERxyJYHNs7fSrO5EUwiSKDcchrWY0DLqkv5zKgXu23+b0ym4 dI39O+Lv3RNbHkaIp3Zrj6YSAiD+xwz8Fo9FhfCholt3wlBcr6esZYRiWmPgEljbUHrh D4YieDbJbD5uDSlPibz5vPGN7B++F+gEuP3aJBFLFQiN7Dnieb2CBBc/JIdRuGZFHmWD w5RA== X-Gm-Message-State: APjAAAWxMp/J8L/r2Myyntw8ozGiiY/CrtHXhIoKQVpvXX7fbPhQ+AAP CxJ7YnXjwhscLHlpv6E05AAx66V+ X-Google-Smtp-Source: APXvYqwk2lIHGpzl+rLL85vLhvfhO73L/4V44hFIu642bbxheTMJwxiZs3BYAvkgrFJMsrfzQ99SkA== X-Received: by 2002:a5d:518f:: with SMTP id k15mr26337205wrv.321.1561384721745; Mon, 24 Jun 2019 06:58:41 -0700 (PDT) Received: from abel.fritz.box ([2a02:908:1252:fb60:c026:1db1:e413:81a2]) by smtp.gmail.com with ESMTPSA id y19sm14848623wmc.21.2019.06.24.06.58.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jun 2019 06:58:41 -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, 24 Jun 2019 15:58:35 +0200 Message-Id: <20190624135839.1661-2-christian.koenig@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190624135839.1661-1-christian.koenig@amd.com> References: <20190624135839.1661-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=QF4VegXBwGAsCjxq6SDKAOxSMRhwsBtf6ouT/0dSTy05UjTymkuPBcBLEB7teWz0SV G+x5OzdmqrpKZmkpSJqssVC4xoVQEY/HKgJ1RFcR7tV32eRSVXxWaQ3mJ/UDSnnflNNw CIHMDkSeiha2XMEJ0958aS+VWNhTogHrff0DF3iEjpkp0znh1gxDqUeEDdMdS76BhzM/ sZlqUL7S6t6jJDErfM4IJAxZWS01U8cZ8IvYpuU78Z23f4I71QpUV1PO8zrpj+9wfzRx x1I6hiG2CkpAmCiaErJCfLK4gF6Nz6bEuxS1kHBzSVa3zxQiiNpB7u0f4deoumtWsya5 ayQA== 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. */