From patchwork Wed Jun 24 18:26:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nirmoy Das X-Patchwork-Id: 11624701 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 30B6290 for ; Thu, 25 Jun 2020 07:31:50 +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 0F263207FC for ; Thu, 25 Jun 2020 07:31:50 +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="iBFF1Dw8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F263207FC 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 9EDC16E88E; Thu, 25 Jun 2020 07:31:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id 84BD16E426 for ; Wed, 24 Jun 2020 18:25:41 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id 22so3218157wmg.1 for ; Wed, 24 Jun 2020 11:25:41 -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=XO4FcoJJwTJZ6Jc9Ac2Ffd7Mo++67gP8osvZQ+hloyg=; b=iBFF1Dw8koUAxgFBM8WGe1PfoT2Umg6DyVuyhSlED41zOgh8B4WjZS3yTnQiNcur+p aw+3xOrMS+gK/CoBH/uh5bW/vwPuP4RGjg+IPBao1EBVu6LiZAeWjReCL+XMNOFrfliM izklRxWERAnmTTxydZlREZT+uj5dZI5iXo+Sys+mhAIivt63a/O3NaTZMYjcGY8/Ie3d Z0FaLelrFqnnVLTnbC+XA7HwK5iM6vMgh0Tk8vckWrnEtmfJ2sWNitvJxPZfSdQsMvV4 NPOfW2cCHku95769Hao9SbQNwFoCPv1VnqfRvL6r9Mw+Yr9t/qUT7yxf+goEi5kgmYva LwuA== 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=XO4FcoJJwTJZ6Jc9Ac2Ffd7Mo++67gP8osvZQ+hloyg=; b=Z0hqIH6Lu3lEm6Q3ilNDyrBpHNF4eNP7rEdoxudKu31321glJXRUD+yV/T2plH/c5p oeMOn90HWApSJ7s05nSPOUaY66fRo65ngzosXw0xhjAoSBFLob/LEy0gzeA4Dhz4n0IR H7fByHHiB3aM/U+gVfETYREZeQP4OZTE8+5kOd5TgWFToC3Roz/dPQSkteRYgnnQny+U g+EoHn+kKFEYbgFGzIVrPkJHenEkuJYS6cuLgsasYv3BDCXwnzmrdrl3K+2DjCLIYCJd 4t7sTWUpg4YWAn0XMVurCEHyLBbFFes9wu/97gU8cREp2DN0EGWNfrubQSGBxs+S/Gwb GdAg== X-Gm-Message-State: AOAM532Ng+cgY6S7f4YxzVyFyed24PyEOSiqB2NSb38GWdX97MqN1nL4 N1IbJZKsaCpTyzN1jbVWRQqo11zZCX3hP1rs X-Google-Smtp-Source: ABdhPJwQnmIaYa5d/sR+asQELybX4h4Md1iwPcWkR+4tZMjUOZ4l4DdR47aKFWvQeaOfSY8p2ZIFsQ== X-Received: by 2002:a7b:cd10:: with SMTP id f16mr31907338wmj.86.1593023139780; Wed, 24 Jun 2020 11:25:39 -0700 (PDT) Received: from brihaspati.fritz.box (pd9567914.dip0.t-ipconnect.de. [217.86.121.20]) by smtp.gmail.com with ESMTPSA id a22sm8734086wmb.4.2020.06.24.11.25.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 11:25:39 -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, 24 Jun 2020 20:26:48 +0200 Message-Id: <20200624182648.6976-9-nirmoy.das@amd.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200624182648.6976-1-nirmoy.das@amd.com> References: <20200624182648.6976-1-nirmoy.das@amd.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 25 Jun 2020 07:31:01 +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: sashal@kernel.org, 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 0a9d042e075a..a6ec6101d9ec 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 54a527aa79cc..aa1f398c2ea7 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;