From patchwork Tue Jul 21 07:32:40 2020 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: 11675069 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0777C13B6 for ; Tue, 21 Jul 2020 07:33:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DA2D42080D for ; Tue, 21 Jul 2020 07:33:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YLtIOaFS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA2D42080D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BF54D6E49B; Tue, 21 Jul 2020 07:32:56 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0D79C6E499 for ; Tue, 21 Jul 2020 07:32:54 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id s10so20075929wrw.12 for ; Tue, 21 Jul 2020 00:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Nh9YF4R80f+foSmXySs44UxAVbWDN7uFO3+6X5LLzuA=; b=YLtIOaFS2sriJIM48hSHciSOk9O83wz6wMPAYBAHbRlYT8qtj+qV6GQNwkV28U1DlE OLMX4rIjuCaY19ltCFj5LUZ5kl8GDi1oIYlsqCJp9dfhFnX+RdEvvQ5Q1CvVLJUl7OHE wm85hpHMUasm3n3MDLGY9gNljBDJe0OBL2WZ6r6IC9RkV/c9U2eBj5QSw129+Xjaahc/ p7yI4rGtSMgG8WlUMg1+vXGIGW+Zq4yvDuwbSdjyrGDLk7XyBVTjOgCYE3OqRYPXbEgH jllT3DL4bSnGJzpqPwB6yfunsjlZZLoS7BBrkVx6xK8x5kh5w2M8TpmJ0rsI4LuYRsGO rvSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Nh9YF4R80f+foSmXySs44UxAVbWDN7uFO3+6X5LLzuA=; b=NgFLMBPKnf6VhcPNzqhyPNeSAiI6yTNzgReaPU0e4kC7X1rhK7uNHIFC2IsdNoJq3j i8brlpIvwQmxiV45+dbOPVy4Ql9XRA6bQFu3NObmqevgYMF7W6Ne5I4ZFCUQJn5kSDA8 Zqt0pKN+zO6/dpnaKEaQ735Bq7QETT7yk9iLjaWjxoBicVyVFi+jANSQtiUy/BTL56EB /M6v1bCsLoLvuEJh/AVjvhL3YuUvO748kY8PYHqc1TU9kEVMT/Aq4AntuHgnNv7LP4u/ j2PZdpYq83NebQOxM8cvyLFu1qnEFmq3nTuzctiooF6pYIKNPbHBM/LIzddx5/+8GDfw LaYQ== X-Gm-Message-State: AOAM531IZ7T4jboFN70A7pub1GYlBLLJt9iz8KssyuAe0bDscRjOXP7v xAqFr9EON1rD7bK/4fCJyAn4/+Ls X-Google-Smtp-Source: ABdhPJwzt/n+AnMdtoGzM378X2ahUwblu1h/+5wnkbp6o2Q0oXc1BNChPR9e8Zl4jU3E4ZeEhuTEVg== X-Received: by 2002:adf:eecb:: with SMTP id a11mr345910wrp.339.1595316772377; Tue, 21 Jul 2020 00:32:52 -0700 (PDT) Received: from abel.fritz.box ([2a02:908:1252:fb60:5eb1:eb29:dadc:7fc5]) by smtp.gmail.com with ESMTPSA id s4sm29740896wre.53.2020.07.21.00.32.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 00:32:51 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 06/11] drm/radeon: stop using TTM_MEMTYPE_FLAG_MAPPABLE Date: Tue, 21 Jul 2020 09:32:40 +0200 Message-Id: <20200721073245.2484-6-christian.koenig@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200721073245.2484-1-christian.koenig@amd.com> References: <20200721073245.2484-1-christian.koenig@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Madhav.Chauhan@amd.com, michael.j.ruhl@intel.com, tzimmermann@suse.de Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The driver doesn't expose any not-mapable memory resources. Signed-off-by: Christian König Reviewed-by: Daniel Vetter --- drivers/gpu/drm/radeon/radeon_ttm.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 54af06df865b..b474781a0920 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -76,7 +76,7 @@ static int radeon_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, switch (type) { case TTM_PL_SYSTEM: /* System memory */ - man->flags = TTM_MEMTYPE_FLAG_MAPPABLE; + man->flags = 0; man->available_caching = TTM_PL_MASK_CACHING; man->default_caching = TTM_PL_FLAG_CACHED; break; @@ -84,7 +84,7 @@ static int radeon_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, man->func = &ttm_bo_manager_func; man->available_caching = TTM_PL_MASK_CACHING; man->default_caching = TTM_PL_FLAG_CACHED; - man->flags = TTM_MEMTYPE_FLAG_MAPPABLE; + man->flags = 0; #if IS_ENABLED(CONFIG_AGP) if (rdev->flags & RADEON_IS_AGP) { if (!rdev->ddev->agp) { @@ -92,8 +92,6 @@ static int radeon_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, (unsigned)type); return -EINVAL; } - if (!rdev->ddev->agp->cant_use_aperture) - man->flags = TTM_MEMTYPE_FLAG_MAPPABLE; man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC; man->default_caching = TTM_PL_FLAG_WC; @@ -103,8 +101,7 @@ static int radeon_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, case TTM_PL_VRAM: /* "On-card" video ram */ man->func = &ttm_bo_manager_func; - man->flags = TTM_MEMTYPE_FLAG_FIXED | - TTM_MEMTYPE_FLAG_MAPPABLE; + man->flags = TTM_MEMTYPE_FLAG_FIXED; man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC; man->default_caching = TTM_PL_FLAG_WC; break; @@ -394,7 +391,6 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict, static int radeon_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem) { - struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type]; struct radeon_device *rdev = radeon_get_rdev(bdev); mem->bus.addr = NULL; @@ -402,8 +398,7 @@ static int radeon_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_ mem->bus.size = mem->num_pages << PAGE_SHIFT; mem->bus.base = 0; mem->bus.is_iomem = false; - if (!(man->flags & TTM_MEMTYPE_FLAG_MAPPABLE)) - return -EINVAL; + switch (mem->mem_type) { case TTM_PL_SYSTEM: /* system memory */