From patchwork Wed Jun 26 12:23:08 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: 11017595 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 7B0151580 for ; Wed, 26 Jun 2019 12:23:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A844287A3 for ; Wed, 26 Jun 2019 12:23:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F02A287A8; Wed, 26 Jun 2019 12:23:26 +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 21770287A2 for ; Wed, 26 Jun 2019 12:23:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 86B656E3BB; Wed, 26 Jun 2019 12:23:18 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 700D46E3B2; Wed, 26 Jun 2019 12:23:16 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id f15so2527228wrp.2; Wed, 26 Jun 2019 05:23:16 -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=X/Ddz4BsAQiAV9qvChmuYB8diI88JLFrEunb+dejOTU=; b=AcNmGWFrWySLVNvOk6xayj8KQKDquc4m3HYq3jS9Viz5QF6H9awMgbFtR3btpiHN9f 8+Br/kKUWVy+rfD0wRyAxJ98NzNwDtBoWGPUSkemJuGfzfZw562RyYVrxvP4iB6PxwMl J4sUDN5qQrDVKmlQEUFxu5dGhXj/eEOJXCltQxMxryrtOrtT3w3pS9x3vtKbjg1vHc5h J/H9AQIJaScUZnl6IcI5I1KVI+N7fjGrgFr1NGghjkZ+d+tG4EpujI+t2A+xQlnvC0lF 1mHxwZ7/xC1n4AaCfSGpRZHsQQR9veXBIQ4yyaNykfWgXjzHNX/8fsh+ebzDeFoHUsYF fF+w== X-Gm-Message-State: APjAAAXkDShYYdWBWb1ZG70WumM0AF3X+qLJnllrLzOkv08vefxej87C b1u6bwqDeRv9A0Q8xjWhKrvRr3z/ X-Google-Smtp-Source: APXvYqwMjN6/qMv/Nudu/dDR5p/6jXxF1ZkELee6ONqoog8b/t6xs2983OFe6sNeSKIOQJ5b6ACRdQ== X-Received: by 2002:a5d:4cc3:: with SMTP id c3mr3607290wrt.259.1561551794783; Wed, 26 Jun 2019 05:23:14 -0700 (PDT) Received: from abel.fritz.box ([2a02:908:1252:fb60:902c:2dc9:c30e:db03]) by smtp.gmail.com with ESMTPSA id k125sm2262018wmf.41.2019.06.26.05.23.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Jun 2019 05:23:14 -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: Wed, 26 Jun 2019 14:23:08 +0200 Message-Id: <20190626122310.1498-4-christian.koenig@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190626122310.1498-1-christian.koenig@amd.com> References: <20190626122310.1498-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=X/Ddz4BsAQiAV9qvChmuYB8diI88JLFrEunb+dejOTU=; b=lyyhB1KR54ZAVvk49u5H1fXQ/BEPW0DB079m8Eyl1kl5kS5hLsqxhuj8hkgYeIRDY0 nHSIavL3tC4OsvkI5G+PUEKTTfjnvC3rxSvhg97FWqLXzWMdw6zXaL2QyP42qPu5tS4d 521x1q33oWFMQeeSeUZqU7ETPEiWn9cU/nrAyhV3richYe+WyqiDS00TttZXKyhzulex 66+By/8jo9wdYmLza3D3jbeIskxd7CMJgxR6Kds2QeFfTdtmyGZLkY5uqe/A5caRFaob vnEDOdt4yj+xnfEbvq659cCjCr6ylrKpd4qORZjYrCLZbmhESwc6Ohl2mPuizbERdWa0 1Flw== Subject: [Intel-gfx] [PATCH 4/6] drm/amdgpu: use allowed_domains for exported DMA-bufs 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 Avoid that we ping/pong the buffers when we stop to pin DMA-buf exports by using the allowed domains for exported buffers. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index dc63707e426f..0da512341194 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -414,7 +415,9 @@ static int amdgpu_cs_bo_validate(struct amdgpu_cs_parser *p, /* Don't move this buffer if we have depleted our allowance * to move it. Don't move anything if the threshold is zero. */ - if (p->bytes_moved < p->bytes_moved_threshold) { + if (p->bytes_moved < p->bytes_moved_threshold && + (!bo->gem_base.dma_buf || + list_empty(&bo->gem_base.dma_buf->attachments))) { if (!amdgpu_gmc_vram_full_visible(&adev->gmc) && (bo->flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED)) { /* And don't move a CPU_ACCESS_REQUIRED BO to limited