From patchwork Tue Jun 25 12:46:52 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: 11015449 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 4AD9F13AF for ; Tue, 25 Jun 2019 12:47:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D8772847E for ; Tue, 25 Jun 2019 12:47:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3227628BDD; Tue, 25 Jun 2019 12:47:15 +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 E02F928BDB for ; Tue, 25 Jun 2019 12:47:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6E7786E100; Tue, 25 Jun 2019 12:47:05 +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 A887D6E0FB; Tue, 25 Jun 2019 12:47:02 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id k11so17755497wrl.1; Tue, 25 Jun 2019 05:47:02 -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=a/mbvXSXBv3VhCb3Tq9evFCUCUbYb0DbiaBiUwx45PNshSizAL7aIg3//hf6NE/ert 3x+Ikoif0Qj+BS85k3Bbm9v3mwz+6BYqSF+Ac0/Xc76Im21BQ1rkPoZUsONnyFGDlTrr T+zhE4ZRqSeCY74BRKsI4C0cXbhIhCWTOdIPIwYZjwSx+pFw5oRaRpLLDug/iG/EnDFw xY7v0oUGMcEUu+n4JzJf9oJMite5XC0lRAuLdPoeLRxqe5pkohd/MxmSxCX5btU0PbJy iwn2qT5moxjPguEaw5/qEWEXN7jz2mffvxqRSFGSbcFcLEmj53wHhvftvuwfHIfOEaKS bIVg== X-Gm-Message-State: APjAAAU/npmBXvG0AEWOy8QjzCuaR+rDGKRA97kkWHTCF2Ph8dsnAC01 LM1CngOncGyar9BFoqYHExEgi4d+ X-Google-Smtp-Source: APXvYqzWEt28+COMLbeUIaUZzRrPXguXBB996tL/mu7w6oINwzaPZxK3FQpZdsY22twYMD7APPMVCQ== X-Received: by 2002:adf:ec49:: with SMTP id w9mr44276792wrn.303.1561466820269; Tue, 25 Jun 2019 05:47:00 -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.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jun 2019 05:46:59 -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:52 +0200 Message-Id: <20190625124654.122364-4-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=X/Ddz4BsAQiAV9qvChmuYB8diI88JLFrEunb+dejOTU=; b=P9S42/cgWy8yzSd6fNFcslE/9AMAHCc3C0lwe6VR6pHV/+6wFlWhZsRh63UAKx+RrH XDjw70jkyviWUpn1r0q/gYVQcH6v46iuftEzvY+RK6xUH3hI5hb5ihETQQ+G9bTJD+w0 E143tqpVAjdZ2x9cqWZyOMQ8KjAjVlXXril8za0yD5nU6i5XR8bkXXzvNTZZUQq9eML8 YsnrSJqM4AxRFj33PYflFQ8Zz0sA3eMuXU+4ShVpZoR//+yy/fnSJ2zSstl/QdVuzJsg 3Vn2D3jI1Tg8ieEqV/tQSJJxwXoyClalD9CEclzTdvL/UjlkX+ZOrbBaItEItwjqLkOA bxQg== 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