From patchwork Sat Jan 30 05:59:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 8169671 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 99041BF0A9 for ; Sat, 30 Jan 2016 05:59:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D7C3D203A0 for ; Sat, 30 Jan 2016 05:59:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 702522039E for ; Sat, 30 Jan 2016 05:59:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C09026E44F; Fri, 29 Jan 2016 21:59:49 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3AE556E44F for ; Fri, 29 Jan 2016 21:59:46 -0800 (PST) Received: by mail-wm0-f65.google.com with SMTP id r129so891786wmr.0 for ; Fri, 29 Jan 2016 21:59:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TQMfKwmscMJ21iiumxHw8zZH2vUD01irH3XcLhc6GWI=; b=qdQjoT54sbcM3Hyu6iIH+LqUoo0vE/NtGSRZnxrT9bK4pXZXoMpJbmULnanL0UmHhD LBAx2gZnkGgw9J7iuzP7xrHxpt0VCx2Xe5cE/wMJvv1XxRSREvaxEnp0XzV7zuN+hXDZ zdqbwG3a23To992kbmjCcYAhHZ6rWD8kqKAe8rs4xiPY+SmExtmI5NZq8k96YY6YCLeV LyAe9ojb5zDOgMc/W3aJJ7Vbfc3HxCPBx462q70dAyfgxruLBy0+9HnRZdfy1qeYPGAX ogq6HDI4IA3+Wvf9kHUhVslJ2zO32cZ+bh0YNZxpOReiDolMAC9xSfSzYPifOoKVM2fk H8uw== 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:in-reply-to :references; bh=TQMfKwmscMJ21iiumxHw8zZH2vUD01irH3XcLhc6GWI=; b=SKikzMDmdieDBtKUmI1u0E7G29HoPP4S7bokmiLUNXV04kfxitS4hb6a9SxjCsQKU5 +OXWOBVSP81GU5w9QY7K3GpdNgOj8AE+stLumGmDplIYUaaSg4n9hwAJAX+KDnZlHIVz OQAxQInQb4ESv6IJlkGdZZnm3ccw1udeUZ+UO5cQ1LK0GBQP1VZIuujHyDdGPG7zrDbS XgBSGGLyYht069wgm8zXisLvWkPLg+dOzgcemmvsABrKPI816OEX4sidSgjNsD9kb10T bH31DhyDMFKQGvJNo+YDxK4jix/Tp+++f6hVNbGry9e1aiKT5ZKCn5+SRRzrltSTUtXu AEag== X-Gm-Message-State: AG10YOSYoVvZkm1IIarCZnFyjXVaLEXvS3MAiQ0aDliGs5ME8f7ov/jFbs0cgxpLs2pCIg== X-Received: by 10.28.222.5 with SMTP id v5mr1226369wmg.94.1454133585067; Fri, 29 Jan 2016 21:59:45 -0800 (PST) Received: from odedg-tlv.redhat.com ([77.125.92.242]) by smtp.gmail.com with ESMTPSA id t199sm1034364wmt.23.2016.01.29.21.59.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Jan 2016 21:59:44 -0800 (PST) From: Oded Gabbay To: dri-devel@lists.freedesktop.org, alexdeucher@gmail.com Subject: [PATCH 3/3] drm/amdgpu: mask out WC from BO on unsupported arches Date: Sat, 30 Jan 2016 07:59:34 +0200 Message-Id: <1454133574-20527-3-git-send-email-oded.gabbay@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454133574-20527-1-git-send-email-oded.gabbay@gmail.com> References: <1454133574-20527-1-git-send-email-oded.gabbay@gmail.com> Cc: michel.daenzer@amd.com 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-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Oded Gabbay --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index c3ce103..7b963e6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "amdgpu.h" #include "amdgpu_trace.h" @@ -261,6 +262,14 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev, AMDGPU_GEM_DOMAIN_OA); bo->flags = flags; + + /* + * For architectures that don't support WC memory, + * mask out the WC flag from the BO + */ + if (!drm_arch_can_wc_memory()) + bo->flags &= ~AMDGPU_GEM_CREATE_CPU_GTT_USWC; + amdgpu_fill_placement_to_bo(bo, placement); /* Kernel allocation are uninterruptible */ r = ttm_bo_init(&adev->mman.bdev, &bo->tbo, size, type,