From patchwork Mon Sep 12 16:44:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9327031 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 47F666077F for ; Mon, 12 Sep 2016 16:44:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 394F328CBA for ; Mon, 12 Sep 2016 16:44:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DF4128D37; Mon, 12 Sep 2016 16:44: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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 763E428CBA for ; Mon, 12 Sep 2016 16:44:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7FBF86E54D; Mon, 12 Sep 2016 16:44:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x242.google.com (mail-qk0-x242.google.com [IPv6:2607:f8b0:400d:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 84A7C6E54D; Mon, 12 Sep 2016 16:44:48 +0000 (UTC) Received: by mail-qk0-x242.google.com with SMTP id n66so12168991qkf.0; Mon, 12 Sep 2016 09:44:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=xOe1RLeWHveU6IVw1xJR18fUAxt2EFoD2vo4TOyk0/g=; b=CmRKLjQWWENoOBMDPdPvoYW/rNsFb9OEi6Y6aoB3PJ45SbhCzzEwV1D4ZLpOAs3NaL 7FV9KPJy7NPHcDg2cc+VCr8PnKYbnegm6kziDg6Zb3+1G/u5CqWFcOFZ/dws5wMOfxaB 9CZcUi8GGUaAwjtVGef6P8nFvTCAp86s0vmp9qC+DxdLqxQn4kp1iLPyjRn/rLGnVTyb cj7ObE+Qd0KLyqyUHubPKk3XVHn4026U4sTYb9J9wVX1ezXYTGY23zKlw0QcLoltpTrX RDmaE6KqpMwphDGO/lQJJKUqk7lYe+zGwpaL2EPhviD9BpTZtZcrfaQZx7WyD5WxGrBP Q6HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=xOe1RLeWHveU6IVw1xJR18fUAxt2EFoD2vo4TOyk0/g=; b=OJLZFCrBqzpDGagsvhNtPEvglhXsTGdXwMF/2CfCPmvQw7BsJj/HKQFQ4OtwjUZxFY fIgss3ds5913MPhtvwtWa5l31hWrUsEjOE2neV1r6WRQ9m+KIqSotS76pJNPDPf9CjiM t/alm8MBJQ1uiPbdX5Wor7fTIhp5reM0x9mLgz+OUO3ht32oUlA3oFnH97wdE7mFbLbj pjR7VI5MaeXSr4WrsqH7m3HYhyovpPAuI/6UbeeCt/hmgma3R2uqYOhw3mtwjNzOBdkv Uc+KmSi854Wyiocnqe8F6V25R+Wx7eHwYvmAojviXNDWFGM5x3rG71l/bEXAnzr/jwfM W3lw== X-Gm-Message-State: AE9vXwOznParh2Yy5kWxSCHFSIyUSYtTauhvNJ/AooVwNxMKqz1xxybeQVcfxkDNOcDhrQ== X-Received: by 10.55.71.17 with SMTP id u17mr15671739qka.144.1473698687502; Mon, 12 Sep 2016 09:44:47 -0700 (PDT) Received: from cm.localdomain (va-67-76-166-195.sta.embarqhsd.net. [67.76.166.195]) by smtp.gmail.com with ESMTPSA id u6sm10928953qtu.2.2016.09.12.09.44.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Sep 2016 09:44:47 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/amdgpu: improve GTT BO alloc speed in OGL Date: Mon, 12 Sep 2016 12:44:41 -0400 Message-Id: <1473698681-28637-1-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.5 Cc: Alex Deucher , "monk.liu" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "monk.liu" original we use ttm_dma path to allocate GTT bo, which is too much slower than the path of ttm_pool, in most cases. The swiotlb checks don't seem to work and we always end up in the slow path even when an IOMMU is available. Signed-off-by: monk.liu Reviewed-by: Jammy Zhou Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 3beb10b..e2fcd39 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -783,12 +783,6 @@ static int amdgpu_ttm_tt_populate(struct ttm_tt *ttm) adev = amdgpu_get_adev(ttm->bdev); -#ifdef CONFIG_SWIOTLB - if (swiotlb_nr_tbl()) { - return ttm_dma_populate(>t->ttm, adev->dev); - } -#endif - r = ttm_pool_populate(ttm); if (r) { return r; @@ -829,13 +823,6 @@ static void amdgpu_ttm_tt_unpopulate(struct ttm_tt *ttm) adev = amdgpu_get_adev(ttm->bdev); -#ifdef CONFIG_SWIOTLB - if (swiotlb_nr_tbl()) { - ttm_dma_unpopulate(>t->ttm, adev->dev); - return; - } -#endif - for (i = 0; i < ttm->num_pages; i++) { if (gtt->ttm.dma_address[i]) { pci_unmap_page(adev->pdev, gtt->ttm.dma_address[i],