From patchwork Wed Apr 1 18:42:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nirmoy Das X-Patchwork-Id: 11470223 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 B246192A for ; Thu, 2 Apr 2020 07:18:23 +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 909AD20784 for ; Thu, 2 Apr 2020 07:18:23 +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="Xzod1j4A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 909AD20784 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 6E8FE6E9ED; Thu, 2 Apr 2020 07:18:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 423C86E983 for ; Wed, 1 Apr 2020 18:39:04 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id m17so1237258wrw.11 for ; Wed, 01 Apr 2020 11:39:04 -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=E6FdkeT6psAvLz0dLRleM1SQvL2LWVWL2O13Tg5RW/Y=; b=Xzod1j4AELLAoEMpn5spG5cuTc/MeWiUtUmkFA81mBjIROd1KoGaa2EoRC8DCNGcdF Ic+xKaJsKqnJRdR6Ml7Xxlix8KybwhewXZhpDPZvllZad4WlWrhN3O/slyYY2o3cKPvT S7wLAH7v8CHlEoCfWB/XorWZ+pMXCa1Nhi1+axbSKGOZ5Wu0pgfYHSz6XL1jkXnzoWNq 34cilCWMAgKXZU5AIUlq6QC8thW/1iBMAK5kVdccZqLDG1tS0XFP85HzAfo1hc9KLLTP yn4MFOrGt+/AaucOH+wd8Ss0ElF5Yfq1MVzhx5fyEJ+Tsf7KhPWe8P2ERHbWJZHEDGxL Teuw== 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=E6FdkeT6psAvLz0dLRleM1SQvL2LWVWL2O13Tg5RW/Y=; b=OSkRRKPh3tMazq05wYwILEfsPpZk3g+Pmn674CzJt/t/YnEvsaibwjjU9lh3CiEqG/ 0tDIZvyLaNwIJ9iy9OjbueT5f6yRreNTNArwJ/T7hZPw+sSGnxkAw6m0FidvrJBWV8H4 2rNeN++WXjs53mam6cUQUS1TkplGfY+9vEeKno1YIHs7gszDVwYLqrL6n56eHyI72V2Y kQKBb5azmZt2dHlVRrB5Y1jN3z0OhhT3GaTZB01Cw8HrFm8phcSc74pEzpS1riWY5gGz D935VR4zk79D2uMsi3/pfHIV4oJTCH3o79sQXRux5ENsUaRo1zjDb6ztNNUOFtwuLGOJ w/GQ== X-Gm-Message-State: ANhLgQ2Fz1+2QINoxgF/xWQC7dW2g7YP1IRqMvFdXcvOekHfQwQ7g+xS bQqpjBzpPDnG3A7ged9LFAiur5W4QSI= X-Google-Smtp-Source: ADFU+vvjjsPh0WppxjmVfJ6secyRte6nRoF1oCaZrLW00RAVVixactCNodpy3JMkbNIQoGq6T5vwNA== X-Received: by 2002:a5d:5106:: with SMTP id s6mr26846554wrt.24.1585766342530; Wed, 01 Apr 2020 11:39:02 -0700 (PDT) Received: from brihaspati.fritz.box (p5DE52E4E.dip0.t-ipconnect.de. [93.229.46.78]) by smtp.gmail.com with ESMTPSA id b11sm3976973wrq.26.2020.04.01.11.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Apr 2020 11:39:02 -0700 (PDT) From: Nirmoy Das X-Google-Original-From: Nirmoy Das To: dri-devel@lists.freedesktop.org Subject: [PATCH 8/8] drm/ttm: do not keep GPU dependent addresses Date: Wed, 1 Apr 2020 20:42:47 +0200 Message-Id: <20200401184247.16643-9-nirmoy.das@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401184247.16643-1-nirmoy.das@amd.com> References: <20200401184247.16643-1-nirmoy.das@amd.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 02 Apr 2020 07:17:56 +0000 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: thellstrom@vmware.com, airlied@linux.ie, kenny.ho@amd.com, brian.welty@intel.com, nirmoy.das@amd.com, linux-graphics-maintainer@vmware.com, bskeggs@redhat.com, alexander.deucher@amd.com, sean@poorly.run, christian.koenig@amd.com, kraxel@redhat.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" GPU address handling is device specific and should be handle by its device driver. Signed-off-by: Nirmoy Das Reviewed-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 7 ------- include/drm/ttm/ttm_bo_api.h | 2 -- include/drm/ttm/ttm_bo_driver.h | 1 - 3 files changed, 10 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index f73b81c2576e..f78cfc76ad78 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -85,7 +85,6 @@ static void ttm_mem_type_debug(struct ttm_bo_device *bdev, struct drm_printer *p drm_printf(p, " has_type: %d\n", man->has_type); drm_printf(p, " use_type: %d\n", man->use_type); drm_printf(p, " flags: 0x%08X\n", man->flags); - drm_printf(p, " gpu_offset: 0x%08llX\n", man->gpu_offset); drm_printf(p, " size: %llu\n", man->size); drm_printf(p, " available_caching: 0x%08X\n", man->available_caching); drm_printf(p, " default_caching: 0x%08X\n", man->default_caching); @@ -343,12 +342,6 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo, moved: bo->evicted = false; - if (bo->mem.mm_node) - bo->offset = (bo->mem.start << PAGE_SHIFT) + - bdev->man[bo->mem.mem_type].gpu_offset; - else - bo->offset = 0; - ctx->bytes_moved += bo->num_pages << PAGE_SHIFT; return 0; diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index b9bc1b00142e..d6f39ee5bf5d 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -213,8 +213,6 @@ struct ttm_buffer_object { * either of these locks held. */ - uint64_t offset; /* GPU address space is independent of CPU word size */ - struct sg_table *sg; }; diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index c9e0fd09f4b2..c8ce6c181abe 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -177,7 +177,6 @@ struct ttm_mem_type_manager { bool has_type; bool use_type; uint32_t flags; - uint64_t gpu_offset; /* GPU address space is independent of CPU word size */ uint64_t size; uint32_t available_caching; uint32_t default_caching;